/* ============================================
   947654.xyz — 日式 Zen 素雅风格
   色系：墨色 / 和纸白 / 朱红
   字体：Noto Serif SC / Noto Sans SC
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@300;400;500;700&family=Noto+Serif+SC:wght@400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Variables --- */
:root {
  /* Colors */
  --bg: #faf8f5;
  --bg-alt: #f3efe8;
  --bg-card: #ffffff;
  --text: #2c2416;
  --text-muted: #6b5e53;
  --text-light: #9a8c80;
  --accent: #8b2500;
  --accent-light: #c0392b;
  --accent-subtle: rgba(139, 37, 0, 0.06);
  --border: #d4c5b2;
  --border-light: #e8e0d5;
  --shadow: 0 1px 3px rgba(44, 36, 22, 0.06), 0 1px 2px rgba(44, 36, 22, 0.04);
  --shadow-md: 0 4px 12px rgba(44, 36, 22, 0.08);

  /* Typography */
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'SimSun', serif;
  --font-sans: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', 'Consolas', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* Layout */
  --max-width: 720px;
  --nav-height: 3.5rem;
  --radius: 4px;
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.8;
  color: var(--text);
  background-color: var(--bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  letter-spacing: 0.02em;
}

h1 {
  font-size: 2.25rem;
  font-weight: 700;
  margin-bottom: var(--space-lg);
}

h2 {
  font-size: 1.625rem;
  margin-top: var(--space-3xl);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

h2:first-child {
  margin-top: 0;
}

h3 {
  font-size: 1.25rem;
  margin-top: var(--space-xl);
  margin-bottom: var(--space-md);
}

p {
  margin-bottom: var(--space-lg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease, border-color 0.2s ease;
  border-bottom: 1px solid transparent;
}

a:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

strong {
  font-weight: 600;
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  background: var(--bg-alt);
  padding: 0.15em 0.4em;
  border-radius: var(--radius);
  color: var(--accent);
}

pre {
  background: var(--text);
  color: var(--bg);
  padding: var(--space-lg);
  border-radius: var(--radius);
  overflow-x: auto;
  margin-bottom: var(--space-lg);
  font-size: 0.875rem;
  line-height: 1.6;
}

pre code {
  background: none;
  padding: 0;
  color: inherit;
  font-size: inherit;
}

blockquote {
  border-left: 3px solid var(--accent);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  background: var(--accent-subtle);
  font-style: italic;
  color: var(--text-muted);
}

blockquote p:last-child {
  margin-bottom: 0;
}

ul, ol {
  margin-bottom: var(--space-lg);
  padding-left: var(--space-xl);
}

li {
  margin-bottom: var(--space-sm);
}

hr {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--space-3xl) 0;
}

/* --- Navigation --- */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  height: var(--nav-height);
}

.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
  border-bottom: none;
}

.nav-logo:hover {
  color: var(--accent);
  border-bottom: none;
}

.nav-links {
  display: flex;
  gap: var(--space-lg);
  list-style: none;
  padding: 0;
  margin: 0;
}

.nav-links li {
  margin: 0;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 400;
  color: var(--text-muted);
  border-bottom: none;
  padding: var(--space-xs) 0;
  position: relative;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-bottom: none;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1.5px;
  background: var(--accent);
  transition: width 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
  flex-direction: column;
  gap: 5px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: all 0.3s ease;
}

/* --- Layout --- */
main {
  flex: 1;
  max-width: var(--max-width);
  width: 100%;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-lg) var(--space-4xl);
}

/* --- Hero Section (Home) --- */
.hero {
  padding: var(--space-4xl) 0 var(--space-2xl);
  text-align: center;
}

.hero h1 {
  font-size: 3rem;
  font-weight: 700;
  margin-bottom: var(--space-md);
  letter-spacing: 0.04em;
  animation: fadeInUp 0.8s ease-out;
}

.hero .subtitle {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-muted);
  font-weight: 400;
  margin-bottom: var(--space-xl);
  animation: fadeInUp 0.8s ease-out 0.15s both;
}

.hero .tagline {
  font-size: 1rem;
  color: var(--text-light);
  max-width: 480px;
  margin: 0 auto var(--space-2xl);
  line-height: 1.7;
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

.hero .cta-group {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.45s both;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.6rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.925rem;
  font-weight: 500;
  text-decoration: none;
  border: 1.5px solid var(--border);
  cursor: pointer;
  transition: all 0.25s ease;
  border-bottom: none;
}

.btn:hover {
  border-bottom: none;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-light);
  border-color: var(--accent-light);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* --- Sections --- */
.section-title {
  font-size: 1.625rem;
  font-weight: 600;
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--border-light);
}

