@import url('../assets/fonts/fonts.css');

/* ---------- Tokens (edit colors here) ---------- */
:root {
  --bg: #f5f4f1;          /* soft off-white, barely warm */
  --bg-raised: #ebe9e5;
  --text: #1c1b19;        /* near-black charcoal */
  --text-body: #393734;
  --text-dim: #6b6863;
  --line: rgba(28, 27, 25, 0.13);
  --accent: #a8662a;      /* golden-hour amber, deepened for contrast on bone */
  --accent-light: #e9a04a; /* brighter amber, used only on top of photos */
  --on-photo: #f4efe6;    /* text that sits on top of photos */
  --serif: 'Cormorant Garamond', 'Iowan Old Style', Palatino, Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --gutter: clamp(20px, 4vw, 56px);
  --header-h: 76px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scrollbar-gutter: stable; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 350;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }
::selection { background: var(--accent); color: var(--bg); }

.label {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}
.serif { font-family: var(--serif); font-weight: 300; }
.wrap { padding-inline: var(--gutter); max-width: 1500px; margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 100; background: var(--accent); color: #000; padding: 8px 14px; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding-inline: var(--gutter);
  transition: background 0.4s var(--ease), backdrop-filter 0.4s;
}
.site-header.solid { background: rgba(245, 244, 241, 0.88); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
/* Over the home hero photo the header is transparent, so its text goes light. */
body[data-page='home']:not(.menu-open) .site-header:not(.solid) { color: var(--on-photo); }
.wordmark { font-family: var(--serif); font-size: 26px; font-weight: 400; letter-spacing: 0.04em; }
.nav { display: flex; gap: clamp(20px, 3vw, 44px); }
.nav a { position: relative; padding: 6px 0; opacity: 0.8; transition: opacity 0.3s; }
.nav a::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px;
  background: var(--accent); transition: right 0.4s var(--ease);
}
.nav a:hover, .nav a[aria-current='page'] { opacity: 1; }
.nav a:hover::after, .nav a[aria-current='page']::after { right: 0; }
.menu-btn { display: none; }

@media (max-width: 720px) {
  .menu-btn { display: block; z-index: 61; }
  .nav {
    position: fixed; inset: 0; background: var(--bg);
    flex-direction: column; align-items: center; justify-content: center; gap: 30px;
    opacity: 0; visibility: hidden; transition: opacity 0.35s, visibility 0.35s;
  }
  .nav a { font-size: 13px; }
  body.menu-open .nav { opacity: 1; visibility: visible; }
  body.menu-open { overflow: hidden; }
  .wordmark { position: relative; z-index: 61; }
}

/* ---------- Hero ---------- */
.hero { position: relative; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; }
.hero-slide {
  position: absolute; inset: 0; opacity: 0; transition: opacity 1.8s var(--ease);
}
.hero-slide.active { opacity: 1; }
.hero-slide img {
  width: 100%; height: 100%; object-fit: cover;
  animation: drift 24s ease-in-out infinite alternate;
}
@keyframes drift { from { transform: scale(1.02); } to { transform: scale(1.09); } }
.hero::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.45), transparent 30%, transparent 45%, rgba(0,0,0,0.78));
}
.hero-copy {
  position: absolute; z-index: 2; left: var(--gutter); right: var(--gutter); bottom: clamp(56px, 11vh, 120px);
  max-width: 1100px;
}
.hero-copy h1 {
  font-family: var(--serif); font-weight: 300; margin: 0 0 22px;
  font-size: clamp(42px, 8vw, 112px); line-height: 0.98; letter-spacing: -0.01em;
}
.hero-copy { color: var(--on-photo); }
.hero-copy h1 em { color: var(--accent-light); font-style: italic; --lw-base: var(--accent-light); --lw-hi: #fff6e2; --lw-glow: 255, 196, 120; }
.hero-copy p { margin: 0; color: rgba(244, 239, 230, 0.78); max-width: 46ch; }
.hero-links { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; }
.hero-links a { border-bottom: 1px solid rgba(244, 239, 230, 0.35); padding-bottom: 4px; transition: border-color 0.3s, color 0.3s; }
.hero-links a:hover { border-color: var(--accent-light); color: var(--accent-light); }
.scroll-cue {
  position: absolute; z-index: 2; right: var(--gutter); bottom: clamp(56px, 11vh, 120px);
  writing-mode: vertical-rl; color: rgba(244, 239, 230, 0.7);
}
.scroll-cue::after { content: ''; display: block; width: 1px; height: 54px; margin: 12px auto 0; background: rgba(244, 239, 230, 0.35); }
@media (max-width: 720px) { .scroll-cue { display: none; } }

/* ---------- Sections ---------- */
section.block { padding-block: clamp(72px, 12vw, 160px); }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 40px; }
.section-title h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(32px, 4.5vw, 60px); margin: 0; line-height: 1.05; }
.arrow-link { color: var(--text-dim); transition: color 0.3s; white-space: nowrap; }
.arrow-link:hover { color: var(--accent); }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.tile { position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--bg-raised); }
.tile img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), opacity 0.6s; opacity: 0.85; }
.tile:hover img { transform: scale(1.05); opacity: 1; }
.tile span { position: absolute; left: 18px; bottom: 16px; z-index: 1; color: var(--on-photo); text-shadow: 0 1px 12px rgba(0,0,0,0.6); }
.tile::after { content: ''; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(0,0,0,0.6)); }
@media (max-width: 860px) { .tiles { grid-template-columns: repeat(2, 1fr); } }

