/* =========================================================
   Portfolio — design system
   ========================================================= */

:root {
  --accent: #4f46e5;
  --radius: 16px;
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --serif: 'Instrument Serif', Georgia, serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  --wrap: 1120px;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: .5s;

  --bg: #fcfcfd;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #fafafb;
  --fg: #0b0b0f;
  --fg-2: #4b4b56;
  --fg-3: #82828f;
  --line: #e8e8ed;
  --line-2: #d9d9e0;
  --shadow-sm: 0 1px 2px rgba(12, 12, 20, .05), 0 1px 1px rgba(12, 12, 20, .03);
  --shadow: 0 4px 14px -4px rgba(12, 12, 20, .09), 0 2px 6px -2px rgba(12, 12, 20, .05);
  --shadow-lg: 0 24px 60px -20px rgba(12, 12, 20, .22), 0 8px 20px -12px rgba(12, 12, 20, .12);
  --ring: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
  --pad-sec: clamp(4.5rem, 10vw, 8rem);

  /* --- themeable shape ------------------------------------------------
     Every one of these is re-pointed by a block in themes.css. The values
     here are the "Editorial Light" defaults. */
  --border-w: 1px;
  --border-color: var(--line);
  --card-radius: var(--radius);
  --icon-radius: 10px;
  --input-radius: 11px;
  --btn-radius: 999px;
  --chip-radius: 999px;
  --card-shadow: none;
  --card-hover-shadow: var(--shadow);
  --card-hover-lift: -3px;

  /* --- themeable type ------------------------------------------------ */
  --heading-font: var(--font);
  --heading-weight: 600;
  --heading-transform: none;
  --heading-spacing: -.022em;
  --display-spacing: -.04em;
  --kicker-color: var(--accent);
  --kicker-transform: uppercase;
  --kicker-spacing: .1em;
  --btn-weight: 550;
  --btn-text-transform: none;

  /* --- themeable chrome ---------------------------------------------- */
  --nav-bg: color-mix(in srgb, var(--bg) 78%, transparent);
  --nav-blur: saturate(180%) blur(16px);
  --nav-height: 68px;
  --body-bg-image: none;
  --glow: color-mix(in srgb, var(--accent) 70%, transparent);
}

[data-density="compact"] { --pad-sec: clamp(3rem, 6vw, 5rem); --wrap: 1240px; }

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: clamp(15.5px, .55vw + 14.2px, 17px);
  line-height: 1.65;
  color: var(--fg);
  background: var(--bg);
  background-image: var(--body-bg-image);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'cv02', 'cv03', 'cv04', 'ss01';
  transition: background .4s var(--ease), color .4s var(--ease);
}

body[data-reduced-motion="1"] *,
body[data-reduced-motion="1"] *::before,
body[data-reduced-motion="1"] *::after {
  animation-duration: .001ms !important;
  transition-duration: .001ms !important;
  scroll-behavior: auto !important;
}

