/* fx-story.css: owned by the story page builder (work, about, contact, 404).
   Every rule is scoped under a page body class. Hidden pre-states only exist
   under classes fx-story.js adds once it knows frames are running (.st-arm),
   and the script always releases them on a timer, so nothing real can stay hidden. */

.page-work, .page-about, .page-contact, .page-404 {
  /* Fallbacks so this file still works before (or without) Global's fx.css tokens. */
  --st-thrust: var(--ease-thrust, cubic-bezier(.16, 1, .3, 1));
  --st-orbit: var(--ease-orbit, cubic-bezier(.45, 0, .55, 1));
  --st-dock: var(--ease-dock, cubic-bezier(.34, 1.56, .64, 1));
  --st-t2: var(--t-2, 220ms);
  --st-t3: var(--t-3, 380ms);
  --st-t4: var(--t-4, 600ms);
  --st-t6: var(--t-6, 1400ms);
  --st-sweep: var(--fx-sweep, linear-gradient(115deg, transparent 40%, rgba(255, 170, 240, .28) 50%, transparent 60%));
}

/* ---------- Instrument slot (fallback grid; Global may define the same) ---------- */
.page-work .hero-instrument, .page-about .hero-instrument, .page-contact .hero-instrument { display: none; }
@media (min-width: 960px) {
  .page-work .hero-split, .page-about .hero-split, .page-contact .hero-split {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
    gap: 3rem;
    align-items: center;
  }
  .page-about .hero-instrument, .page-contact .hero-instrument {
    display: block;
    justify-self: end;
    width: 100%;
    max-width: 440px;
    contain: layout paint;
  }
}

/* =====================================================================
   WORK: Mission Log board
   ===================================================================== */
@media (min-width: 720px) and (max-width: 959.98px) {
  .page-work .hero-instrument.board { display: block; max-width: 520px; margin-top: 2rem; }
}
@media (min-width: 960px) {
  .page-work .hero-instrument.board { display: block; justify-self: end; width: 100%; max-width: 440px; contain: layout paint; }
}
.page-work .hero-instrument.board, .page-about .hero-instrument.homebase, .page-contact .hero-instrument.phone { aspect-ratio: auto; }
.page-work .board {
  position: relative;
  overflow: hidden;
  padding: 1rem 1rem .6rem;
  background: linear-gradient(180deg, rgba(31, 26, 42, .92), rgba(18, 15, 26, .92));
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px -30px rgba(207, 76, 228, .45), inset 0 1px 0 rgba(255, 255, 255, .06);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-variant-numeric: tabular-nums;
}
.page-work .board-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 .35rem .75rem;
  color: var(--violet);
  font-weight: 700;
}
.page-work .board-head small { color: var(--dim); font-size: 12px; font-weight: 500; letter-spacing: .12em; }
.page-work .board-rows { display: grid; gap: 1px; background: var(--line); border-radius: 10px; overflow: hidden; }
.page-work .board-row {
  display: grid;
  grid-template-columns: 2.1em minmax(0, 1fr) auto;
  gap: .75rem;
  align-items: center;
  padding: .48rem .7rem;
  background: #120f1a;
}
.page-work .board-row .n { color: var(--dim); }
.page-work .board-row .w { min-width: 0; }
.page-work .board-row .t, .page-work .board-row .h { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.page-work .board-row .t { color: var(--text); font-weight: 700; }
.page-work .board-row .h { margin-top: 1px; color: var(--muted); font-size: 12px; letter-spacing: .06em; text-transform: none; font-family: var(--font); }
.page-work .board-row .live {
  display: inline-flex;
  align-items: center;
  gap: .4em;
  padding: .2em .55em;
  color: var(--ok);
  font-size: 12px;
  font-weight: 700;
  border: 1px solid rgba(110, 231, 168, .3);
  border-radius: 999px;
}
.page-work .board-row .live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 6px rgba(110, 231, 168, .6); }
.page-work .board::after {
  content: "";
  position: absolute;
  inset: -40% 0;
  background: linear-gradient(180deg, transparent 40%, rgba(255, 170, 240, .14) 50%, transparent 60%);
  transform: translate3d(0, -100%, 0);
  pointer-events: none;
}
/* Armed by JS once frames run; released by .st-go (in view, or the 2.5s failsafe). */
.page-work .board.st-arm .board-row { opacity: 0; transform: translate3d(0, 8px, 0); }
.page-work .board.st-go .board-row {
  opacity: 1;
  transform: none;
  transition: opacity var(--st-t4) var(--st-thrust), transform var(--st-t4) var(--st-thrust);
  transition-delay: calc(var(--i, 0) * 110ms);
}
.page-work .board.st-go::after { animation: st-board-sweep var(--st-t6) var(--st-orbit) 200ms 1 both; }
.page-work .board.st-go .live i { animation: st-pulse-once 900ms var(--st-orbit) 1100ms 1; }
@keyframes st-board-sweep { from { transform: translate3d(0, -100%, 0); } to { transform: translate3d(0, 100%, 0); } }
@keyframes st-pulse-once { 0%, 100% { transform: none; box-shadow: 0 0 6px rgba(110, 231, 168, .6); } 45% { transform: scale(1.7); box-shadow: 0 0 0 5px rgba(110, 231, 168, .18); } }

