@import url('https://fonts.googleapis.com/css2?family=Calistoga:ital@0;1&family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background-color: #fafaf8;
  color: #1a1a1a;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* ── Paper Texture Overlay ── */
.paper-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 999;
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='300' height='300' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 300px 300px;
  opacity: 0.55;
  mix-blend-mode: multiply;
}

/* ── Typography ── */
h1, h2, h3, h4 {
  font-family: 'Calistoga', Georgia, serif;
  line-height: 1.2;
  color: #1a1a1a;
}

h1 { font-size: clamp(2rem, 6vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 4vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 3vw, 1.5rem); }

p { margin-bottom: 1rem; font-size: 1rem; line-height: 1.7; }
a { color: #1a1a1a; text-decoration: underline; text-underline-offset: 3px; }
a:hover { opacity: 0.65; }

small {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  display: block;
  margin-bottom: 0.35rem;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fafaf8;
  border-bottom: 1.5px solid #1a1a1a;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
}

.header-brand {
  padding: 0.9rem 0 0.5rem;
  border-bottom: 1px dashed #4a4a4a;
}

.brand-link {
  text-decoration: none;
  display: inline-block;
}

.brand-text {
  font-family: 'Calistoga', Georgia, serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  color: #1a1a1a;
  letter-spacing: -0.02em;
}

.brand-logo {
  height: 40px;
  width: auto;
}

/* ── Nav ── */
.site-nav {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.site-nav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-nav ol li {
  flex-shrink: 0;
}

.site-nav ol li a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  font-size: 0.875rem;
  font-weight: 500;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  color: #4a4a4a;
  letter-spacing: 0.03em;
  border-right: 1px solid #e0deda;
  position: relative;
}

.site-nav ol li a:hover {
  background: #1a1a1a;
  color: #fafaf8;
  opacity: 1;
}

.site-nav ol li:last-child a {
  border-right: none;
}

/* ── Hero ── */
.hero-section {
  min-height: 70vh;
  display: flex;
  align-items: center;
  border-bottom: 1.5px solid #1a1a1a;
  padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 2.5rem);
  position: relative;
  overflow: hidden;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero-media {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 280px;
}

.hero-sketch-frame {
  position: relative;
  width: 100%;
  max-width: 400px;
}

.sketch-border {
  width: 100%;
  height: auto;
  display: block;
}

.hero-badge {
  position: absolute;
  top: 12px;
  right: -10px;
  background: #1a1a1a;
  color: #fafaf8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.35rem 0.7rem;
  transform: rotate(2.5deg);
  box-shadow: 2px 2px 0 #4a4a4a;
}

.hero-tag {
  position: absolute;
  bottom: 18px;
  left: -8px;
  background: #fafaf8;
  color: #1a1a1a;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  padding: 0.3rem 0.65rem;
  border: 1.5px solid #1a1a1a;
  transform: rotate(-1.8deg);
}

.hero-copy {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1.25rem;
}

.hero-h1 {
  text-align: right;
  max-width: 480px;
  letter-spacing: -0.02em;
}

.hero-desc {
  font-size: 1.05rem;
  color: #4a4a4a;
  max-width: 380px;
  margin: 0;
  text-align: right;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 2rem;
  background: #1a1a1a;
  color: #fafaf8;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  border: 2px solid #1a1a1a;
  position: relative;
  box-shadow: 3px 3px 0 #4a4a4a;
}

.hero-cta:hover {
  background: #fafaf8;
  color: #1a1a1a;
  opacity: 1;
  box-shadow: 5px 5px 0 #1a1a1a;
}

/* ── Content Body ── */
.content-body {
  padding: clamp(2rem, 5vw, 4rem) clamp(1rem, 4vw, 2.5rem);
}

.content-wrap {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  max-width: 1200px;
  margin: 0 auto;
  align-items: start;
}

/* ── Aside ── */
.content-aside {
  position: sticky;
  top: 80px;
  border: 1.5px solid #1a1a1a;
  padding: 1.25rem 1rem;
  background: #fafaf8;
  box-shadow: 3px 3px 0 #4a4a4a;
}

.aside-nav {
  list-style: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.aside-nav li {
  border-bottom: 1px dashed #c8c4be;
}

.aside-nav li:last-child {
  border-bottom: none;
}

.aside-nav li a {
  display: block;
  padding: 0.6rem 0.4rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #4a4a4a;
  text-decoration: none;
  line-height: 1.4;
}

.aside-nav li a:hover {
  color: #1a1a1a;
  background: none;
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.aside-note {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  opacity: 0.5;
}

.aside-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #4a4a4a;
}

/* ── Content Main (page.content 插入区域) ── */
.content-main {
  min-width: 0;
}

.content-main section {
  padding-bottom: clamp(2rem, 5vw, 3.5rem);
  margin-bottom: clamp(1.5rem, 4vw, 3rem);
  border-bottom: 1px solid #d6d2cc;
  scroll-margin-top: 80px;
}

.content-main section:last-child {
  border-bottom: none;
}

.content-main h2 {
  margin-bottom: 1rem;
}

.content-main h3 {
  margin: 1.5rem 0 0.75rem;
}

.content-main ul,
.content-main ol {
  padding-left: 1.4rem;
  margin-bottom: 1rem;
}

.content-main li {
  margin-bottom: 0.4rem;
  line-height: 1.65;
}

.content-main a {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 500;
}

.content-main table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

.content-main th,
.content-main td {
  border: 1px solid #c8c4be;
  padding: 0.6rem 0.8rem;
  text-align: left;
}

.content-main th {
  background: #f0ede8;
  font-weight: 600;
}

.content-main blockquote {
  border-left: 3px solid #1a1a1a;
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: #f3f0eb;
  font-style: italic;
  color: #4a4a4a;
}

/* ── Small / eyebrow before h2/h3 ── */
small + h2,
small + h3 {
  margin-top: 0.1rem;
}

/* ── Card style for any .card elements in content ── */
.content-main .card,
.card {
  border-bottom: 3px solid #1a1a1a;
  border-radius: 0;
  padding: 1.25rem;
  background: #fafaf8;
  border-top: 1px solid #d6d2cc;
  border-left: 1px solid #d6d2cc;
  border-right: 1px solid #d6d2cc;
}

/* ── Footer ── */
.site-footer {
  border-top: 2px solid #1a1a1a;
  padding: clamp(2rem, 5vw, 3.5rem) clamp(1rem, 4vw, 2.5rem) 1.5rem;
  background: #fafaf8;
  position: relative;
}

.footer-brand-row {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed #4a4a4a;
}

.footer-brand-big {
  font-family: 'Calistoga', Georgia, serif;
  font-size: clamp(2.5rem, 10vw, 5.5rem);
  color: #1a1a1a;
  letter-spacing: -0.03em;
  line-height: 1;
  opacity: 0.08;
  display: block;
  user-select: none;
}

.footer-dls {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  max-width: 800px;
  margin: 0 auto 2rem;
}

.footer-dl dt {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #4a4a4a;
  margin-bottom: 0.6rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid #c8c4be;
}

.footer-dl dd {
  margin: 0 0 0.35rem;
}

.footer-dl dd a {
  font-size: 0.85rem;
  color: #4a4a4a;
  text-decoration: none;
}

.footer-dl dd a:hover {
  color: #1a1a1a;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 1;
}

.footer-bottom {
  text-align: center;
  border-top: 1px solid #d6d2cc;
  padding-top: 1.25rem;
}

.footer-copy {
  font-size: 0.78rem;
  color: #4a4a4a;
  letter-spacing: 0.05em;
  margin: 0;
}

/* ── Scroll Reveal ── */
@media (prefers-reduced-motion: no-preference) {
  .content-main section,
  .hero-copy,
  .hero-media {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
  }

  .content-main section.is-visible,
  .hero-copy.is-visible,
  .hero-media.is-visible {
    opacity: 1;
    transform: translateY(0);
  }

  .hero-cta {
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
  }

  .site-nav ol li a {
    transition: background 0.12s, color 0.12s;
  }
}

/* ── Sketch / Raw Decorative marks ── */
.site-header::before {
  content: '';
  display: block;
  height: 2px;
  background: repeating-linear-gradient(
    90deg,
    #1a1a1a 0px,
    #1a1a1a 6px,
    transparent 6px,
    transparent 12px
  );
  opacity: 0.15;
  margin-bottom: 0;
}

/* Random tilt on hero sketch */
.hero-sketch-frame {
  transform: rotate(-1deg);
}

.content-aside {
  transform: rotate(0.4deg);
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .hero-media {
    order: 1;
    min-height: 180px;
  }

  .hero-copy {
    order: 2;
    text-align: left;
    align-items: flex-start;
  }

  .hero-h1 {
    text-align: left;
  }

  .hero-desc {
    text-align: left;
  }

  .content-wrap {
    grid-template-columns: 1fr;
  }

  .content-aside {
    position: static;
    transform: none;
  }

  .aside-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
  }

  .aside-nav li {
    border-bottom: none;
  }

  .aside-nav li a {
    padding: 0.5rem 0.8rem;
    border: 1px solid #c8c4be;
    display: inline-block;
  }

  .footer-dls {
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
  }

  .footer-dls .footer-dl:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  html {
    scroll-padding-top: 60px;
  }

  .site-header {
    padding: 0 1rem;
  }

  .site-nav ol {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  .site-nav ol li a {
    min-height: 44px;
    padding: 0.5rem 0.9rem;
    font-size: 0.8rem;
    white-space: nowrap;
  }

  .hero-section {
    min-height: 65vh;
    padding: 2.5rem 1rem;
  }

  .content-body {
    padding: 1.5rem 1rem;
  }

  .footer-dls {
    grid-template-columns: 1fr;
  }

  .footer-dls .footer-dl:last-child {
    grid-column: auto;
  }

  .footer-brand-big {
    font-size: 3.5rem;
  }
}

/* ── Images ── */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ── Utility ── */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

button[aria-expanded]{min-width:44px;min-height:44px}