/* "light" hover: a glint sweeps across the letters and a soft warm glow rises around them.
   The word stays its amber color at rest. */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .light-word {
    /* extra box space so italic overhangs and descenders still get painted; margins cancel it out */
    padding: 0.08em 0.14em; margin: -0.08em -0.14em;
    background: linear-gradient(100deg, var(--lw-base) 0 35%, var(--lw-hi) 50%, var(--lw-base) 65% 100%);
    background-size: 300% 100%; background-position: 100% 0;
    -webkit-background-clip: text; background-clip: text;
    filter: drop-shadow(0 0 0 rgba(var(--lw-glow), 0));
    transition: filter 0.6s var(--ease);
  }
  .light-word.light-word { color: transparent; } /* doubled class outranks the amber color rules above */
  .light-word:hover {
    background-position: 0 0;
    filter: drop-shadow(0 0 6px rgba(var(--lw-glow), 0.55)) drop-shadow(0 0 22px rgba(var(--lw-glow), 0.35));
    /* the glint only animates on the way in; leaving resets invisibly (both ends are solid amber) */
    /* ease-in-out so the bright band spends its time ON the letters, not off to the side */
    transition: background-position 1.2s cubic-bezier(0.45, 0, 0.3, 1), filter 0.6s var(--ease);
  }
}

/* ---------- Page heads ---------- */
.page-head { padding-top: calc(var(--header-h) + clamp(48px, 9vw, 110px)); padding-bottom: 36px; }
.page-head h1 { font-family: var(--serif); font-weight: 300; font-size: clamp(44px, 7vw, 96px); line-height: 1; margin: 0 0 18px; }
.page-head p { color: var(--text-dim); max-width: 60ch; margin: 0; }