h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.12; font-family: var(--heading-font); letter-spacing: var(--heading-spacing); font-weight: var(--heading-weight); text-transform: var(--heading-transform); }
h1 { font-size: clamp(2.5rem, 6.2vw, 4.4rem); letter-spacing: var(--display-spacing); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); letter-spacing: calc(var(--heading-spacing) * .8); }
h3 { font-size: clamp(1.05rem, 1.4vw, 1.22rem); }
p  { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }
a  { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
::selection { background: color-mix(in srgb, var(--accent) 26%, transparent); }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(1.15rem, 4vw, 2.5rem); }
.i { flex: none; }
.skip { position: absolute; left: -9999px; top: 0; z-index: 999; background: var(--accent); color: #fff; padding: .7rem 1.1rem; border-radius: 0 0 10px 0; }
.skip:focus { left: 0; }

/* ---------------- Nav ---------------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--nav-bg);
  backdrop-filter: var(--nav-blur);
  -webkit-backdrop-filter: var(--nav-blur);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, background .3s, box-shadow .3s;
}
.nav.stuck { border-bottom-color: var(--line); box-shadow: var(--shadow-sm); }
.nav-in { display: flex; align-items: center; gap: clamp(.75rem, 2vw, 2rem); height: var(--nav-height); }

.brand { display: flex; align-items: center; gap: .55rem; font-weight: 600; letter-spacing: -.02em; margin-right: auto; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }

.nav-links { display: flex; gap: .1rem; overflow-x: auto; scrollbar-width: none; }
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  position: relative; padding: .45rem .7rem; border-radius: 999px; font-size: .895rem;
  color: var(--fg-2); white-space: nowrap; font-weight: 500;
  transition: color .2s, background .2s;
}
.nav-links a:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.nav-links a.active { color: var(--fg); background: color-mix(in srgb, var(--accent) 12%, transparent); }
.nav-links a.active::after { content: ''; position: absolute; left: .7rem; right: .7rem; bottom: -.15rem; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(1); }

.nav-cta { display: flex; align-items: center; gap: .4rem; }
.icon-btn {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--icon-radius);
  border: var(--border-w) solid var(--line); background: var(--surface); cursor: pointer;
  transition: border-color .2s, transform .2s, background .2s, box-shadow .2s;
}
.icon-btn:hover { border-color: var(--line-2); transform: translateY(-1px); }
[data-mode="light"] .when-dark, [data-mode="dark"] .when-light { display: none; }

.scroll-progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--accent); transition: width .12s linear; }

/* ---------------- Project detail popup ---------------- */
.card.openable { cursor: pointer; }
.card-more {
  display: inline-flex; align-items: center; gap: .3rem; margin-top: auto; padding-top: .5rem;
  font-size: .855rem; font-weight: 600; color: var(--accent);
}
.card.openable:hover .card-more { gap: .5rem; }
.card-more .i { transition: transform .2s var(--ease); }
.card.openable:hover .card-more .i { transform: translateX(3px); }

body.modal-open { overflow: hidden; }

.pmodal {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center;
  padding: clamp(.8rem, 3vw, 2.2rem); background: rgba(10, 10, 16, .62);
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  animation: pfade .18s var(--ease-out);
}
.pmodal[hidden] { display: none; }
@keyframes pfade { from { opacity: 0 } }

.pmodal-card {
  width: min(880px, 100%); max-height: min(90vh, 940px); display: flex; flex-direction: column;
  background: var(--surface); border: var(--border-w) solid var(--border-color);
  border-radius: var(--card-radius); box-shadow: var(--shadow-lg); overflow: hidden;
  animation: ppop .22s var(--ease-out);
}
@keyframes ppop { from { opacity: 0; transform: translateY(10px) scale(.985) } }

.pmodal-head {
  display: flex; align-items: flex-start; gap: 1rem; padding: 1.3rem 1.4rem 1rem;
  border-bottom: 1px solid var(--line);
}
.pmodal-head h3 { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.7rem); }
.pmodal-year { margin: 0 0 .25rem; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--fg-3); }
.pmodal-sub { margin: .3rem 0 0; color: var(--fg-2); font-size: .95rem; }
.pmodal-x {
  flex: none; margin-left: auto; width: 36px; height: 36px; display: grid; place-items: center;
  border: var(--border-w) solid var(--line); border-radius: var(--icon-radius);
  background: var(--surface); color: var(--fg-2); font-size: 1.4rem; line-height: 1; cursor: pointer;
  transition: background .18s, color .18s, border-color .18s;
}
.pmodal-x:hover { background: var(--bg-alt); color: var(--fg); border-color: var(--line-2); }

.pmodal-body { padding: 1.4rem; overflow-y: auto; }
.pmodal-body > :first-child { margin-top: 0; }
.pmodal-cover { margin: 0 0 1.2rem; }
.pmodal-cover img { width: 100%; border-radius: calc(var(--card-radius) * .7); }

/* images dropped into a richtext story */
.rt-img { margin: 1.3rem 0; }
.rt-img img {
  width: 100%; border-radius: calc(var(--card-radius) * .7);
  border: var(--border-w) solid var(--line);
}
.rt a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.rt strong { color: var(--fg); font-weight: 650; }

.pgal { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; margin-top: 1.4rem; }
.pgal-item { margin: 0; }
.pgal-item img {
  width: 100%; aspect-ratio: 16/10; object-fit: cover;
  border-radius: calc(var(--card-radius) * .7); border: var(--border-w) solid var(--line);
  cursor: zoom-in;
}
.pgal-item figcaption { margin-top: .45rem; font-size: .82rem; color: var(--fg-3); }

