/* Shared styles for every page of jackielang.com */
/* ─────────────────────────────────────────────────────────────
   Design tokens — Apple system colors for dark and light appearance
   ───────────────────────────────────────────────────────────── */
:root {
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --ease: cubic-bezier(.32, .72, 0, 1);
  --gutter: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left), env(safe-area-inset-right));
  --maxw: 1200px;
  --tint: #0091FF;          /* Apple system blue, dark appearance */
  --on-tint: #FFFFFF;

  --bg: #000000;
  --bg-elev: #1C1C1E;
  --bg-elev2: #2C2C2E;
  --label: #FFFFFF;
  --label2: rgba(235, 235, 245, .62);
  --label3: rgba(235, 235, 245, .34);
  --sep: rgba(84, 84, 88, .6);
  --fill: rgba(120, 120, 128, .24);
  --seg-thumb: #636366;
  --glass-bg: rgba(38, 38, 42, .42);
  --glass-stroke: rgba(255, 255, 255, .14);
  --glass-hi: rgba(255, 255, 255, .22);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --link-bg: rgba(0, 145, 255, .16);
  --link-bg-hover: rgba(0, 145, 255, .24);
  --link-fg: #5CB8FF;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --link-bg: rgba(0, 136, 255, .12);
  --link-bg-hover: rgba(0, 136, 255, .18);
  --link-fg: #0062CC;
  --bg: #FFFFFF;
  --bg-elev: #F2F2F7;
  --bg-elev2: #E5E5EA;
  --label: #000000;
  --label2: rgba(60, 60, 67, .64);
  --label3: rgba(60, 60, 67, .36);
  --sep: rgba(60, 60, 67, .2);
  --fill: rgba(120, 120, 128, .12);
  --seg-thumb: #FFFFFF;
  --glass-bg: rgba(255, 255, 255, .58);
  --glass-stroke: rgba(0, 0, 0, .08);
  --glass-hi: rgba(255, 255, 255, .9);
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root[data-theme="auto"] {
    --bg: #FFFFFF; --bg-elev: #F2F2F7; --bg-elev2: #E5E5EA;
    --label: #000000; --label2: rgba(60, 60, 67, .64); --label3: rgba(60, 60, 67, .36);
    --sep: rgba(60, 60, 67, .2); --fill: rgba(120, 120, 128, .12); --seg-thumb: #FFFFFF;
    --glass-bg: rgba(255, 255, 255, .58); --glass-stroke: rgba(0, 0, 0, .08); --glass-hi: rgba(255, 255, 255, .9);
    --shadow: 0 10px 30px rgba(0, 0, 0, .12);
    color-scheme: light;
  }
}

/* Tablets and up: every section, the footer and the hero share one left edge (4% of the screen)
   and run the full width, like the rows under a streaming billboard */
@media (min-width: 760px) {
  :root {
    --gutter: max(4vw, env(safe-area-inset-left), env(safe-area-inset-right));
    --maxw: none;
  }
}

/* Hero name only: Big Shoulders Display ExtraBold, hosted on this site (SIL Open Font License, see fonts/) */
@font-face {
  font-family: "Big Shoulders Display";
  src: url("/fonts/big-shoulders-display-800.woff2") format("woff2");
  font-weight: 800; font-style: normal; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ─────────────────────────────────────────────────────────────
   Base
   ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--label);
  font: 400 1.0625rem/1.47 var(--font);   /* 17px body, per HIG */
  letter-spacing: -0.022em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video, iframe { display: block; max-width: 100%; }
a { color: var(--tint); }
button { font: inherit; letter-spacing: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--tint); outline-offset: 3px; border-radius: 8px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Liquid Glass — reserved for the floating control layer only (nav, player controls, toast) */
.glass {
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%);
  backdrop-filter: blur(22px) saturate(180%);
  border: .5px solid var(--glass-stroke);
  box-shadow: inset 0 .5px 0 var(--glass-hi), var(--shadow);
}
/* Clear glass over video, with the 35% dimming layer HIG recommends */
.glass-clear {
  background: rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
  border: .5px solid rgba(255, 255, 255, .26);
  box-shadow: inset 0 .5px 0 rgba(255, 255, 255, .35), 0 8px 24px rgba(0, 0, 0, .3);
  color: #fff;
}

