/*-----------------------------------------------------------------------------------------
  FOW-OFF — Global Stylesheet
  Design System: "Terminal Nihilism" (see .kiro/steering/Website_Terraform/fow-off.md Section 7)
  Cyber-brutalist: obsidian background, acid-lime accent, Space Grotesk + Space Mono,
  SHARP 0px corners, 1px wireframe borders.

  Pages consume these tokens/components — do not hard-code one-off values in pages.
-----------------------------------------------------------------------------------------*/

/*-----------------------------------------------------------------------------------------
  1. DESIGN TOKENS (CSS custom properties)
-----------------------------------------------------------------------------------------*/
:root {
  /* --- Colors --- */
  --abyss: #08090d;            /* deepest root canvas */
  --bg: #121318;               /* page background */
  --carbon: #12141d;           /* work surface / inputs / cards */
  --surface-low: #0d0e14;      /* sidebar / slightly distinct panels */
  --wireframe: #1a1e29;        /* 1px borders */
  --text: #e3e1e9;            /* primary text */
  --muted: #8b90a0;            /* secondary/muted text */
  --terminal-dim: #4e5668;     /* faint labels, footers, placeholders */
  --accent: #d4ff33;           /* acid lime — primary action / active / focus ONLY */
  --accent-hover: #e0ff66;     /* accent hover */
  --on-accent: #08090d;        /* text on accent */
  --danger: #ff007a;           /* magenta — destructive/volatile only */
  --warning: #ffb703;          /* amber warnings */

  /* --- Typography --- */
  --font-display: 'Space Grotesk', system-ui, sans-serif; /* headings + body */
  --font-mono: 'Space Mono', ui-monospace, monospace;     /* labels/nav/status */

  /* --- Spacing (4px/8px rhythm) --- */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --margin: 2rem;

  /* --- Layout --- */
  --header-h: 56px;
  --footer-h: 44px;
  --sidebar-w: 240px;
  --field-h: 48px;

  /* --- Misc --- */
  --radius: 0;                 /* sharp corners everywhere */
  --border: 1px solid var(--wireframe);
}

/*-----------------------------------------------------------------------------------------
  2. RESET / BASE
-----------------------------------------------------------------------------------------*/
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* subtle technical grid + scanline texture */
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 32px 32px;
}

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

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; }

/* Everything is sharp-cornered */
input, textarea, button, .card, .panel, .btn { border-radius: var(--radius); }

/*-----------------------------------------------------------------------------------------
  3. TYPOGRAPHY HELPERS
-----------------------------------------------------------------------------------------*/
.display   { font-size: 48px; font-weight: 700; line-height: 1.08; letter-spacing: -0.04em; }
.h1        { font-size: 28px; font-weight: 700; line-height: 1.2;  letter-spacing: -0.02em; }
.h2        { font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.h3        { font-size: 18px; font-weight: 600; line-height: 1.3; }
.body-lg   { font-size: 16px; line-height: 1.6; }
.body-md   { font-size: 14px; line-height: 1.5; }
.muted     { color: var(--muted); }

/* Monospace labels / status text */
.label {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.label-sm {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terminal-dim);
}

/*-----------------------------------------------------------------------------------------
  4. BUTTONS
-----------------------------------------------------------------------------------------*/
.btn {
  font-family: var(--font-mono);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 14px;
  border: none;
  cursor: pointer;
  padding: 0 var(--space-lg);
  height: var(--field-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.12s ease, color 0.12s ease;
}

/* Primary — acid lime */
.btn-primary {
  background-color: var(--accent);
  color: var(--on-accent);
}
.btn-primary:hover { background-color: var(--accent-hover); }
.btn-primary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Full-width variant (login/contact submit) */
.btn-block { width: 100%; }

/* Compact header button (sign off) */
.btn-compact { height: 36px; padding: 0 var(--space-md); font-size: 12px; }

/*-----------------------------------------------------------------------------------------
  5. FORM FIELDS
-----------------------------------------------------------------------------------------*/
.field { margin-bottom: var(--space-md); }

.field-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: var(--space-sm);
}

.input,
.textarea {
  width: 100%;
  background-color: var(--carbon);
  border: var(--border);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  padding: 0 var(--space-md);
}

.input { height: var(--field-h); }

.textarea {
  padding: var(--space-md);
  min-height: 140px;
  resize: vertical;
  line-height: 1.5;
}

.input::placeholder,
.textarea::placeholder { color: var(--terminal-dim); }

/* Focus snaps border to acid lime (no rounded, sharp per design system) */
.input:focus,
.textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 0 16px rgba(212, 255, 51, 0.15);
}

