/* Aurebesh Academy — site styles.
   Palettes mirror the app's lib/theme.tsx: dark "Sith" phosphor-amber
   terminal always; light "Jedi" flimsi only when the page is opened
   with ?d=l (the <html> element gets class "light"). */

@font-face {
  font-family: "AurebeshCanon";
  src: url("/fonts/AurebeshAF-Canon.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "AurebeshCanonTech";
  src: url("/fonts/AurebeshAF-CanonTech.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #0b0d10;
  --surface: #12161c;
  --surface-raised: #171d26;
  --border: #232b36;
  --border-bright: #3a4656;
  --text: #e6edf3;
  --text-muted: #8b949e;
  --text-faint: #7f8892;
  --ambient: #57606a;
  --accent: #ffb000;
  --accent-dim: #8a6200;
  --on-accent: #0b0d10;
  --glow: rgba(255, 176, 0, 0.14);
  color-scheme: dark;
}

html.light {
    --bg: #f3efe6;
    --surface: #fffdf7;
    --surface-raised: #e9e3d6;
    --border: #d7cfbe;
    --border-bright: #b4a992;
    --text: #1a1d21;
    --text-muted: #4a515c;
    --text-faint: #616670;
    --ambient: #8a8f99;
    --accent: #9a5b00;
    --accent-dim: #e2c68f;
    --on-accent: #fffdf7;
    --glow: rgba(154, 91, 0, 0.08);
    color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  line-height: 1.6;
  min-height: 100vh;
  position: relative;
}

/* Faint CRT scanlines over everything; decorative only. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0px,
    transparent 3px,
    rgba(0, 0, 0, 0.06) 3px,
    rgba(0, 0, 0, 0.06) 4px
  );
  z-index: 2;
}

.wrap {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 20px 48px;
  position: relative;
  z-index: 1;
}

/* Ambient backdrop glyphs (decorative, like the app's AmbientBackdrop) */
.ambient {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}
.ambient span {
  position: absolute;
  font-family: "AurebeshCanon", monospace;
  color: var(--ambient);
  opacity: 0.12;
  user-select: none;
}

/* Terminal chrome */
.term-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  background: var(--surface-raised);
  padding: 10px 14px;
  margin-top: 40px;
  font-size: 12px;
  color: var(--text-faint);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.term-bar .dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--accent-dim);
  flex: 0 0 auto;
}
.term-bar .dot.lit { background: var(--accent); box-shadow: 0 0 8px var(--glow); }

.term-body {
  border: 1px solid var(--border);
  border-radius: 0 0 8px 8px;
  background: var(--surface);
  padding: 40px 32px;
  box-shadow: 0 0 60px var(--glow);
}

/* Hero */
.hero { text-align: center; }
.hero .app-icon {
  width: 96px; height: 96px;
  border-radius: 22px;
  border: 1px solid var(--border-bright);
  margin-bottom: 24px;
}
.hero .aurebesh-title {
  font-family: "AurebeshCanonTech", monospace;
  font-size: clamp(26px, 6vw, 44px);
  color: var(--accent);
  text-shadow: 0 0 18px var(--glow);
  margin-bottom: 6px;
}
.hero h1 {
  font-size: clamp(22px, 5vw, 34px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero .tagline {
  color: var(--text-muted);
  margin-top: 12px;
  font-size: 16px;
}
.cursor {
  display: inline-block;
  width: 0.55em; height: 1.1em;
  background: var(--accent);
  vertical-align: text-bottom;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* Store badges */
.badges {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 32px;
}
.badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  border: 1px solid var(--border-bright);
  border-radius: 8px;
  background: var(--surface-raised);
  color: var(--text);
  text-decoration: none;
  padding: 10px 18px;
  min-width: 190px;
}
.badge .small { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.badge .store { font-size: 16px; font-weight: 700; }
.badge.soon { opacity: 0.75; cursor: default; }
.badge.soon .store::after { content: " · soon"; color: var(--accent); font-weight: 400; font-size: 12px; }

/* Sections */
section { margin-top: 48px; }
h2 {
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: 1px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 20px;
}
h2::before { content: "// "; color: var(--text-faint); }

.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 14px;
}
.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-raised);
  padding: 18px;
}
.card .glyph {
  font-family: "AurebeshCanon", monospace;
  color: var(--accent);
  font-size: 22px;
  display: block;
  margin-bottom: 10px;
}
.card h3 { font-size: 14px; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 6px; }
.card p { font-size: 13px; color: var(--text-muted); }

/* Prose pages (privacy/support) */
.prose h1 { font-size: 24px; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 4px; }
.prose .meta { color: var(--text-faint); font-size: 13px; margin-bottom: 28px; }
.prose h2 { margin-top: 32px; }
.prose p, .prose li { color: var(--text-muted); font-size: 14px; margin-bottom: 12px; }
.prose ul { padding-left: 22px; margin-bottom: 12px; }
.prose strong { color: var(--text); }
.prose a { color: var(--accent); }

/* Form */
form { display: grid; gap: 14px; max-width: 520px; }
label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-faint); }
input, textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border-bright);
  border-radius: 6px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 10px var(--glow);
}
button {
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 6px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 12px 22px;
  cursor: pointer;
  justify-self: start;
}
button:disabled { opacity: 0.5; cursor: wait; }
#formMsg { font-size: 13px; }

/* Nav + footer */
.nav {
  display: flex;
  gap: 18px;
  justify-content: center;
  margin-top: 28px;
  font-size: 13px;
}
.nav a { color: var(--text-muted); text-decoration: none; letter-spacing: 0.06em; }
.nav a:hover { color: var(--accent); }

.disclaimer {
  margin-top: 40px;
  font-size: 11.5px;
  color: var(--text-faint);
  text-align: center;
  line-height: 1.7;
}

.footer { margin-top: 36px; text-align: center; font-size: 12.5px; color: var(--text-faint); }
.footer-tagline { font-style: italic; text-transform: uppercase; letter-spacing: 0.12em; }
.footer-divider { border: none; border-top: 1px solid var(--border); margin: 14px auto; width: 120px; }
.footer-copy, .footer-app { margin-top: 4px; }

@media (max-width: 560px) {
  .term-body { padding: 28px 18px; }
}