/* ─────────────────────────────────────────────────────────────
   Navigation (functional layer)
   ───────────────────────────────────────────────────────────── */
.nav {
  position: fixed; z-index: 50;
  top: max(12px, env(safe-area-inset-top));
  left: 50%; transform: translateX(-50%);
  width: min(760px, calc(100% - 24px));
  display: flex; align-items: center; gap: 2px;
  padding: 6px; border-radius: 999px;
}
.brand {
  margin-right: auto; min-height: 44px; padding: 0 16px;
  display: flex; align-items: center;
  color: var(--label); text-decoration: none; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; border-radius: 999px;
}
.nav-link {
  min-height: 44px; padding: 0 14px; border-radius: 999px;
  display: flex; align-items: center;
  color: var(--label); text-decoration: none; font-size: .9375rem; font-weight: 500;
  transition: background-color .2s var(--ease);
}
.nav-link:hover { background: var(--fill); }
.nav-link { position: relative; }
/* Underline for the section currently in view */
.nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px;
  border-radius: 2px; background: currentColor;
  transform: scaleX(0); transition: transform .35s var(--ease);
}
.nav-link[aria-current="true"]::after { transform: scaleX(1); }
@media (max-width: 560px) {
  .nav-link { padding: 0 11px; }
  .nav-link::after { left: 11px; right: 11px; }
  .brand { padding: 0 12px; }
}
/* Phones: the full name doesn't fit beside four links, so the brand becomes initials */
.brand-short { display: none; }
@media (max-width: 469px) {
  .brand-full { display: none; }
  .brand-short { display: inline; letter-spacing: -0.02em; }
  .brand { padding: 0 10px; }
  .nav-link { padding: 0 8px; }
  .nav-link::after { left: 8px; right: 8px; }
}
@media (max-width: 360px) {
  .nav-link { padding: 0 6px; font-size: .875rem; }
  .nav-link::after { left: 6px; right: 6px; }
}
@media (max-width: 339px) {
  .nav-link { padding: 0 4px; }
  .nav-link::after { left: 4px; right: 4px; }
  .brand { padding: 0 8px; }
}

/* ─────────────────────────────────────────────────────────────
   Hero — the reel is the first thing people see
   ───────────────────────────────────────────────────────────── */
.hero {
  position: relative; isolation: isolate;
  min-height: 92svh; display: grid; align-items: end;
  overflow: hidden; background: #000; color: #fff;
}
.hero-media { position: absolute; inset: 0; z-index: -2; }
.hero-media video, .hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media { pointer-events: none; }
.hero-play { display: none; }

@media (max-width: 759px) {
  .section { --section-pad: 72px; }
  .grid { gap: 32px; }
  .card-cat { display: none; }
  .card-meta { margin-top: 12px; }
  .about-copy p { font-size: 1.125rem; }
  .contact-card { border-radius: 22px; }
  footer { flex-direction: column; }
}
/* Pause / play for the background loop: a quiet 32px disc inside a 44px tap area.
   Solid dark fill (no glass) so it looks the same over every shot of the reel. */
