/* ==========================================================================
   ayaalmomany.com — case-study pages (/work/hirely/, /work/solace/)
   One template, themed by body.theme-hirely / body.theme-solace.
   ========================================================================== */

/* ---------- Themes ---------- */
.theme-hirely {
  --ac: #f51a2e;
  --ac-2: #ff6b3d;
  --ac-rgb: 245, 26, 46;
  --ac2-rgb: 255, 107, 61;
  --ac-3: #ff9a6b;
  --ac-grad: linear-gradient(120deg, #ff4054 0%, #f51a2e 45%, #ff6b3d 100%);
  --page-bg: #060506;
  --title-font: var(--font);
  --title-style: normal;
  --title-weight: 700;
  --title-case: uppercase;
  --title-track: -0.055em;
  --hl-font: var(--font);
  --hl-weight: 600;
  --hl-track: -0.035em;
  background: var(--page-bg);
}
.theme-solace {
  --ac: #a78bfa;
  --ac-2: #5eead4;
  --ac-rgb: 167, 139, 250;
  --ac2-rgb: 94, 234, 212;
  --ac-3: #f0abfc;
  --ac-grad: linear-gradient(110deg, #c4b5fd 0%, #a78bfa 35%, #7dd3fc 70%, #5eead4 100%);
  --page-bg: #07061a;
  --title-font: var(--serif);
  --title-style: italic;
  --title-weight: 400;
  --title-case: none;
  --title-track: -0.04em;
  --hl-font: var(--serif);
  --hl-weight: 400;
  --hl-track: -0.02em;
  background: var(--page-bg);
}
.theme-solace .serif { font-style: italic; }
.theme-hirely ::selection { background: rgba(245, 26, 46, 0.45); }
.theme-solace ::selection { background: rgba(167, 139, 250, 0.45); }

.work-section-head .serif, .work-tour .serif, .work-hood .h3 .serif, .work-demo .serif, .work-gallery .serif, .work-pitch .serif {
  background: var(--ac-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.06em;
}

.work-section-head { max-width: 760px; margin-bottom: clamp(48px, 6vw, 80px); }
.work-section-head .eyebrow { color: var(--ac); }
.work-section-head .h2 { margin: 18px 0 20px; }
.theme-solace .work-section-head .h2 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.03em; font-size: clamp(42px, 6vw, 80px); }
.work-center { margin-left: auto; margin-right: auto; text-align: center; }
.work-center .eyebrow { justify-content: center; }

/* ==========================================================================
   Hero
   ========================================================================== */
.work-hero {
  position: relative; overflow: hidden;
  padding: clamp(110px, 12vw, 150px) 0 clamp(64px, 8vw, 110px);
  min-height: min(100svh, 1000px);
  display: flex; align-items: center;
}
.work-hero-bg { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.work-hero-bg span { position: absolute; border-radius: 50%; filter: blur(100px); }
.work-hero-bg::after { /* floor fade */
  content: ""; position: absolute; inset: auto 0 0 0; height: 40%;
  background: linear-gradient(to bottom, transparent, var(--page-bg));
}

/* Hirely: red spotlight from above + vignette, cinema black */
.theme-hirely .work-hero-bg::before {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(60% 55% at 72% 38%, rgba(245, 26, 46, 0.22), transparent 70%),
    radial-gradient(120% 80% at 50% -10%, rgba(255, 107, 61, 0.08), transparent 60%);
}
.theme-hirely .work-bg-a { width: 520px; height: 520px; right: 8%; top: 12%; background: rgba(245, 26, 46, 0.35); }
.theme-hirely .work-bg-b { width: 380px; height: 380px; left: -6%; top: 40%; background: rgba(255, 107, 61, 0.12); }
.theme-hirely .work-bg-c { display: none; }

/* Solace: drifting aurora */
.theme-solace .work-hero-bg span { opacity: 0.55; animation: work-drift 22s ease-in-out infinite alternate; }
.theme-solace .work-bg-a { width: 640px; height: 520px; right: -4%; top: -6%; background: #7c5cf5; }
.theme-solace .work-bg-b { width: 520px; height: 460px; right: 22%; top: 46%; background: #14b8a6; opacity: 0.38 !important; animation-duration: 28s; animation-delay: -6s; }
.theme-solace .work-bg-c { width: 460px; height: 380px; left: -8%; top: 10%; background: #c026d3; opacity: 0.22 !important; animation-duration: 34s; animation-delay: -12s; }
@keyframes work-drift {
  0% { transform: translate3d(0, 0, 0) scale(1); }
  50% { transform: translate3d(-60px, 40px, 0) scale(1.12); }
  100% { transform: translate3d(40px, -30px, 0) scale(0.95); }
}

.work-hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px); align-items: center;
}
.work-back {
  display: inline-flex; gap: 8px; align-items: center; margin-bottom: 36px;
  font-size: 14px; color: var(--text-2); transition: color 0.2s;
}
.work-back:hover { color: var(--text); }
.work-back span { transition: transform 0.25s var(--ease); }
.work-back:hover span { transform: translateX(-3px); }

/* Glossy icon with reflection */
.work-icon {
  position: relative; width: 92px; height: 92px; border-radius: 22.5%;
  margin-bottom: 64px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 24px 60px -14px rgba(var(--ac-rgb), 0.7), 0 10px 24px -10px rgba(0, 0, 0, 0.9);
  -webkit-box-reflect: below 8px linear-gradient(transparent 55%, rgba(0, 0, 0, 0.28));
}
.work-icon img { width: 100%; height: 100%; border-radius: inherit; }
.work-icon::after { /* gloss */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.38) 0%, rgba(255, 255, 255, 0.06) 38%, transparent 52%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}
.work-eyebrow { color: var(--ac); display: flex; }
.work-name {
  margin: 18px 0 10px;
  font-family: var(--title-font); font-style: var(--title-style); font-weight: var(--title-weight);
  text-transform: var(--title-case); letter-spacing: var(--title-track);
  font-size: clamp(76px, 12vw, 172px); line-height: 0.86;
  background: var(--ac-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  filter: drop-shadow(0 0 48px rgba(var(--ac-rgb), 0.35));
  padding: 0.04em 0.08em 0.06em 0; margin-left: -0.04em;
}
.theme-solace .work-name { font-size: clamp(88px, 13.5vw, 196px); line-height: 0.92; }
.work-pitch {
  margin: 14px 0 18px; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.15;
  letter-spacing: -0.03em; font-weight: 500; max-width: 560px;
}
.theme-solace .work-pitch { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3.2vw, 44px); letter-spacing: -0.02em; }
.work-sub { max-width: 540px; margin: 0 0 32px; font-size: clamp(16px, 1.3vw, 18px); }

.work-meta {
  display: grid; grid-template-columns: auto auto 1fr; gap: 0; margin: 0 0 34px;
  border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke); max-width: 600px;
}
.work-meta div { padding: 14px 20px 14px 0; }
.work-meta div + div { padding-left: 20px; border-left: 1px solid var(--stroke); }
.work-meta dt { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); margin-bottom: 4px; }
.work-meta dd { margin: 0; font-size: 14px; color: var(--text); line-height: 1.4; }
.work-cta { display: flex; flex-wrap: wrap; gap: 12px; }
.theme-hirely .work-cta .btn-primary { background: var(--ac); color: #fff; }
.theme-hirely .work-cta .btn-primary:hover { box-shadow: 0 12px 40px -10px rgba(245, 26, 46, 0.8); }
.theme-solace .work-cta .btn-primary { background: linear-gradient(120deg, #c4b5fd, #99f6e4); color: #0b0820; }
.theme-solace .work-cta .btn-primary:hover { box-shadow: 0 12px 40px -10px rgba(167, 139, 250, 0.8); }

/* Stage: phone + orbiting screens */
.work-hero-stage {
  position: relative; height: clamp(640px, 56vw, 780px);
  display: grid; place-items: center; perspective: 1400px;
}
.work-hero-glow {
  position: absolute; width: 78%; aspect-ratio: 1; border-radius: 50%; left: 11%; top: 14%;
  background: radial-gradient(circle, rgba(var(--ac-rgb), 0.55), rgba(var(--ac2-rgb), 0.18) 45%, transparent 70%);
  filter: blur(40px);
}
.work-hero-phone {
  position: relative; z-index: 3;
  transform: rotateY(var(--ry, 0deg)) rotateX(var(--rx, 0deg));
  transition: transform 0.6s var(--ease), opacity 1s var(--ease);
  transform-style: preserve-3d;
}
.work-hero-phone .iphone {
  --w: clamp(280px, 24vw, 340px);
  box-shadow:
    inset 0 0 0 1.5px rgba(255, 255, 255, 0.16),
    inset 0 0 0 calc(var(--w) * 0.012) #050506,
    0 60px 120px -30px rgba(0, 0, 0, 0.95),
    0 0 90px -20px rgba(var(--ac-rgb), 0.55);
}
.work-hero-orbits { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.work-orbit { position: absolute; width: clamp(130px, 12vw, 172px); transform: translate3d(0, var(--py, 0px), 0); will-change: transform; }
.work-orbit-card {
  border-radius: 22px; overflow: hidden; border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.9), 0 0 0 6px rgba(255, 255, 255, 0.025);
  animation: work-float 9s ease-in-out infinite;
}
.work-orbit-card img { width: 100%; height: auto; }
.work-orbit-1 { left: -10%; top: 9%; }
.work-orbit-1 .work-orbit-card { --r: -9deg; opacity: 0.78; }
.work-orbit-2 { left: -2%; bottom: 3%; }
.work-orbit-2 .work-orbit-card { --r: 6deg; opacity: 0.6; animation-delay: -3s; filter: blur(0.5px); }
.work-orbit-3 { right: -8%; top: 3%; }
.work-orbit-3 .work-orbit-card { --r: 8deg; opacity: 0.7; animation-delay: -5s; }
.work-orbit-4 { right: -12%; bottom: 10%; }
.work-orbit-4 .work-orbit-card { --r: -6deg; opacity: 0.82; animation-delay: -1.5s; }
@keyframes work-float {
  0%, 100% { transform: rotate(var(--r)) translateY(0); }
  50% { transform: rotate(calc(var(--r) * 0.7)) translateY(-14px); }
}
/* Hirely: glowing horizon line from the splash; Solace: soft reflection pool */
.work-horizon {
  position: absolute; z-index: 1; left: 6%; right: 6%; bottom: 3%; height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, transparent, var(--ac) 30%, var(--ac-2) 70%, transparent);
  box-shadow: 0 0 24px 4px rgba(var(--ac-rgb), 0.55), 0 0 80px 18px rgba(var(--ac-rgb), 0.25);
}
.theme-solace .work-horizon {
  height: 90px; bottom: -2%; border-radius: 50%; opacity: 0.6;
  background: radial-gradient(closest-side, rgba(var(--ac2-rgb), 0.45), transparent);
  box-shadow: none; filter: blur(14px);
}

/* ==========================================================================
   Stats strip
   ========================================================================== */
.work-stats { position: relative; z-index: 1; }
.work-stats-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  border-top: 1px solid var(--stroke); border-bottom: 1px solid var(--stroke);
}
.work-stat { padding: 34px 24px; display: flex; flex-direction: column; gap: 6px; }
.work-stat + .work-stat { border-left: 1px solid var(--stroke); }
.work-stat-num {
  font-size: clamp(44px, 5vw, 68px); font-weight: 600; letter-spacing: -0.05em; line-height: 1;
  background: linear-gradient(180deg, #fff 30%, rgba(var(--ac-rgb), 0.9)); -webkit-background-clip: text; background-clip: text; color: transparent;
  font-variant-numeric: tabular-nums;
}
.theme-solace .work-stat-num { font-family: var(--serif); font-weight: 400; font-size: clamp(52px, 5.6vw, 80px); letter-spacing: -0.03em; }
.work-stat-label { font-size: 14px; color: var(--text-2); }

/* ==========================================================================
   Screen tour (sticky phone + chapters)
   ========================================================================== */
.work-tour-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
.work-tour-pin {
  position: sticky; top: clamp(84px, calc(50vh - 360px), 150px);
  align-self: start; display: flex; align-items: center; justify-content: center; gap: 36px;
}
.work-rail { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.work-rail a {
  display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 13px; color: var(--text-3);
  transition: color 0.3s;
}
.work-rail b { font-family: var(--mono); font-weight: 500; font-size: 11px; width: 22px; }
.work-rail a::before {
  content: ""; width: 14px; height: 2px; border-radius: 2px; background: currentColor; opacity: 0.5;
  transition: width 0.4s var(--ease), background 0.3s, opacity 0.3s;
}
.work-rail a:hover { color: var(--text-2); }
.work-rail a.is-on { color: var(--text); }
.work-rail a.is-on::before { width: 30px; background: var(--ac); opacity: 1; box-shadow: 0 0 12px rgba(var(--ac-rgb), 0.8); }
.work-tour-device { position: relative; display: flex; flex-direction: column; align-items: center; }
.work-tour-glow {
  position: absolute; inset: 8% -18% 14%; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ac-rgb), 0.38), rgba(var(--ac2-rgb), 0.12) 50%, transparent 72%);
  filter: blur(40px); transition: background 0.8s;
}
.work-tour-device .iphone { --w: clamp(260px, 22vw, 316px); }
.work-tour-screen > img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transform: scale(1.04); filter: blur(6px);
  transition: opacity 0.7s var(--ease), transform 0.9s var(--ease), filter 0.7s var(--ease);
}
.work-tour-screen > img.is-on { opacity: 1; transform: none; filter: none; }
.work-tour-caption {
  position: relative; margin: 22px 0 0; font-size: 13px; color: var(--text-2);
  padding: 6px 14px; border-radius: 999px; background: var(--surface); border: 1px solid var(--stroke);
}
.work-tour-caption b { font-family: var(--mono); font-weight: 500; color: var(--ac); margin-right: 4px; }

