/* ─── tokens ───────────────────────────────────────────────────────────── */
:root {
  --bg:        #fafaf8;
  --fg:        #0c0c0c;
  --muted:     #6b6b6b;
  --line:      #e3e3e0;
  --accent:    #0c0c0c; /* same as fg today — swap to a color later */
  --maxw:      1180px;
  --col:       620px;
  --pad:       2.8vw;
  --ease:      cubic-bezier(0.215, 0.61, 0.355, 1);

  --font-ui:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-display: 'Fraunces', Georgia, serif;
  --font-body:    'Fraunces', Georgia, serif;
  --font-mono:    'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}
[data-theme="golden"] {
  --bg:        #f5e6cc;
  --fg:        #2a1808;
  --muted:     #8a6a45;
  --line:      #e3cda5;
  --accent:    #c87a2c;
}
[data-theme="dark"] {
  --bg:        #0c0c0c;
  --fg:        #f0f0ee;
  --muted:     #8a8a8a;
  --line:      #262625;
  --accent:    #f0f0ee;
}
html, body { transition: background 320ms var(--ease), color 320ms var(--ease); }

/* ─── reset ────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
[hidden] { display: none !important; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; background: none; border: none; padding: 0; cursor: pointer; color: inherit; }

/* ─── base ─────────────────────────────────────────────────────────────── */
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-ui);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  font-feature-settings: 'ss01', 'cv11';
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ─── layout ───────────────────────────────────────────────────────────── */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 var(--pad); }

/* ─── nav ──────────────────────────────────────────────────────────────── */
.nav {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 18px var(--pad);
  max-width: var(--maxw); margin: 0 auto;
}
.nav-side { display: flex; align-items: center; }
.nav-side-right { justify-content: flex-end; }
.nav-home {
  display: inline-grid;
  place-items: center;
  width: 36px; height: 36px;
  border-radius: 6px;
  color: var(--muted);
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
.nav-home:hover {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 6%, transparent);
}
.nav-links {
  display: flex;
  gap: 26px;
  justify-content: center;
}
.nav-links a {
  position: relative;
  color: var(--muted);
  transition: color 200ms var(--ease);
}
.nav-links a:hover { color: var(--fg); }
.nav-links a.is-active { color: var(--fg); }

.theme-toggle {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: var(--muted);
  transition: color 200ms var(--ease), background 200ms var(--ease);
}
.theme-toggle:hover,
.theme-toggle:focus-visible {
  color: var(--fg);
  background: color-mix(in oklab, var(--fg) 6%, transparent);
  outline: none;
}
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-moon,
.theme-toggle .icon-sunset { display: none; }

[data-theme="golden"] .theme-toggle .icon-sun    { display: none; }
[data-theme="golden"] .theme-toggle .icon-sunset { display: block; }

[data-theme="dark"]   .theme-toggle .icon-sun  { display: none; }
[data-theme="dark"]   .theme-toggle .icon-moon { display: block; }

/* ─── hero ─────────────────────────────────────────────────────────────── */
.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: clamp(32px, 6vw, 96px);
  align-items: center;
  padding: clamp(80px, 14vh, 180px) 0 clamp(64px, 10vh, 140px);
}
.hero-text h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(36px, 5.4vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 28px;
  max-width: 18ch;
}
.hero-text h1 em {
  font-style: normal;
  color: var(--muted);
}
.hero-text h1 { margin-bottom: 18px; }

/* finder widget — "How did you find me?" ───────────────────────────────── */
.finder {
  margin: 0 0 28px;
  font-size: clamp(18px, 1.5vw, 22px);
  line-height: 1.4;
}
.finder-prompt {
  color: var(--muted);
  border-bottom: 1px dashed color-mix(in oklab, var(--muted) 50%, transparent);
  padding-bottom: 2px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.finder-prompt:hover,
.finder-prompt:focus-visible {
  color: var(--fg);
  border-bottom-color: var(--fg);
  outline: none;
}
.finder-caret {
  display: inline-block;
  margin-left: 6px;
  font-size: 0.85em;
  transition: transform 280ms var(--ease);
}
.finder[data-open] .finder-caret { transform: rotate(180deg); }

.finder-panel {
  margin-top: 14px;
}
.finder-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.finder-opt {
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: -0.005em;
  transition: color 200ms var(--ease), border-color 200ms var(--ease), background 200ms var(--ease);
}
.finder-opt:hover,
.finder-opt:focus-visible {
  color: var(--bg);
  background: var(--fg);
  border-color: var(--fg);
  outline: none;
}

.finder-reply {
  margin-top: 26px;
  animation: finderIn 320ms var(--ease);
}
.finder-reply-text { color: var(--fg); }

@keyframes finderIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-text p {
  font-size: clamp(16px, 1.25vw, 19px);
  line-height: 1.65;
  color: var(--muted);
  max-width: 52ch;
  margin: 0 0 36px;
}
.hero-text p a {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms var(--ease);
}
.hero-text p a:hover { border-color: var(--fg); }
.hero-meta {
  display: flex; gap: 24px;
}
.hero-meta a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: border-color 200ms var(--ease);
}
.hero-meta a:hover { border-color: var(--fg); }