.hero-toggle {
  position: absolute; z-index: 2; width: 44px; height: 44px; border-radius: 50%;
  border: 0; padding: 0; background: none; color: #fff; cursor: pointer;
  display: grid; place-items: center;
  right: 18px; bottom: 18px;
  -webkit-tap-highlight-color: transparent;
}
.hero-toggle::before {
  content: ""; position: absolute; inset: 6px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); border: 1px solid rgba(255, 255, 255, .22);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), transform .15s var(--ease);
}
.hero-toggle svg { position: relative; width: 13px; height: 13px; }
.hero-toggle:hover::before { background: rgba(0, 0, 0, .78); border-color: rgba(255, 255, 255, .45); }
.hero-toggle:active::before { transform: scale(.9); }
.hero-toggle:focus-visible { border-radius: 50%; outline-offset: 0; }
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.45) 100%);
}
.ambient { position: absolute; inset: -10%; }
.ambient span {
  position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: drift 26s ease-in-out infinite alternate;
}
.ambient span:nth-child(1) { width: 55vmax; height: 55vmax; left: -8%; top: 5%;  background: #1e3a8a; }
.ambient span:nth-child(2) { width: 45vmax; height: 45vmax; right: -6%; top: -10%; background: #7c2d12; animation-duration: 32s; }
.ambient span:nth-child(3) { width: 40vmax; height: 40vmax; left: 35%; bottom: -20%; background: #3b0764; animation-duration: 38s; }
@keyframes drift {
  to { transform: translate3d(6vw, -4vh, 0) scale(1.12); }
}
.grain {
  position: absolute; inset: 0; pointer-events: none; opacity: .12; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.hero-inner {
  width: 100%; max-width: var(--maxw); margin: 0 auto;
  padding: 140px var(--gutter) clamp(48px, 9vh, 104px);
}
/* Tablets and up: streaming-style billboard. The text block sits near the left edge of the screen
   and is lifted off the bottom so it floats over the middle of the video; a soft shade from the
   left keeps it readable over brighter shots. Phones keep the bottom-aligned layout above. */
@media (min-width: 760px) {
  .hero-inner {
    max-width: none; margin: 0;
    padding: 120px max(var(--gutter), 4vw) clamp(72px, 22vh, 240px);
  }
  .hero::after {
    background:
      linear-gradient(77deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,0) 62%),
      linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.25) 50%, rgba(0,0,0,.45) 100%);
  }
}
/* Short laptop screens: lift the block a little less so the name keeps clear of the nav */
@media (min-width: 760px) and (max-height: 780px) {
  .hero-inner { padding-bottom: clamp(56px, 13vh, 120px); }
}
/* The name is set like a film title card: tall condensed capitals */
.hero h1 {
  margin: 0; font-size: clamp(4.25rem, 13.5vw, 10.5rem);
  font-family: "Big Shoulders Display", "Arial Narrow", "Helvetica Neue Condensed", var(--font);
  font-weight: 800; line-height: .86; letter-spacing: .005em; text-transform: uppercase;
  text-wrap: balance;
}
.hero .role {
  margin: 22px 0 0; font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 600; letter-spacing: -0.02em; color: #fff;
}
.hero .lede {
  margin: 8px 0 36px; max-width: 36ch;
  font-size: clamp(1.0625rem, 1.8vw, 1.3125rem); line-height: 1.4;
  color: rgba(235, 235, 245, .72); letter-spacing: -0.015em;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* Buttons */
.btn {
  min-height: 44px; padding: 0 22px; border-radius: 999px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-size: 1.0625rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), background-color .2s var(--ease), opacity .2s;
}
.btn:active { transform: scale(.96); }
.btn-lg { min-height: 54px; padding: 0 26px; }
.btn-filled { background: var(--tint); color: var(--on-tint); }
.btn-filled:hover { filter: brightness(1.08); }
.btn-tinted { background: var(--fill); color: var(--label); }
.btn-tinted:hover { background: var(--bg-elev2); }
.btn-plain { background: transparent; color: inherit; padding: 0 14px; }
.btn-plain:hover { background: rgba(255,255,255,.1); }
.btn svg { width: 18px; height: 18px; flex: none; }
/* Secondary button over video: frosted white so it reads on dark and bright shots alike */
.btn-frost {
  background: rgba(255, 255, 255, .16); color: #fff;
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .24);
}
.btn-frost:hover { background: rgba(255, 255, 255, .26); }
.btn-frost svg { width: 16px; height: 16px; }
@media (prefers-reduced-transparency: reduce) {
  .btn-frost { background: #3A3A3C; -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* Play reel: a shine crosses the button every 5 seconds (a soft hot core with a diagonal glint),
   with a brief blue bloom around the button. The shine lives in its own layer (.reel-shine)
   clipped to the pill shape with clip-path, because Safari on iPhone doesn't clip a moving
   effect to a button's rounded corners with overflow alone. The layer sits above the blue but
   under the label. Reduced-motion visitors get a still button (global rule below). */
#playReel { position: relative; isolation: isolate;
  animation: reel-bloom 5s cubic-bezier(.45, .05, .55, .95) 1.5s infinite; }
#playReel .reel-shine {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  border-radius: inherit; overflow: hidden;
  clip-path: inset(0 round 999px); -webkit-clip-path: inset(0 round 999px);
}
#playReel .reel-shine::after {
  content: ""; position: absolute; top: -40%; bottom: -40%; left: 0; width: 70%;
  background:
    radial-gradient(closest-side, rgba(255,255,255,.6), rgba(255,255,255,.22) 35%, transparent 80%) center / 46% 72% no-repeat,
    linear-gradient(100deg, transparent 42%, rgba(255,255,255,.26) 50%, transparent 58%);
  transform: translateX(-80%) skewX(-18deg); opacity: 0;
  animation: reel-flare 5s cubic-bezier(.45, .05, .55, .95) 1.5s infinite;
}
/* The light travels from just off the left edge to just off the right over 1.2s */
@keyframes reel-flare {
  0%        { transform: translateX(-80%) skewX(-18deg); opacity: 0; }
  4%        { opacity: .85; }
  20%       { opacity: .85; }
  24%, 100% { transform: translateX(122%) skewX(-18deg); opacity: 0; }
}
@keyframes reel-bloom {
  0%, 24%, 100% { box-shadow: 0 0 0 0 rgba(0, 145, 255, 0); }
  12%           { box-shadow: 0 0 18px 0 rgba(0, 145, 255, .3); }
}

