/* AGL Manager — Coming Soon. Night mode, brand tokens from AGL_UI_Handoff/02_Tokens.
   Performance rules: no backdrop-filter, no animated filters/box-shadows/gradients;
   continuous motion only via transform/opacity (compositor). */
@font-face { font-family: "Visby CF"; src: url("../fonts/VisbyCF-Medium.woff2") format("woff2"); font-weight: 400 500; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("../fonts/VisbyCF-DemiBold.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Visby CF"; src: url("../fonts/VisbyCF-Bold.woff2") format("woff2"); font-weight: 700; font-display: swap; }

:root {
  --navy: #2B2D42;
  --navy-950: #12131D;
  --navy-900: #181A28;
  --navy-800: #1E2030;
  --navy-700: #3A3D57;
  --amber: #F7941D;
  --apron: #ECEDF1;
  --slate: #A3A6B8;
  --blue: #5B82CC;
  --green: #1FA67A;
  --red: #C93A46;
  --font: "Visby CF", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --pad: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; background: var(--navy-900); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--navy-900);
  color: var(--apron);
  font-family: var(--font);
  font-weight: 500;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
::selection { background: var(--amber); color: var(--navy); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 4px; border-radius: 6px; }

/* ---------- top bar ---------- */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px var(--pad);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.topbar.is-scrolled { background: rgb(18 19 29 / .92); border-color: rgb(236 237 241 / .06); }
.brand img { display: block; height: 40px; width: auto; }
.topbar__meta { display: flex; align-items: center; gap: 14px; font-size: 13px; letter-spacing: .02em; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 14px 7px 12px; border-radius: 999px;
  background: rgb(247 148 29 / .08); border: 1px solid rgb(247 148 29 / .28); color: #FBC27F;
  font-weight: 600;
}
.dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--amber); }
.dot__ring { position: absolute; inset: 0; border-radius: 50%; background: var(--amber); opacity: 0; }
.utc { color: var(--slate); font-variant-numeric: tabular-nums; }
.utc span { color: var(--apron); }
.app-link {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px 8px 16px; border-radius: 999px;
  background: var(--apron); color: var(--navy);
  font-weight: 700; text-decoration: none; letter-spacing: .01em;
  transition: background-color .3s var(--ease), transform .3s var(--ease);
}
.app-link svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .3s var(--ease); }
.app-link:hover { background: var(--amber); }
.app-link:hover svg { transform: translateX(3px); }
.app-link:active { transform: scale(.97); }