/* hero visual — flow field canvas ───────────────────────────────────────── */
.hero-visual {
  position: relative;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  overflow: hidden;
  -webkit-mask-image: radial-gradient(circle at center, #000 25%, transparent 90%);
          mask-image: radial-gradient(circle at center, #000 25%, transparent 90%);
}
.hero-visual canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* ─── section blocks (home) ────────────────────────────────────────────── */
.section {
  padding: 56px 0;
  border-top: 1px solid var(--line);
}
.section-head {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: clamp(24px, 4vw, 48px);
  align-items: baseline;
  margin-bottom: 36px;
}
.section-head h2 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(22px, 2.4vw, 30px);
  letter-spacing: -0.02em;
  margin: 0;
}
.section-head .mono { display: block; margin-bottom: 6px; }
.section-blurb {
  color: var(--muted);
  max-width: 54ch;
  margin: 0;
}

/* post list */
.posts {
  display: flex; flex-direction: column;
  list-style: none; margin: 0; padding: 0;
}
.post-row {
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: clamp(24px, 4vw, 48px);
  align-items: baseline;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  transition: padding-left 280ms var(--ease);
}
.post-row:first-child { border-top: none; }
.post-row:hover { padding-left: 8px; }
.post-row .date { color: var(--muted); }
.post-row .title {
  font-weight: 500;
  letter-spacing: -0.005em;
}
.post-row .arrow {
  color: var(--muted);
  transition: transform 280ms var(--ease), color 200ms var(--ease);
}
.post-row:hover .arrow { transform: translateX(4px); color: var(--fg); }

.see-all {
  display: inline-block;
  margin-top: 24px;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.see-all:hover { color: var(--fg); border-color: var(--fg); }

/* ─── footer ───────────────────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--line);
  margin-top: 80px;
  padding: 40px 0 60px;
  display: flex; justify-content: space-between; align-items: baseline;
  flex-wrap: wrap; gap: 20px;
}

/* ─── post page ────────────────────────────────────────────────────────── */
.post {
  max-width: var(--col);
  margin: 0 auto;
  padding: clamp(60px, 10vh, 120px) var(--pad) 80px;
}
.post .back {
  color: var(--muted);
  display: inline-block;
  margin-bottom: 48px;
  transition: color 200ms var(--ease);
}
.post .back:hover { color: var(--fg); }

.post header {
  margin-bottom: 48px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--line);
}
.post .post-meta {
  display: flex; gap: 16px; margin-bottom: 16px;
}
.post h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(28px, 3.6vw, 44px);
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin: 0;
}

.book-meta {
  display: flex;
  gap: 24px;
  align-items: baseline;
  margin-top: 20px;
}
.book-meta a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 1px;
  transition: color 200ms var(--ease), border-color 200ms var(--ease);
}
.book-meta a:hover { color: var(--fg); border-color: var(--fg); }

.post-body { font-size: 17px; line-height: 1.75; }
.post-body p { margin: 0 0 1.2em; }
.post-body h2 {
  font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 2em 0 0.6em;
}
.post-body h3 {
  font-size: 17px; font-weight: 600;
  margin: 1.6em 0 0.4em;
}
.post-body ul, .post-body ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.post-body li { margin-bottom: 0.4em; }
.post-body a {
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms var(--ease);
}
.post-body a:hover { border-color: var(--fg); }
.post-body blockquote {
  border-left: 2px solid var(--fg);
  padding-left: 18px;
  margin: 1.4em 0;
  color: var(--muted);
}
.post-body code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: color-mix(in oklab, var(--fg) 6%, transparent);
  padding: 1px 6px; border-radius: 3px;
}
.post-body strong { font-weight: 600; }
.post-body hr {
  border: none; border-top: 1px solid var(--line);
  margin: 2em 0;
}

/* ─── resume page (winternet-style plaintext) ──────────────────────────── */
.resume {
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(60px, 10vh, 110px) var(--pad) 100px;
  font-family: var(--font-mono);
  font-size: 14px;
  line-height: 1.65;
  color: var(--fg);
}
.resume p { margin: 0 0 1em; }
.resume a {
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  transition: border-color 200ms var(--ease);
}
.resume a:hover { border-color: var(--fg); }

.resume-header {
  margin-bottom: 56px;
}
.resume h1 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: clamp(28px, 3.4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--fg);
}
.resume-contact {
  color: var(--muted);
  font-size: 13px;
  margin: 4px 0;
}
.resume-contact a { color: var(--muted); border-bottom-color: transparent; }
.resume-contact a:hover { color: var(--fg); border-bottom-color: var(--fg); }

.resume-section {
  margin-bottom: 44px;
}
.resume h2 {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin: 0 0 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--fg);
}

.resume-job { margin-bottom: 28px; }
.resume-job:last-child { margin-bottom: 0; }

.resume-job-head,
.resume-role-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 24px;
  margin-bottom: 4px;
}
.resume-company {
  font-weight: 700;
  color: var(--fg);
}
.resume-location {
  color: var(--muted);
  font-size: 13px;
}
.resume-role {
  color: var(--fg);
}
.resume-dates {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.resume ul {
  list-style: none;
  margin: 10px 0 14px;
  padding: 0;
}
.resume ul li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 6px;
  color: var(--fg);
}
.resume ul li::before {
  content: '-';
  position: absolute;
  left: 0;
  color: var(--muted);
}

.resume-edu-line {
  color: var(--muted);
  margin: 6px 0 0;
}

@media (max-width: 600px) {
  .resume-job-head,
  .resume-role-line {
    flex-direction: column;
    gap: 2px;
  }
  .resume-dates,
  .resume-location { font-size: 12px; }
}

/* ─── section archive page (future) ────────────────────────────────────── */
.archive {
  padding: clamp(60px, 10vh, 120px) 0 80px;
}
.archive h1 {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(32px, 4vw, 56px);
  letter-spacing: -0.03em;
  margin: 0 0 12px;
}

/* ─── responsive ───────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding: 80px 0 56px; }
  .hero-visual { max-width: 280px; margin: 0; }
  .section-head { grid-template-columns: 1fr; gap: 8px; }
  .post-row { grid-template-columns: 1fr auto; }
  .post-row .date {
    grid-column: 1 / -1;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
}