.pmodal-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem;
  padding: 1rem 1.4rem; border-top: 1px solid var(--line); background: var(--surface-2);
}
.pmodal-links { display: flex; flex-wrap: wrap; gap: .45rem; margin-left: auto; }

/* Without JavaScript the popups would be unreachable, so show them inline. */
.no-js .pmodal, html.no-js .pmodal { position: static; display: block; background: none; padding: 0; }
.no-js .pmodal-card { max-height: none; margin: 1rem 0; }

@media (max-width: 620px) {
  .pmodal-head, .pmodal-body, .pmodal-foot { padding-inline: 1rem; }
  .pgal { grid-template-columns: 1fr; }
}

/* ---------------- Theme picker ---------------- */
.theme-pick { position: relative; }
.theme-panel {
  position: absolute; top: calc(100% + .55rem); right: 0; z-index: 60;
  width: min(330px, calc(100vw - 2rem));
  background: var(--surface); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow-lg); padding: .7rem; overflow: hidden;
  animation: themepop .16s var(--ease-out);
}
.theme-panel[hidden] { display: none; }
@keyframes themepop { from { opacity: 0; transform: translateY(-6px) scale(.98) } }
.theme-panel-h { margin: .15rem .35rem .5rem; font-size: .68rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--fg-3); }
.theme-list { display: grid; gap: .12rem; max-height: min(60vh, 460px); overflow-y: auto; }
.theme-opt {
  display: flex; align-items: center; gap: .6rem; width: 100%; text-align: left;
  padding: .5rem .55rem; border: 0; border-radius: 10px; background: none;
  color: inherit; font: inherit; cursor: pointer; transition: background .15s;
}
.theme-opt:hover { background: color-mix(in srgb, var(--fg) 6%, transparent); }
.theme-opt.on { background: color-mix(in srgb, var(--accent) 13%, transparent); }
.theme-dots { display: flex; flex: none; }
.theme-dots i { width: 15px; height: 15px; border-radius: 50%; margin-left: -6px; border: 1.5px solid var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.18); }
.theme-dots i:first-child { margin-left: 0; }
.theme-opt-t { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; flex: 1; }
.theme-opt-t strong { font-size: .87rem; font-weight: 600; }
.theme-opt-t em { font-style: normal; font-size: .74rem; color: var(--fg-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.theme-check { flex: none; color: var(--accent); opacity: 0; transition: opacity .15s; }
.theme-opt.on .theme-check { opacity: 1; }
.theme-reset {
  display: block; width: 100%; margin-top: .45rem; padding: .5rem; border: 0; border-top: 1px solid var(--line);
  background: none; color: var(--fg-3); font: inherit; font-size: .8rem; cursor: pointer; border-radius: 0 0 10px 10px;
}
.theme-reset:hover { color: var(--accent); }
@media print { .theme-pick { display: none !important; } }

/* ---------------- Buttons ---------------- */
.btn {
  --btn-bg: transparent; --btn-fg: var(--fg);
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .6rem 1.05rem; border-radius: var(--btn-radius); border: var(--border-w) solid transparent;
  background: var(--btn-bg); color: var(--btn-fg);
  font-size: .915rem; font-weight: var(--btn-weight); letter-spacing: -.01em; cursor: pointer;
  text-transform: var(--btn-text-transform);
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, border-color .2s, opacity .2s;
}
.btn:hover { transform: translateY(-1.5px); }
.btn:active { transform: translateY(0); }
.btn-primary { --btn-bg: var(--accent); --btn-fg: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.14), 0 6px 18px -8px var(--glow); }
.btn-primary:hover { box-shadow: 0 4px 10px -2px color-mix(in srgb, var(--accent) 45%, transparent), 0 14px 34px -12px var(--glow); }
.btn-ghost { border-color: var(--line-2); background: var(--surface); }
.btn-ghost:hover { border-color: var(--fg-3); }
.btn-quiet { color: var(--fg-2); }
.btn-quiet:hover { color: var(--fg); background: color-mix(in srgb, var(--fg) 6%, transparent); }
.btn-lg { padding: .82rem 1.5rem; font-size: .96rem; }
.btn[disabled] { opacity: .55; pointer-events: none; }

/* ---------------- Hero ---------------- */
.hero { position: relative; padding: clamp(3.5rem, 9vw, 7rem) 0 clamp(3rem, 7vw, 5.5rem); }
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; margin: 0 0 1.1rem;
  padding: .35rem .8rem .35rem .6rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface);
  font-size: .82rem; font-weight: 500; color: var(--fg-2);
  box-shadow: var(--shadow-sm);
}
.pulse { width: 7px; height: 7px; border-radius: 50%; background: #22c55e; position: relative; }
.pulse::after { content: ''; position: absolute; inset: 0; border-radius: 50%; background: #22c55e; animation: pulse 2.2s var(--ease-out) infinite; }
@keyframes pulse { 0% { transform: scale(1); opacity: .8 } 70%,100% { transform: scale(3.2); opacity: 0 } }

.hero h1 { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.hero-name { font-size: .42em; font-weight: 500; letter-spacing: -.01em; color: var(--fg-3); order: -1; margin-bottom: .35rem; }
.hero-headline { font-family: var(--serif); font-weight: 400; font-style: italic; letter-spacing: -.02em; background: linear-gradient(120deg, var(--fg) 30%, var(--accent)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: clamp(1.02rem, 1.5vw, 1.16rem); color: var(--fg-2); max-width: 58ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.9rem; }
.hero-social { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: 1.6rem; }
.hero-social a { display: inline-block; padding: .3rem .6rem; border-radius: 8px; font-size: .855rem; font-weight: 500; color: var(--fg-2); border: 1px solid transparent; transition: all .2s; }
.hero-social a:hover { color: var(--fg); border-color: var(--line); background: var(--surface); }

.hero-art { position: relative; }
.portrait {
  position: relative; border-radius: calc(var(--card-radius) + 6px); overflow: hidden;
  aspect-ratio: 4 / 5; background: var(--bg-alt);
  box-shadow: var(--shadow-lg);
  animation: float 9s ease-in-out infinite;
}
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(200deg, transparent 55%, color-mix(in srgb, var(--accent) 22%, transparent));
  mix-blend-mode: soft-light;
}
@keyframes float { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

.scroll-hint { position: absolute; bottom: 1.2rem; left: 50%; transform: translateX(-50%); width: 22px; height: 34px; border: 1.5px solid var(--line-2); border-radius: 12px; }
.scroll-hint span { position: absolute; top: 6px; left: 50%; width: 3px; height: 6px; margin-left: -1.5px; border-radius: 2px; background: var(--fg-3); animation: hint 1.9s var(--ease) infinite; }
@keyframes hint { 0% { transform: translateY(0); opacity: 1 } 70% { transform: translateY(13px); opacity: 0 } 100% { transform: translateY(0); opacity: 0 } }

/* ---------------- Sections ---------------- */
.sec { padding: var(--pad-sec) 0; }
.sec.alt { background: var(--bg-alt); }
.sec-head { margin-bottom: clamp(2rem, 4vw, 3.2rem); max-width: 46ch; }
.kicker {
  margin: 0 0 .6rem; font-size: .78rem; font-weight: 600; letter-spacing: var(--kicker-spacing);
  text-transform: var(--kicker-transform); color: var(--kicker-color);
}
.sec-head h2 { margin: 0; }
.prose { color: var(--fg-2); max-width: 62ch; }
.prose h3, .prose h4 { color: var(--fg); margin: 1.6em 0 .5em; }
.prose > :first-child { margin-top: 0; }

/* ---------------- About ---------------- */
.about-in { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.about-photo { margin: 0; border-radius: calc(var(--card-radius) + 6px); overflow: hidden; box-shadow: var(--shadow-lg); position: sticky; top: 96px; }
.about-photo img { width: 100%; aspect-ratio: 3/4; object-fit: cover; }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1px; margin: 2.4rem 0 0; background: var(--line); border: var(--border-w) solid var(--border-color); border-radius: var(--card-radius); overflow: hidden; }
.facts > div { background: var(--surface); padding: 1.05rem 1.15rem; }
.facts dt { font-size: .78rem; text-transform: uppercase; letter-spacing: .07em; color: var(--fg-3); margin-bottom: .25rem; }
.facts dd { margin: 0; font-weight: 550; }

/* ---------------- Timeline ---------------- */
.timeline { position: relative; padding-left: 1.9rem; }
.timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 1.5px; background: linear-gradient(var(--line-2), var(--line)); }
.tl-item { position: relative; padding-bottom: 2.6rem; }
.tl-item:last-child { padding-bottom: 0; }
.tl-marker {
  position: absolute; left: -1.9rem; top: .45rem; width: 11px; height: 11px; border-radius: 50%;
  background: var(--bg); border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
  transition: transform .25s var(--ease);
}
.tl-item:hover .tl-marker { transform: scale(1.25); }
.tl-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1rem; }
.tl-top h3 { margin: 0; }
.tl-at { color: var(--fg-3); font-weight: 450; }
.tl-dates { margin-left: auto; display: flex; align-items: baseline; gap: .5rem; font-size: .85rem; color: var(--fg-3); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tl-dates em { font-style: normal; font-size: .78rem; padding: .1rem .45rem; border-radius: var(--chip-radius); background: var(--bg-alt); border: var(--border-w) solid var(--line); }
.sec:not(.alt) .tl-dates em { background: var(--surface); }
.tl-meta { display: flex; flex-wrap: wrap; gap: 1rem; margin: .35rem 0 .7rem; font-size: .865rem; color: var(--fg-3); }
.tl-meta a { display: inline-flex; align-items: center; gap: .3rem; }
.tl-meta a:hover { color: var(--accent); }
.tl-sum { color: var(--fg-2); }
.bullets { margin: .8rem 0 0; display: grid; gap: .42rem; }
.bullets li { position: relative; padding-left: 1.15rem; color: var(--fg-2); font-size: .95rem; }
.bullets li::before { content: ''; position: absolute; left: 0; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: color-mix(in srgb, var(--accent) 60%, var(--fg-3)); }

/* ---------------- Cards & grids ---------------- */
.grid { display: grid; gap: clamp(1rem, 2vw, 1.4rem); }
.grid.cards { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.grid.cards.three { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  background: var(--surface); border: var(--border-w) solid var(--border-color); border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
  padding: 1.5rem; display: flex; flex-direction: column; gap: .7rem;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.card:hover { transform: translateY(var(--card-hover-lift)); box-shadow: var(--card-hover-shadow); border-color: var(--line-2); }
.card h3 { margin: 0; }
.card-sub { margin: 0; color: var(--fg-3); font-size: .93rem; }
.card-text { margin: 0; color: var(--fg-2); font-size: .94rem; }
.card-head { display: flex; align-items: baseline; gap: .75rem; }
.card-head h3 { flex: 1; }
.card-year { font-size: .8rem; color: var(--fg-3); font-variant-numeric: tabular-nums; }
.card-media { margin: -1.5rem -1.5rem 0; border-radius: var(--radius) var(--radius) 0 0; overflow: hidden; background: var(--bg-alt); aspect-ratio: 16/10; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.card:hover .card-media img { transform: scale(1.045); }
.project.featured { grid-column: span 2; }
@media (max-width: 720px) { .project.featured { grid-column: auto; } }
.card-price { margin: auto 0 0; padding-top: .4rem; font-weight: 600; color: var(--accent); }
.svc-ic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }

.chip { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip li {
  padding: .22rem .58rem; border-radius: var(--chip-radius); font-size: .79rem; font-weight: 500;
  background: var(--bg-alt); border: var(--border-w) solid var(--line); color: var(--fg-2);
  transition: all .2s;
}
.chip li:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); color: var(--accent); }
.alt .chip li { background: var(--surface); }
.chip.sm li { font-size: .73rem; padding: .16rem .48rem; }

.links { display: flex; flex-wrap: wrap; gap: .9rem; margin-top: auto; padding-top: .4rem; }
.links a { display: inline-flex; align-items: center; gap: .28rem; font-size: .855rem; font-weight: 500; color: var(--fg-2); transition: color .2s, gap .2s; }
.links a:hover { color: var(--accent); gap: .42rem; }

/* ---------------- Skills ---------------- */
.skills-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1.1rem; }
.skill-group { background: var(--surface); border: var(--border-w) solid var(--border-color); border-radius: var(--card-radius); box-shadow: var(--card-shadow); padding: 1.3rem 1.4rem; }
.skill-group h3 { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--fg-3); margin-bottom: .85rem; }

/* ---------------- Quote ---------------- */
.quote blockquote { margin: 0; font-family: var(--serif); font-size: 1.12rem; line-height: 1.5; letter-spacing: -.01em; }
.quote figcaption { display: flex; align-items: center; gap: .7rem; margin-top: auto; padding-top: .8rem; }
.quote figcaption img, .ava { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: none; }
.ava { display: grid; place-items: center; background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); font-size: .8rem; font-weight: 600; }
.quote figcaption span { display: flex; flex-direction: column; line-height: 1.35; }
.quote figcaption strong { font-size: .9rem; font-weight: 550; }
.quote figcaption em { font-style: normal; font-size: .8rem; color: var(--fg-3); }

/* ---------------- Awards ---------------- */
.awards { display: grid; gap: .5rem; }
.awards li { display: flex; align-items: center; gap: .8rem; padding: .9rem 1.1rem; background: var(--surface); border: var(--border-w) solid var(--border-color); border-radius: var(--card-radius); box-shadow: var(--card-shadow); transition: border-color .2s, transform .2s, box-shadow .2s; }
.awards li:hover { border-color: var(--line-2); transform: translateX(2px); }
.aw-ic { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); flex: none; }
.aw-t { flex: 1; font-weight: 500; }
.aw-t em { font-style: normal; color: var(--fg-3); font-weight: 400; }
.aw-y { font-size: .85rem; color: var(--fg-3); font-variant-numeric: tabular-nums; }