.work-chapter {
  min-height: min(78vh, 760px); display: flex; align-items: center;
  transition: opacity 0.6s var(--ease);
}
.work-tour.is-live .work-chapter:not(.is-active) { opacity: 0.32; }
.work-chapter-media { display: none; }
.work-chapter-copy { max-width: 480px; padding: 40px 0; }
.work-chapter-num { color: var(--ac); }
.work-chapter-title {
  margin: 18px 0 18px; font-family: var(--hl-font); font-weight: var(--hl-weight); letter-spacing: var(--hl-track);
  font-size: clamp(32px, 3.4vw, 48px); line-height: 1.04;
}
.theme-solace .work-chapter-title { font-size: clamp(38px, 4vw, 56px); line-height: 1; }
.work-chapter-copy p { color: var(--text-2); font-size: 17px; margin: 0 0 24px; }
.work-tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.work-tags code {
  display: inline-flex; align-items: center; height: 30px; padding: 0 12px; border-radius: 8px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ac-3);
  background: rgba(var(--ac-rgb), 0.09); border: 1px solid rgba(var(--ac-rgb), 0.25);
}
.theme-solace .work-tags code { color: #c4b5fd; }

/* ==========================================================================
   Every-screen gallery
   ========================================================================== */
.work-gallery { padding-bottom: calc(var(--section) * 0.35); }
.work-gallery-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.work-gallery-head .work-section-head { margin-bottom: 48px; }
.work-arrows { display: flex; gap: 10px; margin-bottom: 52px; }
.work-arrow {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--stroke-2); background: var(--surface);
  cursor: pointer; font-size: 18px; transition: background 0.2s, opacity 0.2s, transform 0.2s var(--ease), border-color 0.2s;
}
.work-arrow:hover:not(:disabled) { background: var(--surface-2); border-color: rgba(var(--ac-rgb), 0.6); }
.work-arrow:active { transform: scale(0.94); }
.work-arrow:disabled { opacity: 0.3; cursor: default; }
.work-strip {
  --pad: max(var(--gutter), calc((100vw - var(--max)) / 2 + var(--gutter)));
  list-style: none; margin: 0; display: flex; gap: clamp(14px, 1.6vw, 22px);
  overflow-x: auto; overscroll-behavior-x: contain;
  padding: 20px var(--pad) 28px; scroll-padding-inline: var(--pad);
  scroll-snap-type: x mandatory; scrollbar-width: none; cursor: grab;
  -webkit-user-select: none; user-select: none;
}
.work-strip::-webkit-scrollbar { display: none; }
.work-strip.is-dragging { cursor: grabbing; scroll-snap-type: none; }
.work-strip.is-dragging .work-shot button { pointer-events: none; }
.work-strip:focus-visible { outline: 2px solid var(--ac); outline-offset: -2px; }
.work-shot { flex: 0 0 clamp(168px, 17vw, 232px); scroll-snap-align: start; }
.work-shot button {
  display: block; width: 100%; padding: 0; border: 0; background: none; cursor: zoom-in;
  border-radius: clamp(22px, 2.2vw, 30px); overflow: hidden; position: relative;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 24px 50px -24px rgba(0, 0, 0, 0.9);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.work-shot button::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; border-radius: inherit;
  background: linear-gradient(130deg, rgba(255, 255, 255, 0.1), transparent 35%);
}
.work-shot img { width: 100%; height: auto; pointer-events: none; -webkit-user-drag: none; }
.work-shot button:hover, .work-shot button:focus-visible {
  transform: translateY(-8px);
  box-shadow: 0 0 0 1px rgba(var(--ac-rgb), 0.55), 0 30px 60px -20px rgba(var(--ac-rgb), 0.5);
}
.work-shot button:focus-visible { outline: 2px solid var(--ac); outline-offset: 4px; }
.work-shot-cap { display: flex; gap: 10px; align-items: baseline; margin-top: 14px; font-size: 13px; color: var(--text-2); }
.work-shot-cap b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ac); }
.work-strip-progress { height: 2px; background: var(--stroke); border-radius: 2px; overflow: hidden; margin-top: 8px; }
.work-strip-progress span {
  display: block; height: 100%; width: 100%; background: var(--ac-grad);
  transform-origin: left; transform: scaleX(var(--p, 0.15)); transition: transform 0.15s linear;
}

