/* ==========================================================================
   Theme tokens. Change --accent-default in content/site.md (theme.accent);
   everything accent-colored derives from --accent below.
   ========================================================================== */
:root {
  --accent: var(--accent-default, #ff7425);
  --accent-soft: color-mix(in srgb, var(--accent) 14%, transparent);
  --accent-line: color-mix(in srgb, var(--accent) 45%, transparent);
  --on-accent: #131314;

  --bg: #131314;
  --surface: #1e1f20;
  --surface-2: #282a2c;
  --border: #333537;
  --text: #e3e3e3;
  --text-strong: #f5f5f5;
  --muted: #a9acb0;

  --font: "Google Sans Flex", "Google Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: dark;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 400 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
h1, h2, h3 { color: var(--text-strong); line-height: 1.2; font-weight: 500; margin: 0; }
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
p { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; margin: 0; padding: 0; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.narrow { max-width: 760px; }
.center { text-align: center; justify-content: center; }
.muted { color: var(--muted); }
.i { width: 1.1em; height: 1.1em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 10; background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: 8px; }
.skip:focus { left: 8px; }

/* ---------- header / footer ---------- */
.site-header { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 500; color: var(--text-strong); white-space: nowrap; }
.logo { width: 42px; height: 28px; background: var(--accent); -webkit-mask: url(/static/logo.svg) center / contain no-repeat; mask: url(/static/logo.svg) center / contain no-repeat; }
.site-nav { display: flex; gap: 4px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.site-nav::-webkit-scrollbar { display: none; }
.site-nav a { padding: 8px 12px; border-radius: 999px; color: var(--muted); font-size: 0.94rem; white-space: nowrap; }
.site-nav a:hover { color: var(--text-strong); background: var(--surface); }
.site-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }

.site-footer { border-top: 1px solid var(--border); margin-top: 96px; padding-block: 28px; color: var(--muted); font-size: 0.9rem; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 18px; }
.footer-links a:hover, .site-footer a:hover { color: var(--accent); }
.swatches { display: flex; gap: 8px; margin-left: auto; align-items: center; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--bg); background: var(--c); box-shadow: 0 0 0 1px var(--border); cursor: pointer; padding: 0; }
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--text); }
.swatch-custom { position: relative; overflow: hidden; background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); }
.swatch-custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

@media (max-width: 760px) {
  .header-inner { flex-wrap: wrap; gap: 0; padding-block: 10px 4px; }
  .site-nav { flex-wrap: wrap; margin: 4px 0 0 -10px; width: calc(100% + 10px); overflow: visible; gap: 0 2px; }
  .site-nav a { padding: 6px 10px; }
  .swatches { margin-left: 0; }
}

/* ---------- buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 20px;
  border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-strong);
  font: 500 0.95rem var(--font); cursor: pointer; transition: background .15s, border-color .15s;
}
.btn:hover { color: var(--text-strong); background: var(--surface); border-color: var(--muted); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-primary:hover { color: var(--on-accent); background: color-mix(in srgb, var(--accent) 85%, white); border-color: transparent; }

/* ---------- home ---------- */
.hero { padding-top: clamp(48px, 10vh, 120px); text-align: center; }
.hero-name { font-size: clamp(2.5rem, 1.6rem + 4vw, 4.5rem); font-weight: 500; letter-spacing: -0.03em; }
.hero-role { margin-top: 10px; font-size: clamp(1.15rem, 1rem + .6vw, 1.5rem); color: var(--accent); }
.hero-tagline { margin: 12px auto 0; max-width: 56ch; color: var(--muted); font-size: 1.05rem; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; margin: 48px auto 0; max-width: 980px; text-align: left; }
.choice { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; transition: border-color .2s, transform .2s; }
.choice:hover { color: inherit; border-color: var(--accent-line); transform: translateY(-2px); }
.choice-thumbs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2px; aspect-ratio: 3 / 1; background: var(--border); }
.choice-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.choice-body { padding: 22px 24px 24px; }
.choice h2 { font-size: 1.5rem; }
.choice p { margin-top: 6px; color: var(--muted); }
.choice-cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 16px; color: var(--accent); font-weight: 500; }
.choice:hover .choice-cta .i { transform: translateX(3px); }
.choice-cta .i { transition: transform .2s; }
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 28px; margin-top: 36px; color: var(--muted); }
.hero-links a { display: inline-flex; align-items: center; gap: 6px; }

