/* ==========================================================================
   STELLAR AGE — Minimal Tactical HUD Landing & Legal Styles
   Ported from lib/views/theme/ (app_colors.dart, app_typography.dart, app_radii.dart)
   ========================================================================== */

@font-face {
  font-family: 'SpaceGrotesk';
  src: url('../assets/fonts/SpaceGrotesk.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Geist';
  src: url('../assets/fonts/Geist.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'JetBrainsMono';
  src: url('../assets/fonts/JetBrainsMono.ttf') format('truetype');
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --surface-lowest: #080E1A;
  --bg: #0E131F;
  --surface-low: #161C28;
  --surface: #1A202C;
  --surface-high: #242A36;
  --on-surface: #DDE2F3;
  --on-surface-variant: #BCC9CD;
  --outline-variant: #3D494C;
  --primary: #4CD7F6;
  --on-primary: #003640;
  --tertiary: #DDB7FF;
  --metal-soft: #FCD34D;
  --status-online: #34D399;

  --font-display: 'SpaceGrotesk', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrainsMono', monospace;

  --glow-primary: 0 0 16px rgba(76, 215, 246, 0.3);
}

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

html, body {
  background-color: var(--bg);
  color: var(--on-surface);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

body {
  background-image:
    radial-gradient(circle at 50% 0%, rgba(76, 215, 246, 0.08) 0%, transparent 50%),
    linear-gradient(rgba(61, 73, 76, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(61, 73, 76, 0.06) 1px, transparent 1px);
  background-size: 100% 100%, 48px 48px, 48px 48px;
}

a {
  color: var(--primary);
  text-decoration: none;
}

.container {
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.app-header {
  background: rgba(8, 14, 26, 0.88);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(61, 73, 76, 0.5);
}

.header-simple,
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-logo {
  width: 30px;
  height: 30px;
  object-fit: contain;
}

.brand-titles {
  display: flex;
  flex-direction: column;
}

.brand-name {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--on-surface-variant);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--on-surface-variant);
  padding: 6px 10px;
  transition: color 0.15s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

/* Compact Landing Layout */
.landing-main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 36px 0 44px;
}

.hero-compact {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 36px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.hero-app-icon {
  width: 84px;
  height: 84px;
  border: 1px solid rgba(76, 215, 246, 0.45);
  box-shadow: var(--glow-primary);
  margin-bottom: 4px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-online {
  color: var(--status-online);
  background: rgba(52, 211, 153, 0.1);
  border: 1px solid rgba(52, 211, 153, 0.35);
}

.pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.hero-title-compact {
  font-family: var(--font-display);
  font-size: clamp(28px, 4.5vw, 44px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-title-compact span {
  color: var(--primary);
}

.hero-sub-compact {
  font-size: 15px;
  color: var(--on-surface-variant);
  max-width: 520px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 6px;
}

.btn-row-center {
  justify-content: center;
}

.btn-store {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 18px;
  background: var(--surface-lowest);
  border: 1px solid rgba(76, 215, 246, 0.45);
  border-radius: 4px;
  color: var(--on-surface);
  transition: all 0.15s ease;
}

.btn-store:hover {
  border-color: var(--primary);
  background: rgba(76, 215, 246, 0.08);
  box-shadow: var(--glow-primary);
}

.btn-store-icon {
  width: 22px;
  height: 22px;
  fill: var(--primary);
}

.btn-store-text {
  display: flex;
  flex-direction: column;
  text-align: left;
}

.btn-store-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--primary);
}

.btn-store-main {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
}

/* 3 Glanceable Pillars */
.pillars-compact {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
}

.pillar-box {
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
  padding: 16px;
}

.pillar-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 4px;
}

.pillar-box h3 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

.pillar-box p {
  font-size: 13px;
  color: var(--on-surface-variant);
  line-height: 1.45;
}

/* 4 Ships Strip */
.ships-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.ship-tile {
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  padding: 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.ship-tile img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border: 1px solid var(--outline-variant);
  background: var(--surface);
}

.ship-tile-meta {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ship-tier {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 0.06em;
}

.ship-tile-meta strong {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Standalone Legal Pages (privacy.html & terms.html) */
.section-block {
  padding: 32px 0;
  flex: 1;
}

.legal-card {
  background: var(--surface-lowest);
  border: 1px solid var(--outline-variant);
  padding: 28px;
}

.legal-content h2 {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 6px;
}

.legal-meta {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--on-surface-variant);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--outline-variant);
}

.legal-content h3 {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  color: var(--on-surface);
  margin: 20px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legal-content p,
.legal-content li {
  font-size: 14px;
  color: var(--on-surface-variant);
  line-height: 1.65;
  margin-bottom: 10px;
}

.legal-content ul {
  padding-left: 20px;
  margin-bottom: 14px;
}

.legal-content strong {
  color: var(--on-surface);
}

.sku-table-wrap {
  overflow-x: auto;
  margin: 14px 0;
}

.sku-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background: var(--surface-low);
  border: 1px solid var(--outline-variant);
}

.sku-table th,
.sku-table td {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(61, 73, 76, 0.5);
}

.sku-table th {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  background: var(--surface-lowest);
}

.sku-table code {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--tertiary);
}

/* Footer */
.app-footer {
  background: var(--surface-lowest);
  border-top: 1px solid rgba(61, 73, 76, 0.5);
  padding: 18px 0;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.footer-protocol {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--on-surface-variant);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
}

/* Toast */
.app-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  background: var(--surface-high);
  border: 1px solid var(--primary);
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--on-surface);
  transform: translateY(140%);
  opacity: 0;
  transition: all 0.2s ease;
  pointer-events: none;
}

.app-toast.visible {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 768px) {
  .pillars-compact {
    grid-template-columns: 1fr;
  }
  .ships-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .ships-strip {
    grid-template-columns: 1fr;
  }
}
