@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500&family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300&display=swap');

/* ============================================================
   极色导航 · Editorial Grid · 黑白印刷风
   ============================================================ */

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background: #000;
  color: #fff;
}

body {
  font-family: 'Source Serif 4', Georgia, 'Noto Serif SC', serif;
  font-weight: 300;
  font-size: 1.0625rem;
  line-height: 1.75;
  background: #000;
  color: #fff;
  overflow-x: hidden;
}

/* scroll-margin for fixed nav */
div[id] {
  scroll-margin-top: 2rem;
}

@media (min-width: 960px) {
  div[id] {
    scroll-margin-top: 0;
  }
}

/* ============================================================
   Layout: Site Wrapper
   ============================================================ */

.site-wrapper {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ============================================================
   Left Fixed Navigation (竖排)
   ============================================================ */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  background: #000;
  border-right: 1px solid rgba(255,255,255,0.15);
  display: flex;
  flex-direction: column;
  padding: 2.5rem 1.5rem 2rem;
  z-index: 100;
  overflow-y: auto;
}

.header-brand {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.logo-mark {
  width: 36px;
  height: 36px;
  object-fit: contain;
  filter: invert(1);
}

.brand-name {
  font-family: 'Playfair Display', Georgia, serif;
  font-weight: 900;
  font-size: 1.35rem;
  color: #fff;
  text-decoration: none;
  letter-spacing: 0.04em;
  line-height: 1.2;
  /* tap target: ensure min 44px height */
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.brand-name:hover {
  color: rgba(255,255,255,0.7);
}

/* 导航结构：header > nav > p > a */
.site-nav {
  flex: 1;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-link {
  font-family: 'Source Serif 4', serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  letter-spacing: 0.06em;
  padding: 0.75rem 0;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  transition: color 0.2s, padding-left 0.2s;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.nav-link:hover,
.nav-link:focus {
  color: #fff;
  padding-left: 0.5rem;
  outline: none;
}

.nav-link:first-child {
  border-top: 1px solid rgba(255,255,255,0.08);
}

/* ============================================================
   Content Area (right of nav)
   ============================================================ */

.content-area {
  margin-left: 220px;
  flex: 1;
  min-width: 0;
  background: #fff;
  color: #000;
}

/* ============================================================
   Hero Block
   ============================================================ */

.hero-block {
  position: relative;
  width: 100%;
  height: 70vh;
  min-height: 420px;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  background: #111;
}

.hero-media {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0,0,0,0.1) 0%,
    rgba(0,0,0,0.55) 60%,
    rgba(0,0,0,0.82) 100%
  );
}

.hero-caption {
  position: relative;
  z-index: 2;
  text-align: right;
  padding: 3rem 4rem 3.5rem;
  max-width: 680px;
}

.hero-eyebrow {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

.hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2.2rem, 5vw, 4rem);
  font-weight: 900;
  color: #fff;
  line-height: 1.05;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
}

.hero-sub {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  font-weight: 300;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  font-style: italic;
}

/* ============================================================
   Main Content Grid (article + aside)
   ============================================================ */

.main-content {
  background: #fff;
  color: #000;
}

.main-grid {
  display: grid;
  grid-template-columns: 1fr 260px;
  grid-template-areas: "article aside";
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

.article-body {
  grid-area: article;
  border-right: 1px solid rgba(0,0,0,0.1);
  padding: 4rem 3.5rem 5rem;
  min-width: 0;
}

/* ============================================================
   Content Sections (page.content 内部样式)
   ============================================================ */

.content-sections div {
  margin-bottom: 4.5rem;
  padding-bottom: 4rem;
  border-bottom: 1px solid rgba(0,0,0,0.1);
}

.content-sections div:last-child {
  border-bottom: none;
}

/* Drop cap for first div first paragraph */
.content-sections div:first-child > p:first-of-type::first-letter {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 4.5rem;
  font-weight: 900;
  line-height: 0.8;
  float: left;
  margin-right: 0.12em;
  margin-top: 0.08em;
  color: #000;
}

/* Section headings from injected content */
.content-sections h2 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 700;
  line-height: 1.15;
  color: #000;
  margin-bottom: 1.25rem;
  margin-top: 0;
  letter-spacing: -0.01em;
}

/* h2 > span decoration (build2 auto-injects) */
.content-sections h2 > span {
  display: inline;
  border-bottom: 3px solid #000;
  padding-bottom: 0.05em;
}

.content-sections h3 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #000;
  margin-bottom: 0.75rem;
  margin-top: 2rem;
}

.content-sections h3 > span {
  display: inline;
}

.content-sections p {
  font-family: 'Source Serif 4', serif;
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.85;
  color: #111;
  margin-bottom: 1.2rem;
}

.content-sections strong {
  font-weight: 600;
  color: #000;
}

.content-sections em {
  font-style: italic;
  color: #222;
}

.content-sections a {
  color: #000;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: opacity 0.15s;
}

.content-sections a:hover {
  opacity: 0.55;
}

.content-sections ul,
.content-sections ol {
  margin: 1rem 0 1.25rem 1.5rem;
}

.content-sections li {
  font-family: 'Source Serif 4', serif;
  font-size: 1rem;
  line-height: 1.75;
  color: #111;
  margin-bottom: 0.35rem;
}

.content-sections blockquote {
  border-left: 4px solid #000;
  margin: 2.5rem 0;
  padding: 1rem 1.5rem;
  background: rgba(0,0,0,0.03);
}