/* ---------- Stills ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px 30px; padding-bottom: 28px; margin-bottom: 14px; border-bottom: 1px solid var(--line); position: sticky; top: var(--header-h); z-index: 20; padding-top: 14px; background: linear-gradient(var(--bg) 82%, transparent); }
.filter { color: var(--text-dim); padding: 6px 0; position: relative; transition: color 0.3s; }
.filter sup { font-size: 9px; margin-left: 4px; opacity: 0.6; letter-spacing: 0; }
.filter:hover, .filter[aria-pressed='true'] { color: var(--text); }
.filter[aria-pressed='true']::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); }

.grid { position: relative; padding-bottom: 80px; }
.grid-row { display: flex; gap: var(--gap, 6px); margin-bottom: var(--gap, 6px); }
.item {
  position: relative; display: block; overflow: hidden; background: var(--bg-raised);
  cursor: zoom-in; flex: none;
  opacity: 0; transform: translateY(18px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.item.in { opacity: 1; transform: none; }
.item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease), filter 0.5s; }
.item::after {
  content: ''; position: absolute; inset: 0; opacity: 0; transition: opacity 0.4s;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.75));
}
.item .cap { position: absolute; z-index: 1; left: 16px; right: 16px; bottom: 14px; color: var(--on-photo); opacity: 0; transform: translateY(8px); transition: opacity 0.4s, transform 0.4s var(--ease); pointer-events: none; }
.item .cap b { display: block; font-family: var(--serif); font-weight: 400; font-size: 22px; line-height: 1.15; letter-spacing: 0.01em; }
.item .cap small { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent-light); }
.item:hover img, .item:focus-visible img { transform: scale(1.04); filter: brightness(0.82); }
.item:hover::after, .item:focus-visible::after, .item:hover .cap, .item:focus-visible .cap { opacity: 1; transform: none; }
.item .cap-exif { display: block; margin-top: 5px; font-size: 11px; line-height: 1.45; letter-spacing: 0.04em; color: var(--on-photo); opacity: 0.85; font-variant-numeric: tabular-nums; text-wrap: balance; }
@media (hover: none) { .item .cap, .item::after { opacity: 1; transform: none; } .item .cap b { font-size: 17px; } .item .cap-exif { display: none; } }
.empty { color: var(--text-dim); padding: 60px 0; }

/* ---------- Lightbox ---------- */
.lb { position: fixed; inset: 0; z-index: 200; background: var(--bg); display: none; }
.lb.open { display: block; animation: fade 0.35s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.lb-stage { position: absolute; inset: 64px 0 88px; display: flex; align-items: center; justify-content: center; padding-inline: clamp(12px, 6vw, 96px); }
.lb-stage img { max-width: 100%; max-height: 100%; object-fit: contain; transition: opacity 0.3s; user-select: none; -webkit-user-drag: none; }
.lb-stage img.swap { opacity: 0; }
.lb-top { position: absolute; inset: 0 0 auto 0; height: 64px; display: flex; align-items: center; justify-content: space-between; padding-inline: var(--gutter); color: var(--text-dim); }
.lb-bottom { position: absolute; inset: auto 0 0 0; height: 88px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding-inline: var(--gutter); }
.lb-bottom b { font-family: var(--serif); font-weight: 400; font-size: 24px; }
.lb-bottom small { color: var(--text-dim); font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase; }
.lb-bottom .lb-exif { margin-top: 6px; font-size: 11px; letter-spacing: 0.06em; text-transform: none; opacity: 0.8; font-variant-numeric: tabular-nums; }
.lb-bottom .lb-exif:empty { display: none; }
.lb-btn { position: absolute; top: 50%; translate: 0 -50%; width: 64px; height: 120px; display: grid; place-items: center; color: var(--text-dim); transition: color 0.3s; z-index: 2; }
.lb-btn:hover { color: var(--accent); }
.lb-prev { left: 0; } .lb-next { right: 0; }
.lb-close:hover { color: var(--accent); }
@media (max-width: 720px) { .lb-btn { width: 44px; } .lb-stage { padding-inline: 8px; } }

/* ---------- Work ---------- */
.work { padding-bottom: clamp(56px, 7vw, 96px); }
.work > * { max-width: 1200px; } /* left-aligned with the header, capped for readability */
.work-split > section { margin-top: 0 !important; }
.work-head { padding-bottom: 0; }
.work-head p#work-intro { max-width: 68ch; color: var(--text-body); font-size: 17px; }
.work section + section, .work .work-split { margin-top: 28px; }
.work h3 { font-family: var(--serif); font-weight: 400; font-size: 24px; line-height: 1.15; margin: 0 0 6px; }

/* Current role: the feature panel */
.current {
  margin-top: 44px !important;
  display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 56px);
  padding: clamp(24px, 3.4vw, 44px); background: var(--bg-raised); border: 1px solid var(--line);
}
.current-label { color: var(--accent); margin: 0 0 10px; }
.current h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.08; margin: 0 0 10px; }
.current-meta { margin: 0 0 22px; color: var(--text-dim); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 10px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; padding: 5px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--text-body); background: var(--bg); }
.points { margin: 0; padding-left: 18px; color: var(--text-body); }
.points li { margin-bottom: 12px; padding-left: 4px; }
.points li:last-child { margin-bottom: 0; }
.points li::marker { color: var(--accent); }

/* Capabilities: three tiles sharing hairline borders */
.caps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cap-tile { background: var(--bg); padding: 26px clamp(20px, 2.4vw, 32px); }
.cap-tile p { margin: 0; color: var(--text-dim); font-size: 15px; }

