/* ============================================================
   Panya Ou — Portfolio Redesign
   A premium, restrained dark theme. Type, space, hierarchy.
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* color */
  --bg: #0a0a0a;
  --bg-elev: #111111;
  --bg-elev-2: #161616;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #f3f3f1;
  --text-muted: rgba(243, 243, 241, 0.62);
  --text-faint: rgba(243, 243, 241, 0.38);
  --accent: #c4f060;            /* lime — used sparingly */
  --accent-soft: rgba(196, 240, 96, 0.16);
  --warm: #f3a16b;              /* secondary editorial warm */

  /* type */
  --font-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  --font-serif: "Instrument Serif", "Iowan Old Style", "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* layout */
  --max: 1240px;
  --max-prose: 64ch;
  --pad-x: clamp(20px, 4vw, 48px);

  /* radii */
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;

  /* motion */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  /* Prevent horizontal scroll. `clip` is preferred over `hidden` because it
     doesn't create a scroll context — that's what breaks position: sticky on
     iOS Safari (nav appears to float with a gap above it). The `hidden`
     declaration is a fallback for Safari < 16 / older browsers; modern
     engines apply the `clip` rule second and win the cascade. */
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.55;
  font-weight: 400;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

img, video { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--accent); color: #0a0a0a; }

/* subtle grain overlay for warmth (very faint) */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 200;
  opacity: 0.025;
  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.5 0'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--text);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 1.4rem + 4.2vw, 5.4rem); letter-spacing: -0.035em; font-weight: 400; }
h2 { font-size: clamp(1.75rem, 1.2rem + 1.8vw, 2.75rem); letter-spacing: -0.03em; }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.45rem); letter-spacing: -0.02em; }
h4 { font-size: 1rem; letter-spacing: -0.01em; }

p { margin: 0; text-wrap: pretty; }
.serif { font-family: var(--font-serif); font-weight: 400; font-style: italic; letter-spacing: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.eyebrow.no-dot::before { display: none; }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); }

/* ---------- Layout ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

section { padding-block: clamp(64px, 9vw, 140px); }
section.compact { padding-block: clamp(40px, 5vw, 72px); }

/* ---------- Navigation ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
  /* Respect iOS notch / dynamic island without leaving a gap on devices
     that don't expose safe-area-inset-top. */
  padding-top: env(safe-area-inset-top, 0);
}
.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  height: 64px;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}
.nav__brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  letter-spacing: -0.01em;
  font-size: 15px;
}
.nav__brand img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
}
.nav__links {
  display: flex;
  gap: 4px;
  list-style: none;
  padding: 0; margin: 0;
}
.nav__links a {
  display: inline-block;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-muted);
  border-radius: 6px;
  transition: color .2s var(--ease), background .2s var(--ease);
}
.nav__links a:hover { color: var(--text); }
.nav__links a.active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.nav__cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--text);
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.nav__cta:hover { border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.04); }
.nav__cta svg { width: 13px; height: 13px; }

.nav__toggle {
  display: none;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
}
.nav__toggle:hover { background: rgba(255,255,255,0.06); }
.nav__toggle svg { width: 20px; height: 20px; }

/* Mobile menu */
.nav__mobile {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.96);
  backdrop-filter: blur(10px);
  z-index: 100;
  display: none;
  flex-direction: column;
  padding: 96px var(--pad-x) 48px;
}
.nav__mobile.open { display: flex; }
.nav__mobile ul {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 4px;
}
.nav__mobile a {
  display: block;
  padding: 14px 0;
  font-size: 22px;
  letter-spacing: -0.02em;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}
.nav__mobile a:hover { color: var(--accent); }
.nav__mobile-close {
  position: absolute;
  top: 18px; right: var(--pad-x);
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: inline-flex; }
}
@media (max-width: 640px) {
  .nav__inner { height: 56px; }
  .nav__brand { font-size: 14px; }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: 999px;
  border: 1px solid transparent;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
  line-height: 1;
}
.btn svg { width: 14px; height: 14px; }
.btn--primary {
  background: var(--text);
  color: #0a0a0a;
}
.btn--primary:hover { background: #fff; transform: translateY(-1px); }
.btn--secondary {
  border-color: var(--line-strong);
  color: var(--text);
}
.btn--secondary:hover { border-color: rgba(255,255,255,0.32); background: rgba(255,255,255,0.04); }
.btn--ghost {
  color: var(--text-muted);
  padding-inline: 4px;
}
.btn--ghost:hover { color: var(--text); }
.btn--ghost .arrow { transition: transform .2s var(--ease); }
.btn--ghost:hover .arrow { transform: translateX(3px); }

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* ---------- Hero (Home) ---------- */
.hero {
  position: relative;
  padding-block: clamp(28px, 4vw, 56px) clamp(60px, 8vw, 100px);
}
.hero__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.hero__copy { min-width: 0; }
.hero__media {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #1a1a1a;
}
.hero__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  /* slight, premium tonal treatment */
  filter: contrast(1.05) saturate(0.92) brightness(0.95);
}
.hero__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 60%, rgba(10,10,10,0.45) 100%);
  pointer-events: none;
}
.hero__media-tag {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
}
.hero__media-tag .l { display: inline-flex; align-items: center; gap: 6px; }
.hero__media-tag .l::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