/* ─────────────────────────────────────────────────────────────
   Sections (content layer — solid surfaces, no glass)
   ───────────────────────────────────────────────────────────── */
.section {
  --section-pad: clamp(80px, 12vw, 144px);
  /* Where a heading lands after an anchor jump: just below the floating nav */
  --nav-clear: calc(max(12px, env(safe-area-inset-top)) + 56px + 28px);
  max-width: var(--maxw); margin: 0 auto; padding: var(--section-pad) var(--gutter) 0;
  scroll-margin-top: calc(var(--nav-clear) - var(--section-pad));
}
.title1 {
  margin: 0; font-size: clamp(2rem, 4.5vw, 3.25rem);
  font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance;
}
.section-head {
  display: flex; flex-wrap: wrap; gap: 20px 24px;
  align-items: end; justify-content: space-between; margin-bottom: 36px;
}

/* Segmented control */
.seg {
  position: relative; display: inline-flex; padding: 2px; border-radius: 999px;
  background: var(--fill); max-width: 100%; overflow-x: auto; scrollbar-width: none;
}
.seg::-webkit-scrollbar { display: none; }
.seg.more-right { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
@media (max-width: 759px) {
  .section-head { margin-bottom: 28px; }
  .seg { width: 100%; }
}
.seg-thumb {
  position: absolute; top: 2px; bottom: 2px; left: 0; border-radius: 999px;
  background: var(--seg-thumb); box-shadow: 0 3px 8px rgba(0,0,0,.12), 0 1px 1px rgba(0,0,0,.04);
  transition: transform .4s var(--ease), width .4s var(--ease);
}
.seg button {
  position: relative; z-index: 1; min-height: 44px; padding: 0 18px;
  border: 0; background: none; cursor: pointer; border-radius: 999px;
  font-size: .9375rem; font-weight: 500; color: var(--label2); white-space: nowrap;
  transition: color .2s;
}
.seg button[aria-pressed="true"] { color: var(--label); font-weight: 600; }

/* Work grid */
.grid {
  display: grid; gap: 44px 24px;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}
/* Home page Featured: one big tile, then two side by side under it (stacked on phones) */
.grid.grid-featured { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 700px) { .grid.grid-featured { grid-template-columns: 1fr; } }
.card {
  display: block; width: 100%; padding: 0; border: 0; background: none;
  text-align: left; cursor: pointer; border-radius: 20px;
}
.card[hidden] { display: none; }
.card:focus-visible { outline: none; }
.card:focus-visible .thumb { outline: 3px solid var(--tint); outline-offset: 4px; }
.card.featured { grid-column: 1 / -1; }
.thumb {
  position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden;
  background: var(--bg-elev); isolation: isolate;
}
.card.featured .thumb { aspect-ratio: 2.39 / 1; border-radius: 22px; }
@media (max-width: 700px) { .card.featured .thumb { aspect-ratio: 16 / 9; } }
.thumb img, .thumb .ph {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  transition: transform .7s var(--ease);
}
.card:hover .thumb img, .card:hover .thumb .ph { transform: scale(1.035); }
.thumb .ph { background: var(--ph); }
.thumb .ph .grain { opacity: .18; }
.thumb .ph-title {
  position: absolute; left: 20px; bottom: 16px; right: 20px;
  color: rgba(255,255,255,.5); font-weight: 700; letter-spacing: -0.03em;
  font-size: clamp(1.5rem, 3vw, 2.25rem); line-height: 1;
}
.card.featured .ph-title { font-size: clamp(2rem, 5vw, 4rem); left: 28px; bottom: 24px; }
.play {
  position: absolute; top: 50%; left: 50%; width: 64px; height: 64px; border-radius: 50%;
  display: grid; place-items: center; transform: translate(-50%, -50%) scale(.9);
  opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease);
}
.play svg { width: 22px; height: 22px; margin-left: 3px; }
.card:hover .play, .card:focus-visible .play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
@media (hover: none) { .play { opacity: 1; transform: translate(-50%, -50%) scale(.85); } }
.card-meta { margin-top: 14px; display: flex; gap: 16px; justify-content: space-between; align-items: baseline; }
.card-title { margin: 0; font-size: 1.0625rem; font-weight: 600; color: var(--label); }
.card.featured .card-title { font-size: 1.375rem; letter-spacing: -0.025em; }
.card-sub { margin: 2px 0 0; font-size: .9375rem; color: var(--label2); }
.card-cat { font-size: .875rem; color: var(--label2); white-space: nowrap; }