/* --- Cards --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-lg);
  box-shadow: var(--shadow);
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}

.card h3 {
  margin-top: 0;
  font-size: 1.2rem;
}

.card .card-meta {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--space-md);
}

.card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: var(--space-md);
}

.card p:last-child {
  margin-bottom: 0;
}

.card .card-link {
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
}

.card .card-link::after {
  content: '→';
  transition: transform 0.2s ease;
}

.card .card-link:hover::after {
  transform: translateX(3px);
}

/* --- Project Cards --- */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-xl);
  margin-bottom: var(--space-xl);
  box-shadow: var(--shadow);
}

.project-card .project-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.project-card .project-icon {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.project-card h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.project-card .project-tags {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  margin-bottom: var(--space-md);
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.15rem 0.6rem;
  border-radius: 100px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid rgba(139, 37, 0, 0.15);
}

/* --- Skills --- */
.skill-group {
  margin-bottom: var(--space-xl);
}

.skill-group h3 {
  font-size: 1.05rem;
  margin-bottom: var(--space-md);
  color: var(--text-muted);
  font-weight: 500;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --- Timeline --- */
.timeline {
  position: relative;
  padding-left: var(--space-xl);
  margin-bottom: var(--space-2xl);
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-xl);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-xl) - 3px);
  top: 0.45rem;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.timeline-item .time-label {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.timeline-item h3 {
  margin-top: 0;
  margin-bottom: var(--space-xs);
}

.timeline-item p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* --- Blog List --- */
.blog-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.blog-list-item {
  padding: var(--space-lg) 0;
  border-bottom: 1px solid var(--border-light);
}

.blog-list-item:first-child {
  padding-top: 0;
}

.blog-list-item .blog-date {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-bottom: var(--space-xs);
}

.blog-list-item h3 {
  margin: 0 0 var(--space-xs);
  font-size: 1.2rem;
}

.blog-list-item h3 a {
  border-bottom: none;
  color: var(--text);
}

.blog-list-item h3 a:hover {
  color: var(--accent);
}

.blog-list-item .blog-excerpt {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 0;
}

/* --- Blog Post --- */
.post-header {
  text-align: center;
  padding: var(--space-2xl) 0;
}

.post-header h1 {
  margin-bottom: var(--space-md);
}

.post-meta {
  font-size: 0.9rem;
  color: var(--text-light);
}

.post-content {
  font-size: 1.05rem;
  line-height: 1.9;
}

.post-content p {
  margin-bottom: var(--space-lg);
}

.post-content img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: var(--space-lg) 0;
}

.post-content h2 {
  margin-top: var(--space-3xl);
}

/* --- Teaching Subjects Grid --- */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-md);
  margin-bottom: var(--space-2xl);
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: var(--space-lg);
  text-align: center;
  box-shadow: var(--shadow);
}

.subject-card .subject-emoji {
  font-size: 2rem;
  margin-bottom: var(--space-sm);
}

.subject-card h3 {
  font-size: 1rem;
  margin: 0;
  font-family: var(--font-sans);
}

/* --- Footer --- */
footer {
  border-top: 1px solid var(--border-light);
  padding: var(--space-xl) var(--space-lg);
  text-align: center;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-md);
}

.footer-links li {
  margin: 0;
}

.footer-links a {
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: none;
}

.footer-links a:hover {
  color: var(--accent);
}

footer .copyright {
  font-size: 0.85rem;
  color: var(--text-light);
}

/* --- Utilities --- */
.text-muted {
  color: var(--text-muted);
}

.text-center {
  text-align: center;
}

.mt-2xl { margin-top: var(--space-2xl); }
.mt-3xl { margin-top: var(--space-3xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: var(--space-3xl) 0;
}

/* Quote block (Japanese-style highlighted quote) */
.zen-quote {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.7;
  position: relative;
}

.zen-quote::before {
  content: '〝';
  font-size: 3rem;
  color: var(--border);
  display: block;
  margin-bottom: var(--space-md);
  font-style: normal;
}

.zen-quote .attribution {
  display: block;
  margin-top: var(--space-md);
  font-size: 0.9rem;
  font-style: normal;
  color: var(--text-light);
}

/* --- Animations --- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* --- Responsive --- */
@media (max-width: 768px) {
  :root {
    --max-width: 100%;
  }

  html {
    font-size: 15px;
  }

  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.375rem; }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero .subtitle {
    font-size: 1.1rem;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.98);
    backdrop-filter: blur(12px);
    flex-direction: column;
    padding: var(--space-lg);
    border-bottom: 1px solid var(--border-light);
    gap: var(--space-md);
  }

  .nav-links.show {
    display: flex;
  }

  .nav-toggle {
    display: flex;
  }

  .subjects-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .project-card .project-header {
    flex-direction: column;
  }
}

@media (max-width: 480px) {
  .hero h1 {
    font-size: 1.75rem;
  }

  .hero .subtitle {
    font-size: 1rem;
  }

  .btn {
    padding: 0.5rem 1.2rem;
    font-size: 0.875rem;
  }

  .card {
    padding: var(--space-lg);
  }
}
