/* ════════════════════════════════════════════════════════════════════════════
   NEX WIRE  •  ANTHROPIC CLAUDE EDITORIAL CONSOLE WORKSTATION
   Warm Terracotta · Eggshell Parchment · Obsidian Charcoal
   Literary Serif Headings, High-Precision Telemetry & Micro-Interactions
   ════════════════════════════════════════════════════════════════════════════ */

:root {
  color-scheme: light;

  /* Anthropic Claude Signature Terracotta */
  --ac:         #e51829;
  --ac-hover:   #c40012;
  --ac-active:  #b35639;
  --ac-light:   #ff2e43;
  --ac-ring:    rgba(229, 24, 41, 0.22);
  --ac-soft:    rgba(229, 24, 41, 0.08);
  --ac-line:    rgba(229, 24, 41, 0.28);
  --ac-glow:    0 6px 20px rgba(229, 24, 41, 0.25);

  /* Day Canvas: Warm Eggshell Parchment */
  --bg:         #faf9f5;
  --bg-subtle:  #f4f2ea;
  --surface:    #ffffff;
  --surface-2:  #f7f6f0;
  --surface-3:  #eeebe2;
  --pane-bg:    rgba(255, 255, 255, 0.72);

  /* Lines & Borders */
  --line:       rgba(31, 30, 29, 0.08);
  --line-strong:rgba(31, 30, 29, 0.14);
  --line-hi:    rgba(255, 255, 255, 0.85);

  /* Typography */
  --tx:         #1f1e1d;
  --tx-sub:     #4a4742;
  --tx-muted:   #736f66;
  --tx-faint:   #9c978b;

  /* Status Colors */
  --green:      #2fd27a;
  --green-soft: rgba(47, 210, 122, 0.12);
  --green-bdr:  rgba(47, 210, 122, 0.30);
  --err-tx:     #b91c1c;
  --err-bg:     rgba(239, 68, 68, 0.08);
  --err-bdr:    rgba(239, 68, 68, 0.25);

  /* Elevation */
  --shadow-sm:  0 1px 3px rgba(28, 27, 24, 0.04);
  --shadow:     0 12px 32px rgba(28, 27, 24, 0.06), 0 2px 6px rgba(28, 27, 24, 0.02);
  --shadow-lg:  0 20px 48px rgba(28, 27, 24, 0.09), 0 4px 12px rgba(28, 27, 24, 0.03);

  /* Fonts */
  --ui:         'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --serif:      'Newsreader', 'Georgia', serif;
  --mono:       'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

html[data-theme="dark"] {
  color-scheme: dark;

  /* Claude Warm Obsidian Charcoal */
  --bg:         #141312;
  --bg-subtle:  #181816;
  --surface:    #22211e;
  --surface-2:  #282723;
  --surface-3:  #2f2d29;
  --pane-bg:    rgba(34, 33, 30, 0.72);

  --line:       rgba(255, 255, 255, 0.07);
  --line-strong:rgba(255, 255, 255, 0.12);
  --line-hi:    rgba(255, 255, 255, 0.04);

  --tx:         #f5f4ee;
  --tx-sub:     #d6d3c9;
  --tx-muted:   #9c988e;
  --tx-faint:   #6e6b63;

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow:     0 14px 36px rgba(0, 0, 0, 0.50);
  --shadow-lg:  0 24px 60px rgba(0, 0, 0, 0.65);
}

/* ── Reset & Document Base ── */
*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font: 14px/1.6 var(--ui);
  color: var(--tx);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  transition: background 0.25s ease, color 0.25s ease;
}

::selection {
  background: var(--ac-ring);
  color: var(--tx);
}

:focus-visible {
  outline: 2px solid var(--ac);
  outline-offset: 2px;
}

/* ── Ambient Background Canvas ── */
.ambient-canvas {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(65% 45% at 15% -8%, rgba(229, 24, 41, 0.08) 0%, transparent 60%),
    radial-gradient(55% 40% at 85% 0%, rgba(229, 24, 41, 0.05) 0%, transparent 55%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-subtle) 100%);
  background-attachment: fixed;
}

/* ════════════════════════════════════════════════════════════════════════════
   TOP STUDIO NAVIGATION BAR
   ════════════════════════════════════════════════════════════════════════════ */
.studio-nav {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) max(24px, env(safe-area-inset-right, 0px)) 10px max(24px, env(safe-area-inset-left, 0px));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.studio-nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.nav-logo {
  display: block;
  flex: none;
  width: 38px;
  height: 38px;
  object-fit: cover;
  padding: 0;
  border-radius: 10px;
  background: #0d0d0f;
  border: 1px solid rgba(229, 24, 41, 0.35);
  box-shadow: 0 3px 10px rgba(229, 24, 41, 0.18);
}