/* About */
.about { display: grid; grid-template-columns: 1.25fr 1fr; gap: clamp(40px, 7vw, 96px); align-items: start; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; } }
.portrait { margin: 0; width: 100%; border-radius: 20px; overflow: hidden; background: var(--bg-elev); }
.portrait[hidden] { display: none; }
.portrait img { display: block; width: 100%; height: auto; aspect-ratio: 968 / 748; object-fit: cover; }
.about-copy p { margin: 24px 0 0; max-width: 34em; font-size: 1.25rem; line-height: 1.5; letter-spacing: -0.02em; }
.about-copy p + p { color: var(--label2); font-size: 1.0625rem; line-height: 1.55; }
.groups { display: grid; gap: 32px; align-content: start; }
.group-label { margin: 0 0 10px; font-size: .9375rem; font-weight: 600; color: var(--label); letter-spacing: -0.006em; }
.group { margin: 0; padding: 0; list-style: none; background: var(--bg-elev); border-radius: 14px; overflow: hidden; }
.row {
  position: relative; min-height: 46px; padding: 11px 16px;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.row + .row::before {
  content: ""; position: absolute; top: 0; left: 16px; right: 0;
  height: .5px; background: var(--sep);
}
.row > span:first-child { flex: none; max-width: 55%; }
.row > span:last-child { color: var(--label2); text-align: right; min-width: 0; }
/* A value given as a list of lines: each line stays whole, right-aligned */
.row .line { display: block; white-space: nowrap; line-height: 1.4; }
@media (max-width: 359px) { .row .line { white-space: normal; } }
/* Rows with a second line on the left: company over role, dates on the right */
.row.has-sub { align-items: flex-start; padding-top: 12px; padding-bottom: 12px; }
.row.has-sub > span:first-child { flex: 1 1 auto; max-width: none; min-width: 0; }
.row.has-sub > span:last-child { flex: none; white-space: nowrap; }
.row-sub { display: block; margin-top: 2px; font-size: .875rem; line-height: 1.35; color: var(--label2); }

/* Contact */
.contact {
  padding-bottom: clamp(80px, 12vw, 144px);
  /* Tall enough that the Contact link can scroll the card up under the nav like the other sections */
  min-height: calc(var(--section-pad) + 100svh - var(--nav-clear) - 72px);
}
.contact-card {
  border-radius: 28px; background: var(--bg-elev);
  padding: clamp(32px, 6vw, 72px);
  display: grid; gap: 28px;
}
.contact-card p { margin: 0; max-width: 34em; color: var(--label2); font-size: 1.1875rem; line-height: 1.45; }
/* Link buttons: a blue-tinted shade, distinct from the gray Copy button */
.socials {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px;
  max-width: 760px; margin: 0;
}
.socials a {
  min-height: 48px; padding: 0 14px; border-radius: 999px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--link-bg); color: var(--link-fg);
  font-size: 1rem; font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color .2s var(--ease), transform .2s var(--ease);
}
.socials a:hover { background: var(--link-bg-hover); }
.socials a:active { transform: scale(.97); }
.socials svg { width: 18px; height: 18px; flex: none; }
@media (max-width: 759px) {
  /* Phones: full-width buttons, then an even 2×2 grid of links */
  .contact-card .actions { display: grid; grid-template-columns: 1fr; gap: 10px; }
  .contact-card .actions .btn { width: 100%; }
  .socials { grid-template-columns: 1fr 1fr; max-width: none; }
  .socials a { padding: 0 12px; }
}

