:root {
  color-scheme: dark;
  --bg: #030609;
  --bg-2: #071016;
  --text: #f6f0e6;
  --muted: rgba(246, 240, 230, 0.68);
  --soft: rgba(246, 240, 230, 0.44);
  --line: rgba(212, 180, 112, 0.24);
  --line-blue: rgba(78, 214, 241, 0.28);
  --gold: #d5b36d;
  --gold-2: #a9905d;
  --cyan: #00d7ff;
  --green: #00f09a;
  --red: #f06c7a;
  --panel: rgba(5, 10, 15, 0.72);
  --panel-strong: rgba(5, 10, 15, 0.9);
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  --radius: 8px;
  --font: Inter, "Segoe UI", Arial, sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  width: 100%;
  max-width: 100vw;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: linear-gradient(180deg, #030609 0%, #061016 44%, #020405 100%);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

button,
a,
input {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

#pcm-app {
  position: relative;
  width: 100%;
  max-width: 100vw;
  min-height: 100svh;
  isolation: isolate;
  overflow-x: hidden;
}

#scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  width: 100vw;
  height: 100svh;
  display: block;
  background: transparent;
}

.grid-layer {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.24;
  background-image:
    radial-gradient(circle, rgba(0, 240, 154, 0.72) 0 1px, transparent 2px),
    linear-gradient(rgba(246, 240, 230, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 240, 230, 0.032) 1px, transparent 1px);
  background-size: 116px 116px, 48px 48px, 48px 48px;
  background-position: 18px 24px, 0 0, 0 0;
  mask-image: linear-gradient(180deg, transparent 0%, black 14%, black 78%, transparent 100%);
}

.site-header {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  min-height: 76px;
  padding: max(12px, env(safe-area-inset-top)) clamp(18px, 4vw, 56px) 12px;
  border-bottom: 1px solid rgba(246, 240, 230, 0.09);
  background: rgba(3, 6, 9, 0.72);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  font-size: 0.92rem;
  font-weight: 900;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #e7c579 0%, #79d8e9 100%);
  color: #061014;
  box-shadow: 0 0 28px rgba(213, 179, 109, 0.28);
}

.header-link {
  justify-self: start;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(246, 240, 230, 0.17);
  border-radius: var(--radius);
  padding: 0 16px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
}

.primary-link {
  justify-self: end;
  color: var(--text);
  border-color: rgba(213, 179, 109, 0.42);
}

main {
  position: relative;
  z-index: 4;
  width: 100%;
  max-width: 100vw;
}

.section {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding: 118px clamp(18px, 6vw, 86px) 70px;
}

.section > * {
  min-width: 0;
}

.hero-section {
  justify-content: space-between;
  gap: 48px;
}

.hero-copy {
  width: min(780px, 43vw);
  min-width: 0;
  overflow-wrap: anywhere;
}

.mobile-title {
  display: none;
}

.system-line {
  margin: 0 0 18px;
  color: var(--green);
  font-size: 0.92rem;
  font-weight: 900;
  font-family: var(--mono);
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

h1 {
  max-width: 760px;
  font-size: 5.45rem;
  line-height: 0.92;
  font-weight: 950;
  text-transform: uppercase;
}

.desktop-title,
.accent-line {
  display: block;
}

.mobile-title {
  display: none;
}

.accent-line {
  color: var(--green);
}

h2 {
  font-size: 3.3rem;
  line-height: 1;
  font-weight: 950;
}

.lead,
.story-panel p {
  margin: 22px 0 0;
  color: var(--muted);
  font-size: 1.16rem;
  line-height: 1.7;
}

.proof-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.proof-cell {
  min-height: 96px;
  padding: 14px;
  border: 1px solid rgba(0, 240, 154, 0.32);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 240, 154, 0.1), rgba(0, 240, 154, 0.025));
  box-shadow: inset 3px 0 0 rgba(0, 240, 154, 0.72);
}

.proof-cell span,
.console-top span,
.input-layer span,
.process-cells span,
.stat-grid span,
.board-header span {
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.proof-cell p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
}

.role-chooser {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 30px;
}