/* ---------- Browser-framed thumbs ---------- */
.page-work .work-thumb { position: relative; padding-top: 34px; overflow: hidden; }
.page-work .work-thumb .chrome {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 26px;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  background: rgba(12, 10, 18, .55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.page-work .work-thumb .chrome i { flex: none; width: 7px; height: 7px; border-radius: 50%; background: rgba(255, 255, 255, .22); }
.page-work .work-thumb .chrome i:first-child { background: #ef5ba8; }
.page-work .work-thumb .chrome i:nth-child(2) { background: #cf4ce4; }
.page-work .work-thumb .chrome i:nth-child(3) { background: #ab7bff; }
.page-work .work-thumb .chrome b {
  position: relative;
  min-width: 0;
  max-width: 70%;
  margin: 0 auto;
  padding: 2px 10px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font: 500 11px/1.3 var(--font);
  background: rgba(255, 255, 255, .07);
  border-radius: 999px;
}
.page-work .work-thumb .chrome::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.fx-calm) .page-work .work-thumb .chrome::after { transition: transform var(--st-t3) var(--st-thrust); }
  html:not(.fx-calm) .page-work .work-thumb:hover .chrome::after,
  html:not(.fx-calm) .page-work .work-thumb:focus-visible .chrome::after { transform: scaleX(1); transition-duration: var(--st-t4); }
}
@media (min-width: 960px) {
  .page-work .work-grid > :last-child:nth-child(3n+1) { grid-column: 2; }
}

/* =====================================================================
   ABOUT: ground crew
   ===================================================================== */
.page-about .owners-photo { position: relative; }
.page-about .st-photo { position: relative; display: block; overflow: hidden; }
.page-about .st-photo img { display: block; transform: translate3d(0, var(--st-py, 0px), 0) scale(var(--st-ps, 1)); will-change: auto; }
.page-about .owners-photo.st-develop img { filter: grayscale(1) brightness(1.15); }
.page-about .owners-photo.st-develop.st-dev-done img { filter: none; transition: filter var(--st-t6) var(--st-thrust); }
.page-about .st-photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--st-sweep);
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
  pointer-events: none;
}
.page-about .owners-photo.st-dev-done .st-photo::after { animation: st-photo-sweep var(--st-t6) var(--st-orbit) 300ms 1; }
@keyframes st-photo-sweep { 0% { opacity: 1; background-position: 120% 0; } 100% { opacity: 1; background-position: -20% 0; } }
/* viewfinder corners (local version of FX.brackets) */
.page-about .st-tick {
  position: absolute;
  z-index: 1;
  width: 22px;
  height: 22px;
  border: 0 solid rgba(245, 242, 249, .85);
  pointer-events: none;
}
.page-about .st-tick.tl { top: 12px; left: 12px; border-top-width: 2px; border-left-width: 2px; border-top-left-radius: 6px; }
.page-about .st-tick.tr { top: 12px; right: 12px; border-top-width: 2px; border-right-width: 2px; border-top-right-radius: 6px; }
.page-about .st-tick.bl { bottom: 12px; left: 12px; border-bottom-width: 2px; border-left-width: 2px; border-bottom-left-radius: 6px; }
.page-about .st-tick.br { bottom: 12px; right: 12px; border-bottom-width: 2px; border-right-width: 2px; border-bottom-right-radius: 6px; }
.page-about .owners-photo.st-arm .st-tick { opacity: 0; transform: scale(1.6); }
.page-about .owners-photo.st-dev-done .st-tick { opacity: 1; transform: none; transition: opacity var(--st-t4) var(--st-dock), transform var(--st-t4) var(--st-dock); }
.page-about .coords {
  display: block;
  min-height: 1.4em;
  padding: .85rem 1rem 0;
  color: var(--dim);
  font: 500 11px/1.4 var(--font-display);
  letter-spacing: .14em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: clip;
}
.page-about .owners-photo figcaption { padding-top: .35rem; }
.page-about .coords.st-typing::after { content: "▍"; margin-left: 2px; color: var(--violet); }

/* home-base pin instrument */
.page-about .homebase svg { display: block; width: 100%; height: auto; overflow: visible; }
.page-about .homebase .rip { transform-box: fill-box; transform-origin: center; opacity: 0; }
.page-about .homebase .rip.static { opacity: .35; }
html:not(.fx-calm) .page-about .homebase.st-run .rip { animation: st-ripple 2.4s linear infinite; }
html:not(.fx-calm) .page-about .homebase.st-run .rip:nth-of-type(2) { animation-delay: .8s; }
html:not(.fx-calm) .page-about .homebase.st-run .rip:nth-of-type(3) { animation-delay: 1.6s; }
.page-about .homebase.st-paused .rip { animation-play-state: paused; }
@keyframes st-ripple { 0% { transform: scale(.25); opacity: .7; } 100% { transform: scale(1); opacity: 0; } }

/* checklist ticks dock in */
.page-about .callout .checklist.st-arm li::before { opacity: 0; transform: scale(.3); }
.page-about .callout .checklist.st-go li::before {
  opacity: 1;
  transform: none;
  transition: opacity var(--st-t4) var(--st-dock), transform var(--st-t4) var(--st-dock);
  transition-delay: calc(var(--i, 0) * 80ms);
}
.page-about .checklist li { --i: 0; }
.page-about .checklist li:nth-child(2) { --i: 1; }
.page-about .checklist li:nth-child(3) { --i: 2; }
.page-about .checklist li:nth-child(4) { --i: 3; }
.page-about .checklist li:nth-child(5) { --i: 4; }
.page-about .checklist li:nth-child(6) { --i: 5; }

/* SVG icons that replaced the emoji */

/* =====================================================================
   CONTACT: comms open
   ===================================================================== */
.page-contact .phone { display: none; }
@media (min-width: 960px) {
  .page-contact .hero-instrument.phone { display: grid; place-items: center; max-width: 360px; padding: 20px 0; }
}
.page-contact .ph {
  position: relative;
  width: 260px;
  height: 480px;
  padding: 12px;
  background: linear-gradient(160deg, #241d31, #120f1a 60%);
  border: 1px solid var(--line-2);
  border-radius: 36px;
  box-shadow: 0 40px 80px -40px rgba(207, 76, 228, .5), inset 0 0 0 4px #0c0a12, inset 0 1px 0 rgba(255, 255, 255, .08);
}
.page-contact .ph-screen {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #0e0b15;
  border-radius: 26px;
}
.page-contact .ph-notch { position: absolute; top: 8px; left: 50%; width: 76px; height: 20px; margin-left: -38px; background: #000; border-radius: 999px; z-index: 2; }
.page-contact .ph-head {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 38px 12px 12px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.page-contact .ph-head img { width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); padding: 3px; }
.page-contact .ph-head b { color: var(--text); font: 600 12px/1.2 var(--font); }
.page-contact .ph-body { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; padding: 12px; }
.page-contact .ph-day { align-self: center; margin-bottom: auto; padding-top: 4px; color: var(--dim); font: 500 10px/1 var(--font); letter-spacing: .06em; }
.page-contact .ph-bubble {
  align-self: flex-end;
  max-width: 88%;
  min-height: 2.2em;
  padding: 8px 11px;
  color: var(--ink);
  background: var(--grad);
  border-radius: 16px 16px 4px 16px;
  font: 500 12.5px/1.4 var(--font);
}
.page-contact .ph-meta { align-self: flex-end; color: var(--dim); font: 500 10px/1 var(--font); }
.page-contact .ph-meta.st-wait, .page-contact .ph-dots.st-wait { visibility: hidden; }
.page-contact .ph-dots { align-self: flex-start; display: inline-flex; gap: 4px; padding: 9px 12px; background: var(--surface-2); border-radius: 14px 14px 14px 4px; }
.page-contact .ph-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; }
html:not(.fx-calm) .page-contact .ph-dots.st-loop i { animation: st-dot 1.2s var(--st-orbit) 3; }
html:not(.fx-calm) .page-contact .ph-dots.st-loop i:nth-child(2) { animation-delay: .15s; }
html:not(.fx-calm) .page-contact .ph-dots.st-loop i:nth-child(3) { animation-delay: .3s; }
@keyframes st-dot { 0%, 100% { transform: none; opacity: .4; } 40% { transform: translate3d(0, -3px, 0); opacity: 1; } }
.page-contact .ph-input { margin: 0 12px 14px; padding: 8px 12px; color: var(--dim); font: 500 11px/1 var(--font); border: 1px solid var(--line-2); border-radius: 999px; }
.page-contact .ph-bubble.st-typing::after { content: ""; display: inline-block; width: 1px; height: 1em; margin-left: 1px; vertical-align: -2px; background: var(--ink); }

/* plan chip target lock (script.js adds .is-picked from ?plan=) */
.page-contact .is-picked.st-lock { position: relative; }
.page-contact .txt-chips a.is-picked { box-shadow: 0 0 0 3px var(--violet-line), 0 0 22px -4px rgba(207, 76, 228, .55); }
.page-contact .txt-opt.is-picked { box-shadow: 0 0 0 3px var(--violet-line), 0 0 26px -8px rgba(207, 76, 228, .55); }
html:not(.fx-calm) .page-contact .txt-chips a.is-picked.st-lock { animation: st-lock-chip 700ms var(--st-dock) 300ms 1 both; }
html:not(.fx-calm) .page-contact .txt-opt.is-picked.st-lock { animation: st-lock-row 700ms var(--st-dock) 300ms 1 both; }
@keyframes st-lock-chip {
  from { transform: scale(1.12); box-shadow: 0 0 0 10px transparent, 0 0 0 0 transparent; }
  to { transform: none; box-shadow: 0 0 0 3px var(--violet-line), 0 0 22px -4px rgba(207, 76, 228, .55); }
}
@keyframes st-lock-row {
  from { transform: scale(1.03); box-shadow: 0 0 0 10px transparent, 0 0 0 0 transparent; }
  to { transform: none; box-shadow: 0 0 0 3px var(--violet-line), 0 0 26px -8px rgba(207, 76, 228, .55); }
}
.page-contact .text-card { overflow: clip; overflow-clip-margin: 14px; }

html:not(.fx-calm) .page-contact .ico.st-ring svg { animation: st-ring 200ms var(--st-orbit) 3; transform-origin: 50% 60%; }
html:not(.fx-calm) .page-contact .ico.st-lift svg { animation: st-lift var(--st-t4) var(--st-thrust) 1; }
@keyframes st-ring { 0%, 100% { transform: none; } 25% { transform: rotate(12deg); } 75% { transform: rotate(-12deg); } }
@keyframes st-lift { 0%, 100% { transform: none; } 45% { transform: translate3d(0, -4px, 0); } }

/* =====================================================================
   404: lost in space
   ===================================================================== */
.page-404 .err { position: relative; overflow: hidden; isolation: isolate; }
.page-404 .err-code {
  display: inline-flex;
  gap: .04em;
  padding: .1em .2em;
  color: var(--violet);
  font-size: clamp(5rem, 3.5rem + 7vw, 8.5rem);
  letter-spacing: -.02em;
}
.page-404 .st-d { position: relative; isolation: isolate; display: inline-block; --amp: 8px; --rot: 4deg; }
.page-404 .st-g {
  display: inline-block;
  color: transparent;
  background: var(--grad);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
}
.page-404 .st-d:nth-child(1) .st-g { background-position: 0 0; }
.page-404 .st-d:nth-child(2) .st-g { background-position: 50% 0; }
.page-404 .st-d:nth-child(3) .st-g { background-position: 100% 0; }
@supports not ((-webkit-background-clip: text) or (background-clip: text)) { .page-404 .st-g { color: var(--violet); background: none; } }
.page-404 .st-ring { position: absolute; left: 50%; top: 50%; width: 205%; height: 32%; transform: translate(-50%, -42%) rotate(-18deg); pointer-events: none; overflow: visible; max-width: none; }
.page-404 .st-ring.back { z-index: -1; }
.page-404 .st-ring.front { z-index: 1; }
.page-404 .st-ring ellipse, .page-404 .st-ring path { fill: none; stroke: #eea4f9; stroke-width: 2.2; vector-effect: non-scaling-stroke; }
.page-404 .st-ring.back ellipse { opacity: .5; }
.page-404 .st-star {
  position: absolute;
  z-index: -1;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f5f2f9;
  box-shadow: 0 0 6px rgba(239, 91, 168, .6);
  opacity: .55;
  pointer-events: none;
}
.page-404 .st-ret { width: 1em; height: 1em; margin-left: .45em; vertical-align: -.12em; overflow: visible; }
.page-404 .st-ret path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
  html:not(.fx-calm) .page-404 .st-ret path { stroke-dasharray: 40; stroke-dashoffset: 0; opacity: .7; transition: opacity var(--st-t3) var(--st-thrust); }
  html:not(.fx-calm) .page-404 a:hover .st-ret path, html:not(.fx-calm) .page-404 a:focus-visible .st-ret path { opacity: 1; animation: st-draw var(--st-t3) var(--st-thrust) 1; }
}
@keyframes st-draw { from { stroke-dashoffset: 40; } to { stroke-dashoffset: 0; } }
@media (max-width: 719.98px) { .page-404 .st-d { --amp: 4px; --rot: 2deg; } }
@media (prefers-reduced-motion: no-preference) {
  html:not(.fx-calm) .page-404 .st-d { animation: st-drift 7s var(--st-orbit) infinite alternate; }
  html:not(.fx-calm) .page-404 .st-d:nth-child(2) { animation-duration: 9s; animation-delay: -3s; }
  html:not(.fx-calm) .page-404 .st-d:nth-child(3) { animation-duration: 8s; animation-delay: -5s; }
  html:not(.fx-calm) .page-404 .st-star { animation: st-twinkle var(--loop-pulse, 3.2s) var(--st-orbit) infinite; }
}
@keyframes st-drift { from { transform: translate3d(0, calc(var(--amp) * -1), 0) rotate(calc(var(--rot) * -1)); } to { transform: translate3d(0, var(--amp), 0) rotate(var(--rot)); } }
@keyframes st-twinkle { 0%, 100% { opacity: .2; } 50% { opacity: .85; } }

/* ---------- Reduced motion: everything final and still ---------- */
@media (prefers-reduced-motion: reduce) {
  .page-work *, .page-about *, .page-contact *, .page-404 * { animation: none !important; }
  .page-work .board-row, .page-about .st-tick, .page-about .checklist li::before { opacity: 1 !important; transform: none !important; }
  .page-about .owners-photo img { filter: none !important; transform: none !important; }
}
html.fx-calm .page-work *, html.fx-calm .page-about *, html.fx-calm .page-contact *, html.fx-calm .page-404 * { animation: none !important; }
html.fx-calm .page-about .owners-photo img { filter: none !important; transform: none !important; }
html.fx-calm .page-about .homebase .rip { opacity: .3; }
@media (prefers-reduced-motion: reduce) { .page-about .homebase .rip { opacity: .3; } }