.nav-brand-lockup {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.nav-title {
  font: 500 18px/1.1 var(--serif);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

.nav-title .w1 { color: var(--tx); }
.nav-title .w2 { color: var(--ac); font-style: italic; }

.nav-sub {
  font: 600 8.5px/1.2 var(--ui);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.studio-nav-right {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: none;
}

.telemetry-live-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--green-soft);
  border: 1px solid var(--green-bdr);
  color: var(--green);
  font: 700 9.5px/1 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  flex: none;
  animation: live-pulse 2s infinite ease-in-out;
}

@keyframes live-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.85); }
}

/* Day/Night Segmented Switcher */
.theme-seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}

.seg-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0;
  padding: 5px 11px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--tx-muted);
  font: 600 11px/1 var(--ui);
  cursor: pointer;
  transition: all 0.16s ease;
}

.seg-ic {
  width: 13px;
  height: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}

.seg-btn:hover:not([aria-pressed="true"]) { color: var(--tx); }
.seg-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--tx);
  box-shadow: var(--shadow-sm);
  font-weight: 700;
}

/* ════════════════════════════════════════════════════════════════════════════
   MAIN WORKSPACE & EDITORIAL COMMAND DECK
   ════════════════════════════════════════════════════════════════════════════ */
.gate-workspace {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 32px 20px 48px;
}

.deck-wrapper {
  width: min(100%, 1040px);
  margin: auto 0;
}

.studio-deck {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

/* ────────────────────────────────────────────────────────────────────────────
   LEFT PANE: SYSTEM PROTOCOL & WIRE SCHEMATICS
   ──────────────────────────────────────────────────────────────────────────── */
.deck-telemetry-pane {
  display: flex;
  flex-direction: column;
  padding: 38px 36px;
  background: var(--pane-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.deck-telemetry-pane::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-hi), transparent);
}

.deck-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.kicker-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--ac-soft);
  border: 1px solid var(--ac-line);
  color: var(--ac);
  font: 700 9.5px/1 var(--ui);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.badge-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--ac);
}

.kicker-meta {
  font: 600 9.5px/1 var(--ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.deck-manifesto {
  margin: 0 0 14px;
  font: 500 clamp(30px, 3.2vw, 42px)/1.12 var(--serif);
  letter-spacing: -0.025em;
  color: var(--tx);
}

.deck-manifesto em {
  font-style: italic;
  font-family: var(--serif);
  font-weight: 400;
  color: var(--ac);
}

.deck-lead {
  margin: 0 0 28px;
  font: 400 14px/1.65 var(--ui);
  color: var(--tx-sub);
  max-width: 48ch;
}

/* 4-Tile Telemetry Grid */
.telemetry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.tel-tile {
  display: flex;
  flex-direction: column;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.tel-tile:hover {
  border-color: var(--ac-line);
  transform: translateY(-1px);
}

.tel-lbl {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-muted);
  margin-bottom: 6px;
}

.tel-val {
  font: 700 14.5px/1.2 var(--ui);
  color: var(--tx);
  margin-bottom: 2px;
}

.tel-val.highlight {
  color: var(--ac);
}

.tel-sub {
  font: 400 11px/1.3 var(--ui);
  color: var(--tx-muted);
}

/* Wire Route Visualizer */
.wire-route-card {
  margin-top: auto;
  padding: 16px 18px;
  border-radius: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.route-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.route-title {
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--tx-muted);
}

.route-badge {
  padding: 3px 7px;
  border-radius: 5px;
  background: var(--ac-soft);
  color: var(--ac);
  font: 700 8.5px/1 var(--mono);
  letter-spacing: 0.08em;
}

.route-flow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex: none;
}

.step-ico {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--tx-sub);
}

.step-ico svg {
  width: 16px;
  height: 16px;
}

.flow-step.highlight .step-ico {
  background: var(--ac);
  border-color: var(--ac);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(229, 24, 41, 0.35);
}

.flow-step span {
  font: 700 9px/1 var(--mono);
  letter-spacing: 0.06em;
  color: var(--tx-muted);
}

.flow-track {
  position: relative;
  flex: 1;
  height: 2px;
  background: var(--line);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 15px;
}

.flow-pulse {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 30%;
  background: linear-gradient(90deg, transparent, var(--ac), transparent);
  animation: track-sweep 2.2s infinite linear;
}

.flow-pulse.delay {
  animation-delay: 1.1s;
}

@keyframes track-sweep {
  0% { left: -30%; }
  100% { left: 100%; }
}

/* ────────────────────────────────────────────────────────────────────────────
   RIGHT PANE: ACCESS GATEWAY & AUTH TERMINAL
   ──────────────────────────────────────────────────────────────────────────── */
.deck-auth-pane {
  display: flex;
  flex-direction: column;
  padding: 38px 34px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

/* Hairline Terracotta accent on auth card top */
.auth-card-accent {
  position: absolute;
  top: 0;
  left: 32px;
  right: 32px;
  height: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--ac) 30%, var(--ac) 70%, transparent 100%);
}

.auth-header {
  margin-bottom: 24px;
}

.auth-header-tag {
  display: inline-block;
  font: 700 9.5px/1 var(--mono);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--ac);
  margin-bottom: 8px;
}

.auth-title {
  margin: 0 0 6px;
  font: 500 26px/1.2 var(--serif);
  letter-spacing: -0.02em;
  color: var(--tx);
}