/* ---------- hero + scene ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 110px var(--pad) 70px;
  background: var(--navy-950);
}
.hero > *:not(.scene):not(.hero__shade) { position: relative; z-index: 2; }

.scene { position: absolute; inset: 0; z-index: 0; overflow: hidden; contain: strict; }
.scene__glide {
  position: absolute; inset: -5%;
  transform-origin: 50% 63%;
  opacity: 0; transition: opacity 1.2s var(--ease);
}
.scene.is-on .scene__glide { opacity: 1; animation: approach 5.5s cubic-bezier(.25, .1, .2, 1) both; }
@keyframes approach { from { transform: scale(1.07) translateY(1.5%); } to { transform: none; } }
.scene__par { position: absolute; inset: 0; will-change: transform; }
.scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }

.hero__shade {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background:
    radial-gradient(52% 46% at 50% 46%, rgb(18 19 29 / .82) 0%, rgb(18 19 29 / .45) 58%, transparent 88%),
    linear-gradient(to bottom, rgb(18 19 29 / .6), transparent 22%, transparent 82%, var(--navy-900));
}

.symbol-wrap { width: clamp(104px, 18vh, 180px); aspect-ratio: 1; margin-bottom: clamp(20px, 3.5vh, 36px); }
.symbol-wrap::before {
  content: ""; position: absolute; inset: -45%; border-radius: 50%; z-index: -1;
  background: radial-gradient(closest-side, rgb(247 148 29 / .18), rgb(247 148 29 / .05) 55%, transparent 75%);
  opacity: 0; transition: opacity 1.6s var(--ease) .2s;
}
.is-lit .symbol-wrap::before { opacity: 1; }
.symbol { width: 100%; height: 100%; overflow: visible; display: block; }
.symbol .stroke { fill: none; stroke: var(--amber); stroke-width: .55; stroke-linecap: round; }
.symbol .lamp { fill: var(--amber); transform-box: fill-box; transform-origin: center; }
.symbol .halo { opacity: 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 12px;
  margin: 0 0 22px; font-size: 12.5px; font-weight: 600; letter-spacing: .22em; text-transform: uppercase; color: var(--slate);
}
.eyebrow .sep { width: 28px; height: 1px; background: linear-gradient(90deg, transparent, var(--amber), transparent); }

.headline {
  margin: 0; font-weight: 700; line-height: .98; letter-spacing: -.035em;
  font-size: clamp(44px, min(8.4vw, 12vh), 116px);
}
.headline .line { display: block; overflow: hidden; padding: .04em .06em .1em; }
.headline .accent .word {
  background: linear-gradient(100deg, #F7941D 0%, #FFB55C 42%, #FFD39C 50%, #FFB55C 58%, #F7941D 100%);
  background-size: 250% 100%; background-position: 100% 0;
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.is-ready .headline .accent .word { animation: sheen 2.6s var(--ease) 1.4s 1 both; }
@keyframes sheen { from { background-position: 100% 0; } to { background-position: 0 0; } }
.headline .word { display: inline-block; transform: translateY(105%) rotate(4deg); opacity: 0; }
.is-ready .headline .word {
  transform: none; opacity: 1;
  transition: transform 1.1s var(--ease), opacity .8s var(--ease);
  transition-delay: calc(var(--d) * 90ms);
}
.reveal { opacity: 0; transform: translateY(14px); }
.is-ready .reveal { opacity: 1; transform: none; transition: opacity .9s var(--ease), transform 1s var(--ease); transition-delay: calc(var(--d) * 90ms + 150ms); }

.lede { max-width: 620px; text-wrap: balance; margin: 28px auto 0; font-size: clamp(16px, 1.35vw, 19px); line-height: 1.6; color: #C6C8D4; text-shadow: 0 1px 14px rgb(12 13 20 / .9); }

.build { width: min(340px, 80vw); margin: 36px auto 0; }
.build__bar { position: relative; height: 2px; border-radius: 2px; background: rgb(236 237 241 / .1); overflow: hidden; }
.build__bar span {
  position: absolute; inset: 0 auto 0 0; width: 34%;
  background: linear-gradient(90deg, transparent, var(--amber), #FFD9A6);
  transform: translateX(-110%);
}
.build__label { text-shadow: 0 1px 10px rgb(12 13 20 / .9); display: flex; justify-content: space-between; margin-top: 12px; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--slate); }
.build__phase { color: var(--apron); transition: opacity .35s; }
.build__phase.is-swapping { opacity: 0; }

.scroll-cue {
  position: absolute !important; left: 50%; bottom: 22px; translate: -50% 0; display: inline-flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; letter-spacing: .14em; text-transform: uppercase; text-decoration: none; color: var(--slate);
}
.scroll-cue svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue:hover { color: var(--apron); }

@media (min-aspect-ratio: 1/1) {
  .hero { padding-bottom: clamp(150px, 27vh, 300px); padding-top: 96px; }
}
@media (max-aspect-ratio: 1/1) {
  .hero { padding-top: 84px; padding-bottom: clamp(130px, 21vh, 220px); }
  .symbol-wrap { width: clamp(96px, 15vh, 150px); }
}

/* ---------- marquee ---------- */
.marquee { position: relative; overflow: hidden; background: var(--navy-900); border-block: 1px solid rgb(236 237 241 / .07); }
.marquee::before, .marquee::after { content: ""; position: absolute; top: 0; bottom: 0; width: 12%; z-index: 1; pointer-events: none; }
.marquee::before { left: 0; background: linear-gradient(90deg, var(--navy-900), transparent); }
.marquee::after { right: 0; background: linear-gradient(-90deg, var(--navy-900), transparent); }
.marquee__track { display: flex; width: max-content; }
.marquee span {
  display: inline-flex; align-items: center; gap: 28px; padding: 18px 0 18px 28px;
  font-size: 14px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: #8E91A6; white-space: nowrap;
}
.marquee span::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 10px var(--amber); }