.content-sections blockquote p {
  font-family: 'Playfair Display', serif;
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 400;
  color: #000;
  line-height: 1.55;
  margin: 0;
}

.content-sections figure {
  margin: 2rem 0;
}

.content-sections figure img {
  width: 100%;
  height: auto;
  display: block;
}

.content-sections figcaption {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #666;
  margin-top: 0.5rem;
  letter-spacing: 0.04em;
}

.content-sections time {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.72rem;
  color: #888;
  letter-spacing: 0.08em;
}

/* ============================================================
   Aside
   ============================================================ */

.content-aside {
  grid-area: aside;
  position: sticky;
  top: 2rem;
  padding: 3rem 1.75rem 2.5rem;
  background: #fff;
}

.aside-inner {
  border-left: 3px solid #000;
  padding-left: 1.25rem;
}

.aside-heading {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #000;
  margin-bottom: 1.25rem;
}

.aside-heading > span {
  display: inline;
}

.aside-nav {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.aside-link {
  font-family: 'Source Serif 4', serif;
  font-size: 0.875rem;
  font-weight: 400;
  color: #444;
  text-decoration: none;
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  transition: color 0.15s, padding-left 0.15s;
  min-height: 40px;
  display: flex;
  align-items: center;
  line-height: 1.3;
}

.aside-link:hover,
.aside-link:focus {
  color: #000;
  padding-left: 0.35rem;
  outline: none;
}

.aside-divider {
  width: 2rem;
  height: 2px;
  background: #000;
  margin: 1.75rem 0 1.25rem;
}

.aside-brand {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 900;
  color: #000;
  margin-bottom: 0.35rem;
  letter-spacing: 0.02em;
}

.aside-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: #888;
  letter-spacing: 0.1em;
  line-height: 1.5;
}

/* ============================================================
   Footer：极简，仅 p + small
   ============================================================ */

.site-footer {
  background: #000;
  color: #fff;
  padding: 2.5rem 4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  border-top: none;
}

.footer-brand {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.02em;
  line-height: 1;
}

.site-footer small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.08em;
  text-align: right;
  line-height: 1.6;
}

/* ============================================================
   Scroll Reveal Animation
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
  .content-sections div {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.6s ease, transform 0.6s ease;
  }

  .content-sections div.is-visible {
    opacity: 1;
    transform: none;
  }

  .hero-caption {
    animation: heroFadeIn 0.9s ease 0.1s both;
  }

  @keyframes heroFadeIn {
    from { opacity: 0; transform: translateY(18px); }
    to { opacity: 1; transform: none; }
  }
}

/* ============================================================
   Responsive: Tablet
   ============================================================ */

@media (max-width: 1100px) {
  .site-header {
    width: 190px;
  }

  .content-area {
    margin-left: 190px;
  }

  .main-grid {
    grid-template-columns: 1fr 220px;
  }

  .article-body {
    padding: 3rem 2.5rem 4rem;
  }
}

/* ============================================================
   Responsive: Mobile (≤ 768px)
   ============================================================ */

@media (max-width: 768px) {
  html {
    scroll-behavior: smooth;
  }

  div[id] {
    scroll-margin-top: 68px;
  }

  /* Header becomes top bar on mobile */
  .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: auto;
    flex-direction: row;
    align-items: center;
    padding: 0 1rem;
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,0.15);
    overflow: hidden;
    z-index: 200;
    min-height: 56px;
  }

  .header-brand {
    margin-bottom: 0;
    flex-direction: row;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
    margin-right: auto;
  }

  .brand-name {
    font-size: 1.05rem;
    min-height: 44px;
  }

  .logo-mark {
    width: 26px;
    height: 26px;
  }

  .site-nav {
    flex: none;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: calc(100vw - 120px);
  }

  .nav-list {
    flex-direction: row;
    gap: 0;
    white-space: nowrap;
  }

  .nav-link {
    font-size: 0.78rem;
    padding: 0 0.75rem;
    border-bottom: none;
    border-right: 1px solid rgba(255,255,255,0.1);
    min-height: 48px;
    display: inline-flex;
    align-items: center;
  }

  .nav-link:hover {
    padding-left: 0.75rem;
  }

  .nav-link:first-child {
    border-top: none;
  }

  /* Content area fills full width */
  .content-area {
    margin-left: 0;
    margin-top: 56px;
  }

  /* Hero */
  .hero-block {
    height: 70vh;
    min-height: 360px;
  }

  .hero-caption {
    padding: 1.5rem 1.25rem 2rem;
    max-width: 100%;
    text-align: right;
  }

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

  .hero-eyebrow {
    font-size: 0.65rem;
  }

  /* Main grid: stack vertically */
  .main-grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      "article"
      "aside";
  }

  .article-body {
    padding: 2rem 1.25rem 3rem;
    border-right: none;
    border-bottom: 1px solid rgba(0,0,0,0.1);
  }

  .content-aside {
    position: static;
    padding: 2rem 1.25rem;
    border-top: 1px solid rgba(0,0,0,0.08);
  }

  /* Footer */
  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    padding: 2rem 1.25rem;
    gap: 0.75rem;
  }

  .footer-brand {
    font-size: 2rem;
  }

  .site-footer small {
    text-align: left;
  }
}

@media (max-width: 420px) {
  .hero-title {
    font-size: 1.65rem;
  }

  .content-sections h2 {
    font-size: 1.4rem;
  }

  .content-sections p {
    font-size: 1rem;
  }
}
