:root {
  color-scheme: dark;
  --ink: #07090b;
  --surface: #0e1316;
  --surface-2: #151c1f;
  --line: rgba(219, 237, 235, 0.14);
  --muted: #8c9a9b;
  --text: #edf4f2;
  --acid: #c9ff63;
  --acid-soft: rgba(201, 255, 99, 0.16);
  --coral: #ff5e62;
  --cyan: #54d6d0;
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.42);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background:
    radial-gradient(circle at 75% 12%, rgba(67, 119, 111, 0.18), transparent 32rem),
    linear-gradient(180deg, #090c0e 0%, #07090b 100%);
  overflow-x: hidden;
}

button, select, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.noise {
  position: fixed;
  inset: 0;
  opacity: 0.035;
  pointer-events: none;
  z-index: 100;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
}

.topbar {
  width: min(1440px, calc(100% - 48px));
  height: 84px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 12px; font-weight: 900; letter-spacing: -0.04em; }
.brand > span:last-child > span { color: var(--acid); }
.brand-mark { width: 30px; height: 30px; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; transform: skew(-8deg); }
.brand-mark i { display: block; background: var(--text); clip-path: polygon(0 0, 100% 0, 62% 100%, 0 100%); }
.brand-mark i:last-child { background: var(--acid); transform: rotate(180deg); }
.topbar nav { display: flex; align-items: center; gap: 30px; font-size: 0.78rem; font-weight: 750; letter-spacing: 0.09em; text-transform: uppercase; }
.topbar nav a { color: var(--muted); transition: color 180ms ease; }
.topbar nav a:hover { color: var(--text); }

.ghost-button, .primary-button, .text-button, .icon-button {
  border: 0;
  cursor: pointer;
}
.ghost-button {
  background: transparent;
  border: 1px solid rgba(237, 244, 242, 0.26);
  border-radius: 3px;
  padding: 12px 16px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.73rem;
  font-weight: 800;
  transition: border-color 180ms ease, background 180ms ease;
}
.ghost-button:hover { border-color: var(--acid); background: var(--acid-soft); }
.ghost-button.compact { padding: 11px 14px; color: var(--acid); }
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 2px;
  background: var(--acid);
  color: #11160f;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.76rem;
  font-weight: 900;
  box-shadow: 8px 8px 0 rgba(201, 255, 99, 0.1);
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.primary-button:hover { transform: translate(-2px, -2px); box-shadow: 11px 11px 0 rgba(201, 255, 99, 0.12); }
.text-button { background: transparent; color: var(--text); padding: 8px 0; font-size: 0.78rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; }
.text-button span { color: var(--acid); padding-left: 6px; }
.text-button.small { font-size: 0.68rem; margin-left: auto; color: var(--acid); }
.text-button.danger { color: var(--coral); text-align: left; }

.hero {
  width: min(1440px, calc(100% - 48px));
  min-height: 760px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  align-items: center;
  gap: 40px;
  border-left: 1px solid rgba(237, 244, 242, 0.05);
  border-right: 1px solid rgba(237, 244, 242, 0.05);
}