.role-button,
.action-button {
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(246, 240, 230, 0.18);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.role-button:hover,
.role-button.active,
.action-button:hover {
  transform: translateY(-1px);
  border-color: var(--gold);
  background: rgba(213, 179, 109, 0.14);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.action-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  min-width: 168px;
  font-weight: 800;
}

.gold {
  border-color: var(--gold);
  background: linear-gradient(180deg, #d9bb74, #b8944f);
  color: #071014;
}

.signal-panel {
  width: 100%;
  margin-top: 16px;
  padding: 20px;
  border: 1px solid var(--line-blue);
  border-radius: var(--radius);
  background: rgba(5, 12, 18, 0.78);
  box-shadow: var(--shadow);
}

.system-console {
  width: min(820px, 47vw);
  align-self: center;
  padding: 28px;
  border: 1px solid rgba(0, 240, 154, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(0, 240, 154, 0.16), transparent 42%),
    linear-gradient(180deg, rgba(0, 64, 48, 0.28), rgba(5, 10, 15, 0.78));
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(0, 215, 255, 0.08);
  backdrop-filter: blur(22px);
}

.console-top,
.board-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(0, 215, 255, 0.22);
}

.console-top strong,
.board-header strong {
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
}

.input-layer {
  position: relative;
  min-height: 154px;
  margin-top: 20px;
  padding: 18px;
  border: 1px dashed rgba(0, 215, 255, 0.38);
  border-radius: var(--radius);
  background: rgba(0, 215, 255, 0.035);
}

.input-layer em {
  position: absolute;
  right: 18px;
  top: 18px;
  padding: 7px 12px;
  border: 1px solid rgba(0, 240, 154, 0.36);
  border-radius: 999px;
  color: var(--green);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-style: normal;
  text-transform: uppercase;
}

.load-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100px;
  height: 100px;
  display: grid;
  place-items: center;
  translate: -50% -50%;
  border: 1px dashed var(--cyan);
  border-radius: 50%;
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
  box-shadow: 0 0 0 26px rgba(0, 240, 154, 0.08), 0 0 54px rgba(0, 240, 154, 0.18);
}

.process-cells {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.process-cells div,
.stat-grid div {
  min-width: 0;
  border: 1px solid rgba(246, 240, 230, 0.13);
  border-radius: var(--radius);
  background: rgba(5, 10, 15, 0.66);
}

.process-cells div {
  min-height: 126px;
  padding: 13px;
  box-shadow: inset 3px 0 0 rgba(0, 240, 154, 0.74);
}

.process-cells strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.12;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.process-cells p,
.stat-grid p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stat-grid div {
  min-height: 112px;
  padding: 18px;
}

.stat-grid strong {
  display: block;
  margin-top: 12px;
  color: var(--text);
  font-family: var(--mono);
  font-size: 2.1rem;
  line-height: 1;
}

.signal-panel span,
.scene-index {
  display: block;
  color: var(--cyan);
  font-size: 0.82rem;
  font-weight: 900;
}

.signal-panel strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
  font-size: 1rem;
  line-height: 1.55;
}

.story-section {
  position: relative;
}

.story-section.left {
  justify-content: flex-start;
}

.story-section.right {
  justify-content: flex-end;
}