.auth-desc {
  margin: 0;
  font: 400 13px/1.55 var(--ui);
  color: var(--tx-muted);
}

/* Auth Form */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
}

.f-group {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.f-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.f-label {
  font: 700 10.5px/1 var(--mono);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tx-sub);
}

.f-sub-badge {
  font: 700 8.5px/1 var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ac);
  background: var(--ac-soft);
  padding: 3px 6px;
  border-radius: 4px;
}

/* Terminal Key Input Box */
.key-terminal-input {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 2px 6px 2px 14px;
  transition: all 0.18s ease;
}

.key-terminal-input:focus-within {
  background: var(--surface);
  border-color: var(--ac);
  box-shadow: 0 0 0 3px var(--ac-ring);
}

.key-ico {
  display: flex;
  align-items: center;
  color: var(--tx-muted);
  flex: none;
  margin-right: 10px;
}

.key-ico svg {
  width: 17px;
  height: 17px;
}

.key-terminal-input input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--tx);
  font: 600 13.5px/1 var(--mono);
  letter-spacing: 0.03em;
  outline: none;
}

.key-terminal-input input::placeholder {
  color: var(--tx-faint);
  font-weight: 400;
}

.btn-paste-tool {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface);
  color: var(--tx-sub);
  font: 700 10px/1 var(--mono);
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: all 0.16s ease;
}

.btn-paste-tool:hover {
  border-color: var(--ac);
  color: var(--ac);
  background: var(--ac-soft);
}

.f-hint {
  margin: 0;
  font: 400 11.5px/1.4 var(--ui);
  color: var(--tx-muted);
}

/* Turnstile Mount */
.turnstile-wrap {
  min-height: 65px;
  display: flex;
  justify-content: center;
}

/* Submit Button */
.submit-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 13px 20px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--ac) 0%, var(--ac-light) 100%);
  color: #ffffff;
  font: 700 13px/1 var(--ui);
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: var(--ac-glow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.submit-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
  box-shadow: 0 8px 24px rgba(229, 24, 41, 0.35);
}

.submit-btn:active {
  transform: translateY(1px);
}

.submit-btn[disabled] {
  opacity: 0.72;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-arrow svg {
  width: 17px;
  height: 17px;
  transition: transform 0.18s ease;
}

.submit-btn:hover .btn-arrow svg {
  transform: translateX(3px);
}

/* Status Box */
.status {
  display: none;
  margin-bottom: 18px;
  padding: 12px 14px;
  border-radius: 10px;
  font: 500 12.5px/1.4 var(--ui);
  text-align: left;
}

.status.show { display: block; }
.status.error {
  background: var(--err-bg);
  border: 1px solid var(--err-bdr);
  color: var(--err-tx);
}

.status.ok {
  background: var(--green-soft);
  border: 1px solid var(--green-bdr);
  color: var(--green);
}

/* Security Spec Strip */
.security-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  margin-top: auto;
}

.sec-item {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--tx-muted);
  font: 600 10px/1.2 var(--ui);
}

.sec-item svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: var(--ac);
}

.auth-notice {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 14px;
  font: 400 11px/1.4 var(--ui);
  color: var(--tx-faint);
}

.auth-notice svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke: var(--tx-muted);
  fill: none;
  stroke-width: 2;
  margin-top: 1px;
}

/* ════════════════════════════════════════════════════════════════════════════
   SYSTEM FOOTER
   ════════════════════════════════════════════════════════════════════════════ */
.deck-footer {
  margin-top: 24px;
  text-align: center;
}

.footer-inner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font: 500 11.5px/1 var(--ui);
  color: var(--tx-muted);
}

.foot-dot {
  color: var(--line-strong);
  font-size: 8px;
}

/* ════════════════════════════════════════════════════════════════════════════
   RESPONSIVE LAYOUT BREAKPOINTS
   ════════════════════════════════════════════════════════════════════════════ */
@media (max-width: 960px) {
  .deck-wrapper {
    width: min(100%, 540px);
  }

  .studio-deck {
    display: flex;
    flex-direction: column;
    gap: 20px;
  }

  .deck-telemetry-pane {
    padding: 28px 24px;
  }

  .deck-manifesto {
    font-size: 26px;
  }

  .telemetry-grid {
    gap: 8px;
    margin-bottom: 18px;
  }

  .tel-tile {
    padding: 10px 12px;
  }

  .tel-val {
    font-size: 13px;
  }

  .deck-auth-pane {
    padding: 28px 24px;
  }

  .security-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .telemetry-live-pill {
    display: none;
  }
}

@media (max-width: 480px) {
  .gate-workspace {
    padding: 16px 14px 36px;
  }

  .deck-telemetry-pane {
    padding: 22px 18px;
  }

  .deck-auth-pane {
    padding: 24px 18px;
  }

  .nav-title {
    font-size: 16px;
  }

  .nav-logo {
    width: 32px;
    height: 32px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 6px;
  }

  .foot-dot {
    display: none;
  }
}
