/* ========================================================
   Work pages. One structure, six skins.

   Each case study sets the tokens below in its own <style>
   so the page is dressed in that brand's system, not mine.
   The only thing that stays Sean-branded is the little glass
   "back to portfolio" bar and Baggy in the corner.
   ======================================================== */
:root {
  --bg: #fff;
  --fg: #111;
  --muted: #555;
  --line: rgba(0,0,0,0.12);
  --surface: #f6f6f6;
  --accent: #0a6e9c;
  --accent-ink: #fff;
  --display-font: system-ui, sans-serif;
  --body-font: system-ui, sans-serif;
  --mono-font: var(--body-font);   /* labels speak in the brand's own body face */
  --display-weight: 800;
  --display-case: none;
  --display-track: -0.03em;
  --radius: 16px;
  --card-shadow: 0 10px 30px rgba(0,0,0,0.08);
  --max: 1160px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: clip; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
img, video { max-width: 100%; height: auto; display: block; }
body { background: var(--bg); color: var(--fg); font-family: var(--body-font); line-height: 1.6; min-height: 100vh; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
@media (max-width: 640px) { .wrap { padding: 0 16px; } }

/* ---------- the portfolio bar (always Sean's Aero) ---------- */
.pf-bar {
  position: sticky; top: 10px; z-index: 60;
  margin: 10px auto 0; max-width: calc(var(--max) - 48px);
  display: flex; align-items: center; gap: 8px;
  padding: 5px 6px 5px 12px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.86), rgba(225,243,252,0.8));
  -webkit-backdrop-filter: blur(18px) saturate(180%); backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid rgba(255,255,255,0.9);
  box-shadow: inset 0 1px 0 #fff, 0 8px 26px rgba(0,0,0,0.22);
  font: 400 13.5px 'Segoe UI', 'Source Sans 3', system-ui, sans-serif; color: #0b2538;
}
@media (max-width: 640px) { .pf-bar { margin: 8px 8px 0; max-width: none; } }
.pf-bar a { text-decoration: none; color: #0b2538; }
.pf-home { display: flex; align-items: center; gap: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pf-home::before {
  content: ""; flex-shrink: 0; width: 10px; height: 10px; border-radius: 50%;
  background: radial-gradient(ellipse 130% 120% at 50% 135%, #f0fadf 0%, #c8ec9c 22%, #95d96b 50%, #6dbe45 78%, #3d8b27 100%);
  box-shadow: 0 0 7px rgba(109,190,69,0.8);
}
.pf-bar .sp { flex: 1; }
.pf-bar .pf-btn {
  padding: 6px 11px; border-radius: 6px; border: 1px solid rgba(10,110,156,0.35);
  background: linear-gradient(180deg, rgba(255,255,255,0.85), rgba(185,225,245,0.7) 48%, rgba(145,208,238,0.65) 52%, rgba(110,190,228,0.6));
  box-shadow: inset 0 1px 0 #fff; white-space: nowrap;
}
.pf-bar .pf-btn:hover { filter: brightness(1.05); }
@media (max-width: 520px) { .pf-bar .hide-sm { display: none; } }

/* ---------- hero ---------- */
.w-hero { padding-top: 72px; padding-bottom: 56px; position: relative; }   /* block padding only: the .wrap gutter must survive */
.w-kicker { font: 700 13px var(--mono-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; display: block; }
.w-title {
  font-family: var(--display-font); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: clamp(48px, 8.4vw, 112px); line-height: 0.9; margin-bottom: 24px;
}
.w-lede { font-size: clamp(18px, 1.8vw, 22px); line-height: 1.5; max-width: 760px; color: var(--muted); }
.w-lede strong { color: var(--fg); }
.w-facts { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; margin-top: 44px; border-top: 1px solid var(--line); }
.w-facts div { padding: 16px 16px 0 0; }
.w-facts dt { font: 700 12.5px var(--mono-font); letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 4px; }
.w-facts dd { font-weight: 600; font-size: 15px; }
.w-facts dd a { color: var(--accent); }
@media (max-width: 760px) { .w-facts { grid-template-columns: 1fr 1fr; } }

/* ---------- full-bleed figure ---------- */
.w-figure { margin: 8px 0 0; }
.w-figure img, .w-figure video { width: 100%; border-radius: var(--radius); box-shadow: var(--card-shadow); }
.w-figure figcaption { font: 400 14px var(--body-font); color: var(--muted); margin-top: 10px; }

/* ---------- sections ---------- */
.w-sec { padding: 88px 0 0; }
.w-sec-head { display: grid; grid-template-columns: 220px 1fr; gap: 24px; margin-bottom: 30px; align-items: baseline; }
.w-sec-head .n { font: 700 13px var(--mono-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.w-sec-head h2 {
  font-family: var(--display-font); font-weight: var(--display-weight);
  text-transform: var(--display-case); letter-spacing: var(--display-track);
  font-size: clamp(32px, 4.4vw, 56px); line-height: 0.98;
}
.w-prose { margin-left: 244px; max-width: 720px; font-size: 17.5px; color: var(--muted); }
.w-prose p + p { margin-top: 14px; }
.w-prose strong { color: var(--fg); }
.w-indent { margin-left: 244px; }
@media (max-width: 860px) { .w-sec-head { grid-template-columns: 1fr; gap: 8px; } .w-prose, .w-indent { margin-left: 0; } }

/* ---------- decisions ---------- */
.calls { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 760px) { .calls { grid-template-columns: 1fr; } }
.call { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; box-shadow: var(--card-shadow); display: flex; flex-direction: column; gap: 8px; }
.call .k { font: 700 12.5px var(--mono-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--accent); }
.call h3 { font-family: var(--display-font); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: 24px; line-height: 1.08; }
.call p { color: var(--muted); font-size: 15.5px; }
.call p strong { color: var(--fg); }
.call blockquote { border-left: 3px solid var(--accent); padding: 4px 0 4px 14px; font-style: italic; color: var(--fg); font-size: 15.5px; }

/* ---------- gallery ---------- */
.gal { display: grid; grid-template-columns: repeat(12, 1fr); gap: 16px; }
.gal a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--card-shadow); border: 1px solid var(--line); background: var(--surface); position: relative; }
.gal img, .gal video { width: 100%; height: 100%; object-fit: cover; object-position: top; transition: transform .8s cubic-bezier(.2,.85,.25,1); }
.gal a:hover img { transform: scale(1.03); }
.gal .g12 { grid-column: span 12; } .gal .g8 { grid-column: span 8; } .gal .g6 { grid-column: span 6; } .gal .g4 { grid-column: span 4; } .gal .g3 { grid-column: span 3; }
.gal .tall { aspect-ratio: 9 / 16; } .gal .wide { aspect-ratio: 16 / 10; } .gal .sq { aspect-ratio: 1; } .gal .pano { aspect-ratio: 16 / 7; }
.gal a span { position: absolute; left: 10px; bottom: 10px; font: 600 13px var(--body-font); background: rgba(0,0,0,0.65); color: #fff; padding: 4px 8px; border-radius: 6px; opacity: 0; transition: opacity .3s; }
.gal a:hover span, .gal a:focus-visible span { opacity: 1; }
@media (max-width: 760px) { .gal .g8, .gal .g6, .gal .g4 { grid-column: span 12; } .gal .g3 { grid-column: span 6; } }

/* ---------- system: swatches + type ---------- */
.sys { display: grid; grid-template-columns: 1.1fr 1fr; gap: 16px; }
@media (max-width: 860px) { .sys { grid-template-columns: 1fr; } }
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.sw { border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); background: var(--surface); }
.sw i { display: block; height: 84px; }
.sw b { display: block; padding: 8px 10px 0; font-size: 13px; }
.sw code { display: block; padding: 0 10px 10px; font: 500 12.5px ui-monospace, Consolas, monospace; color: var(--muted); }
.sw small { display: block; padding: 0 10px 10px; font-size: 12px; color: var(--muted); line-height: 1.35; margin-top: -6px; }
.type-card { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 22px; display: flex; flex-direction: column; gap: 14px; }
.type-card .spec { border-bottom: 1px solid var(--line); padding-bottom: 14px; }
.type-card .spec:last-child { border: 0; padding: 0; }
.type-card .spec small { display: block; font: 600 12.5px var(--mono-font); color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }

/* ---------- results ---------- */
.results { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
@media (max-width: 760px) { .results { grid-template-columns: 1fr 1fr; } }
.res { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); padding: 20px; }
.res .v { font-family: var(--display-font); font-weight: var(--display-weight); font-size: clamp(30px, 3.6vw, 44px); line-height: 1; letter-spacing: var(--display-track); color: var(--accent); }
.res .l { font-size: 13.5px; color: var(--muted); margin-top: 6px; }

/* ---------- next world ---------- */
.w-next { margin: 110px 0 0; padding: 48px 0 120px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; align-items: flex-end; }
.w-next a { text-decoration: none; }
.w-next .lbl { font: 700 12.5px var(--mono-font); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); display: block; margin-bottom: 6px; }
.w-next .big { font-family: var(--display-font); font-weight: var(--display-weight); text-transform: var(--display-case); letter-spacing: var(--display-track); font-size: clamp(30px, 5vw, 60px); line-height: 1; }
.w-next a:hover .big { color: var(--accent); }
.w-next .ask { font-size: 15px; color: var(--muted); max-width: 340px; }
.w-next .ask button { all: unset; cursor: pointer; color: var(--accent); font-weight: 700; text-decoration: underline; }

/* lightbox (shared with site.js) */
.lb { position: fixed; inset: 0; z-index: 990; display: none; background: rgba(4,8,12,0.9); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); align-items: center; justify-content: center; padding: 56px 16px 24px; }
.lb.open { display: flex; }
.lb figure { max-width: min(1300px, 100%); max-height: 100%; display: flex; flex-direction: column; gap: 10px; align-items: center; }
.lb img, .lb video { max-height: calc(100dvh - 130px); width: auto; max-width: 100%; border-radius: 8px; }
.lb figcaption { color: #fff; font: 600 14px system-ui; text-align: center; }
.lb figcaption small { display: block; opacity: .7; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; }
.lb-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 34px; border-radius: 6px; border: 0; color: #fff; font-size: 18px; cursor: pointer; background: linear-gradient(180deg, #ffa58c, #cd301a); }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.4); background: rgba(255,255,255,0.9); font-size: 22px; cursor: pointer; }
.lb-nav.prev { left: 14px; } .lb-nav.next { right: 14px; }
@media (max-width: 640px) { .lb-nav { top: auto; bottom: 16px; transform: none; } }

.reveal.anim { opacity: 0.3; transform: translateY(22px); transition: opacity .7s ease-out, transform .7s cubic-bezier(.2,.85,.25,1); }
.reveal.anim.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal.anim { opacity: 1; transform: none; } html { scroll-behavior: auto; } }

/* touch: the portfolio bar's links get finger-sized hit areas */
@media (pointer: coarse) {
  .pf-bar { padding: 4px 6px 4px 10px; }
  .pf-bar a { min-height: 44px; display: flex; align-items: center; }
  .pf-bar .pf-btn { padding: 0 14px; }
}
