:root {
  --bg: #FDFBF7;
  --bg-deep: #F6F1E8;
  --card: #FFFFFF;
  --shell: rgba(43, 33, 25, 0.045);
  --text: #2B2119;
  --muted: #8A7B6C;
  --accent: #3D5A3D;
  --accent-ink: #2E452E;
  --accent-soft: rgba(61, 90, 61, 0.08);
  --hairline: rgba(43, 33, 25, 0.08);
  --hairline-strong: rgba(43, 33, 25, 0.14);
  --code-bg: #1C1712;
  --code-text: #C9E4B4;
  --shadow-ambient: 0 24px 60px -24px rgba(43, 33, 25, 0.18), 0 6px 18px -8px rgba(43, 33, 25, 0.08);
  --ease: cubic-bezier(0.32, 0.72, 0, 1);
}
[data-theme="dark"] {
  --bg: #171310;
  --bg-deep: #131009;
  --card: #201A15;
  --shell: rgba(237, 230, 220, 0.05);
  --text: #EDE6DC;
  --muted: #9C8F7F;
  --accent: #A3B899;
  --accent-ink: #C2d4b9;
  --accent-soft: rgba(163, 184, 153, 0.1);
  --hairline: rgba(237, 230, 220, 0.09);
  --hairline-strong: rgba(237, 230, 220, 0.16);
  --code-bg: #100D0A;
  --code-text: #C9E4B4;
  --shadow-ambient: 0 24px 60px -24px rgba(0, 0, 0, 0.6), 0 6px 18px -8px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  font-size: 16px;
  transition: background .6s var(--ease), color .6s var(--ease);
}
/* film grain */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 60; pointer-events: none;
  opacity: .035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
code, .mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }

.wrap { max-width: 1060px; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- floating island nav ---------- */
header.site {
  position: sticky; top: 1.25rem; z-index: 40;
  display: flex; justify-content: center;
  padding: 0 1rem;
  pointer-events: none;
}
header.site .wrap {
  pointer-events: auto;
  display: flex; align-items: center; gap: 1.4rem;
  width: max-content; max-width: calc(100vw - 2rem);
  margin: 0; padding: .55rem .6rem .55rem 1.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--hairline);
  box-shadow: var(--shadow-ambient);
}
.brand { font-weight: 800; letter-spacing: .05em; font-size: .98rem; color: var(--text); white-space: nowrap; }
.brand .tick { color: var(--accent); }
nav.main { display: flex; gap: 1.15rem; flex-wrap: wrap; align-items: center; }
nav.main a {
  color: var(--muted); font-size: .86rem; font-weight: 600;
  transition: color .4s var(--ease);
}
nav.main a:hover, nav.main a.active { color: var(--accent); text-decoration: none; }

#theme-toggle {
  background: var(--shell); border: 1px solid var(--hairline); border-radius: 999px;
  color: var(--muted); cursor: pointer; font-size: .9rem;
  width: 2.1rem; height: 2.1rem; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
  transition: transform .5s var(--ease), color .4s var(--ease), border-color .4s var(--ease);
}
#theme-toggle:hover { color: var(--accent); border-color: var(--hairline-strong); transform: rotate(15deg); }
#theme-toggle:active { transform: scale(.94); }

/* ---------- hero: editorial split ---------- */
.hero {
  padding: 7rem 0 6rem;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: 3.5rem; align-items: center;
}
.hero .eyebrow {
  display: inline-block; border-radius: 999px; padding: .3rem .85rem;
  font-size: 10px; text-transform: uppercase; letter-spacing: .22em; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--hairline);
  margin-bottom: 1.4rem;
}
.hero h1 {
  font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(2.3rem, 5.2vw, 3.7rem);
  line-height: 1.08; letter-spacing: -0.025em;
  margin: 0 0 1.4rem;
}
.hero p.lead { font-size: 1.06rem; color: var(--muted); max-width: 36rem; margin: 0 0 2.2rem; }
.hero .actions { display: flex; gap: .8rem; flex-wrap: wrap; }
.hero-side { display: flex; flex-direction: column; gap: 1.2rem; min-width: 0; }

/* ---------- buttons: island pills with nested icon ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .7rem;
  padding: .55rem .6rem .55rem 1.35rem; border-radius: 999px;
  border: 1px solid var(--hairline-strong); color: var(--text);
  font-size: .92rem; font-weight: 700; background: var(--card);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease), border-color .5s var(--ease);
}
.btn .go {
  width: 2rem; height: 2rem; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--shell); font-size: .95rem;
  transition: transform .5s var(--ease), background .5s var(--ease);
}
.btn:hover { text-decoration: none; box-shadow: var(--shadow-ambient); border-color: var(--accent); }
.btn:hover .go { transform: translate(2px, -1px) scale(1.05); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--bg); }
.btn.primary .go { background: rgba(255, 255, 255, 0.16); }

/* ---------- double-bezel shells ---------- */
.shell {
  background: var(--shell);
  border: 1px solid var(--hairline);
  border-radius: 2rem;
  padding: .45rem;
}
.shell > .core {
  background: var(--card);
  border-radius: calc(2rem - .45rem);
  border: 1px solid var(--hairline);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.4);
  overflow: hidden;
}
[data-theme="dark"] .shell > .core { box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.05); }

