:root {
  --gb-bg: #090b0d;
  --gb-panel: #14181b;
  --gb-line: #3d4449;
  --gb-text: #eceff1;
  --gb-muted: #8f989f;
  --gb-training: #aeb5ba;
  --gb-operations: #5a9fc4;
  --gb-signal: #d45a42;
  --gb-resolved: #5a9fc4;
  --gb-dojo-red: #9b2d2f;
  --gb-container: 1180px;
  --gb-beat-font: "Barlow Semi Condensed", "Segoe UI", system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: auto;
}

body {
  min-width: 320px;
  overflow-x: hidden;
  background: var(--gb-bg);
  color: var(--gb-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(100% - 48px, var(--gb-container));
  margin: 0 auto;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 12px;
  left: 12px;
  padding: 10px 14px;
  background: #f4f5f6;
  color: #151719;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: none;
}

:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

.gb-nav {
  position: fixed;
  z-index: 100;
  inset: 0 0 auto;
  height: 60px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(20, 23, 25, 0.92);
}

.nav-inner {
  width: min(100% - 40px, var(--gb-container));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  font-weight: 700;
}

.brand-mark img {
  width: 26px;
  height: 26px;
  filter: none;
}

.production-mode .brand-mark img {
  filter: grayscale(0.15);
}

.gate-chip {
  display: none;
}

.debug-mode .gate-chip {
  display: inline-block;
  padding-left: 18px;
  border-left: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--gb-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nav-marketing {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--gb-muted);
  font-size: 13px;
}

.immersive-active .nav-marketing {
  visibility: hidden;
}

.immersive-active .site-nav-premium .nav-marketing {
  visibility: visible;
}

.nav-restored .nav-marketing {
  visibility: visible;
}

.production-mode.immersive-active .gb-nav {
  border-bottom-color: rgba(255, 255, 255, 0.06);
  background: rgba(9, 11, 13, 0.72);
}

.nav-restored .gb-nav {
  border-bottom-color: rgba(255, 255, 255, 0.12);
  background: rgba(9, 11, 13, 0.92);
}

.btn {
  display: inline-flex;
  min-height: 38px;
  padding: 0 14px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--gb-line);
  font-weight: 650;
}

.btn-primary {
  background: #e8eaeb;
  color: #17191b;
}

.btn-ghost {
  background: transparent;
}

.btn-lg {
  min-height: 46px;
  padding: 0 20px;
}

.btn-block {
  width: 100%;
}

.greybox-story {
  position: relative;
  background: var(--gb-bg);
}

.greybox-pin {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 560px;
  overflow: hidden;
  background: var(--gb-bg);
}

#dojo-greybox {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.world-labels {
  position: absolute;
  z-index: 12;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.world-label {
  position: absolute;
  left: 0;
  top: 0;
  padding: 3px 6px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(20, 23, 25, 0.82);
  color: #fff;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  transform: translate(-50%, -100%);
}

.world-label.is-behind {
  display: none;
}

.world-label.signal-label {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--gb-signal);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-shadow:
    0 1px 0 #141719,
    0 0 6px rgba(20, 23, 25, 0.95);
}

.world-label.signal-label::before {
  content: "◇";
  margin-right: 5px;
}

.world-label.signal-label.is-resolving {
  color: var(--gb-resolved);
}

.previs-hud {
  display: none;
}

