/* style.css — portfolio v0.1
   Warm coffee-dark background, sage-olive green accents, Fraunces slab + IBM Plex Sans/Mono.
   All colors in OKLCH for perceptual consistency. */

:root {
  --bg:        oklch(18% 0.014 60);
  --bg-2:      oklch(22% 0.016 60);
  --bg-card:   oklch(20% 0.015 60);
  --line:      oklch(34% 0.014 60);
  --line-soft: oklch(27% 0.014 60);

  --ink:       oklch(92% 0.015 80);
  --ink-mute:  oklch(72% 0.018 75);
  --ink-faint: oklch(54% 0.018 70);

  --green:      oklch(75% 0.09 125);
  --green-ink:  oklch(82% 0.095 125);
  --green-soft: oklch(38% 0.054 125);

  --serif: "Fraunces", Georgia, serif;
  --sans:  "IBM Plex Sans", ui-sans-serif, system-ui, sans-serif;
  --mono:  "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --pad-x: clamp(20px, 4vw, 56px);
  --col:   1100px;
  --rad:   10px;

  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01", "cv05";
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 80% 60% at 50% -10%, oklch(28% 0.03 60 / 0.55), transparent 60%),
    radial-gradient(ellipse 60% 40% at 110% 110%, oklch(30% 0.05 130 / 0.18), transparent 70%);
  background-attachment: fixed;
}

/* film grain — pure SVG noise, fixed so it doesn't scroll */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  opacity: 0.05;
  z-index: 0;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  0 0 0 0.6 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

::selection { background: var(--green-soft); color: var(--ink); }

a { color: inherit; text-decoration: none; }

/* ── shell ─────────────────────────────────────────────── */
.shell {
  position: relative;
  z-index: 1;
  max-width: var(--col);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ── nav ───────────────────────────────────────────────── */
.nav {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 0 20px;
}
.nav-id {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  color: var(--ink-mute);
}
.nav-id .dot {
  width: 9px; height: 9px;
  background: var(--green);
  border-radius: 2px;
  box-shadow: 0 0 0 3px oklch(75% 0.09 125 / 0.18);
  flex-shrink: 0;
}
.nav-id b { color: var(--ink); font-weight: 500; }
.nav-links {
  display: flex; gap: 22px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--ink-mute);
}
.nav-links a {
  position: relative;
  padding: 4px 2px;
  transition: color 0.15s;
}
.nav-links a::before {
  content: "·";
  color: var(--ink-faint);
  margin-right: 6px;
}
.nav-links a:first-child::before { display: none; }
.nav-links a:hover { color: var(--green-ink); }

/* ── hero ──────────────────────────────────────────────── */
.hero {
  padding: clamp(40px, 9vw, 110px) 0 clamp(32px, 6vw, 60px);
  position: relative;
}
.hero-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
}
.hero-eyebrow::after {
  content: "";
  flex: 0 0 60px;
  height: 1px;
  background: var(--line);
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(56px, 11vw, 140px);
  line-height: 0.95;
  letter-spacing: -0.035em;
  margin: 0 0 22px;
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 144;
  max-width: 14ch;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  font-weight: 350;
  color: var(--green-ink);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
}
.hero-lede {
  font-family: var(--sans);
  font-weight: 400;
  font-size: clamp(14px, 1.1vw, 16px);
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-mute);
  max-width: 52ch;
  text-wrap: pretty;
}