/*-----------------------------------------------------------------------------------------
  6. CARDS / PANELS
-----------------------------------------------------------------------------------------*/
.panel {
  background-color: var(--carbon);
  border: var(--border);
  padding: var(--space-lg);
}

.card {
  background-color: var(--carbon);
  border: var(--border);
  padding: var(--space-lg);
}

/*-----------------------------------------------------------------------------------------
  7. BRAND LOCKUP (header, login) — shared
-----------------------------------------------------------------------------------------*/
.brand {
  display: inline-flex;
  flex-direction: column;
  border-left: 2px solid var(--accent);
  padding-left: var(--space-md);
}
.brand-name {
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--text);
  font-size: 15px;
}
.brand-tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

/*-----------------------------------------------------------------------------------------
  8. APP SHELL (header + sidebar + main + footer) — Home/About/Contact
-----------------------------------------------------------------------------------------*/
.app {
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margin);
  border-bottom: var(--border);
  background-color: var(--surface-low);
}

/* Body: sidebar + main */
.app-body {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr;
  min-height: 0;
}

/* Sidebar */
.sidebar {
  border-right: var(--border);
  background-color: var(--surface-low);
  display: flex;
  flex-direction: column;
  padding: var(--space-md) 0;
}
.nav-item {
  display: block;
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding: var(--space-md) var(--space-lg);
  border-left: 2px solid transparent;
  transition: color 0.12s ease, background-color 0.12s ease;
}
.nav-item:hover { color: var(--text); background-color: rgba(255, 255, 255, 0.02); }
.nav-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background-color: rgba(212, 255, 51, 0.05);
}
/* Sidebar divider + secondary section */
.nav-divider {
  margin: var(--space-md) var(--space-lg);
  border-top: var(--border);
  padding-top: var(--space-md);
}
.nav-section-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terminal-dim);
  padding: 0 var(--space-lg);
}
.nav-placeholder {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--terminal-dim);
  padding: var(--space-sm) var(--space-lg);
}

/* Main content area */
.app-main {
  padding: var(--space-xl) var(--margin);
  overflow-y: auto;
}
.content-wrap { max-width: 960px; }

/* Footer */
.app-footer,
.page-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  border-top: var(--border);
  background-color: var(--surface-low);
  padding: 0 var(--margin);
}
.footer-link {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terminal-dim);
  transition: color 0.12s ease;
}
.footer-link:hover { color: var(--accent); }
.footer-sep { color: var(--wireframe); }

/*-----------------------------------------------------------------------------------------
  9. LOGIN PAGE (index.html) — full-page centered layout
-----------------------------------------------------------------------------------------*/
.login-page {
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  min-height: 100vh;
}
.login-header {
  display: flex;
  align-items: center;
  padding: 0 var(--margin);
  border-bottom: var(--border);
  background-color: var(--surface-low);
}
.login-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-xl) var(--margin);
}
.login-box { width: 100%; max-width: 500px; }
.login-intro { margin-bottom: var(--space-lg); }
.login-intro p { color: var(--muted); font-size: 14px; line-height: 1.6; margin-top: var(--space-md); }

/*-----------------------------------------------------------------------------------------
  10. ABOUT PAGE — services grid + FAQ
-----------------------------------------------------------------------------------------*/
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
  margin-top: var(--space-lg);
}
.service-card .svc-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  color: var(--terminal-dim);
  display: block;
  margin-bottom: var(--space-sm);
  transition: color 0.15s ease;
}
.service-card h3 { margin-bottom: var(--space-sm); transition: color 0.15s ease; }
.service-card p { color: var(--muted); font-size: 14px; margin: 0; }

/* Subtle interactive lift on service cards — border/tag pick up the accent, faint glow */
.service-card {
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.service-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px var(--accent), 0 0 18px rgba(212, 255, 51, 0.08);
}
.service-card:hover .svc-tag { color: var(--accent); }