/* ---------- coming / bento ---------- */
.coming { max-width: 1160px; margin: 0 auto; padding: clamp(80px, 12vh, 140px) var(--pad) clamp(60px, 10vh, 120px); }
.section-head { margin-bottom: 44px; max-width: 780px; }
.kicker { margin: 0 0 14px; font-size: 12.5px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; color: var(--amber); }
.section-head h2 { margin: 0; font-size: clamp(30px, 4vw, 52px); line-height: 1.05; letter-spacing: -.03em; font-weight: 700; }

.bento { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.tile {
  --mx: 50%; --my: 50%;
  position: relative; overflow: hidden; isolation: isolate;
  padding: 28px; border-radius: 16px; min-height: 230px;
  background: linear-gradient(180deg, #252739, #1D1F2E);
  border: 1px solid rgb(236 237 241 / .07);
  transition: border-color .4s var(--ease), transform .6s var(--ease), opacity .8s var(--ease);
}
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0; transition: opacity .4s;
  background: radial-gradient(360px circle at var(--mx) var(--my), rgb(247 148 29 / .12), transparent 60%);
}
.tile:hover { border-color: rgb(247 148 29 / .28); }
.tile:hover::before { opacity: 1; }
.tile--wide { grid-column: span 2; display: grid; grid-template-columns: 1fr 1.1fr; gap: 24px; align-items: center; }
.tile h3 { margin: 18px 0 8px; font-size: 21px; letter-spacing: -.01em; font-weight: 700; }
.tile p { margin: 0; font-size: 15px; line-height: 1.55; color: #A9ACBD; max-width: 34ch; }
.ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; fill: none; stroke: var(--amber); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; background: rgb(247 148 29 / .1); border: 1px solid rgb(247 148 29 / .2); }

.js .tile.in-view { opacity: 0; transform: translateY(24px); }
.js .tile.in-view.is-visible { opacity: 1; transform: none; }

/* asset register: lamp status grid */
.lampgrid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 9px; padding: 6px; }
.lampgrid i { aspect-ratio: 1; border-radius: 50%; background: #3A3D57; transition: background-color .35s; }
.lampgrid i.ok { background: var(--amber); box-shadow: 0 0 8px rgb(247 148 29 / .55); }
.lampgrid i.green { background: var(--green); box-shadow: 0 0 8px rgb(31 166 122 / .55); }
.lampgrid i.blue { background: var(--blue); box-shadow: 0 0 8px rgb(91 130 204 / .55); }
.lampgrid i.fault { background: var(--red); box-shadow: 0 0 10px rgb(201 58 70 / .7); }

/* maintenance: PM cadence bars */
.pm { display: flex; align-items: flex-end; gap: 6px; height: 34px; margin-top: 22px; }
.pm i { position: relative; flex: 1; height: 100%; border-radius: 3px; background: rgb(236 237 241 / .08); overflow: hidden; }
.pm i::after {
  content: ""; position: absolute; inset: 0; border-radius: 3px; background: var(--amber);
  transform-origin: bottom; transform: scaleY(.3); opacity: .25;
}

/* ---------- footer ---------- */
.footer {
  display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  max-width: 1160px; margin: 0 auto; padding: 28px var(--pad) 40px;
  border-top: 1px solid rgb(236 237 241 / .07);
  font-size: 13px; color: #8E91A6;
}
.footer img { height: 30px; width: auto; display: block; }
.footer p { margin: 0; }
.footer__mail { color: var(--slate); letter-spacing: .02em; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .bento { grid-template-columns: 1fr 1fr; }
  .tile--wide { grid-column: span 2; }
}
@media (max-width: 620px) {
  .topbar { padding-block: 14px; }
  .brand img { height: 32px; }
  .utc, .status-pill { display: none; }
  .bento { grid-template-columns: 1fr; }
  .tile--wide { grid-column: auto; grid-template-columns: 1fr; }
  .tile { min-height: 0; }
  .lampgrid { gap: 7px; padding: 0; }
  .footer { flex-direction: column; text-align: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0s !important; }
  html { scroll-behavior: auto; }
}