/* Lightbox */
.work-lightbox {
  position: fixed; inset: 0; z-index: 200; display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: 16px; padding: 24px clamp(12px, 3vw, 40px);
  background: rgba(4, 4, 8, 0.86); backdrop-filter: blur(24px) saturate(140%); -webkit-backdrop-filter: blur(24px) saturate(140%);
  animation: work-fade 0.3s var(--ease);
}
.work-lightbox[hidden] { display: none; }
@keyframes work-fade { from { opacity: 0; } }
.work-lb-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 16px; min-width: 0; }
.work-lb-img {
  max-height: calc(100svh - 120px); width: auto; max-width: 100%; height: auto;
  border-radius: clamp(28px, 3vw, 44px);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 40px 120px -20px rgba(var(--ac-rgb), 0.45);
  animation: work-pop 0.4s var(--ease);
}
@keyframes work-pop { from { opacity: 0; transform: scale(0.96); } }
.work-lb-figure figcaption { font-size: 14px; color: var(--text-2); }
.work-lb-count { font-family: var(--mono); font-weight: 500; color: var(--ac); margin-right: 6px; }
.work-lb-nav, .work-lb-close {
  width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--stroke-2);
  background: rgba(255, 255, 255, 0.06); cursor: pointer; font-size: 18px; transition: background 0.2s;
}
.work-lb-nav:hover, .work-lb-close:hover { background: rgba(255, 255, 255, 0.14); }
.work-lb-close { position: absolute; top: 18px; right: 18px; z-index: 2; }
.work-lightbox button:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }

/* ==========================================================================
   Under the hood (bento)
   ========================================================================== */
.work-bento { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.work-bento-card { padding: clamp(22px, 2.4vw, 32px); display: flex; flex-direction: column; gap: 22px; min-width: 0; }
.work-bento-card.w2 { grid-column: span 2; }
.work-bento-card.w3 { grid-column: span 3; }
.work-bento-card.w4 { grid-column: span 4; }
.work-bento-card.w6 { grid-column: span 6; }
.work-bento-card::after { /* corner accent glow */
  content: ""; position: absolute; width: 260px; height: 260px; right: -110px; top: -130px; border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--ac-rgb), 0.22), transparent 70%); pointer-events: none;
}
.work-bento-head .eyebrow { color: var(--ac); }
.work-bento-head .h3 { margin: 14px 0 10px; font-size: clamp(22px, 2vw, 28px); }
.theme-solace .work-bento-head .h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(26px, 2.4vw, 34px); letter-spacing: -0.02em; }
.work-bento-head p { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.55; }
.work-bento-split { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); align-items: center; gap: clamp(22px, 4vw, 48px); }

.work-code {
  position: relative; margin-top: auto; border-radius: 16px; overflow: hidden; min-width: 0;
  background: rgba(0, 0, 0, 0.45); border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}
