/* HarborSOC · The Watch (Act 1 prototype) */
:root {
  --bg: #0a0a0b; --text: #f5f5f4; --dim: #b8b8be; --faint: #75757e;
  --a: #ff7a2f; --w: #ffbe5c; --r: #ff4d5e; --g: #46f5a0; --line: rgba(205,205,215,.16);
  --ease: cubic-bezier(.2,.8,.2,1);
  --font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, monospace;
}
* { box-sizing: border-box; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.locked { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
.mono { font-family: var(--mono); }

#gl { position: fixed; inset: 0; width: 100vw; height: 100vh; display: block; z-index: 0; }
.space { height: 1100vh; }
.flash { position: fixed; inset: 0; z-index: 3; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fffaf0 0%, #ffe0b0 35%, #ffa25a 70%, #ff7a2f 100%); }
.rings { position: fixed; inset: -20%; z-index: 2; pointer-events: none; opacity: 0;
  background: repeating-radial-gradient(circle at 50% 50%, rgba(255,214,150,0) 0 18px, rgba(255,214,150,.55) 20px, rgba(255,214,150,0) 24px 46px);
  mix-blend-mode: screen; }

/* ---------- gate ---------- */
.gate { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; }
.gate-band { position: absolute; left: 0; right: 0; height: 50%; background: var(--bg); z-index: -1; transition: transform 1.4s cubic-bezier(.76,0,.24,1); }
.gate-band.top { top: 0; } .gate-band.bottom { bottom: 0; }
.gate.open .gate-band.top { transform: translateY(-100%); }
.gate.open .gate-band.bottom { transform: translateY(100%); }
.gate-inner { text-align: center; display: grid; justify-items: center; gap: 16px; transition: opacity .6s; }
.gate.open .gate-inner { opacity: 0; pointer-events: none; }
.gate.done { display: none; }
.gate-word { margin: 0; font-size: clamp(2rem, 7vw, 4rem); letter-spacing: .34em; padding-left: .34em; font-weight: 500; }
.gate-sub { margin: 0; color: var(--faint); font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; }
.gate-btn { position: relative; margin-top: 18px; padding: 16px 30px; background: none; border: 0; color: var(--a); font-size: .82rem; letter-spacing: .22em; text-transform: uppercase; opacity: 0; transform: translateY(8px); transition: opacity .8s var(--ease), transform .8s var(--ease), color .3s; }
.gate-btn:not([disabled]) { opacity: 1; transform: none; }
.gate-btn:hover { color: #fff; }
.gate-btn .br { position: absolute; width: 12px; height: 12px; border: 1.5px solid var(--a); transition: transform .5s var(--ease); }
.gate-btn .tl { left: 0; top: 0; border-right: 0; border-bottom: 0; } .gate-btn .tr { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.gate-btn .bl { left: 0; bottom: 0; border-right: 0; border-top: 0; } .gate-btn .br2 { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.gate-btn[disabled] .tl { transform: translate(-14px, -14px); } .gate-btn[disabled] .tr { transform: translate(14px, -14px); }
.gate-btn[disabled] .bl { transform: translate(-14px, 14px); } .gate-btn[disabled] .br2 { transform: translate(14px, 14px); }
.gate-btn:hover .tl { transform: translate(-4px, -4px); } .gate-btn:hover .tr { transform: translate(4px, -4px); }
.gate-btn:hover .bl { transform: translate(-4px, 4px); } .gate-btn:hover .br2 { transform: translate(4px, 4px); }
.gate-hint { margin: 4px 0 0; color: var(--faint); font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; }

/* ---------- HUD ---------- */
.hud-top { position: fixed; top: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-between; align-items: center; padding: 22px 32px; pointer-events: none; opacity: 0; transition: opacity 1s; }
body.started .hud-top, body.started .hud-bottom, body.started .coords { opacity: 1; }
.hud-top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.12rem; letter-spacing: -.02em; }
.brand svg { width: 28px; height: 28px; color: var(--a); }
.brand .lamp { fill: var(--w); }
.brand b { color: var(--a); }
.shot { font-size: .74rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); display: flex; gap: 10px; }
.shot #shot-n { color: var(--a); } .shot .sep { color: var(--faint); }
.hud-right { display: flex; gap: 18px; align-items: center; }
.sound { display: flex; align-items: center; gap: 10px; background: none; border: 0; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.eq { display: flex; gap: 2px; align-items: flex-end; height: 12px; }
.eq i { width: 2px; height: 3px; background: currentColor; }
.sound[aria-pressed="true"] { color: var(--text); }
.sound[aria-pressed="true"] .eq i { background: var(--a); animation: eq 1s ease-in-out infinite; }
.sound[aria-pressed="true"] .eq i:nth-child(2) { animation-delay: .25s; } .sound[aria-pressed="true"] .eq i:nth-child(3) { animation-delay: .5s; } .sound[aria-pressed="true"] .eq i:nth-child(4) { animation-delay: .1s; }
@keyframes eq { 50% { height: 12px; } }
.skip { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 8px 14px; }
.skip:hover { color: var(--a); border-color: var(--a); }

.coords { position: fixed; top: 74px; right: 32px; z-index: 20; display: flex; align-items: center; gap: 10px; font-size: .72rem; letter-spacing: .14em; color: var(--dim); opacity: 0; transition: opacity 1s; }
.coords .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--g); box-shadow: 0 0 10px var(--g); animation: blink 1.6s infinite; }
@keyframes blink { 50% { opacity: .3; } }

.hud-bottom { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0 32px 22px; pointer-events: none; opacity: 0; transition: opacity 1s; }
.cue { display: flex; align-items: center; gap: 12px; font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-bottom: 14px; transition: opacity .6s; }
.cue.hide { opacity: 0; }
.mouse { width: 18px; height: 28px; border: 1.5px solid currentColor; border-radius: 10px; display: grid; justify-items: center; padding-top: 5px; }
.mouse i { width: 2px; height: 6px; border-radius: 2px; background: var(--a); animation: wheel 1.6s ease-in-out infinite; }
@keyframes wheel { 0% { transform: none; opacity: 1; } 70% { transform: translateY(8px); opacity: 0; } 100% { opacity: 0; } }
.bar { height: 1px; background: rgba(255,255,255,.12); }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--a), var(--w)); box-shadow: 0 0 10px var(--a); }