/* ---------- page heads ---------- */
.page-head { padding-block: clamp(40px, 7vh, 72px) 32px; }
.eyebrow { color: var(--accent); font-size: 0.85rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.lede { margin-top: 12px; color: var(--muted); font-size: 1.1rem; max-width: 62ch; }
.split-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.split-links a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border: 1px solid var(--border); border-radius: 999px; }
.split-links a:hover { border-color: var(--accent-line); }

/* ---------- project cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 24px; }
.card { min-width: 0; }
.card-link { display: flex; flex-direction: column; height: 100%; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); overflow: hidden; transition: border-color .2s, transform .2s; }
.card-link:hover { color: inherit; border-color: var(--accent-line); transform: translateY(-2px); }
.card-media { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.card-link:hover .card-media img { transform: scale(1.03); }
.card-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 20px; flex: 1; }
.card-title { font-size: 1.15rem; }
.card-link:hover .card-title { color: var(--accent); }
.card-summary { color: var(--muted); font-size: 0.95rem; }
.card-meta { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.85rem; color: var(--muted); }
.card-meta > span + span::before { content: "·"; margin-right: 14px; opacity: .6; }
.card-cats { color: var(--accent); }

/* ---------- project page ---------- */
.project { padding-top: 28px; }
.crumbs a { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.95rem; }
.crumbs a:hover { color: var(--accent); }
.project-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 4vw, 56px); align-items: start; margin-top: 20px; }
.project-hero h1 { font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 24px; margin: 28px 0 0; }
.facts dt { font-size: 0.8rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.facts dd { margin: 2px 0 0; color: var(--text-strong); }
.video, .hero-img { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); aspect-ratio: 16 / 9; border: 1px solid var(--border); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; }
.video-poster { position: relative; display: block; width: 100%; height: 100%; }
.video-poster img { width: 100%; height: 100%; object-fit: cover; }
.play { position: absolute; inset: 0; margin: auto; width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 24px rgb(0 0 0 / .4); transition: transform .2s; }
.play .i { width: 28px; height: 28px; margin-left: 4px; }
.video-poster:hover .play { transform: scale(1.08); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 1px; margin-top: 40px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.stats li { background: var(--surface); padding: 20px 24px; }
.stats strong { display: block; font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem); font-weight: 500; color: var(--accent); line-height: 1.2; }
.stats span { color: var(--muted); font-size: 0.92rem; }

.project-body { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); margin-top: 48px; }
.project section > h2, .project aside > h2 { margin-bottom: 16px; }
.highlights ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.highlights li { position: relative; padding-left: 22px; max-width: 72ch; }
.highlights li::before { content: ""; position: absolute; left: 2px; top: .65em; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.highlights strong { color: var(--text-strong); font-weight: 500; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 5px 12px; border-radius: 999px; background: var(--surface-2); font-size: 0.88rem; color: var(--text); }
.more-videos, .project section[aria-labelledby="h-gallery"] { margin-top: 56px; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.shot { display: block; aspect-ratio: 16 / 10; border-radius: var(--radius-sm); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); cursor: zoom-in; }
.shot img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.shot:hover img { transform: scale(1.03); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; padding-top: 24px; border-top: 1px solid var(--border); }
.pager a { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: var(--radius-sm); border: 1px solid var(--border); }
.pager a:hover { border-color: var(--accent-line); color: inherit; }
.pager span { color: var(--muted); font-size: 0.85rem; }
.pager strong { font-weight: 500; color: var(--text-strong); }
.pager-next { text-align: right; grid-column: 2; }

@media (max-width: 900px) {
  .project-hero, .project-body { grid-template-columns: 1fr; }
  .project-media { order: -1; }
}
@media (max-width: 560px) {
  .pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; }
}