.hero-copy { padding: 80px clamp(8px, 5vw, 76px); position: relative; z-index: 2; }
.eyebrow { margin: 0 0 24px; color: #a9b6b4; font-size: 0.68rem; font-weight: 850; letter-spacing: 0.19em; text-transform: uppercase; display: flex; align-items: center; gap: 10px; }
.eyebrow span { display: inline-block; width: 24px; height: 2px; background: var(--acid); }
.hero h1, .section-heading h2, .method-copy h2 {
  margin: 0;
  text-transform: uppercase;
  font-weight: 950;
  letter-spacing: -0.065em;
  line-height: 0.86;
  font-stretch: condensed;
}
.hero h1 { font-size: clamp(4rem, 8.5vw, 8rem); }
.hero h1 em { color: transparent; -webkit-text-stroke: 1px rgba(237, 244, 242, 0.68); font-style: normal; }
.hero-lede { max-width: 590px; margin: 34px 0 32px; color: #aeb9b8; font-size: clamp(1rem, 1.45vw, 1.24rem); line-height: 1.7; }
.hero-actions { display: flex; align-items: center; gap: 28px; }
.hero-stats { display: flex; gap: clamp(28px, 4vw, 58px); margin: 58px 0 0; }
.hero-stats div { display: grid; gap: 4px; }
.hero-stats dt { font-size: 1.7rem; font-weight: 900; }
.hero-stats dd { margin: 0; color: var(--muted); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.12em; }

.hero-visual {
  min-height: 620px;
  height: calc(100% - 72px);
  margin-right: 28px;
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(rgba(201,255,99,0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201,255,99,0.045) 1px, transparent 1px),
    radial-gradient(circle at 50% 50%, rgba(75, 125, 116, 0.24), #0b1012 66%);
  background-size: 42px 42px, 42px 42px, 100% 100%;
  border: 1px solid rgba(237,244,242,.08);
  clip-path: polygon(6% 0, 100% 0, 100% 94%, 94% 100%, 0 100%, 0 6%);
}
.hero-visual::after { content: "LIVE TACTICAL PREVIEW"; position: absolute; top: 24px; right: 28px; color: var(--muted); font-size: .62rem; letter-spacing: .18em; }
.radar-ring { position: absolute; border: 1px solid rgba(201,255,99,.15); border-radius: 50%; left: 22%; top: 18%; }
.ring-one { width: 56%; aspect-ratio: 1; }
.ring-two { width: 38%; aspect-ratio: 1; left: 31%; top: 27%; }
.hero-cone { position: absolute; left: 48%; top: 44%; width: 54%; height: 24%; transform-origin: 0 50%; transform: rotate(-16deg); background: linear-gradient(90deg, rgba(201,255,99,.3), rgba(201,255,99,.015)); clip-path: polygon(0 48%, 100% 0, 100% 100%, 0 52%); }
.hero-agent { position: absolute; width: 32px; height: 32px; left: calc(48% - 16px); top: calc(44% + 12% - 16px); border: 2px solid var(--acid); border-radius: 50%; box-shadow: 0 0 28px rgba(201,255,99,.4); display: grid; place-items: center; }
.hero-agent span { width: 9px; height: 9px; background: var(--acid); border-radius: 50%; }
.hero-target { position: absolute; width: 34px; height: 34px; border: 1px solid rgba(255,94,98,.7); color: var(--coral); display: grid; place-items: center; font-size: .58rem; font-weight: 900; }
.target-one { right: 13%; top: 31%; }.target-two { right: 21%; top: 61%; }
.micro-label { position: absolute; color: var(--muted); font-size: .58rem; letter-spacing: .14em; line-height: 1.8; }
.micro-label b { color: var(--text); font-size: .73rem; }
.label-a { left: 8%; top: 24%; }.label-b { left: 14%; bottom: 18%; }
.hero-visual > p { position: absolute; right: 34px; bottom: 26px; margin: 0; color: var(--muted); font-size: .58rem; letter-spacing: .15em; text-align: right; line-height: 1.7; }
.hero-visual > p b { color: var(--acid); font-size: .82rem; }

.guide-section {
  padding: 120px max(24px, calc((100vw - 1340px) / 2));
  background: #ecf0eb;
  color: #111718;
}
.section-heading { display: grid; grid-template-columns: 1.35fr .65fr; align-items: end; gap: 70px; margin-bottom: 44px; }
.section-heading .eyebrow { color: #54605f; }
.section-heading h2, .method-copy h2 { font-size: clamp(3.1rem, 6vw, 6rem); }
.section-heading > p { margin: 0 0 8px; color: #5b6665; line-height: 1.75; max-width: 500px; }
.map-toolbar { border-top: 1px solid rgba(17,23,24,.16); border-bottom: 1px solid rgba(17,23,24,.16); padding: 14px 0; margin-bottom: 22px; display: flex; align-items: center; gap: 16px; }
.map-toolbar label { display: flex; align-items: center; gap: 12px; color: #697372; font-size: .65rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.map-toolbar select { min-width: 180px; background: transparent; color: #111718; border: 0; border-bottom: 1px solid #111718; padding: 8px 28px 8px 2px; font-weight: 850; text-transform: uppercase; }
.segmented { margin-left: auto; display: flex; padding: 3px; background: rgba(17,23,24,.07); }
.segmented button { border: 0; background: transparent; color: #667170; padding: 9px 14px; font-size: .66rem; text-transform: uppercase; font-weight: 850; letter-spacing: .08em; }
.segmented button.active { background: #111718; color: var(--acid); }
.guide-section .ghost-button { border-color: rgba(17,23,24,.28); color: #31413d; }

.guide-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, .55fr); gap: 18px; }
.map-card { background: #101517; color: var(--text); box-shadow: var(--shadow); min-width: 0; }
.map-meta { padding: 24px 28px 18px; display: flex; align-items: flex-start; justify-content: space-between; border-bottom: 1px solid var(--line); }
.map-meta span { color: var(--muted); font-size: .62rem; letter-spacing: .13em; text-transform: uppercase; }
.map-meta h3 { margin: 4px 0 0; font-size: 1.55rem; text-transform: uppercase; letter-spacing: -.04em; }
.status-badge { border: 1px solid rgba(201,255,99,.28); color: var(--acid) !important; padding: 7px 9px; }
.map-stage { position: relative; overflow: hidden; aspect-ratio: 1.42; background: radial-gradient(circle, #172124, #090d0f 76%); isolation: isolate; }
.map-stage > img { position: absolute; inset: 5%; width: 90%; height: 90%; object-fit: contain; filter: sepia(.25) hue-rotate(85deg) saturate(.62) brightness(.82) contrast(1.06); opacity: .84; z-index: 1; }
.map-vignette { position: absolute; inset: 0; background: radial-gradient(circle, transparent 42%, rgba(7,9,11,.78) 100%); z-index: 2; pointer-events: none; }
#coneLayer, #markerLayer { position: absolute; inset: 5%; z-index: 3; }
#markerLayer { z-index: 4; }
.sight-cone { position: absolute; width: 29%; aspect-ratio: 2.1; transform-origin: 0 50%; background: linear-gradient(90deg, rgba(201,255,99,.48), rgba(201,255,99,.025)); clip-path: polygon(0 46%, 100% 0, 100% 100%, 0 54%); transition: opacity 180ms ease, transform 260ms ease; pointer-events: none; }
.sight-cone.draft { background: linear-gradient(90deg, rgba(84,214,208,.5), rgba(84,214,208,.02)); }
.map-marker { position: absolute; width: 30px; height: 30px; margin: -15px 0 0 -15px; border: 1px solid var(--acid); border-radius: 50%; background: rgba(11,15,18,.82); color: var(--acid); display: grid; place-items: center; font-size: .62rem; font-weight: 900; cursor: pointer; box-shadow: 0 0 0 6px rgba(201,255,99,.08); transition: transform 180ms ease, background 180ms ease; }
.map-marker:hover, .map-marker.active { transform: scale(1.16); background: var(--acid); color: #101510; }
.map-marker.draft { border-color: var(--cyan); color: var(--cyan); box-shadow: 0 0 0 6px rgba(84,214,208,.08); }
.map-north { position: absolute; right: 24px; top: 20px; z-index: 5; display: grid; justify-items: center; color: var(--muted); font-size: .58rem; }
.map-north i { display: block; width: 1px; height: 24px; background: linear-gradient(var(--acid), transparent); margin-top: 4px; }
.map-footer { padding: 14px 24px; display: flex; align-items: center; gap: 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .62rem; text-transform: uppercase; letter-spacing: .09em; }
.legend-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; }
.legend-dot.reviewed { background: var(--acid); }.legend-dot.draft { background: var(--cyan); }

.position-panel { background: #fff; border: 1px solid rgba(17,23,24,.12); padding: 28px; min-height: 610px; display: flex; flex-direction: column; }
.panel-topline { display: flex; justify-content: space-between; color: #707b79; font-size: .62rem; letter-spacing: .12em; font-weight: 800; }
#positionScore { color: #2d6f62; }
.position-panel > h3 { margin: 20px 0 6px; font-size: clamp(2rem, 3vw, 3rem); text-transform: uppercase; letter-spacing: -.055em; line-height: .95; }
.position-tagline { color: #5c6866; line-height: 1.55; margin: 0 0 24px; }
.scenario { border-top: 1px solid rgba(17,23,24,.12); border-bottom: 1px solid rgba(17,23,24,.12); padding: 16px 0; }
.scenario span, .playbook > span { color: #7c8584; font-size: .6rem; text-transform: uppercase; letter-spacing: .13em; font-weight: 800; }
.scenario p { margin: 7px 0 0; color: #2f3a38; font-size: .83rem; line-height: 1.55; }
.score-grid { padding: 20px 0; display: grid; gap: 10px; }
.score-row { display: grid; grid-template-columns: 1fr 1.2fr 30px; align-items: center; gap: 10px; font-size: .66rem; text-transform: uppercase; letter-spacing: .06em; font-weight: 750; }
.score-row .track { height: 4px; background: #dfe5e1; overflow: hidden; }
.score-row .track i { display: block; height: 100%; background: #317769; }
.score-row b { text-align: right; font-size: .65rem; }
.playbook { margin-top: 2px; }
.playbook ol { margin: 10px 0 0; padding: 0; list-style: none; counter-reset: play; }
.playbook li { counter-increment: play; display: grid; grid-template-columns: 22px 1fr; gap: 8px; margin-top: 8px; color: #394442; font-size: .78rem; line-height: 1.45; }
.playbook li::before { content: "0" counter(play); color: #2f7668; font-size: .62rem; font-weight: 900; padding-top: 2px; }
.warning { margin-top: auto; padding: 13px 14px; background: #f4ece8; display: flex; gap: 12px; align-items: flex-start; }
.warning > span { width: 22px; height: 22px; border: 1px solid #bd5e4b; color: #a64036; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 900; flex: 0 0 auto; }
.warning p { margin: 0; color: #84584f; font-size: .7rem; line-height: 1.45; }
.warning p b { color: #853f35; text-transform: uppercase; letter-spacing: .08em; }
.position-nav { display: flex; gap: 6px; margin-top: 16px; }
.position-nav button { border: 1px solid rgba(17,23,24,.14); background: transparent; width: 32px; height: 32px; color: #5c6866; font-size: .62rem; font-weight: 850; cursor: pointer; }
.position-nav button.active { background: #111718; color: var(--acid); }
.empty-state { margin: auto 0; text-align: center; padding: 28px 4px; }
.empty-state b { display: block; font-size: 1.4rem; text-transform: uppercase; margin-bottom: 10px; }
.empty-state p { color: #6a7573; line-height: 1.6; }

.method-section { width: min(1340px, calc(100% - 48px)); margin: 0 auto; padding: 120px 0; display: grid; grid-template-columns: .9fr 1.1fr; gap: 100px; }
.method-copy { position: sticky; top: 40px; align-self: start; }
.method-copy h2 { font-size: clamp(3.1rem, 5.5vw, 5.5rem); }
.method-copy > p:last-child { max-width: 520px; color: var(--muted); line-height: 1.75; font-size: 1.02rem; }
.factor-list { border-top: 1px solid var(--line); }
.factor-list article { min-height: 120px; display: grid; grid-template-columns: 42px 1fr 48px; gap: 20px; align-items: center; border-bottom: 1px solid var(--line); }
.factor-list article > span { color: var(--acid); font-size: .62rem; font-weight: 900; }
.factor-list h3 { margin: 0 0 6px; text-transform: uppercase; font-size: 1.1rem; }
.factor-list p { margin: 0; color: var(--muted); font-size: .83rem; }
.factor-list b { color: #a8b2b0; font-size: .7rem; text-align: right; }

footer { width: min(1440px, calc(100% - 48px)); margin: 0 auto; min-height: 170px; padding: 44px 0; border-top: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr auto; gap: 50px; align-items: center; }
footer p { max-width: 680px; margin: 0; color: var(--muted); font-size: .72rem; line-height: 1.6; }
footer > a { color: var(--acid); font-size: .68rem; text-transform: uppercase; font-weight: 850; letter-spacing: .1em; }

dialog { width: min(980px, calc(100% - 32px)); max-height: calc(100vh - 32px); border: 1px solid rgba(237,244,242,.18); padding: 0; color: var(--text); background: #0c1113; box-shadow: 0 30px 100px #000; }
dialog::backdrop { background: rgba(2,4,5,.82); backdrop-filter: blur(8px); }
.dialog-shell { padding: clamp(22px, 4vw, 42px); }
.dialog-header { display: flex; justify-content: space-between; gap: 20px; }
.dialog-header h2 { margin: 0; text-transform: uppercase; font-size: clamp(2rem, 5vw, 4rem); letter-spacing: -.055em; line-height: .9; }
.icon-button { align-self: flex-start; background: transparent; border: 1px solid var(--line); width: 38px; height: 38px; font-size: 1.5rem; }
.dialog-intro { color: var(--muted); max-width: 720px; line-height: 1.6; }
.lab-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 26px; margin-top: 24px; }
.lab-map { aspect-ratio: 1; background: radial-gradient(circle, #1b2528, #070a0b 75%); position: relative; overflow: hidden; cursor: crosshair; }
.lab-map img { position: absolute; inset: 3%; width: 94%; height: 94%; object-fit: contain; filter: sepia(.2) hue-rotate(85deg) saturate(.65) brightness(.82); opacity: .82; pointer-events: none; }
.draft-cone { position: absolute; width: 33%; aspect-ratio: 2.1; transform-origin: 0 50%; background: linear-gradient(90deg, rgba(84,214,208,.55), rgba(84,214,208,.02)); clip-path: polygon(0 46%,100% 0,100% 100%,0 54%); pointer-events: none; }
.lab-pin { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border: 2px solid var(--cyan); border-radius: 50%; background: #091012; box-shadow: 0 0 0 6px rgba(84,214,208,.1); pointer-events: none; }
.lab-controls { display: flex; flex-direction: column; gap: 18px; }
.lab-controls label { display: grid; gap: 8px; }
.lab-controls label > span { display: flex; justify-content: space-between; color: #a8b4b2; font-size: .65rem; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.lab-controls input[type="text"], .lab-controls textarea { width: 100%; border: 1px solid var(--line); background: #11181a; color: var(--text); padding: 12px; outline: none; resize: vertical; }
.lab-controls input:focus, .lab-controls textarea:focus { border-color: var(--cyan); }
.lab-controls input[type="range"] { accent-color: var(--cyan); width: 100%; }
.save-message { min-height: 20px; margin: 0; color: var(--acid); font-size: .72rem; }

@media (max-width: 1050px) {
  .hero { grid-template-columns: 1fr; padding-bottom: 48px; }
  .hero-copy { padding-bottom: 20px; }
  .hero-visual { width: calc(100% - 48px); min-height: 540px; margin: 0 auto; }
  .guide-layout { grid-template-columns: 1fr; }
  .position-panel { min-height: 0; }
  .method-section { grid-template-columns: 1fr; gap: 48px; }
  .method-copy { position: static; }
}

@media (max-width: 720px) {
  .topbar, .hero, footer, .method-section { width: min(100% - 28px, 1440px); }
  .topbar nav a { display: none; }
  .topbar nav { gap: 0; }
  .hero-copy { padding: 64px 12px 20px; }
  .hero h1 { font-size: clamp(3.6rem, 18vw, 6rem); }
  .hero-actions { align-items: flex-start; flex-direction: column; gap: 12px; }
  .hero-stats { flex-wrap: wrap; }
  .hero-visual { width: 100%; min-height: 430px; margin: 0; }
  .guide-section { padding: 80px 14px; }
  .section-heading { grid-template-columns: 1fr; gap: 22px; }
  .section-heading h2, .method-copy h2 { font-size: clamp(3rem, 15vw, 5rem); }
  .map-toolbar { align-items: stretch; flex-wrap: wrap; }
  .map-toolbar label { width: 100%; }
  .map-toolbar select { flex: 1; }
  .segmented { margin-left: 0; }
  .map-stage { aspect-ratio: 1; }
  .map-footer { flex-wrap: wrap; gap: 12px; }
  .map-footer .text-button { width: 100%; text-align: left; }
  .position-panel { padding: 22px; }
  .lab-grid { grid-template-columns: 1fr; }
  footer { grid-template-columns: 1fr; gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
