/* Open To Work — $SINS · stage/UI styles */
:root {
  --green: #2f6f3a;
  --green-hi: #3f8a4b;
  --ink: #1d2226;
  --stamp: #c8102e;
  --paper: #fbf8ef;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; overflow: clip; background: #bdb9ad; }
body { font-family: Inter, system-ui, sans-serif; color: var(--ink); }

/* ---------- stage ---------- */
/* the whole scene stays hidden until the loader finishes (bg first, then UI) */
#stage { position: fixed; top: 0; left: 0; width: 2560px; height: 1024px; transform-origin: 0 0; visibility: hidden; }
body.stage-on #stage { visibility: visible; }
#bg { position: absolute; inset: 0; background: url(../assets/bg.webp) 0 0 / 2560px 1024px no-repeat; }
#safe { position: absolute; left: 512px; top: 160px; width: 1536px; height: 864px; }

/* in-scene UI stays hidden until the scene is revealed */
#tv, .callout, .card { opacity: 0; transition: opacity .3s ease; }
body.ready #tv, body.ready .callout, body.ready .card { opacity: 1; }

/* ---------- loading screen styles live in index.html as critical CSS ---------- */

/* ---------- NOW SERVING display ---------- */
#tv {
  position: absolute; left: 293px; top: 139px; width: 91px; height: 57px;
  background: #050807; color: #ff3b2f; font-family: VT323, monospace;
  text-align: center; line-height: 1; text-shadow: 0 0 6px #ff3b2f;
  pointer-events: none; overflow: hidden;
}
#tv small { display: block; font-size: 10px; letter-spacing: 1px; margin-top: 5px; color: #ffb199; }
#tv b { font-size: 38px; font-weight: 400; }
#tv.blink b { animation: blink3 .6s steps(1) 1; }
@keyframes blink3 {
  0%, 16% { opacity: 0; } 8%, 24% { opacity: 1; }
  32% { opacity: 0; } 40% { opacity: 1; }
  48% { opacity: 0; } 56%, 100% { opacity: 1; }
}

/* ---------- character layers ---------- */
.char {
  position: absolute; inset: 0; width: 1536px; height: 864px;
  pointer-events: none; transform-origin: 768px 864px;
  animation: breathe 4s ease-in-out infinite;
  opacity: 0; transition: opacity .3s ease;
}
.layer { position: absolute; inset: 0; width: 1536px; height: 864px; display: block; }
body.ready #char1 { opacity: 1; }
body.ready #char2 { opacity: 0; }
body.m2-on #char1 { opacity: 0; transition: opacity .12s linear; }
body.m2-on #char2 { opacity: 1; transition: opacity .12s linear; }
@keyframes breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.006); } }