/* Previously + Toolkit side by side */
.work-split { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); padding-top: 36px; border-top: 1px solid var(--line); margin-top: 44px !important; }
.sec-label { color: var(--text-dim); margin: 0 0 16px; font-weight: 500; }
.sec-label ~ .sec-label { margin-top: 32px; }
.prev { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 18px; padding: 18px 0; border-top: 1px solid var(--line); }
.prev:first-of-type { border-top: 0; padding-top: 0; }
.prev-when { color: var(--accent); padding-top: 6px; }
.prev p { margin: 0; color: var(--text-body); font-size: 15px; }
.prev .prev-role { color: var(--text-dim); margin-bottom: 6px; }
.toolkit { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px 18px; margin: 0; }
.toolkit dt { color: var(--text-dim); padding-top: 4px; }
.toolkit dd { margin: 0; color: var(--text-body); font-size: 15px; }
.creds { list-style: none; margin: 0; padding: 0; color: var(--text-body); font-size: 15px; }
.creds li { padding: 8px 0; border-top: 1px solid var(--line); }
.creds li:first-child { border-top: 0; padding-top: 0; }
.work .social-list { margin-top: 28px; }

@media (max-width: 860px) {
  .current, .work-split { grid-template-columns: 1fr; }
  .caps { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .prev, .toolkit { grid-template-columns: 1fr; gap: 4px; }
  .toolkit dd { margin-bottom: 10px; }
}
.load-error { padding: 140px var(--gutter); color: var(--accent); }

/* ---------- About / Contact ---------- */
.about-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(32px, 7vw, 110px); align-items: start; padding-bottom: clamp(72px, 10vw, 140px); }
@media (max-width: 860px) { .about-grid { grid-template-columns: 1fr; } }
.portrait { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; background: var(--bg-raised); }
.prose h2 { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 3.6vw, 48px); line-height: 1.12; margin: 0 0 28px; }
.prose p { color: var(--text-body); margin: 0 0 1.3em; max-width: 58ch; }
.prose h3 { margin: 40px 0 10px; color: var(--text-dim); }
.contact-big { font-family: var(--serif); font-weight: 300; font-size: clamp(30px, 6vw, 84px); line-height: 1.1; border-bottom: 1px solid var(--line); padding-bottom: 6px; transition: color 0.3s, border-color 0.3s; word-break: break-word; }
.contact-big:hover { color: var(--accent); border-color: var(--accent); }
.contact-reveal { margin: 18px 0 0; color: var(--text-dim); user-select: all; }
.social-list { display: flex; flex-wrap: wrap; gap: 10px 36px; margin-top: 48px; }
.social-list a { color: var(--text-dim); transition: color 0.3s; }
.social-list a:hover { color: var(--accent); }
pre.pgp { font-size: 11px; color: var(--text-dim); white-space: pre-wrap; word-break: break-all; border: 1px solid var(--line); padding: 16px; margin-top: 40px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 36px var(--gutter); display: flex; flex-wrap: wrap; gap: 14px 30px; justify-content: space-between; color: var(--text-dim); }

/* ---------- Motion preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: 0.01s !important; scroll-behavior: auto !important; }
  .item { opacity: 1; transform: none; }
}

/* ---------- Hover effects ---------- */
/* Letter scramble (js: scramble). Links become inline-block so their size can be locked mid-effect. */
a.scramble, span.scramble { display: inline-block; }
.scramble { font-variant-numeric: tabular-nums; white-space: nowrap; }
h1.scramble, h2.scramble, h3.scramble { white-space: normal; }

/* Cursor chip (js: cursorChip): an amber pill that follows the pointer over the home tiles. */
.cursor-chip { position: fixed; top: 0; left: 0; z-index: 150; pointer-events: none; }
.cursor-chip__pill {
  display: inline-flex; align-items: center; gap: 0.5em;
  padding: 0.6em 0.95em 0.6em 1.05em; border-radius: 999px;
  background: var(--accent-light); color: #1c1b19; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; white-space: nowrap;
  opacity: 0; transform: translate(-50%, -50%) scale(0.6);
  transition: opacity 0.14s, transform 0.28s cubic-bezier(0.34, 1.56, 0.64, 1); /* slight overshoot */
}
.cursor-chip.on .cursor-chip__pill { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.cursor-chip__pill svg { width: 1em; height: 1em; stroke-width: 1.6; }
@media (hover: hover) and (min-width: 641px) { .has-chip, .has-chip * { cursor: none; } }

/* ---------- Small helpers ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.eyebrow { color: var(--accent) !important; margin-bottom: 14px !important; }
.pad-bottom { padding-bottom: 120px; }