footer {
  max-width: var(--maxw); margin: 0 auto;
  padding: 24px var(--gutter) max(32px, env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between;
  font-size: .8125rem; color: var(--label2); border-top: .5px solid var(--sep);
}

/* ─────────────────────────────────────────────────────────────
   Player sheet
   ───────────────────────────────────────────────────────────── */
body.locked { overflow: hidden; }
/* Width keeps the whole window (title, video, text, credits) on screen on a typical laptop */
dialog.sheet {
  --sheet-pad: 32px;
  width: min(1120px, calc(100% - 24px), max(640px, calc((100svh - 400px) * 16 / 9))); max-width: none;
  max-height: calc(100svh - 32px); margin: auto; padding: 0; border: 0;
  border-radius: 24px; background: var(--bg-elev); color: var(--label);
  overflow: auto; overscroll-behavior: contain;
  box-shadow: 0 40px 100px rgba(0,0,0,.55);
}
dialog.sheet[open] { animation: sheet-in .5s var(--ease); }
dialog.sheet::backdrop {
  background: rgba(0,0,0,.62);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
@keyframes sheet-in { from { opacity: 0; transform: translateY(28px) scale(.975); } }
/* Title bar: the one title, on the same left edge as the text below; close button centered on it */
.sheet-bar {
  position: sticky; top: 0; z-index: 2;
  display: flex; align-items: center; gap: 16px;
  padding: 14px 16px 14px var(--sheet-pad); min-height: 72px;
  background: var(--bg-elev);
}
.sheet-bar h2 {
  margin: 0 auto 0 0; min-width: 0;
  font-size: 1.375rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.025em; text-wrap: balance;
}
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%; border: 0; cursor: pointer;
  display: grid; place-items: center; background: var(--fill); color: var(--label);
  transition: transform .2s var(--ease), background-color .2s;
}
.icon-btn:hover { background: var(--bg-elev2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 16px; height: 16px; }
.player { position: relative; aspect-ratio: 16 / 9; background: #000; }
.player iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.player-empty {
  position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; text-align: center;
  color: rgba(235,235,245,.62); font-size: .9375rem; background: #111113;
}
.player-empty strong { display: block; color: #fff; font-size: 1.0625rem; margin-bottom: 6px; }
/* Below the video: text on the left, credits on the right, both starting on the same top line */
.sheet-body {
  padding: 24px var(--sheet-pad) 32px;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 24px 40px; align-items: start;
}
.sheet-body.single { grid-template-columns: minmax(0, 1fr); }
.sheet-copy { display: grid; gap: 12px; justify-items: start; }
.sheet-body .summary { margin: 0; color: var(--label2); max-width: 36em; }
.sheet-body .result { margin: 0; font-weight: 600; }
.sheet-copy .actions { margin-top: 8px; }
/* Credits: label over value, two or three to a row (as room allows), so long labels don't squeeze the names */
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 118px), 1fr)); gap: 12px 20px; }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.facts div { min-width: 0; }
.facts dt { color: var(--label2); font-size: .8125rem; line-height: 1.3; }
.facts dd { margin: 2px 0 0; font-size: .9375rem; line-height: 1.35; }
/* Short laptop screens: slightly tighter spacing so the full credits still fit without scrolling */
@media (min-width: 761px) and (max-height: 820px) {
  dialog.sheet { max-height: calc(100svh - 24px); }
  .sheet-bar { min-height: 64px; padding-block: 10px; }
  .sheet-body { padding-block: 20px 24px; }
}
@media (max-width: 760px) {
  dialog.sheet { --sheet-pad: 20px; }
  .sheet-bar { min-height: 64px; padding-right: 10px; }
  .sheet-bar h2 { font-size: 1.1875rem; }
  .sheet-body { grid-template-columns: minmax(0, 1fr); padding-top: 20px; padding-bottom: 28px; }
}