.logo-shell .core { padding: 1.2rem 1.4rem; background: #fff; text-align: center; }
.legacy-logo { max-width: 100%; height: auto; display: inline-block; }

.termcard-shell .core { background: var(--code-bg); }
.termcard {
  color: var(--code-text); padding: 1.15rem 1.35rem; margin: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8rem; line-height: 1.75; overflow-x: auto;
}
.termcard .dim { color: #6E6558; }

/* ---------- sections ---------- */
section { padding: 6.5rem 0; }
section.alt {
  background: var(--bg-deep);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.eyebrow {
  display: inline-block; border-radius: 999px; padding: .3rem .85rem;
  font-size: 10px; text-transform: uppercase; letter-spacing: .22em; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--hairline);
  margin-bottom: 1.1rem;
}
h2 {
  font-family: "Fraunces", Georgia, serif;
  font-weight: 560; font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  line-height: 1.12; letter-spacing: -0.01em; margin: 0 0 .7rem;
}
.sub { color: var(--muted); margin: 0 0 3rem; max-width: 42rem; font-size: 1.02rem; }

/* ---------- bento grid ---------- */
.grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.1rem; }
.grid .shell { grid-column: span 4; display: flex; }
.grid .shell.wide { grid-column: span 8; }
.grid .shell > .core { padding: 1.6rem 1.7rem; width: 100%; }
.card h3 { margin: 0 0 .5rem; font-size: 1.04rem; font-weight: 700; }
.card p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- versions table ---------- */
.tablewrap { overflow-x: auto; }
.tablewrap .core { padding: .5rem 1rem; }
table.versions { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.versions th, table.versions td { text-align: left; padding: .85rem 1rem; border-bottom: 1px solid var(--hairline); }
table.versions tr:last-child td { border-bottom: none; }
table.versions th { color: var(--muted); font-weight: 700; font-size: .78rem; text-transform: uppercase; letter-spacing: .14em; }
table.versions td:nth-child(2) { font-family: ui-monospace, Menlo, monospace; color: var(--accent-ink); }

/* ---------- timeline ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: ""; position: absolute; left: 7px; top: 8px; bottom: 8px;
  width: 1px; background: var(--hairline-strong);
}
.timeline li { position: relative; padding: 0 0 2.4rem 2.4rem; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: 1px; top: .5rem;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent); border: 3px solid var(--bg);
  box-shadow: 0 0 0 1px var(--hairline-strong);
}
section.alt .timeline li::before { border-color: var(--bg-deep); }
.timeline .when {
  font-size: .74rem; color: var(--accent); letter-spacing: .2em; font-weight: 700;
  text-transform: uppercase;
}
.timeline h3 { margin: .2rem 0 .35rem; font-size: 1.12rem; font-weight: 700; }
.timeline p { margin: 0; color: var(--muted); font-size: .93rem; max-width: 40rem; }

/* ---------- news archive ---------- */
.year-h {
  font-family: "Fraunces", Georgia, serif; font-weight: 560;
  color: var(--text); font-size: 1.7rem; margin: 4rem 0 1.8rem;
  padding-bottom: .6rem; border-bottom: 1px solid var(--hairline-strong);
}
.year-h::before { content: none; }
article.post { margin: 0 0 2.6rem; }
article.post h3 { margin: 0 0 .2rem; font-size: 1.12rem; font-weight: 700; }
article.post .meta {
  font-size: .74rem; color: var(--accent); font-weight: 700;
  letter-spacing: .16em; text-transform: uppercase; margin-bottom: .45rem;
}
article.post .body { color: var(--muted); font-size: .95rem; max-width: 46rem; }
article.post .body p { margin: .4rem 0; }

/* ---------- footer ---------- */
footer.site {
  border-top: 1px solid var(--hairline); padding: 3.5rem 0 4rem;
  color: var(--muted); font-size: .86rem;
}
footer.site .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* ---------- scroll reveal ---------- */
.reveal {
  opacity: 0; transform: translateY(28px); filter: blur(6px);
  transition: opacity .9s var(--ease), transform .9s var(--ease), filter .9s var(--ease);
}
.reveal.in { opacity: 1; transform: translateY(0); filter: blur(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; filter: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ---------- mobile collapse ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2.5rem; padding: 4.5rem 0 4rem; }
  .grid .shell, .grid .shell.wide { grid-column: span 12; }
}
@media (max-width: 768px) {
  section { padding: 4rem 0; }
  .wrap { padding: 0 1rem; }
  header.site .wrap { gap: .9rem; padding-left: 1rem; }
  nav.main { gap: .8rem; }
  nav.main a { font-size: .8rem; }
}