@media (max-width: 860px) {
  .hero__layout { grid-template-columns: 1fr; }
  .hero__media { max-width: 380px; aspect-ratio: 4/3; margin-top: 32px; }
}

.hero__eyebrow { margin-bottom: 28px; }
.hero__title {
  max-width: 18ch;
  margin-bottom: 28px;
}
.hero__title .serif { color: var(--text); }
.hero__sub {
  font-size: clamp(1.05rem, 0.95rem + 0.6vw, 1.3rem);
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 56ch;
  margin-bottom: 40px;
}
.hero__cta { margin-bottom: 0; }

.hero__meta {
  margin-top: 80px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
}
.hero__meta-item .label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
  display: block;
  margin-bottom: 8px;
}
.hero__meta-item .value {
  font-size: 14px;
  color: var(--text);
  font-weight: 400;
}
.hero__meta-item .value .dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 6px;
  vertical-align: middle;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 var(--accent-soft); }
  50%     { box-shadow: 0 0 0 6px transparent; }
}

@media (max-width: 720px) {
  .hero__meta { grid-template-columns: 1fr 1fr; gap: 24px; }
}

/* ---------- Section headers ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 56px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}
.section-head__title {
  max-width: 26ch;
}
.section-head__lead {
  max-width: 42ch;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
@media (max-width: 720px) {
  .section-head { flex-direction: column; align-items: flex-start; gap: 16px; }
}

/* ---------- Selected Work (editorial project cards) ---------- */
.work-list {
  display: flex;
  flex-direction: column;
}
.work-row {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) 200px 36px;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  border-top: 1px solid var(--line);
  transition: padding .2s var(--ease);
}
.work-row:last-child { border-bottom: 1px solid var(--line); }
.work-row__num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.02em;
  align-self: start;
  padding-top: 6px;
}
.work-row__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.work-row__title {
  font-size: clamp(1.2rem, 1rem + 0.7vw, 1.7rem);
  letter-spacing: -0.02em;
  font-weight: 400;
  line-height: 1.15;
  background-image: linear-gradient(var(--accent), var(--accent));
  background-size: 0 1px;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .35s var(--ease);
  display: inline;
}
.work-row:hover .work-row__title {
  background-size: 100% 1px;
}
.work-row__desc {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.5;
  max-width: 60ch;
}
.work-row__tags {
  display: flex; gap: 6px; flex-wrap: wrap;
  justify-content: flex-end;
  align-self: center;
}
.work-row__arrow {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all .2s var(--ease);
  align-self: center;
}
.work-row:hover .work-row__arrow {
  border-color: var(--text);
  color: var(--text);
  transform: rotate(-45deg);
}
.work-row__arrow svg { width: 14px; height: 14px; }

/* Tablet: drop the dedicated tags column, keep the num column. */
@media (max-width: 860px) {
  .work-row {
    grid-template-columns: 56px minmax(0, 1fr) 36px;
    gap: 8px 16px;
    padding: 28px 0;
    align-items: start;
  }
  .work-row__num { padding-top: 4px; }
  .work-row__body { grid-column: 2; }
  .work-row__tags {
    grid-column: 2;
    justify-content: flex-start;
    margin-top: 10px;
  }
  .work-row__arrow { align-self: start; }
}

/* Phone: switch off grid entirely. Block flow with the arrow absolutely
   positioned in the top-right. Card reserves 44px of right padding so the
   title can never collide with the arrow, no matter how long it wraps. */