.debug-mode .previs-hud {
  display: block;
  position: absolute;
  z-index: 20;
  top: 82px;
  left: max(20px, 4vw);
  min-width: 208px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 23, 25, 0.86);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.hud-kicker {
  margin-bottom: 5px;
  color: var(--gb-muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.previs-hud strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
}

.hud-meta {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--gb-muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hud-attention {
  margin-top: 7px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--gb-muted);
  font-size: 8px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.hud-attention b {
  color: var(--gb-text);
  font-weight: 700;
}

.axis-key {
  display: none;
}

.debug-mode .axis-key {
  display: flex;
  position: absolute;
  z-index: 20;
  right: max(20px, 4vw);
  top: 82px;
  gap: 14px;
  color: var(--gb-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.axis-key span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.axis-key i {
  width: 8px;
  height: 8px;
  border: 1px solid currentColor;
}

.axis-mats {
  background: var(--gb-training);
}

.axis-desk {
  background: var(--gb-operations);
}

.scroll-cue {
  position: absolute;
  z-index: 20;
  left: 50%;
  bottom: max(20px, 3vh);
  margin: 0;
  color: var(--gb-muted);
  font-family: var(--gb-beat-font);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  transform: translateX(-50%);
  opacity: 0.72;
}

.debug-mode .scroll-cue {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.immersive-active .scroll-cue {
  opacity: 1;
}

body[data-story-beat="freeze"] .scroll-cue,
body[data-story-beat="absorb"] .scroll-cue,
body[data-story-beat="turn-to-desk"] .scroll-cue {
  opacity: 0;
}

.threshold-beats {
  position: absolute;
  z-index: 22;
  inset: 0;
  pointer-events: none;
}

.threshold-beat {
  position: absolute;
  left: 50%;
  top: 18vh;
  width: min(90vw, 920px);
  margin: 0;
  color: #f2f4f5;
  font-family: var(--gb-beat-font);
  font-size: clamp(28px, 5vw, 72px);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.02;
  text-align: center;
  text-shadow: 0 2px 24px rgba(6, 8, 10, 0.92);
  opacity: 0;
  transform: translateX(-50%);
}

.threshold-beat.is-active {
  visibility: visible;
}

.gate3-story-beats {
  position: absolute;
  z-index: 24;
  inset: 0;
  pointer-events: none;
}

.gate3-beat {
  position: absolute;
  left: 50%;
  width: min(88vw, 980px);
  margin: 0;
  color: #f4f6f7;
  font-family: var(--gb-beat-font);
  font-size: clamp(24px, 4.4vw, 62px);
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.05;
  text-align: center;
  text-shadow: 0 2px 16px rgba(10, 12, 13, 0.9);
  opacity: 0;
  visibility: hidden;
  transform: translate(-50%, -50%);
}

.gate3-beat.is-active {
  visibility: visible;
}

.beat-freeze {
  top: 50%;
  left: 50%;
  width: min(92vw, 1040px);
  color: #f8f9fa;
  font-size: clamp(28px, 5.2vw, 68px);
  letter-spacing: 0.06em;
  text-align: center;
  transform: translate(-50%, -50%);
}

.beat-your-place {
  top: auto;
  bottom: 14vh;
  left: 8vw;
  width: min(58vw, 620px);
  color: #f4f6f7;
  font-size: clamp(22px, 3.8vw, 46px);
  letter-spacing: 0.04em;
  text-align: left;
  transform: none;
}

.beat-our-place {
  top: auto;
  bottom: 16vh;
  left: auto;
  right: 8vw;
  width: min(52vw, 560px);
  color: #d8e4ea;
  font-size: clamp(20px, 3.4vw, 42px);
  letter-spacing: 0.04em;
  text-align: right;
  transform: none;
}

body[data-story-beat="freeze"] .previs-hud,
body[data-story-beat="freeze"] .axis-key,
body[data-story-beat="freeze"] .scroll-cue {
  opacity: 0.18;
}

body[data-story-beat="freeze"] .world-label:not(.signal-label) {
  opacity: 0.1;
}

body[data-story-beat="freeze"] .signal-label {
  opacity: 0.38 !important;
}

body[data-story-beat="your-place"] .world-label,
body[data-story-beat="our-place"] .world-label {
  opacity: 0.22;
}

.gate-boundary {
  padding: 96px 0;
  border-top: 1px solid var(--gb-line);
  background: #1d2124;
}

.gate-boundary .container {
  max-width: 760px;
}

.kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--gb-muted);
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.gate-boundary h2,
#after-dojo h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
}

.gate-boundary p,
#after-dojo .sub,
.price-sub {
  color: var(--gb-muted);
}

#after-dojo {
  padding: 96px 0 72px;
  border-top: 1px solid var(--gb-line);
  background: #181b1d;
}

#after-dojo .section-head {
  max-width: 640px;
  margin: 0 auto 38px;
  text-align: center;
}

.price-card {
  max-width: 480px;
  margin: 0 auto;
  padding: 30px;
  border: 1px solid var(--gb-line);
  background: var(--gb-panel);
}

.price {
  margin-bottom: 8px;
}

.price .amount {
  font-size: 48px;
  font-weight: 750;
}

.price .per {
  color: var(--gb-muted);
}

.price-list {
  margin: 22px 0;
  padding: 0;
  list-style: none;
}

.price-list li {
  padding: 9px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.final-actions {
  margin-top: 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.site-footer {
  padding: 28px 0;
  border-top: 1px solid var(--gb-line);
  background: #111315;
}

.footer-inner,
.foot-brand,
.footer-links {
  display: flex;
  align-items: center;
}

.footer-inner {
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.foot-brand {
  gap: 10px;
}

.foot-brand small,
.footer-links a {
  color: var(--gb-muted);
}

.footer-links {
  gap: 16px;
  flex-wrap: wrap;
  font-size: 12px;
}

.sr-only,
.sr-story {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.greybox-fallback {
  position: absolute;
  z-index: 30;
  inset: 50% auto auto 50%;
  width: min(520px, calc(100% - 48px));
  padding: 20px;
  border: 1px solid var(--gb-line);
  background: var(--gb-panel);
  transform: translate(-50%, -50%);
}

.reduced-motion .greybox-story,
.reduced-motion .greybox-pin {
  min-height: 100svh;
  height: 100svh;
}

.reduced-motion .scroll-cue {
  display: none;
}

.reduced-motion .threshold-beats {
  display: block;
}

.reduced-motion .threshold-beat[data-threshold="built-for-mats"],
.reduced-motion .threshold-beat[data-threshold="outdated"] {
  opacity: 1;
  visibility: visible;
}

.reduced-motion .gate3-story-beats {
  display: block;
}

.reduced-motion .beat-your-place,
.reduced-motion .beat-our-place {
  opacity: 1;
  visibility: visible;
}

.reduced-motion .beat-freeze {
  display: none;
}

@media (max-width: 800px) {
  .gb-nav {
    height: 54px;
  }

  .nav-inner {
    width: calc(100% - 28px);
  }

  .gate-chip {
    margin-left: auto;
    padding-left: 12px;
    max-width: 154px;
    line-height: 1.25;
    text-align: right;
  }

  .nav-marketing {
    display: none;
  }

  .site-nav-premium .nav-marketing {
    display: flex;
  }

  .previs-hud {
    top: 68px;
    left: 14px;
    min-width: 176px;
    padding: 9px 10px;
  }

  .previs-hud strong {
    font-size: 14px;
  }

  .axis-key {
    top: 70px;
    right: 14px;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
  }

  .world-label {
    font-size: 7px;
    padding: 2px 4px;
  }

  .world-label.signal-label {
    font-size: 7px;
  }

  .hud-attention {
    font-size: 7px;
  }

  .gate3-beat {
    width: calc(100% - 30px);
    font-size: clamp(22px, 8vw, 34px);
    letter-spacing: 0.035em;
  }

  .beat-your-place {
    left: 6vw;
    bottom: 17vh;
    width: min(84vw, 620px);
    font-size: clamp(19px, 6vw, 28px);
  }

  .beat-our-place {
    right: 6vw;
    bottom: 19vh;
    width: min(84vw, 560px);
    font-size: clamp(18px, 5.6vw, 26px);
  }

  .scroll-cue {
    width: calc(100% - 48px);
    text-align: center;
  }

  .container {
    width: min(100% - 32px, var(--gb-container));
  }

  .gate-boundary,
  #after-dojo {
    padding: 72px 0;
  }
}

@media (max-height: 599px) and (orientation: landscape) {
  .previs-hud {
    top: 66px;
  }

  .axis-key {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