.work-code-bar {
  display: flex; align-items: center; gap: 6px; padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06); background: rgba(255, 255, 255, 0.025);
}
.work-code-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, 0.14); }
.work-code-bar span { margin-left: 8px; font-family: var(--mono); font-size: 11.5px; color: var(--text-3); }
.work-code pre {
  margin: 0; padding: 16px 18px 18px; overflow-x: auto; font-family: var(--mono);
  font-size: 12.5px; line-height: 1.7; color: #e6e6eb; tab-size: 4; scrollbar-width: thin;
}
/* Xcode "Default (Dark)"-inspired tokens */
.tk-k { color: #ff7ab2; font-weight: 500; }
.tk-t { color: #dabaff; }
.tk-s { color: #ff8170; }
.tk-c { color: #7f8c98; font-style: italic; }
.tk-n { color: #d9c97c; }
.tk-a { color: #fd8f3f; }
.tk-f { color: #67b7a4; }
.tk-m { color: #78c2b3; }

/* Bento visuals */
.work-bento-card > .work-tabbar, .work-bento-card > .work-states, .work-bento-card > .work-roll, .work-bento-card > .work-orb { align-self: center; margin: auto 0; }
.work-bento-card.w2 .work-code pre { font-size: 11.5px; padding: 14px 14px 16px; }
.work-states { display: flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 500; }
.work-states span { height: 40px; padding: 0 18px; border-radius: 12px; display: grid; place-items: center; }
.work-states .s1 { background: #fff; color: #000; }
.work-states .s2 { width: 64px; padding: 0; background: rgba(255, 255, 255, 0.1); }
.work-states .s2 em { width: 18px; height: 18px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); border-top-color: #fff; animation: work-spin 0.9s linear infinite; }
.work-states .s3 { color: #4ade80; border: 1.5px solid rgba(74, 222, 128, 0.7); background: rgba(74, 222, 128, 0.1); box-shadow: 0 0 24px -4px rgba(74, 222, 128, 0.5); }
.work-states i { font-style: normal; color: var(--text-3); }
@keyframes work-spin { to { transform: rotate(360deg); } }
.work-tabbar {
  display: flex; gap: 4px; padding: 6px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke); font-size: 12px;
}
.work-tabbar span { position: relative; padding: 6px 12px; border-radius: 999px; color: var(--text-3); }
.work-tabbar span.on { background: rgba(var(--ac-rgb), 0.22); color: #fff; }
.work-tabbar b {
  position: absolute; top: -4px; right: -2px; min-width: 16px; height: 16px; border-radius: 8px; padding: 0 4px;
  background: var(--ac); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
}
.work-aurora {
  height: 120px; border-radius: 16px; position: relative; overflow: hidden;
  background:
    radial-gradient(60% 90% at 20% 30%, #7c3aed, transparent 70%),
    radial-gradient(60% 90% at 80% 70%, #14b8a6, transparent 70%),
    radial-gradient(50% 80% at 55% 20%, #db2777, transparent 70%),
    #0c0a2a;
  background-size: 160% 160%; animation: work-aurora 14s ease-in-out infinite alternate;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}
@keyframes work-aurora { 0% { background-position: 0% 0%; } 100% { background-position: 100% 100%; } }
.work-roll { display: flex; align-items: baseline; gap: 8px; }
.work-roll span { font-family: var(--serif); font-size: 64px; line-height: 1; background: var(--ac-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.work-roll small { color: var(--text-3); font-size: 13px; }
.work-orb { height: 140px; display: grid; place-items: center; position: relative; }
.work-orb i {
  width: 96px; height: 96px; border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff 0%, #c4b5fd 18%, #7c3aed 52%, #134e4a 100%);
  box-shadow: 0 0 60px rgba(167, 139, 250, 0.6), 0 0 0 18px rgba(167, 139, 250, 0.07), 0 0 0 38px rgba(94, 234, 212, 0.04);
  animation: work-breathe 16s ease-in-out infinite;
}
@keyframes work-breathe { /* box breathing: 4 in · 4 hold · 4 out · 4 hold */
  0% { transform: scale(0.62); } 25%, 50% { transform: scale(1); } 75%, 100% { transform: scale(0.62); }
}

/* Automated capture card */
.work-capture {
  display: grid; grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); gap: clamp(24px, 4vw, 56px); align-items: center;
  background:
    radial-gradient(80% 120% at 0% 0%, rgba(var(--ac-rgb), 0.14), transparent 60%),
    var(--surface);
  border-color: rgba(var(--ac-rgb), 0.25);
}
.work-capture-copy .eyebrow { color: var(--ac); }
.work-capture-copy .h3 { margin: 14px 0 14px; font-size: clamp(26px, 2.6vw, 36px); }
.theme-solace .work-capture-copy .h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(30px, 3vw, 42px); }
.work-capture-copy .h3 .serif { background: var(--ac-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.work-capture-copy > p { color: var(--text-2); font-size: 15.5px; margin: 0 0 22px; }
.work-pipeline { list-style: none; margin: 0 0 22px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.work-pipeline li {
  display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px;
  background: rgba(255, 255, 255, 0.035); border: 1px solid var(--stroke); font-size: 13.5px; line-height: 1.4;
}
.work-pipeline b { font-family: var(--mono); font-weight: 500; font-size: 11px; color: var(--ac); padding-top: 2px; }
.work-pipeline code, .work-capture-out code { font-family: var(--mono); font-size: 12px; color: var(--ac-3); }
.work-capture-out { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 14px; color: var(--text); }
.work-capture-code { display: flex; flex-direction: column; gap: 12px; min-width: 0; }

/* ==========================================================================
   Full demo player
   ========================================================================== */
.work-demo { overflow: hidden; padding-top: calc(var(--section) * 0.6); }
.work-demo-stage { position: relative; display: flex; flex-direction: column; align-items: center; }
.work-demo-glow {
  position: absolute; width: min(900px, 120vw); aspect-ratio: 1.3; top: 0%; left: 50%; transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(var(--ac-rgb), 0.4), rgba(var(--ac2-rgb), 0.12) 55%, transparent);
  filter: blur(30px); pointer-events: none;
}
.work-demo-phone { --w: min(380px, 78vw); z-index: 1; }
.work-demo-video { background: #000; }
.work-demo-big {
  position: absolute; left: 50%; top: 50%; width: 84px; height: 84px; margin: -42px 0 0 -42px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.3); cursor: pointer; display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.16); backdrop-filter: blur(16px) saturate(160%); -webkit-backdrop-filter: blur(16px) saturate(160%);
  box-shadow: 0 20px 50px -10px rgba(0, 0, 0, 0.6), 0 0 0 10px rgba(255, 255, 255, 0.05);
  transition: transform 0.3s var(--ease), opacity 0.3s, background 0.2s; z-index: 2;
}
.work-demo-big svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
.work-demo-big:hover { transform: scale(1.06); background: rgba(255, 255, 255, 0.24); }
.work-demo-stage.is-playing .work-demo-big { opacity: 0; transform: scale(0.8); pointer-events: none; }
.work-demo-controls {
  position: relative; z-index: 1; display: flex; align-items: center; gap: 14px; margin-top: 28px;
  width: min(440px, 100%); padding: 8px 18px 8px 8px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.06); border: 1px solid var(--stroke-2);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
}
.work-demo-toggle {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer; display: grid; place-items: center;
  background: var(--text); color: #000;
}
.work-demo-toggle svg { width: 18px; height: 18px; fill: currentColor; }
.work-demo-toggle .i-pause, .is-playing .work-demo-toggle .i-play { display: none; }
.is-playing .work-demo-toggle .i-pause { display: block; }
.work-demo-track {
  flex: 1; height: 6px; border-radius: 6px; background: rgba(255, 255, 255, 0.12); cursor: pointer; position: relative;
}
.work-demo-track::before { content: ""; position: absolute; inset: -10px 0; } /* bigger hit area */
.work-demo-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0; border-radius: inherit; background: var(--ac-grad);
  box-shadow: 0 0 12px rgba(var(--ac-rgb), 0.7);
}
.work-demo-track:focus-visible, .work-demo-toggle:focus-visible, .work-demo-big:focus-visible { outline: 2px solid var(--ac); outline-offset: 3px; }
.work-demo-time { font-family: var(--mono); font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.work-demo-note { margin: 14px 0 0; font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-3); }

/* ==========================================================================
   Next project
   ========================================================================== */
.work-next { padding-top: 0; }
.work-next-card {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 32px;
  padding: clamp(32px, 5vw, 64px); min-height: 340px; isolation: isolate;
  transition: border-color 0.4s, transform 0.5s var(--ease);
}
.work-next-hirely { background: radial-gradient(80% 140% at 85% 50%, rgba(245, 26, 46, 0.32), transparent 65%), #0b0607; }
.work-next-solace { background: radial-gradient(80% 140% at 85% 40%, rgba(124, 92, 245, 0.42), transparent 60%), radial-gradient(60% 90% at 95% 100%, rgba(20, 184, 166, 0.3), transparent 60%), #0a0920; }
.work-next-card:hover { border-color: var(--stroke-2); transform: translateY(-4px); }
.work-next-copy .eyebrow { color: var(--text-2); }
.work-next-name {
  display: flex; align-items: center; gap: 18px; margin: 16px 0 12px;
  font-size: clamp(56px, 9vw, 120px); font-weight: 600; letter-spacing: -0.05em; line-height: 0.95;
}
.work-next-hirely .work-next-name { text-transform: uppercase; font-weight: 700; letter-spacing: -0.055em; color: #ff2a3d; }
.work-next-solace .work-next-name { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: -0.03em; background: linear-gradient(110deg, #c4b5fd, #5eead4); -webkit-background-clip: text; background-clip: text; color: transparent; }
.work-next-name .arrow { font-family: var(--font); font-style: normal; font-size: 0.45em; color: var(--text); transition: transform 0.35s var(--ease); -webkit-text-fill-color: var(--text); }
.work-next-card:hover .work-next-name .arrow { transform: translateX(10px); }
.work-next-copy p { margin: 0; font-size: clamp(18px, 1.8vw, 24px); color: var(--text-2); max-width: 520px; line-height: 1.35; }
.work-next-copy p .serif { color: var(--text); }
.work-next-visual { position: relative; width: 260px; height: 300px; }
.work-next-poster {
  position: absolute; right: 0; top: -10px; width: 170px; border-radius: 26px; transform: rotate(6deg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 30px 60px -20px rgba(0, 0, 0, 0.9);
  transition: transform 0.6s var(--ease);
}
.work-next-icon {
  position: absolute; left: 0; bottom: 10px; width: 112px; border-radius: 25px; z-index: 1;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 24px 50px -12px rgba(0, 0, 0, 0.9);
  transition: transform 0.6s var(--ease);
}
.work-next-card:hover .work-next-poster { transform: rotate(2deg) translateY(-6px); }
.work-next-card:hover .work-next-icon { transform: translateY(-8px) rotate(-4deg); }
.work-next-links { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 32px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1100px) {
  .work-bento-card.w2 { grid-column: span 3; }
  .work-bento-card.w4 { grid-column: span 6; }
  .work-rail { display: none; }
}
@media (max-width: 960px) {
  .work-hero { min-height: 0; }
  .work-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .work-hero-copy { text-align: center; display: flex; flex-direction: column; align-items: center; }
  .work-icon { margin-bottom: 44px; }
  .work-meta { margin-left: auto; margin-right: auto; text-align: left; }
  .work-cta { justify-content: center; }
  .work-hero-stage { height: 620px; }
  .work-stats-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .work-stat { padding: 26px 18px; }
  .work-stat:nth-child(4) { border-left: 0; }
  .work-stat:nth-child(n+4) { border-top: 1px solid var(--stroke); }

  /* Tour degrades to stacked chapters, each with its own phone */
  .work-tour-grid { grid-template-columns: minmax(0, 1fr); }
  .work-tour-pin { display: none; }
  .work-chapter {
    min-height: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 36px; align-items: center;
    padding: 36px 0; border-top: 1px solid var(--stroke);
  }
  .work-tour.is-live .work-chapter:not(.is-active) { opacity: 1; }
  .work-chapter-media { display: block; position: relative; }
  .work-chapter-media::before {
    content: ""; position: absolute; inset: 5% -20%; border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--ac-rgb), 0.3), transparent 70%); filter: blur(30px);
  }
  .work-chapter-media .iphone { --w: 220px; }
  .work-chapter-copy { padding: 0; }
  .work-capture, .work-bento-split { grid-template-columns: minmax(0, 1fr); }
  .work-bento-card.w3 { grid-column: span 6; }
  .work-next-card { grid-template-columns: minmax(0, 1fr); }
  .work-next-visual { display: none; }
}
@media (max-width: 640px) {
  .work-hero { padding-top: 104px; }
  .work-back { margin-bottom: 28px; }
  .work-icon { width: 80px; height: 80px; margin-bottom: 40px; }
  .work-meta { grid-template-columns: 1fr 1fr; width: 100%; }
  .work-meta div:nth-child(3) { grid-column: 1 / -1; border-left: 0; padding-left: 0; border-top: 1px solid var(--stroke); }
  .work-cta { width: 100%; flex-direction: column; }
  .work-cta .btn { width: 100%; }
  .work-hero-stage { height: 560px; margin: 0 calc(var(--gutter) * -1); }
  .work-hero-phone .iphone { --w: 236px; }
  .work-orbit { width: 112px; }
  .work-orbit-1 { left: 2%; } .work-orbit-2 { left: 4%; } .work-orbit-3 { right: 2%; } .work-orbit-4 { right: 4%; }
  .work-stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .work-stat:nth-child(n) { border-left: 0; border-top: 1px solid var(--stroke); }
  .work-stat:nth-child(-n+2) { border-top: 0; }
  .work-stat:nth-child(even) { border-left: 1px solid var(--stroke); }
  .work-stat:last-child { grid-column: 1 / -1; border-left: 0; }
  .work-chapter { grid-template-columns: minmax(0, 1fr); gap: 28px; padding: 48px 0; }
  .work-chapter-media { justify-self: center; }
  .work-chapter-media .iphone { --w: 240px; }
  .work-gallery-head { display: block; }
  .work-arrows { display: none; }
  .work-gallery-head .work-section-head { margin-bottom: 28px; }
  .work-shot { flex-basis: 64vw; }
  .work-bento { grid-template-columns: minmax(0, 1fr); }
  .work-bento-card.w2, .work-bento-card.w3, .work-bento-card.w4, .work-bento-card.w6 { grid-column: auto; }
  .work-pipeline { grid-template-columns: minmax(0, 1fr); }
  .work-code pre { font-size: 11.5px; }
  .work-lightbox { grid-template-columns: minmax(0, 1fr); padding: 64px 16px 16px; }
  .work-lb-nav { position: absolute; bottom: 20px; z-index: 2; }
  .work-lb-prev { left: 20px; } .work-lb-next { right: 20px; }
  .work-lb-img { max-height: calc(100svh - 170px); }
  .work-lb-figure { padding-bottom: 60px; }
}

/* ---------- Static screenshots & reduced motion ---------- */
/* ?static (headless screenshots): the sticky tour can't animate, so lay the
   chapters out as alternating phone + copy rows instead of an empty column. */
@media (min-width: 961px) {
  .static .work-tour-grid { grid-template-columns: minmax(0, 1fr); }
  .static .work-tour-pin { display: none; }
  .static .work-chapter {
    min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 96px);
    align-items: center; padding: 56px 0;
  }
  .static .work-chapter + .work-chapter { border-top: 1px solid var(--stroke); }
  .static .work-chapter-media { display: flex; justify-content: center; position: relative; }
  .static .work-chapter-media::before {
    content: ""; position: absolute; inset: 5% 10%; border-radius: 50%;
    background: radial-gradient(circle, rgba(var(--ac-rgb), 0.32), transparent 70%); filter: blur(40px);
  }
  .static .work-chapter-media .iphone { --w: 260px; }
  .static .work-chapter:nth-child(even) .work-chapter-media { order: 2; }
}
.static .work-orbit-card, .static .work-hero-bg span { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .work-orbit-card, .work-hero-bg span, .work-aurora, .work-orb i { animation: none !important; }
  .work-orbit { transform: none !important; }
  .work-hero-phone { transform: none !important; }
  .work-tour-screen > img { transform: none; filter: none; }
}

/* Solace hypnogram visual (bento) */
.work-hypno { position: relative; height: 120px; margin: auto 0; }
.work-hypno em {
  display: block; height: 25%; font-style: normal; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); line-height: 30px; border-top: 1px dashed rgba(255, 255, 255, 0.07);
}
.work-hypno-track { position: absolute; inset: 0 0 0 52px; }
.work-hypno span { position: absolute; height: 10px; margin-top: 10px; border-radius: 5px; }
.work-hypno .l0 { top: 0; background: #f9a8d4; }
.work-hypno .l1 { top: 25%; background: #5eead4; box-shadow: 0 0 12px rgba(94, 234, 212, 0.5); }
.work-hypno .l2 { top: 50%; background: #818cf8; }
.work-hypno .l3 { top: 75%; background: #a78bfa; box-shadow: 0 0 12px rgba(167, 139, 250, 0.6); }