@media (max-width: 600px) {
  .work-row {
    position: relative;
    display: block;
    padding: 24px 44px 24px 0;
  }
  .work-row__num {
    display: block;
    padding-top: 0;
    margin-bottom: 10px;
    font-size: 11px;
  }
  .work-row__body {
    display: flex;
    flex-direction: column;
    gap: 6px;
  }
  .work-row__title {
    font-size: 1.15rem;
    line-height: 1.25;
  }
  .work-row__tags {
    margin-top: 14px;
    justify-content: flex-start;
    gap: 6px;
  }
  .work-row__arrow {
    position: absolute;
    top: 24px;
    right: 0;
    width: 32px;
    height: 32px;
    align-self: auto;
  }
  .work-row__arrow svg { width: 12px; height: 12px; }
}

/* ---------- Tags ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Now / Status panel ---------- */
.now-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.now-grid > * {
  padding: 36px 40px;
}
.now-grid > *:first-child {
  border-right: 1px solid var(--line);
}
.now-grid h3 {
  font-size: 14px;
  font-family: var(--font-mono);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: 18px;
}
.now-grid p { color: var(--text); font-size: 16.5px; line-height: 1.6; }
.now-grid p + p { margin-top: 14px; }
@media (max-width: 720px) {
  .now-grid { grid-template-columns: 1fr; }
  .now-grid > * { padding: 28px var(--pad-x); }
  .now-grid > *:first-child { border-right: 0; border-bottom: 1px solid var(--line); }
}

/* ---------- Footer ---------- */
.footer {
  margin-top: 0;
  padding-block: 64px 40px;
}
.footer__inner {
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  align-items: flex-start;
}
.footer__brand h2 {
  font-size: clamp(2rem, 1.4rem + 2vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.03em;
  line-height: 1.05;
  margin-bottom: 8px;
  max-width: 16ch;
}
.footer__brand h2 .serif { color: var(--text); }
.footer__brand p {
  color: var(--text-muted);
  font-size: 15px;
  max-width: 36ch;
}
.footer__col h4 {
  font-family: var(--font-mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  font-weight: 400;
  margin-bottom: 16px;
}
.footer__col ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.footer__col a {
  color: var(--text-muted);
  font-size: 14.5px;
  transition: color .2s var(--ease);
  display: inline-flex; align-items: center; gap: 8px;
}
.footer__col a:hover { color: var(--text); }
.footer__col a svg { width: 12px; height: 12px; opacity: 0.5; }

.footer__legal {
  margin-top: 56px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-faint);
}
.footer__legal a { color: var(--text-faint); }
.footer__legal a:hover { color: var(--text-muted); }

@media (max-width: 720px) {
  .footer { padding-block: 44px 28px; }
  .footer__inner {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "brand brand"
      "site  elsewhere";
    gap: 28px 24px;
  }
  .footer__brand { grid-area: brand; }
  .footer__col:nth-of-type(2) { grid-area: site; }
  .footer__col:nth-of-type(3) { grid-area: elsewhere; }
  .footer__brand h2 {
    font-size: 1.75rem;
    max-width: none;
  }
  .footer__brand p { font-size: 14px; }
  .footer__col h4 { margin-bottom: 12px; }
  .footer__col ul { gap: 8px; }
  .footer__col a { font-size: 14px; }
  .footer__legal {
    flex-direction: column;
    gap: 4px;
    margin-top: 32px;
    padding-top: 20px;
    font-size: 12px;
  }
}

/* ---------- Page header (interior pages) ---------- */
.page-header {
  padding-block: clamp(28px, 4vw, 56px) clamp(36px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
}
.page-header__eyebrow { margin-bottom: 24px; }
.page-header h1 {
  font-size: clamp(2.4rem, 1.4rem + 3.4vw, 4.4rem);
  max-width: 18ch;
  margin-bottom: 24px;
}
.page-header__lead {
  font-size: clamp(1.05rem, 0.95rem + 0.4vw, 1.2rem);
  color: var(--text-muted);
  max-width: 56ch;
  line-height: 1.55;
}

/* Split variant: text on left, image on right, mirroring the home hero. */
.page-header--split .page-header__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.page-header--split .page-header__copy { min-width: 0; }
.page-header--split .page-header__media {
  position: relative;
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #161616;
  margin: 0;
}
.page-header--split .page-header__media img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.92) brightness(0.95);
}
.page-header--split .page-header__media::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 60%, rgba(10,10,10,0.45) 100%);
  pointer-events: none;
}
.page-header--split .page-header__media-tag {
  position: absolute;
  bottom: 16px; left: 16px; right: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  z-index: 1;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  margin: 0;
}
.page-header--split .page-header__media-tag .l { display: inline-flex; align-items: center; gap: 6px; }
.page-header--split .page-header__media-tag .l::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

