@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  background: #f5f5f5;
  color: #1f1f1f;
  line-height: 1.6;
  min-height: 100vh;
}

/* ── CSS Variables ── */
:root {
  --white: #ffffff;
  --gray: #f5f5f5;
  --ink: #1f1f1f;
  --ink-60: rgba(31,31,31,0.6);
  --ink-10: rgba(31,31,31,0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow: 0 4px 6px rgba(0,0,0,0.05);
  --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
  --header-h: 64px;
  --announce-h: 36px;
  --sticky-h: 44px;
  --nav-offset: calc(var(--header-h) + var(--announce-h) + var(--sticky-h));
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

/* ── Site Shell ── */
.site-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ── Header ── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--white);
  border-bottom: 1px solid var(--ink-10);
}

.header-announce {
  height: var(--announce-h);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.06em;
}

.header-inner {
  height: var(--header-h);
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand-mark {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.brand-icon { height: 36px; width: auto; display: block; }

.brand-text {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.main-nav { flex: 1; }

.main-nav ol {
  display: flex;
  list-style: none;
  gap: 4px;
  justify-content: flex-end;
}

.main-nav ol li a {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  min-height: 40px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-60);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.main-nav ol li a:hover,
.main-nav ol li a:focus-visible {
  background: var(--gray);
  color: var(--ink);
}

.nav-icon {
  font-size: 0.9em;
  opacity: 0.6;
}

/* ── Sticky Anchor Bar ── */
.sticky-anchor-bar {
  height: var(--sticky-h);
  display: flex;
  align-items: center;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 4px;
  padding: 0 24px;
  border-top: 1px solid var(--ink-10);
  background: var(--white);
}

.sticky-anchor-bar::-webkit-scrollbar { display: none; }

.sticky-anchor-bar a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--ink-60);
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid var(--ink-10);
  background: var(--gray);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.sticky-anchor-bar a:hover {
  background: var(--ink);
  color: var(--white);
}

/* ── Mobile Nav Toggle ── */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  margin-left: auto;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

/* ── Main & Wrap ── */
main { flex: 1; }

.wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ── Scroll Margin ── */
div[id] {
  scroll-margin-top: var(--nav-offset);
}

/* ── Hero ── */
.hero-section {
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 80px;
}

.hero-article {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 40px;
  align-items: end;
}

.hero-aside {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  box-shadow: var(--shadow-md);
  align-self: end;
}

.aside-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--ink);
  border-radius: 6px;
  padding: 4px 10px;
  margin-bottom: 16px;
}

.aside-desc {
  font-size: 0.9rem;
  color: var(--ink-60);
  line-height: 1.7;
}

.hero-text {
  text-align: right;
}

.hero-text h1 {
  font-size: clamp(2.5rem, 6vw, 5rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 20px;
}

.hero-text .subtitle {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: var(--ink-60);
  font-weight: 400;
  max-width: 480px;
  margin-left: auto;
  line-height: 1.65;
}

/* ── Content Section / Bento Grid ── */
.content-section {
  padding-top: 40px;
}

.page-content {
  width: 100%;
}

/* ── Bento: page.content sections ── */
.page-content div {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 48px 52px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow var(--transition), transform var(--transition);
}

.page-content div:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px) scale(1.005);
}

/* Bento Grid for pairs of sections */
.page-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: auto;
  gap: 16px;
}

.page-content div {
  grid-column: span 4;
  margin-bottom: 0;
}

/* Alternate layout: 2+2 bento feel for even/odd */
.page-content div:nth-child(2),
.page-content div:nth-child(5) {
  grid-column: span 2;
}

.page-content div:nth-child(3),
.page-content div:nth-child(6) {
  grid-column: span 2;
}

/* ── Typography within content ── */
.page-content h2 {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin-bottom: 8px;
  line-height: 1.25;
}

.page-content p.subtitle,
.page-content h2 + p {
  font-size: 1rem;
  color: var(--ink-60);
  margin-bottom: 20px;
  line-height: 1.65;
}

.page-content p {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--ink);
  margin-bottom: 14px;
}

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

.page-content h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 24px 0 8px;
}

.page-content ul, .page-content ol {
  padding-left: 1.4em;
  margin-bottom: 14px;
}

.page-content li {
  margin-bottom: 6px;
  font-size: 1rem;
  line-height: 1.7;
  color: var(--ink);
}

.page-content a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: opacity var(--transition);
}

.page-content a:hover { opacity: 0.65; }

.page-content img {
  max-width: 100%;
  border-radius: var(--radius-md);
  display: block;
  margin: 20px 0;
}

.page-content blockquote {
  border-left: 3px solid var(--ink-10);
  padding-left: 20px;
  margin: 20px 0;
  color: var(--ink-60);
  font-style: italic;
}

/* ── Footer ── */
.site-footer {
  background: var(--ink);
  color: var(--white);
  padding: 64px 24px 40px;
  text-align: center;
}

.footer-cta {
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.5;
  color: var(--white);
}

.site-footer small {
  display: block;
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  letter-spacing: 0.04em;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── Tablet ── */
@media (max-width: 900px) {
  .hero-article {
    grid-template-columns: 1fr;
    gap: 24px;
  }

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

  .hero-text .subtitle {
    margin-left: 0;
  }

  .page-content div:nth-child(n) {
    grid-column: span 4;
  }
}

/* ── Mobile ── */
@media (max-width: 640px) {
  :root {
    --header-h: 56px;
    --announce-h: 32px;
    --sticky-h: 40px;
  }

  .header-inner { padding: 0 16px; }

  .main-nav { display: none; }
  .main-nav.open { display: block; }

  .nav-toggle { display: flex; }

  .main-nav ol {
    flex-direction: column;
    position: absolute;
    top: calc(var(--announce-h) + var(--header-h));
    left: 0; right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--ink-10);
    padding: 12px 16px;
    gap: 2px;
    justify-content: flex-start;
    z-index: 200;
  }

  .main-nav ol li a {
    padding: 12px 16px;
    font-size: 1rem;
    min-height: 48px;
  }

  .wrap { padding: 0 16px 60px; }

  .hero-section {
    padding-bottom: 48px;
    align-items: center;
  }

  .hero-text h1 { font-size: 2.25rem; }

  .hero-aside { padding: 24px 20px; }

  .page-content div { padding: 28px 20px; }

  .page-content h2 { font-size: 1.3rem; }

  .sticky-anchor-bar { padding: 0 16px; }

  .site-footer { padding: 48px 16px 32px; }
  .footer-cta { font-size: 1.1rem; }
}