/* ---------- vacancy slips ---------- */
#slips { position: absolute; inset: 0; }
.slip {
  position: absolute; left: 0; top: 0; width: 210px; height: 140px;
  background: var(--paper); box-shadow: 0 6px 16px rgba(0,0,0,.28);
  font-family: 'Courier Prime', monospace; font-size: 12px;
  padding: 11px 14px 58px;              /* bottom 58px is reserved for the stamp */
  transform-origin: 50% 50%; will-change: transform; pointer-events: none;
}
.slip::before {
  content: ""; position: absolute; left: 50%; top: -6px; width: 14px; height: 14px;
  margin-left: -7px; border-radius: 50%; background: #d23;
  box-shadow: 0 2px 3px rgba(0,0,0,.4);
}
.slip .k { font-size: 10px; letter-spacing: 2px; line-height: 1.1; color: #777; }
.slip .j {
  font-family: 'Courier Prime', monospace; font-weight: 700; font-size: 24px;
  line-height: 1.05; margin: 3px 0 2px;
  text-transform: uppercase; white-space: nowrap;
}
.slip .s {
  font-size: 12px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.stamp {
  position: absolute; right: 8px; bottom: 8px; transform-origin: 100% 100%;
  border: 3px solid var(--stamp); color: var(--stamp); border-radius: 6px;
  font-family: 'Black Ops One', cursive; font-size: 15px; line-height: 1;
  padding: 4px 6px; text-align: center;
  mix-blend-mode: multiply; opacity: 0;
}
.stamp::after {
  content: ""; position: absolute; inset: 0; mix-blend-mode: multiply; opacity: .18;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='80' height='80'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2'/><feColorMatrix type='saturate' values='0'/></filter><rect width='80' height='80' filter='url(%23n)'/></svg>");
  background-size: 80px 80px;
}

/* ---------- badge ---------- */
#badge {
  position: absolute; inset: 0; width: 1536px; height: 864px;
  overflow: visible; pointer-events: none; opacity: 0; transition: opacity .3s ease;
  /* fade the band start along the arc: 0 at the arc start (215deg screen = 305deg conic, 10 o'clock),
     ramping to 1 about 45deg further counter-clockwise (toward 9 o'clock); rest of the circle opaque.
     The wrap point sits at 305deg (transparent both sides), so there is no seam. */
  -webkit-mask-image: conic-gradient(from 305deg at 768px 470px,
    transparent 0deg, transparent 45deg, #000 165deg, #000 315deg, transparent 360deg);
  mask-image: conic-gradient(from 305deg at 768px 470px,
    transparent 0deg, transparent 45deg, #000 165deg, #000 315deg, transparent 360deg);
}
body.ready #badge { opacity: 1; }
#badgeInner { transform-box: view-box; transform-origin: 768px 470px; transition: transform .12s ease; }
#band { stroke: var(--band, var(--green)); animation: badgePulse 2.4s ease-in-out infinite; }
#band.glow { animation: badgeGlow 2s ease-in-out; }
#sheen {
  stroke-dasharray: 90 2000; opacity: 0; pointer-events: none;
  animation: sheen 4s linear infinite; animation-delay: 2.8s;
}
#badge text {
  font-family: Inter, sans-serif; font-weight: 900; font-size: 40px;
  fill: #fff; letter-spacing: 5px; pointer-events: none;
}
#hit { pointer-events: stroke; cursor: pointer; }
#badge.hover { --band: var(--green-hi); }
#badge.hover #badgeInner { transform: scale(1.02); }
#badge.press #badgeInner { transform: scale(.97); transition: transform 80ms ease; }
#badge:focus { outline: none; }
#badge:focus-visible #band { stroke: #4ea45d; }
#badge:focus-visible #band { filter: drop-shadow(0 0 26px rgba(47,111,58,1)); }
@keyframes badgePulse {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(47,111,58,.35)); }
  50% { filter: drop-shadow(0 0 26px rgba(47,111,58,.85)); }
}
@keyframes badgeGlow {
  0%, 100% { filter: drop-shadow(0 0 18px rgba(47,111,58,.6)); }
  50% { filter: drop-shadow(0 0 46px rgba(47,111,58,1)); }
}
@keyframes sheen {
  0% { stroke-dashoffset: var(--sheen-from, -228); opacity: 0; }
  4% { opacity: .28; }
  30% { stroke-dashoffset: var(--sheen-to, -897); opacity: .28; }
  31% { opacity: 0; }
  100% { stroke-dashoffset: var(--sheen-to, -897); opacity: 0; }
}

/* ---------- reaction bubble ---------- */
.bubble {
  position: absolute; left: 1010px; top: 250px; max-width: 300px;
  background: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: 15px; font-weight: 700; box-shadow: 0 8px 22px rgba(0,0,0,.22);
  opacity: 0; transform: translateY(6px) scale(.96);
  transition: opacity .12s ease, transform .12s ease; pointer-events: none;
}
.bubble.show { opacity: 1; transform: none; }
.bubble::after {
  content: ""; position: absolute; left: -10px; top: 24px;
  border: 8px solid transparent; border-right: 12px solid #fff;
}