/* ---------------- Contact ---------------- */
.contact { background: var(--bg-alt); }
.contact-in { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 480px); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-list { display: grid; gap: .7rem; margin: 1.6rem 0; }
.contact-list li { display: flex; align-items: center; gap: .6rem; color: var(--fg-2); }
.contact-list .i { color: var(--fg-3); }
.contact-list a:hover { color: var(--accent); }
.soc { display: flex; flex-wrap: wrap; gap: .8rem; }
.soc a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.avail { display: inline-flex; align-items: center; gap: .45rem; padding: .4rem .8rem; border-radius: 999px; background: color-mix(in srgb, #22c55e 12%, transparent); color: color-mix(in srgb, #16a34a 88%, var(--fg)); font-size: .87rem; font-weight: 500; margin-bottom: 1.4rem; }

.form { padding: 1.7rem; }
.form h3 { margin-bottom: 1.2rem; }
.field { position: relative; margin-bottom: .95rem; }
.field input, .field textarea {
  width: 100%; padding: 1.05rem .85rem .55rem; font: inherit; font-size: .95rem;
  color: var(--fg); background: var(--surface-2); border: var(--border-w) solid var(--line);
  border-radius: var(--input-radius); resize: vertical; transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea { min-height: 108px; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); background: var(--surface); }
.field label {
  position: absolute; left: .9rem; top: .95rem; font-size: .95rem; color: var(--fg-3);
  pointer-events: none; transition: all .2s var(--ease); transform-origin: left top;
}
.field input:focus + label, .field input:not(:placeholder-shown) + label,
.field textarea:focus + label, .field textarea:not(:placeholder-shown) + label {
  top: .42rem; font-size: .7rem; letter-spacing: .04em; text-transform: uppercase; color: var(--accent);
}
.hp { position: absolute; left: -9999px; }
.form-msg { margin: .8rem 0 0; font-size: .89rem; min-height: 1.2em; }
.form-msg.ok { color: #16a34a; }
.form-msg.err { color: #dc2626; }
.form-note { margin: .6rem 0 0; font-size: .8rem; color: var(--fg-3); text-align: center; }

/* ---------------- Footer ---------------- */
.foot { border-top: 1px solid var(--line); padding: 2.2rem 0; }
.foot-in { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; }
.foot p { margin: 0; font-size: .875rem; color: var(--fg-3); }
.foot-links { display: flex; gap: 1.1rem; }
.foot-links a:hover { color: var(--fg); }

/* ---------------- Reveal on scroll ---------------- */
[data-reveal] { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease-out) var(--d, 0s), transform .7s var(--ease-out) var(--d, 0s); }
[data-reveal].in { opacity: 1; transform: none; }
.no-js [data-reveal] { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

@media (max-width: 900px) {
  .hero-in, .about-in, .contact-in { grid-template-columns: 1fr; }
  .about-photo { position: static; max-width: 380px; }
  .hero-art { order: -1; max-width: 320px; }
  .tl-dates { margin-left: 0; width: 100%; }
}

/* Narrow screens: keep navigation, just let it scroll horizontally
   underneath the brand and CTA row. */
@media (max-width: 760px) {
  .nav-in { height: auto; flex-wrap: wrap; padding-top: .6rem; padding-bottom: .6rem; row-gap: .5rem; }
  .brand { margin-right: 0; }
  .nav-cta { margin-left: auto; }
  .nav-links {
    display: flex; order: 3; width: 100%; margin: 0 -.35rem; padding: 0 .35rem .1rem;
    gap: .2rem; overflow-x: auto; scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    mask-image: linear-gradient(90deg, #000 88%, transparent);
  }
  .nav-links a { scroll-snap-align: start; padding: .35rem .6rem; font-size: .845rem; }
  .nav-links::-webkit-scrollbar { height: 0; }
}
@media (max-width: 520px) {
  .nav-cta .btn-ghost { display: none; }
  .grid.cards, .grid.cards.three { grid-template-columns: 1fr; }
}

/* ---------------- CV page ---------------- */
body.is-cv { background: #fff; color: #14141a; }
body.is-cv .nav { background: #fff; }
body.is-cv { --fg: #14141a; --fg-2: #3a3a44; --fg-3: #6b6b78; --line: #e3e3e8; --bg-alt: #f6f6f8; }
.cv { max-width: 820px; margin: 0 auto; padding: 3.5rem clamp(1.15rem, 5vw, 2rem) 4rem; }
.cv-head { border-bottom: 2px solid #14141a; padding-bottom: 1.4rem; margin-bottom: 2rem; }
.cv-head h1 { font-size: 2.4rem; margin-bottom: .2rem; }
.cv-role { font-family: var(--serif); font-style: italic; font-size: 1.2rem; color: #55555f; margin: 0 0 .9rem; }
.cv-contact { display: flex; flex-wrap: wrap; gap: .35rem 1.2rem; font-size: .88rem; color: #55555f; }
.cv-contact a { border-bottom: 1px solid #ddd; }
.cv-sec { margin-bottom: 1.9rem; break-inside: avoid; }
.cv-sec > h2 { font-size: .82rem; text-transform: uppercase; letter-spacing: .13em; color: #6b6b78; border-bottom: 1px solid #e3e3e8; padding-bottom: .35rem; margin-bottom: .95rem; }
.cv-entry { margin-bottom: 1.15rem; break-inside: avoid; }
.cv-entry:last-child { margin-bottom: 0; }
.cv-entry-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.cv-entry-head h3 { font-size: 1.02rem; margin: 0; }
.cv-dates { font-size: .82rem; color: #6b6b78; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cv-entry-sub { font-size: .9rem; color: #55555f; margin: .1rem 0 .35rem; }
.cv-entry p, .cv-entry li { font-size: .9rem; color: #3a3a44; }
.cv-entry ul { list-style: disc; padding-left: 1.1rem; display: grid; gap: .18rem; }
.cv-entry .chip li { background: #f4f4f7; border-color: #e6e6ec; }
.cv-two { display: grid; grid-template-columns: 2fr 1fr; gap: 2.4rem; }
@media (max-width: 720px) { .cv-two { grid-template-columns: 1fr; } }

@media print {
  body.is-cv { background: #fff; }
  .nav, .foot, .no-print { display: none !important; }
  .cv { padding: 0; max-width: 100%; }
  a { text-decoration: none; color: inherit; }
  .cv-sec, .cv-entry { break-inside: avoid; }
  @page { margin: 14mm; }
}