@media (max-width: 860px) {
  .page-header--split .page-header__layout { grid-template-columns: 1fr; }
  .page-header--split .page-header__media { max-width: 380px; aspect-ratio: 4/3; margin-top: 28px; }
}

/* ---------- Prose blocks ---------- */
.prose {
  max-width: var(--max-prose);
  font-size: 17px;
  line-height: 1.7;
  color: rgba(243,243,241,0.82);
}
.prose p + p { margin-top: 1.1em; }
.prose strong, .prose b { color: var(--text); font-weight: 500; }

/* ---------- Skills list (about) ---------- */
.skill-table {
  border-top: 1px solid var(--line);
}
.skill-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 24px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
  align-items: baseline;
}
.skill-row dt {
  font-family: var(--font-mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-faint);
}
.skill-row dd {
  margin: 0;
  font-size: 16px;
  color: var(--text);
  line-height: 1.55;
}
@media (max-width: 640px) {
  .skill-row { grid-template-columns: 1fr; gap: 6px; }
}

/* ---------- Experience timeline ---------- */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
}
.timeline__item {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 48px;
  padding: 40px 0;
  border-top: 1px solid var(--line);
}
.timeline__item:last-child { border-bottom: 1px solid var(--line); }
.timeline__side {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline__date {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}
.timeline__loc {
  font-size: 13px;
  color: var(--text-faint);
}
.timeline__main h3 {
  font-size: clamp(1.2rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 500;
  margin-bottom: 6px;
  letter-spacing: -0.02em;
}
.timeline__company {
  font-size: 15px;
  color: var(--text-muted);
  margin-bottom: 18px;
}
.timeline__bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 18px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.timeline__bullets li {
  position: relative;
  padding-left: 18px;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.55;
}
.timeline__bullets li::before {
  content: "";
  position: absolute;
  left: 0; top: 11px;
  width: 6px; height: 1px;
  background: var(--text-faint);
}
.timeline__tags {
  display: flex; gap: 6px; flex-wrap: wrap;
}
@media (max-width: 720px) {
  .timeline__item { grid-template-columns: 1fr; gap: 14px; padding: 32px 0; }
}

/* ---------- Interests grid ---------- */
.interest-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--line);
}
.interest-item {
  padding: 36px 36px 36px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 20px;
  align-items: start;
}
.interest-item:nth-child(odd) { border-right: 1px solid var(--line); padding-right: 36px; }
.interest-item:nth-child(even) { padding-left: 36px; }
.interest-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.04em;
  padding-top: 4px;
}
.interest-item h3 {
  font-size: 1.15rem;
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.interest-item p {
  color: var(--text-muted);
  font-size: 14.5px;
  line-height: 1.6;
  max-width: 52ch;
}
@media (max-width: 720px) {
  .interest-list { grid-template-columns: 1fr; }
  .interest-item, .interest-item:nth-child(odd), .interest-item:nth-child(even) {
    padding: 28px 0;
    border-right: 0;
  }
}

/* ---------- Cert / Learning cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}
.card-grid > * {
  background: var(--bg);
  padding: 28px;
}
.card-item h3 {
  font-size: 1.05rem;
  font-weight: 500;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}
.card-item p {
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.55;
  margin-bottom: 16px;
}
.card-item__meta {
  display: flex; gap: 12px; flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--text-faint);
  text-transform: uppercase;
}
.card-item__meta .status-dot {
  display: inline-flex; align-items: center; gap: 6px;
}
.card-item__meta .status-dot::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--warm);
}
.card-item__meta .status-dot--done::before { background: var(--accent); }

/* ---------- Filter pills (projects) ---------- */
.filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}
.filter-pill {
  padding: 7px 14px;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text-muted);
  transition: all .2s var(--ease);
}
.filter-pill:hover { color: var(--text); border-color: var(--line-strong); }
.filter-pill.active {
  background: var(--text);
  color: #0a0a0a;
  border-color: var(--text);
}