/* ---------- CTA callout ---------- */
.callout {
  position: absolute; left: 170px; top: 690px; width: 250px; background: #fff;
  border-radius: 10px; padding: 12px 14px; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: 15px; font-weight: 700; animation: bob 2s ease-in-out infinite;
}
.callout em { display: block; font-style: normal; font-weight: 500; font-size: 12px; color: #5e6a70; margin-top: 4px; }
.callout::after {
  content: ""; position: absolute; right: -12px; top: 22px;
  border: 8px solid transparent; border-left: 12px solid #fff;
}
@keyframes bob { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(6px); } }

/* ---------- applicant card ---------- */
.card {
  position: absolute; left: 1095px; top: 600px; width: 360px; background: #fff;
  border-radius: 10px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: 13px;
}
.card .top { background: linear-gradient(90deg, #a0b4b7, #cfd9d4); height: 26px; }
.card .body { padding: 10px 14px 12px; }
.card h3 { font-size: 17px; }
.card .head { color: #5e6a70; font-size: 12px; margin: 2px 0 8px; }
.card .row { display: flex; justify-content: space-between; border-top: 1px solid #e6e9eb; padding: 5px 0; }
.card .row b { font-weight: 900; }
.card .open { color: var(--green); font-weight: 900; }

/* ---------- fx ---------- */
#flash {
  position: absolute; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(circle at 768px 420px, rgba(255,255,255,.85), rgba(255,255,255,0) 62%);
}
#flash.on { animation: flash .25s ease-out 1; }
@keyframes flash { 0% { opacity: .6; } 100% { opacity: 0; } }
/* full-viewport FX layer: above the stage, below header (5) / ticker (5) */
#fx { position: fixed; inset: 0; width: 100vw; height: 100vh; pointer-events: none; z-index: 3; }

/* ---------- impacts ---------- */
#safe.shake { animation: shake .18s ease-in-out; }
@keyframes shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(4px, -3px); }
  60% { transform: translate(-3px, -2px); }
  80% { transform: translate(3px, 2px); }
}
.slip.pinned::before { animation: pinpop .12s ease-out; }
@keyframes pinpop { from { transform: scale(1.3); } to { transform: scale(1); } }

/* ---------- header ---------- */
header {
  position: fixed; left: 0; right: 0; top: 0; height: 64px; display: flex;
  align-items: center; justify-content: space-between; padding: 0 28px; z-index: 5;
}
.logo { display: flex; align-items: center; gap: 12px; font-weight: 900; font-size: 22px; }
.logo .ring { width: 34px; height: 34px; display: block; }
.tick { background: var(--green); color: #fff; border-radius: 999px; padding: 3px 10px; font-size: 14px; }
nav { display: flex; gap: 10px; align-items: center; }
nav a, nav button {
  font: 700 13px Inter, sans-serif; color: var(--ink); background: rgba(255,255,255,.85);
  border: 1px solid rgba(0,0,0,.12); border-radius: 999px; padding: 8px 14px;
  text-decoration: none; cursor: pointer;
}
nav a:hover, nav button:hover { background: #fff; }
#muteBtn { min-width: 46px; text-align: center; }

/* ---------- ticker ---------- */
#ticker {
  position: fixed; left: 0; right: 0; bottom: 0; height: 34px; background: var(--ink);
  color: #fff; font-size: 13px; display: flex; align-items: center;
  white-space: nowrap; overflow: hidden; z-index: 5;
}
#ticker .track { display: flex; animation: marquee 40s linear infinite; will-change: transform; }
#ticker .group { padding-left: 28px; }
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .char { animation: none !important; }
  #band { animation: none !important; }
  #sheen { animation: none !important; opacity: 0 !important; }
  .callout { animation: none !important; }
  #ticker .track { animation-duration: 120s !important; }
  #flash.on { animation: none !important; }
  #tv.blink b { animation: none !important; }
}