/* ---------- lightbox ---------- */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: rgb(10 10 11 / .94); color: var(--text); }
.lightbox::backdrop { background: transparent; }
.lightbox[open] { display: grid; place-items: center; }
.lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 120px); width: auto; height: auto; border-radius: 8px; }
.lb-btn { position: fixed; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--border); background: var(--surface); color: var(--text-strong); display: grid; place-items: center; cursor: pointer; }
.lb-btn:hover { border-color: var(--accent); color: var(--accent); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 16px; top: 50%; translate: 0 -50%; }
.lb-next { right: 16px; top: 50%; translate: 0 -50%; }
.lb-count { position: fixed; bottom: 20px; left: 0; right: 0; text-align: center; color: var(--muted); font-size: .9rem; }
@media (max-width: 600px) { .lb-prev, .lb-next { top: auto; bottom: 8px; translate: none; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); padding-top: clamp(40px, 7vh, 72px); }
.about-side { position: sticky; top: 96px; align-self: start; }
.portrait { width: 160px; height: 160px; border-radius: 50%; object-fit: cover; border: 1px solid var(--border); }
.about-name { margin-top: 16px; font-size: 1.15rem; color: var(--text-strong); font-weight: 500; }
.about-side .muted { margin-top: 4px; font-size: .95rem; }
.label { margin-top: 28px; margin-bottom: 8px; font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 500; }
.cv-list { display: grid; gap: 2px; }
.cv-list a { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.cv-list .i { color: var(--accent); }
.about-main > h2 { margin-top: 48px; margin-bottom: 18px; }
.prose { margin-top: 20px; display: grid; gap: 14px; max-width: 70ch; font-size: 1.05rem; }
.prose p { margin: 0; }
.timeline { display: grid; gap: 24px; border-left: 2px solid var(--border); padding-left: 22px !important; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -29px; top: .45em; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 2px solid var(--accent); }
.tl-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; align-items: baseline; }
.tl-period { color: var(--muted); font-size: .9rem; white-space: nowrap; }
.tl-org { color: var(--accent); font-size: .95rem; margin: 2px 0 6px; }
.timeline p:last-child { color: var(--text); max-width: 72ch; }
.skills { display: grid; gap: 18px; margin: 0; }
.skills dt { color: var(--muted); font-size: .9rem; margin-bottom: 8px; }
.skills dd { margin: 0; }
.plain-list { display: grid; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.plain-list li { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding: 14px 18px; background: var(--surface); }
.plain-list a { display: inline-flex; align-items: center; gap: 6px; color: var(--accent); }
@media (max-width: 800px) {
  .about { grid-template-columns: 1fr; }
  .about-side { position: static; }
}

/* ---------- contact form ---------- */
.form { display: grid; gap: 18px; margin-top: 40px; padding: clamp(20px, 4vw, 32px); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.field { display: grid; gap: 6px; }
.field label { font-size: .9rem; color: var(--muted); }
.field input, .field textarea {
  width: 100%; padding: 12px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--bg); color: var(--text-strong); font: inherit; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.form .btn { justify-self: start; }
.form-status { min-height: 1.4em; color: var(--muted); }
.form-status.ok { color: #6dd58c; }
.form-status.err { color: #ff8a80; }
.hp { position: absolute; left: -9999px; }

/* ---------- motion / print ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  :root { --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #222; --text-strong: #000; --muted: #555; --border: #ccc; }
  .site-header, .site-footer, .project-media, .gallery, .more-videos, .pager, .swatches, .actions { display: none !important; }
  .project-hero, .project-body, .about { grid-template-columns: 1fr; }
}