/* ---------- story lines ---------- */
.lines { position: fixed; inset: 0; z-index: 10; pointer-events: none; }
.line { position: absolute; left: clamp(20px, 7vw, 120px); top: 50%; transform: translateY(-50%); width: min(620px, calc(100vw - 40px)); visibility: hidden; }
.line.on { visibility: visible; }
.line .eyebrow { margin: 0 0 18px; font-size: .74rem; letter-spacing: .2em; text-transform: uppercase; color: var(--a); display: flex; align-items: center; gap: 12px; }
.line .eyebrow::before { content: ""; width: 0; height: 1px; background: currentColor; transition: width .8s var(--ease) .1s; }
.line.on .eyebrow::before { width: 40px; }
.line h2 { margin: 0 0 18px; font-size: clamp(2.4rem, 5.6vw, 4.8rem); line-height: .98; letter-spacing: -.045em; font-weight: 600; text-shadow: 0 6px 50px rgba(0,0,0,.7); }
.line h2 .row { display: block; }
.line h2 .accent { color: var(--a); }
.line.threat .eyebrow, .line.threat .accent { color: var(--r); }
.line .body { margin: 0; max-width: 46ch; font-size: clamp(1rem, 1.35vw, 1.15rem); line-height: 1.6; color: var(--dim); text-shadow: 0 2px 24px rgba(0,0,0,.9); }
.line .ch { display: inline-block; white-space: pre; }
.line .eyebrow, .line .body { opacity: 0; transform: translateY(14px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.line.on .eyebrow { opacity: 1; transform: none; transition-delay: .05s; }
.line.on .body { opacity: 1; transform: none; transition-delay: .45s; }

/* ---------- threat markers ---------- */
.markers { position: fixed; inset: 0; z-index: 8; pointer-events: none; }
.mk { position: absolute; left: 0; top: 0; width: 0; height: 0; opacity: 0; }
.mk .box { position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; transition: transform .45s var(--ease); }
.mk .box i { position: absolute; width: 8px; height: 8px; border: 1.5px solid var(--r); transition: border-color .4s; }
.mk .box i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; } .mk .box i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; }
.mk .box i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; } .mk .box i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; }
.mk .core { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; background: var(--r); box-shadow: 0 0 14px var(--r), 0 0 30px rgba(255,77,94,.6); transition: background .4s, box-shadow .4s; }
.mk .tag { position: absolute; left: 24px; top: -10px; white-space: nowrap; font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: #ffb0b7; text-shadow: 0 1px 8px #000; }
.mk .tag small { display: block; color: var(--faint); font-size: .58rem; letter-spacing: .12em; margin-top: 3px; }
.mk .ping { position: absolute; left: -4px; top: -4px; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--a); opacity: 0; }
.mk.spotted .box i { border-color: var(--a); }
.mk.spotted .core { background: var(--a); box-shadow: 0 0 16px var(--a), 0 0 34px rgba(255,122,47,.7); }
.mk.spotted .tag { color: var(--w); }
.mk.spotted .ping { animation: ping 1.1s var(--ease) 2; }
@keyframes ping { 0% { transform: scale(1); opacity: 1; } 100% { transform: scale(7); opacity: 0; } }