/* Toast */
.toast {
  position: fixed; z-index: 60; left: 50%; bottom: max(24px, env(safe-area-inset-bottom));
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: .9375rem;
  transition: opacity .3s var(--ease), transform .4s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast svg { width: 16px; height: 16px; color: #30D158; }

/* ─────────────────────────────────────────────────────────────
   Accessibility preferences
   ───────────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .glass-clear { background: var(--bg-elev2); -webkit-backdrop-filter: none; backdrop-filter: none; }
  .glass-clear { background: #2C2C2E; }
  dialog.sheet::backdrop { background: rgba(0,0,0,.85); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  :root { --link-fg: #A6D6FF; --link-bg: rgba(92, 184, 255, .22); }
  :root { --tint: #5CB8FF !important; --on-tint: #000000; }
  :root[data-theme="light"] { --tint: #1E6EF4 !important; --on-tint: #FFFFFF; }
  :root { --label2: rgba(235,235,245,.85); --label3: rgba(235,235,245,.7); --glass-stroke: rgba(255,255,255,.5); }
  :root[data-theme="light"] { --label2: rgba(60,60,67,.9); --label3: rgba(60,60,67,.75); --glass-stroke: rgba(0,0,0,.4); }
}

/* ─────────────────────────────────────────────────────────────
   Portfolio page (/portfolio): grouped sections with a sticky jump bar
   ───────────────────────────────────────────────────────────── */
.pf {
  /* Bottom edge of the floating nav, and of the jump bar that sticks just under it */
  --pf-nav-bottom: calc(max(12px, env(safe-area-inset-top)) + 56px);
  --pf-bar-top: calc(var(--pf-nav-bottom) + 10px);
  --pf-bar-bottom: calc(var(--pf-bar-top) + 48px);
}
.pf-intro {
  max-width: var(--maxw); margin: 0 auto;
  padding: calc(var(--pf-nav-bottom) + clamp(48px, 7vw, 96px)) var(--gutter) 0;
}
.pf-intro p { margin: 14px 0 0; max-width: 34em; color: var(--label2); font-size: clamp(1.0625rem, 1.6vw, 1.25rem); line-height: 1.45; }
.jump-wrap {
  position: sticky; top: var(--pf-bar-top); z-index: 40;
  max-width: var(--maxw); margin: 28px auto 0; padding: 0 var(--gutter);
  pointer-events: none;
}
.jump-wrap .seg {
  pointer-events: auto;
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  border: .5px solid var(--glass-stroke);
  box-shadow: inset 0 .5px 0 var(--glass-hi), var(--shadow);
}
/* While the bar is stuck, a dark band behind the nav and bar keeps scrolling content from showing through */
/* Phones: the four short section names share the bar's width instead of scrolling sideways */
@media (max-width: 759px) {
  .jump-wrap .seg button { flex: 1 1 auto; padding: 0 10px; }
}
@media (max-width: 359px) {
  .jump-wrap .seg button { padding: 0 8px; font-size: .875rem; }
}
.pf-fade {
  position: fixed; z-index: 30; top: 0; left: 0; right: 0; pointer-events: none;
  height: calc(var(--pf-bar-bottom) + 24px);
  background: linear-gradient(to bottom, var(--bg) calc(100% - 28px), transparent);
  opacity: 0; transition: opacity .25s var(--ease);
}
.pf-fade.on { opacity: 1; }
.pf-section {
  --pf-pad: clamp(56px, 8vw, 96px);
  max-width: var(--maxw); margin: 0 auto; padding: var(--pf-pad) var(--gutter) 0;
  /* A jump lands with the section heading just under the jump bar */
  scroll-margin-top: calc(var(--pf-bar-bottom) + 24px - var(--pf-pad));
}
.pf-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.pf-title { margin: 0; font-size: clamp(1.625rem, 3.2vw, 2.25rem); font-weight: 700; line-height: 1.1; letter-spacing: -0.03em; }
.pf-count { font-size: 1.0625rem; font-weight: 600; color: var(--label2); font-variant-numeric: tabular-nums; }
/* The section heading already names the category, so cards don't repeat it */
.pf-section .card-cat { display: none; }
/* No contact card on this page, so the last section leaves the room before the footer */
.pf-section:last-child { padding-bottom: clamp(72px, 10vw, 120px); }
@media (prefers-reduced-transparency: reduce) {
  .jump-wrap .seg { background: var(--bg-elev2); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
