/* ==========================================================================
   THE LAST AGENT — SITE THEME CONTRACT (BEYOND DIGITAL LABS)
   1. Color Palette: Obsidian Ink (#07080c), Carbon Glass (#10131c),
      Beyond Gold (#d3b578), Bright Gold (#e6d5ac), Emerald (#34d399),
      Crimson Lock (#f87171), Slate Text (#f2f1ee / #9ca3af).
   2. Typography: System Geometric Sans + Monospace Telemetry.
   3. Global Header & Footer: Sticky glass header + Dual Animated Attribution Footer.
   4. Padding & Section Templates: Symmetrical container & card spacing tokens.
   5. Button Contract: 100% Slender Pill Geometry (border-radius: 9999px),
      strictly symmetrical padding, hover lift/glow, and tactile click scale.
      ZERO square or rectangular buttons permitted anywhere.
   6. 3D / WebGL Motion: Full-viewport pointer-reactive neural orbital field.
   ========================================================================== */

:root {
  --bg-ink: #07080c;
  --bg-surface: rgba(16, 19, 28, 0.84);
  --bg-surface-elevated: rgba(24, 29, 42, 0.92);
  --bg-input: rgba(10, 12, 19, 0.92);
  --border-subtle: rgba(211, 181, 120, 0.18);
  --border-strong: rgba(211, 181, 120, 0.48);
  --gold-primary: #d3b578;
  --gold-bright: #e6d5ac;
  --gold-deep: #a98e5d;
  --text-primary: #f3f2ee;
  --text-secondary: #a7b0c0;
  --text-muted: #727c8f;
  --status-emerald: #34d399;
  --status-amber: #fbbf24;
  --status-crimson: #f87171;
  --status-cyan: #38bdf8;

  --font-sans: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Cascadia Code", Consolas, monospace;

  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.125rem;
  --space-lg: 1.5rem;
  --space-xl: 2.25rem;

  --radius-card: 1.25rem;
  --radius-pill: 9999px;
  --shadow-card: 0 20px 48px rgba(0, 0, 0, 0.48);
  --shadow-pill-gold: 0 8px 24px rgba(211, 181, 120, 0.24);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: var(--bg-ink);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

#neural-webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.72;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Global Header Template */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(18px);
  background: rgba(7, 8, 12, 0.86);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-md) var(--space-lg);
}

.site-header__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.brand-cluster__emblem {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border-strong);
  object-fit: cover;
  flex-shrink: 0;
}

.brand-cluster__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--gold-bright);
}

.brand-cluster__subtitle {
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.telemetry-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-xs);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.status-pill--online {
  border-color: rgba(52, 211, 153, 0.42);
  color: var(--status-emerald);
}

.status-pill--locked {
  border-color: rgba(248, 113, 113, 0.45);
  color: var(--status-crimson);
}

/* Slender Pill Button System — Zero Square Buttons */
button,
.pill-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border-radius: var(--radius-pill);
  padding: 0.625rem 1.375rem;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0.01em;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  text-decoration: none;
  transition:
    transform 160ms cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease;
  white-space: nowrap;
}

button:hover,
.pill-btn:hover {
  transform: translateY(-1.5px);
  border-color: var(--gold-primary);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}

button:active,
.pill-btn:active {
  transform: translateY(0) scale(0.975);
}

button:focus-visible,
.pill-btn:focus-visible {
  outline: 2px solid var(--gold-bright);
  outline-offset: 2px;
}

.pill-btn--primary {
  background: linear-gradient(135deg, var(--gold-bright) 0%, var(--gold-primary) 55%, var(--gold-deep) 100%);
  color: #090a0f;
  border-color: var(--gold-bright);
  box-shadow: var(--shadow-pill-gold);
}

.pill-btn--primary:hover {
  box-shadow: 0 10px 28px rgba(211, 181, 120, 0.38);
}

.pill-btn--emerald {
  background: rgba(52, 211, 153, 0.16);
  border-color: rgba(52, 211, 153, 0.52);
  color: var(--status-emerald);
}

.pill-btn--danger {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.48);
  color: var(--status-crimson);
}

.pill-btn--compact {
  padding: 0.45rem 1rem;
  font-size: 0.78rem;
}

.pill-tab--active {
  background: rgba(211, 181, 120, 0.18);
  border-color: var(--gold-primary);
  color: var(--gold-bright);
}

/* Navigation Bar */
.nav-tabs {
  max-width: 1320px;
  width: 100%;
  margin: var(--space-md) auto 0;
  padding: 0 var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

/* Main Content Container & Section Design Templates */
.main-container {
  flex: 1;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.section-card {
  background: var(--bg-surface);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-card);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
}

.section-card__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-bottom: var(--space-md);
}

.section-card__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold-bright);
}

.section-card__desc {
  margin: 0.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* Inputs & Controls */
.field-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  align-items: center;
}

.text-input,
.prompt-textarea,
.select-input {
  width: 100%;
  background: var(--bg-input);
  color: var(--text-primary);
  border: 1px solid var(--border-subtle);
  border-radius: 0.9rem;
  padding: 0.75rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.9rem;
}

.select-input,
.text-input--pill {
  border-radius: var(--radius-pill);
}

.prompt-textarea {
  min-height: 104px;
  resize: vertical;
}

.text-input:focus,
.prompt-textarea:focus,
.select-input:focus {
  outline: none;
  border-color: var(--gold-primary);
}

/* Grids */
.grid-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-md);
}

.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: var(--space-sm);
}

.sub-card {
  background: var(--bg-surface-elevated);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.sub-card--selected {
  border-color: var(--gold-primary);
  background: rgba(211, 181, 120, 0.09);
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-secondary);
  word-break: break-word;
}

/* S24 Remote Touch Viewport */
.handoff-viewport {
  position: relative;
  width: 100%;
  max-width: 780px;
  aspect-ratio: 16 / 10;
  margin: var(--space-sm) auto;
  border-radius: 1rem;
  border: 1px solid var(--gold-primary);
  background: radial-gradient(circle at 50% 40%, #1a2133 0%, #090b12 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: crosshair;
  overflow: hidden;
  touch-action: manipulation;
  padding: var(--space-md);
  text-align: center;
}

.hidden-panel {
  display: none !important;
}

/* Global Dual-Attribution Animated Footer */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-subtle);
  background: rgba(7, 8, 12, 0.92);
  padding: var(--space-lg);
}

.site-footer__inner {
  max-width: 1320px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.attribution-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 1.125rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-primary);
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
}

.attribution-pill__logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: contain;
  flex-shrink: 0;
}

@media (max-width: 960px) {
  .grid-two,
  .grid-three {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .site-header,
  .main-container,
  .site-footer {
    padding: var(--space-md);
  }

  .nav-tabs {
    padding: 0 var(--space-md);
  }

  button,
  .pill-btn {
    padding: 0.55rem 1.05rem;
    font-size: 0.8rem;
  }

  .attribution-pill {
    width: 100%;
    justify-content: center;
    font-size: 0.76rem;
    white-space: normal;
    text-align: center;
  }
}