/* ── now strip ─────────────────────────────────────────── */
.now {
  margin: clamp(20px, 4vw, 40px) 0 clamp(40px, 6vw, 70px);
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 18px 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
  font-family: var(--mono);
  font-size: 12px;
}
.now-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.now-cell .lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.now-cell .val {
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.now-cell .val .accent { color: var(--green-ink); }
.now-cell .val .blink {
  display: inline-block;
  width: 7px; height: 13px;
  vertical-align: -2px;
  background: var(--green);
  margin-left: 2px;
  animation: blink 1s steps(2, jump-none) infinite;
}
@keyframes blink { 50% { opacity: 0.15; } }

@media (max-width: 760px) {
  .now { grid-template-columns: repeat(2, 1fr); }
}

/* ── sections ──────────────────────────────────────────── */
.section { padding: clamp(40px, 6vw, 72px) 0; }
.section + .section { border-top: 1px solid var(--line-soft); }

.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 36px;
}
.sec-head .left {
  display: flex; align-items: baseline; gap: 18px;
  flex-wrap: wrap;
}
.sec-num {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green-ink);
  letter-spacing: 0.06em;
}
.sec-title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(26px, 3.4vw, 36px);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0;
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 60;
}
.sec-sub {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

/* ── project cards (list-of-cards layout) ──────────────── */
.projects-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.projects-grid .card {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 0;
}
.projects-grid .card-thumb {
  aspect-ratio: auto;
  height: 100%;
  min-height: 160px;
  border-bottom: 0;
  border-right: 1px solid var(--line-soft);
}
.projects-grid .card-body {
  padding: 22px 26px 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  display: block;
  background: var(--bg-card);
  border: 1px solid var(--line-soft);
  border-radius: var(--rad);
  overflow: hidden;
  transition: transform 0.25s cubic-bezier(.2,.7,.3,1), border-color 0.2s;
  position: relative;
}
.card:hover {
  transform: translateY(-3px);
  border-color: var(--green-soft);
}
.card:hover h3 { color: var(--green-ink); }

.card-thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  overflow: hidden;
  background: var(--bg-2);
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
}
.card-thumb-stripes {
  position: absolute; inset: 0;
  background-image: repeating-linear-gradient(45deg,
    oklch(26% 0.018 60) 0 10px,
    oklch(22% 0.014 60) 10px 20px);
  opacity: 0.7;
}
.card-thumb-label {
  position: absolute;
  left: 14px; bottom: 12px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
  text-transform: uppercase;
}
.card-thumb-marker {
  position: absolute; top: 14px; right: 14px;
  font-family: var(--mono); font-size: 10px;
  color: var(--ink-mute);
  display: flex; align-items: center; gap: 6px;
}
.card-thumb-marker::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--green);
}
.card-body { padding: 18px 20px 20px; }
.card-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  margin-bottom: 8px;
  display: flex; gap: 10px; align-items: center;
}
.card-meta .sep { opacity: 0.4; }
.card h3 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 22px;
  letter-spacing: -0.01em;
  margin: 0 0 6px;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 36;
  transition: color 0.2s;
}
.card h3 .arrow {
  display: inline-block;
  margin-left: 6px;
  transition: transform 0.25s;
  color: var(--ink-faint);
}
.card:hover h3 .arrow {
  transform: translate(4px, -4px);
  color: var(--green-ink);
}
.card-blurb {
  color: var(--ink-mute);
  font-size: 14.5px;
  line-height: 1.55;
  margin: 0;
  text-wrap: pretty;
}

@media (max-width: 760px) {
  .projects-grid .card { grid-template-columns: 1fr; }
  .projects-grid .card-thumb {
    aspect-ratio: 16/9; min-height: 0;
    border-right: 0; border-bottom: 1px solid var(--line-soft);
  }
}

/* ── writing list ──────────────────────────────────────── */
.writing-list {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--line-soft);
}
.writing-row {
  display: grid;
  grid-template-columns: 90px 1fr auto;
  gap: 24px;
  padding: 18px 4px;
  border-bottom: 1px solid var(--line-soft);
  align-items: baseline;
  font-family: var(--sans);
  transition: padding-left 0.2s;
}
.writing-row:hover { padding-left: 12px; }
.writing-row .date {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
}
.writing-row .ttl {
  font-family: var(--serif);
  font-size: 18px;
  font-variation-settings: "SOFT" 30, "WONK" 1, "opsz" 24;
  transition: color 0.2s;
}
.writing-row:hover .ttl { color: var(--green-ink); }
.writing-row .tag {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-faint);
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}

/* ── stack / shelf ─────────────────────────────────────── */
.stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  font-family: var(--mono);
  font-size: 12px;
}
.stack-cell {
  border: 1px solid var(--line-soft);
  border-radius: var(--rad);
  padding: 14px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-card);
  transition: border-color 0.2s;
}
.stack-cell:hover { border-color: var(--green-soft); }
.stack-cell .lbl {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.14em;
  color: var(--ink-faint);
}
.stack-cell ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
  color: var(--ink);
}
.stack-cell li::before { content: "› "; color: var(--green-ink); }

@media (max-width: 760px) { .stack { grid-template-columns: repeat(2, 1fr); } }