/* ---------- counter ---------- */
.counter { position: fixed; left: 32px; bottom: 64px; z-index: 12; opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .8s var(--ease); pointer-events: none; }
.counter.on { opacity: 1; transform: none; }
.counter p { margin: 0; font-size: .66rem; letter-spacing: .18em; text-transform: uppercase; color: var(--faint); }
.counter b { display: block; font-size: 2.4rem; font-weight: 500; letter-spacing: -.02em; color: var(--text); margin: 4px 0; }
.counter .sub { color: var(--w); }

/* ---------- endcard ---------- */
.endcard { position: fixed; left: 50%; bottom: 80px; transform: translate(-50%, 20px); z-index: 30; width: min(620px, calc(100vw - 32px)); padding: 26px 28px; border-radius: 20px; background: rgba(12,12,14,.82); border: 1px solid var(--line); backdrop-filter: blur(14px); opacity: 0; pointer-events: none; transition: opacity .8s var(--ease), transform .8s var(--ease); }
.endcard.on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.endcard .eyebrow { margin: 0 0 8px; color: var(--a); font-size: .72rem; letter-spacing: .18em; text-transform: uppercase; }
.endcard h3 { margin: 0 0 18px; font-size: 1.35rem; letter-spacing: -.02em; line-height: 1.3; }
.end-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { border: 1px solid var(--line); background: rgba(255,255,255,.03); border-radius: 999px; padding: 12px 20px; font-weight: 600; font-size: .92rem; }
.btn.primary { background: var(--a); border-color: var(--a); color: #1f0b00; }

@media (max-width: 760px) {
  .hud-top { padding: 16px; } .shot { display: none; } .sound #sound-label { display: none; }
  .coords { top: 64px; right: 16px; font-size: .62rem; }
  .line { top: auto; bottom: 120px; transform: none; }
  .counter { left: 16px; bottom: 40px; } .counter b { font-size: 1.8rem; }
  .hud-bottom { padding: 0 16px 14px; }
}
/* ---------- text entrances (data-fx) ---------- */
/* readable over the photo without blocking the beam: shadows only, no panel */
.line h2 { text-shadow: 0 2px 4px rgba(0,0,0,.55), 0 8px 50px rgba(0,0,0,.75); }
.line .body { text-shadow: 0 1px 3px rgba(0,0,0,.9), 0 2px 24px rgba(0,0,0,.95); }

/* type: characters appear left to right with a caret */
.line[data-fx="type"] .ch { visibility: hidden; }
.line[data-fx="type"] .ch.vis { visibility: visible; }
.caret { display: inline-block; width: .08em; height: .82em; margin-left: .04em; vertical-align: -.06em; background: var(--r); box-shadow: 0 0 14px var(--r); animation: caret .8s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.line[data-fx="type"] .body { opacity: 1; transform: none; clip-path: inset(0 100% 0 0); transition: clip-path 1.6s cubic-bezier(.4,0,.2,1) .9s; }
.line[data-fx="type"].on .body { clip-path: inset(0 0 0 0); }

/* wipe: each row is revealed left to right by a moving bar of light */
.line[data-fx="wipe"] h2 .row { position: relative; width: fit-content; clip-path: inset(0 100% 0 0); }
.line[data-fx="wipe"].on h2 .row { animation: wipeRow 1.1s cubic-bezier(.65,0,.35,1) forwards; }
.line[data-fx="wipe"].on h2 .row:nth-child(2) { animation-delay: .35s; }
@keyframes wipeRow { to { clip-path: inset(0 0 0 0); } }
.line[data-fx="wipe"] h2 .row::after { content: ""; position: absolute; top: -10%; bottom: -10%; width: 10px; left: 0; background: #fff4e0; box-shadow: 0 0 24px 8px rgba(255,190,92,.9), 0 0 60px 20px rgba(255,122,47,.5); opacity: 0; }
.line[data-fx="wipe"].on h2 .row::after { animation: wipeBar 1.1s cubic-bezier(.65,0,.35,1) forwards; }
.line[data-fx="wipe"].on h2 .row:nth-child(2)::after { animation-delay: .35s; }
@keyframes wipeBar { 0% { left: 0; opacity: 1; } 92% { opacity: 1; } 100% { left: 100%; opacity: 0; } }

/* slide: words fly in from the left out of a blur */
.line[data-fx="slide"] .wd { display: inline-block; opacity: 0; transform: translateX(-70px); filter: blur(10px); transition: opacity .9s var(--ease), transform 1.1s var(--ease), filter .9s var(--ease); transition-delay: calc(var(--i) * 90ms); }
.line[data-fx="slide"].on .wd { opacity: 1; transform: none; filter: none; }

/* ---------- midnight interstitial ---------- */
.midnight { position: fixed; inset: 0; z-index: 11; display: grid; place-content: center; text-align: center; pointer-events: none; opacity: 0; visibility: hidden; }
.midnight.on { visibility: visible; }
.mid-label { margin: 0 0 10px; font-size: .74rem; letter-spacing: .24em; text-transform: uppercase; color: var(--faint); }
.mid-clock { font-size: clamp(4rem, 13vw, 11rem); font-weight: 500; letter-spacing: -.04em; line-height: 1; color: var(--text); text-shadow: 0 0 60px rgba(255,122,47,.35); font-variant-numeric: tabular-nums; }
.mid-clock.zero { color: var(--a); }
.mid-sub { margin: 18px 0 0; font-size: clamp(1.05rem, 1.6vw, 1.35rem); color: var(--dim); opacity: 0; transform: translateY(10px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.mid-sub span { color: var(--a); }
.midnight.zero .mid-sub { opacity: 1; transform: none; }

/* ---------- intercepted phishing email ---------- */
.email { position: fixed; left: 0; top: 0; z-index: 9; width: 330px; padding: 14px 16px; border-radius: 14px; background: rgba(14,14,17,.78); border: 1px solid rgba(255,77,94,.45); backdrop-filter: blur(10px); box-shadow: 0 20px 60px -20px rgba(0,0,0,.9), 0 0 40px -10px rgba(255,77,94,.35); opacity: 0; pointer-events: none; transform-origin: 0 50%; }
.email::before { content: ""; position: absolute; left: -46px; top: 50%; width: 46px; height: 1px; background: linear-gradient(90deg, transparent, var(--r)); }
.email-head { display: flex; justify-content: space-between; align-items: center; font-size: .62rem; letter-spacing: .12em; text-transform: uppercase; color: var(--faint); margin-bottom: 10px; }
.email .pill { color: #1f0306; background: var(--r); padding: 3px 8px; border-radius: 99px; font-weight: 600; }
.email-row { display: grid; grid-template-columns: 58px 1fr; gap: 8px; font-size: .7rem; padding: 4px 0; border-bottom: 1px solid rgba(255,255,255,.06); color: var(--dim); }
.email-row b { color: var(--faint); font-weight: 500; text-transform: uppercase; letter-spacing: .1em; font-size: .6rem; padding-top: 1px; }
.email-row mark { background: rgba(255,77,94,.25); color: #ffb0b7; border-bottom: 1px solid var(--r); padding: 0 1px; }
.email-body { font-size: .8rem; line-height: 1.5; color: var(--text); margin: 10px 0; }
.email-foot { font-size: .6rem; letter-spacing: .1em; text-transform: uppercase; color: #ffb0b7; display: flex; align-items: center; gap: 8px; }
.dotr { width: 6px; height: 6px; border-radius: 50%; background: var(--r); box-shadow: 0 0 10px var(--r); animation: blink 1s infinite; }
.email > * { opacity: 0; transform: translateX(-10px); transition: opacity .4s var(--ease), transform .4s var(--ease); }
.email.on > * { opacity: 1; transform: none; }
.email.on > *:nth-child(2) { transition-delay: .25s; } .email.on > *:nth-child(3) { transition-delay: .45s; } .email.on > *:nth-child(4) { transition-delay: .65s; } .email.on > *:nth-child(5) { transition-delay: .95s; } .email.on > *:nth-child(6) { transition-delay: 1.4s; }

/* ---------- radar ---------- */
.radar { position: fixed; right: 32px; bottom: 60px; z-index: 12; width: 180px; text-align: center; opacity: 0; transform: scale(.85) translateY(14px); transition: opacity .9s var(--ease), transform .9s var(--ease); pointer-events: none; }
.radar.on { opacity: 1; transform: none; }
.radar canvas { width: 180px; height: 180px; display: block; }
.radar-label { margin: 8px 0 0; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.radar-label span { color: var(--w); }

@media (max-width: 760px) {
  .email { width: 260px; }
  .radar { right: 12px; bottom: 120px; width: 120px; } .radar canvas { width: 120px; height: 120px; }
}