/* ---------- CTA strip ---------- */
.cta-strip {
  padding-block: clamp(80px, 10vw, 140px);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.cta-strip h2 {
  font-size: clamp(2rem, 1.4rem + 3vw, 4rem);
  max-width: 20ch;
  margin-bottom: 24px;
  font-weight: 400;
}
.cta-strip h2 .serif { color: var(--text); }
.cta-strip p {
  color: var(--text-muted);
  max-width: 48ch;
  font-size: 1.05rem;
  margin-bottom: 32px;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.reveal.in {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- Media treatments ---------- */

/* Portrait used on About page intro */
.portrait {
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #161616;
}
.portrait img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.93);
  display: block;
}
.about-split {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}
.about-split .portrait { aspect-ratio: 4/5; }
@media (max-width: 860px) {
  .about-split { grid-template-columns: 1fr; }
  .about-split .portrait { max-width: 360px; aspect-ratio: 4/5; }
}

/* Project thumbnail strip — small, restrained, behind a hairline */
.proj-thumb {
  width: 100%;
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #161616;
  margin-top: 8px;
  position: relative;
}
.proj-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.9) brightness(0.92);
  transition: transform .6s var(--ease), filter .4s var(--ease);
}
.proj-card:hover .proj-thumb img {
  transform: scale(1.02);
  filter: contrast(1.04) saturate(0.95) brightness(0.95);
}
.proj-thumb::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 70%, rgba(10,10,10,0.5) 100%);
  pointer-events: none;
}
.proj-thumb__label {
  position: absolute;
  bottom: 12px; left: 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.78);
  z-index: 1;
}

/* Interest image accents — small thumbnails inline with text */
.interest-item {
  position: relative;
}
.interest-thumb {
  width: 72px;
  height: 72px;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #161616;
}
.interest-thumb img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.04) saturate(0.93);
}
/* Photo strip — a tasteful horizontal montage */
.photo-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}
.photo-strip__item {
  aspect-ratio: 4/5;
  border-radius: 4px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #161616;
  position: relative;
}
.photo-strip__item img {
  width: 100%; height: 100%;
  object-fit: cover;
  filter: contrast(1.05) saturate(0.92) brightness(0.9);
  transition: filter .4s var(--ease), transform .6s var(--ease);
}
.photo-strip__item:hover img {
  filter: contrast(1.05) saturate(1) brightness(1);
  transform: scale(1.03);
}
.photo-strip__item .cap {
  position: absolute;
  left: 12px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  z-index: 1;
}
.photo-strip__item::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(10,10,10,0) 60%, rgba(10,10,10,0.55) 100%);
  pointer-events: none;
}
@media (max-width: 720px) {
  .photo-strip { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Pulse on dot ---------- */
.live-dot {
  display: inline-block;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--accent);
  position: relative;
  margin-right: 8px;
  vertical-align: middle;
}
.live-dot::after {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.5;
  animation: ring 2s ease-out infinite;
}
@keyframes ring {
  0% { transform: scale(0.6); opacity: 0.6; }
  100% { transform: scale(2.4); opacity: 0; }
}

/* ---------- Zoomable image cursor hint ---------- */
.hero__media img,
.portrait img,
.proj-thumb img,
.photo-strip__item img,
.page-header__media img,
.interest-thumb img {
  cursor: zoom-in;
}

/* ---------- Lightbox / image viewer ---------- */
.lb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  background: rgba(6, 6, 6, 0.97);
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.lb.open { display: block; opacity: 1; }
.lb__stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: zoom-in;
}
.lb__stage.zoomed { cursor: grab; }
.lb__stage.zoomed.dragging { cursor: grabbing; }
.lb__img {
  max-width: 92vw;
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  transform-origin: center center;
  transform: scale(1) translate(0, 0);
  transition: transform .28s var(--ease);
  border-radius: 4px;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none; /* clicks bubble to stage */
  filter: none !important; /* full quality in viewer */
}
.lb.dragging .lb__img,
.lb__stage.dragging .lb__img { transition: none; }

.lb__chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  z-index: 10;
  pointer-events: none;
}
.lb__chrome > * { pointer-events: auto; }
.lb__caption {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  max-width: 60ch;
}
.lb__caption .l { display: inline-flex; align-items: center; gap: 8px; }
.lb__caption .l::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.lb__btns { display: flex; gap: 6px; }
.lb__btn {
  width: 44px; height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
  cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.lb__btn:hover { background: rgba(255, 255, 255, 0.18); border-color: rgba(255, 255, 255, 0.32); transform: scale(1.05); }
.lb__btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lb__btn svg { width: 18px; height: 18px; }

.lb__zoombar {
  position: absolute;
  bottom: 24px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: rgba(20, 20, 20, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  z-index: 10;
}
.lb__zoombar span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255, 255, 255, 0.7);
  min-width: 44px;
  text-align: center;
}
.lb__zoombar button {
  width: 28px; height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--text);
  transition: background .15s var(--ease);
}
.lb__zoombar button:hover { background: rgba(255, 255, 255, 0.1); }
.lb__zoombar button svg { width: 14px; height: 14px; }

@media (prefers-reduced-motion: reduce) {
  .lb { transition: none; }
  .lb__img { transition: none; }
}