/* FAQ — collapsible accordion rows (uses native <details>/<summary>) */
.faq { margin-top: var(--space-xl); }
.faq-row {
  border: var(--border);
  margin-bottom: var(--space-sm);
  transition: border-color 0.15s ease;
}
.faq-row:hover { border-color: var(--terminal-dim); }
.faq-row[open] { border-color: var(--accent); }

/* Clickable question row (the <summary>) */
.faq-q {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--text);
  letter-spacing: 0.04em;
  padding: var(--space-md);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  transition: color 0.15s ease;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { color: var(--accent); }

/* Custom [+] / [-] toggle indicator in acid lime */
.faq-q::after {
  content: "[+]";
  font-family: var(--font-mono);
  color: var(--accent);
  font-size: 12px;
}
.faq-row[open] .faq-q { color: var(--accent); }
.faq-row[open] .faq-q::after { content: "[-]"; }

.faq-a {
  color: var(--muted);
  font-size: 14px;
  padding: 0 var(--space-md) var(--space-md);
}

/*-----------------------------------------------------------------------------------------
  11. CONTACT PAGE — two-column (form + info)
-----------------------------------------------------------------------------------------*/
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-lg);
  align-items: start;
}
.contact-info dt {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--terminal-dim);
  margin-top: var(--space-md);
}
.contact-info dd {
  margin: var(--space-xs) 0 0 0;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text);
}

/*-----------------------------------------------------------------------------------------
  12. RESPONSIVE (mobile-first breakpoints — see fow-off.md Section 7.6)
  Tokens/base above are the desktop baseline; these adapt down.
-----------------------------------------------------------------------------------------*/
@media (max-width: 1024px) {
  .services-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  :root { --margin: 1rem; --sidebar-w: 100%; }
  .display { font-size: 32px; }

  /* Stack the app shell: sidebar becomes a top strip, main below */
  .app-body { grid-template-columns: 1fr; }
  .sidebar { border-right: none; border-bottom: var(--border); flex-direction: row; flex-wrap: wrap; padding: var(--space-sm); }
  .nav-item { border-left: none; border-bottom: 2px solid transparent; padding: var(--space-sm) var(--space-md); }
  .nav-item.active { border-left: none; border-bottom-color: var(--accent); }
  .nav-divider, .nav-section-label, .nav-placeholder { display: none; }

  .services-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: var(--space-lg); }
}

/*-----------------------------------------------------------------------------------------
  13. LEGAL / PUBLIC PAGES (privacy.html, terms.html, security.html)
  Public layout: header + centered content + footer. NO sidebar (sidebar is for
  authenticated pages only). Header has a "Back to Login" button on the right.
-----------------------------------------------------------------------------------------*/
.legal-page {
  display: grid;
  grid-template-rows: var(--header-h) 1fr var(--footer-h);
  min-height: 100vh;
}
.legal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--margin);
  border-bottom: var(--border);
  background-color: var(--surface-low);
}
.legal-main {
  padding: var(--space-xl) var(--margin);
  overflow-y: auto;
}
.legal-wrap { max-width: 760px; margin: 0 auto; }

/* Playground disclaimer banner */
.disclaimer {
  border: 1px solid var(--warning);
  background-color: rgba(255, 183, 3, 0.06);
  padding: var(--space-md);
  margin-bottom: var(--space-xl);
}
.disclaimer .label-sm { color: var(--warning); }
.disclaimer p { margin: var(--space-xs) 0 0 0; color: var(--text); font-size: 14px; }

/* Legal content typography — concise, readable */
.legal-wrap h1 { margin-bottom: var(--space-sm); }
.legal-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--terminal-dim);
  margin-bottom: var(--space-xl);
}
.legal-section { margin-bottom: var(--space-lg); }
.legal-section h2 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: var(--space-sm);
}
.legal-section p,
.legal-section li { color: var(--muted); font-size: 14px; line-height: 1.6; }
.legal-section ul { margin: var(--space-sm) 0 0 0; padding-left: 1.1rem; }
.legal-section li { margin-bottom: var(--space-xs); }
.legal-section a { color: var(--accent); }
.legal-section a:hover { color: var(--accent-hover); }