/* ── about ─────────────────────────────────────────────── */
.about {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 48px;
}
.prose {
  max-width: 60ch;
  font-family: var(--serif);
  font-size: 18px;
  line-height: 1.65;
  font-weight: 400;
  font-variation-settings: "opsz" 18;
  color: var(--ink);
}
.prose p { margin: 0 0 1em; text-wrap: pretty; }
.prose p + p { text-indent: 1.4em; }
.prose .first { font-variant-caps: all-small-caps; letter-spacing: 0.06em; }

.about-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  display: flex; flex-direction: column; gap: 14px;
}
.about-meta dt {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--ink-faint);
  margin-bottom: 2px;
}
.about-meta dd { margin: 0; }

@media (max-width: 760px) {
  .about { grid-template-columns: 1fr; gap: 28px; }
}

/* ── footer ────────────────────────────────────────────── */
.footer {
  margin-top: 40px;
  border-top: 1px solid var(--line-soft);
  padding: clamp(40px, 6vw, 70px) 0 clamp(40px, 5vw, 60px);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: end;
}
.foot-q {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(28px, 3.4vw, 40px);
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin: 0 0 18px;
  font-variation-settings: "SOFT" 50, "WONK" 1, "opsz" 60;
  text-wrap: balance;
}
.foot-q em {
  font-style: italic;
  color: var(--green-ink);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 60;
}
.foot-mail {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 4px;
  transition: color 0.15s, border-color 0.15s;
}
.foot-mail:hover { color: var(--green-ink); border-color: var(--green-ink); }
.foot-side {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-mute);
  display: flex; flex-direction: column; gap: 18px;
}
.foot-side .row { display: flex; gap: 18px; flex-wrap: wrap; }
.foot-side .row a:hover { color: var(--green-ink); }
.foot-side .meta {
  color: var(--ink-faint);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  display: flex; gap: 18px; flex-wrap: wrap;
}
.foot-colophon {
  margin-top: 50px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--ink-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.foot-colophon .secret { cursor: default; }

@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; gap: 28px; align-items: start; }
}

/* ── easter egg overlay ────────────────────────────────── */
.egg {
  display: none;
  position: fixed; inset: 0;
  z-index: 100;
  align-items: center;
  justify-content: center;
  background: oklch(18% 0.014 60 / 0.94);
  backdrop-filter: blur(8px);
  font-family: var(--mono);
  animation: eggIn 0.3s;
}
.egg.open { display: flex; }
@keyframes eggIn { from { opacity: 0; } }

.egg-card {
  border: 1px solid var(--green-soft);
  background: var(--bg-card);
  border-radius: var(--rad);
  padding: 32px 36px;
  max-width: 480px;
  text-align: center;
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-mute);
}
.egg-card .ascii {
  white-space: pre;
  color: var(--green-ink);
  font-size: 11px;
  line-height: 1.2;
  margin-bottom: 14px;
}
.egg-card .hl { color: var(--ink); }
.egg-card .hint {
  margin-top: 16px;
  font-size: 10.5px;
  color: var(--ink-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.egg-x {
  margin-top: 18px;
  display: inline-block;
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
  border-bottom: 1px dashed var(--line);
  padding-bottom: 2px;
}

/* ── writing post ──────────────────────────────────────── */
.post-head {
  padding: clamp(40px, 7vw, 80px) 0 clamp(24px, 4vw, 40px);
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: clamp(32px, 5vw, 56px);
}
.post-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-faint);
  margin-bottom: 20px;
}
.post-eyebrow .tag-pill {
  border: 1px solid var(--line);
  padding: 2px 8px;
  border-radius: 999px;
  letter-spacing: 0.05em;
}
.post-title {
  font-family: var(--serif);
  font-weight: 350;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.03em;
  margin: 0;
  font-variation-settings: "SOFT" 60, "WONK" 1, "opsz" 72;
  max-width: 22ch;
  text-wrap: balance;
}
.post-body {
  padding-bottom: clamp(48px, 8vw, 96px);
}
.post-body h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(20px, 2.4vw, 26px);
  letter-spacing: -0.02em;
  margin: 2em 0 0.5em;
  font-variation-settings: "SOFT" 40, "WONK" 1, "opsz" 36;
}

/* ── reduced motion ────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .now-cell .val .blink { animation: none; opacity: 1; }
  .card { transition: border-color 0.2s; }
  .card:hover { transform: none; }
  .card h3 .arrow { transition: none; }
  .writing-row { transition: none; }
}