.story-panel {
  width: min(500px, 38vw);
  padding: 28px;
  border: 1px solid rgba(246, 240, 230, 0.14);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.data-room-section {
  gap: 54px;
  justify-content: space-between;
}

.data-room-board {
  width: min(640px, 42vw);
  padding: 28px;
  border: 1px solid rgba(0, 240, 154, 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 20% 0%, rgba(0, 240, 154, 0.14), transparent 42%),
    rgba(5, 12, 18, 0.76);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.builder-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  min-height: 92px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(246, 240, 230, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.builder-row b {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(0, 240, 154, 0.36);
  border-radius: var(--radius);
  color: var(--cyan);
  background: rgba(0, 240, 154, 0.08);
  font-family: var(--mono);
}

.builder-row strong {
  color: var(--text);
  text-transform: uppercase;
}

.builder-row p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.statement-panel h2 {
  text-transform: uppercase;
}

.wide-panel {
  width: min(600px, 44vw);
}

.metric-list {
  display: grid;
  gap: 10px;
  margin: 24px 0 0;
}

.metric-list div,
.sandbox-output {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 13px 14px;
  border: 1px solid rgba(246, 240, 230, 0.12);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
}

dt,
dd {
  margin: 0;
}

dt {
  color: var(--soft);
}

dd {
  color: var(--text);
  font-weight: 900;
}

.mode-rail,
.investor-points {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}

.mode-rail span,
.investor-points span {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  padding: 0 13px;
  border: 1px solid rgba(73, 212, 238, 0.24);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(73, 212, 238, 0.055);
}

.upload-box {
  display: grid;
  gap: 8px;
  margin-top: 24px;
  padding: 20px;
  border: 1px dashed rgba(73, 212, 238, 0.45);
  border-radius: var(--radius);
  background: rgba(73, 212, 238, 0.045);
  cursor: pointer;
}

.upload-box span {
  color: var(--cyan);
  font-weight: 900;
}

.upload-box strong {
  color: var(--text);
}

.upload-box input {
  display: none;
}

.sandbox-output {
  margin-top: 12px;
  justify-content: flex-start;
  color: var(--muted);
  line-height: 1.5;
}

.final-section {
  padding-bottom: 18vh;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .role-button,
  .action-button {
    transition: none;
  }
}

@media (max-width: 1120px) {
  h1 {
    font-size: 4rem;
  }

  h2 {
    font-size: 2.8rem;
  }

  .hero-copy,
  .story-panel,
  .wide-panel,
  .system-console,
  .data-room-board {
    width: min(560px, 48vw);
  }

  .process-cells {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  html,
  body {
    width: 100%;
    max-width: 100dvw;
    overflow-x: hidden;
  }

  #pcm-app,
  main,
  .section {
    max-width: 100dvw;
    overflow-x: clip;
  }

  .site-header {
    min-height: 70px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .header-link {
    display: none;
  }

  .site-header {
    grid-template-columns: 1fr;
  }

  .brand {
    justify-self: center;
  }

  #scene {
    width: 100dvw;
    height: 100svh;
  }

  .grid-layer {
    background-size: 36px 36px;
  }

  .section {
    display: block;
    min-height: 100svh;
    width: 100dvw;
    padding: 92px 18px 58px;
    align-items: flex-end;
    overflow: hidden;
  }

  .hero-section {
    padding-top: 36svh;
    width: 100%;
  }

  .hero-copy,
  .story-panel,
  .wide-panel,
  .signal-panel,
  .system-console,
  .data-room-board {
    width: 100%;
    max-width: 100%;
  }

  .hero-copy {
    padding: 16px 0 0;
    max-width: 100%;
    white-space: normal;
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: block;
  }

  .signal-panel {
    display: none;
  }

  h1 {
    max-width: 100%;
    font-size: 2.45rem;
    line-height: 1.06;
    text-wrap: wrap;
    word-break: normal;
    overflow-wrap: break-word;
  }

  h2 {
    font-size: 2.35rem;
  }

  .lead,
  .story-panel p {
    max-width: 100%;
    font-size: 1rem;
    line-height: 1.52;
    word-break: normal;
    overflow-wrap: break-word;
  }

  .proof-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .proof-cell {
    min-height: 84px;
    padding: 12px;
  }

  .system-console,
  .data-room-board {
    margin-top: 22px;
    padding: 18px;
  }

  .input-layer {
    min-height: 132px;
  }

  .input-layer em {
    position: static;
    display: inline-flex;
    margin-top: 12px;
  }

  .load-core {
    width: 82px;
    height: 82px;
    font-size: 0.66rem;
  }

  .process-cells,
  .stat-grid {
    grid-template-columns: 1fr;
  }

  .process-cells div,
  .stat-grid div {
    min-height: auto;
  }

  .role-chooser {
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
    max-width: 100%;
  }

  .role-button {
    width: 100%;
    padding-left: 8px;
    padding-right: 8px;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .action-button {
    width: 100%;
  }

  .story-section.left,
  .story-section.right,
  .data-room-section {
    justify-content: center;
  }

  .story-panel {
    padding: 20px;
  }

  .builder-row {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 13px;
  }

  .builder-row b {
    width: 48px;
    height: 48px;
  }

  .metric-list div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }
}

@media (max-width: 380px) {
  h1 {
    font-size: 1.9rem;
  }

  h2 {
    font-size: 2.05rem;
  }

  .brand {
    font-size: 0.82rem;
  }

  .brand-mark {
    width: 38px;
    height: 38px;
  }
}
