/* ============================================================
   Starlight Brand Guidelines — Core Styles
   Dark-first, responsive, no frameworks
   ============================================================ */

/* --- Font --- */
@font-face {
  font-family: 'Michroma';
  src: url('../fonts/Michroma-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* --- Custom Properties --- */
:root {
  /* Brand */
  --brand-white: #FFFFFF;
  --brand-black: #000000;
  --brand-blue: #01C0E2;
  --brand-mars: #C76A3C;
  --brand-offwhite: #FFF3B3;
  --brand-gray: #606060;
  --brand-richblack: #1A1A1A;

  /* Surfaces */
  --color-bg: #000000;
  --color-surface: rgba(255,255,255,0.02);
  --color-surface-alt: rgba(255,255,255,0.04);
  --color-panel: rgba(255,255,255,0.05);
  --color-border: rgba(255,255,255,0.03);
  --color-border-light: rgba(255,255,255,0.05);

  /* Text */
  --color-text: #E8E8E8;
  --color-text-dim: #999999;
  --color-text-muted: #666666;
  --color-text-faint: #444444;

  /* Semantic */
  --color-accent: #01C0E2;
  --color-success: #34C759;
  --color-danger: #FF3B30;

  /* Typography */
  --font-display: 'Michroma', 'Orbitron', monospace;
  --font-body: 'Manrope', -apple-system, 'Helvetica Neue', system-ui, sans-serif;

  /* Layout */
  --sidebar-w: 240px;
  --content-max: 960px;
  --section-gap: 100px;
  --gutter: 24px;
}

/* Light mode override */
body.light {
  --color-bg: #FAFAFA;
  --color-surface: #F0F0F0;
  --color-surface-alt: #E8E8E8;
  --color-panel: #FFFFFF;
  --color-border: #DDDDDD;
  --color-border-light: #CCCCCC;
  --color-text: #1A1A1A;
  --color-text-dim: #555555;
  --color-text-muted: #888888;
  --color-text-faint: #BBBBBB;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout --- */
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-w);
  height: 100vh;
  background: rgba(255,255,255,0.02);
  border-right: 1px solid rgba(255,255,255,0.03);
  padding: 32px 20px 20px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  z-index: 100;
  transition: transform 0.3s ease;
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.sidebar-brand img {
  width: 28px;
  height: 28px;
}

.sidebar-brand span {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.05em;
  color: var(--color-text);
}

.sidebar-subtitle {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: 28px;
  letter-spacing: 0.02em;
}

.sidebar-group {
  margin-bottom: 20px;
}

.sidebar-group-label {
  font-family: var(--font-display);
  font-size: 7px;
  letter-spacing: 0.15em;
  color: var(--color-text-faint);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.sidebar-nav {
  list-style: none;
}

.sidebar-nav li {
  margin-bottom: 1px;
}

.sidebar-nav a {
  display: block;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--color-text-muted);
  border-radius: 4px;
  transition: all 0.15s ease;
  text-decoration: none;
}

.sidebar-nav a:hover {
  color: var(--color-text-dim);
  background: var(--color-surface-alt);
  text-decoration: none;
}

.sidebar-nav a.active {
  color: var(--color-text);
  background: var(--color-surface-alt);
  border-left: 2px solid var(--color-accent);
  padding-left: 8px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
}

.sidebar-footer-text {
  font-size: 9px;
  color: var(--color-text-faint);
  margin-bottom: 4px;
}

.sidebar-progress {
  font-size: 9px;
  color: var(--color-text-muted);
  margin-top: 8px;
}

.sidebar-progress .count {
  color: var(--color-accent);
  font-family: var(--font-display);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  cursor: pointer;
  font-size: 10px;
  color: var(--color-text-muted);
}

.theme-toggle-track {
  width: 32px;
  height: 18px;
  background: var(--color-border);
  border-radius: 9px;
  position: relative;
  transition: background 0.2s;
}

.theme-toggle-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  background: var(--color-text-muted);
  border-radius: 50%;
  transition: transform 0.2s;
}

body.light .theme-toggle-track {
  background: var(--color-accent);
}

body.light .theme-toggle-track::after {
  transform: translateX(14px);
  background: #fff;
}

/* Main content */
.main {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-height: 100vh;
}

/* --- Section Styles --- */
.brand-section {
  padding: var(--section-gap) 60px 60px;
  max-width: calc(var(--content-max) + 120px);
  position: relative;
}

.brand-section:first-child {
  padding-top: 0;
}

/* Section divider (full-bleed title pages) */
.section-divider {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 80px 60px;
  max-width: none;
  position: relative;
}

.section-divider--mission {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  position: relative;
}

.section-divider--mission::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,var(--overlay-opacity, 0.9));
  mix-blend-mode: multiply;
}

.section-divider--mission > * {
  position: relative;
  z-index: 1;
}

.section-number {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  color: var(--color-accent);
  line-height: 1;
  margin-bottom: 12px;
}

.section-accent {
  width: 50px;
  height: 2px;
  background: var(--color-accent);
  margin-bottom: 16px;
}

.section-title {
  font-family: var(--font-display);
  font-size: 40px;
  color: var(--color-text);
  letter-spacing: 0.02em;
  line-height: 1.15;
}

.section-subtitle {
  font-size: 13px;
  color: var(--color-text-dim);
  margin-top: 10px;
}

/* Subsection */
.subsection {
  margin-bottom: 80px;
}

.subsection-label {
  font-family: var(--font-display);
  font-size: 9px;
  color: var(--color-text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.subsection-label::after {
  content: '';
  width: 24px;
  height: 1.5px;
  background: var(--color-accent);
}

.subsection-title {
  font-family: var(--font-display);
  font-size: 20px;
  color: var(--color-text);
  margin-bottom: 12px;
  letter-spacing: 0.01em;
}

.subsection-desc {
  font-size: 15px;
  color: var(--color-text-dim);
  max-width: 640px;
  margin-bottom: 32px;
  line-height: 1.7;
}

/* --- Component: Grids --- */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--gutter); }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gutter); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gutter); }
.grid-2-1 { display: grid; grid-template-columns: 2fr 1fr; gap: 40px; }
.grid-1-2 { display: grid; grid-template-columns: 1fr 2fr; gap: 40px; }

/* --- Component: Cards / Panels --- */
.brand-panel {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 6px;
  padding: var(--gutter);
}

.brand-panel--light {
  background: #FFFFFF;
  color: #1A1A1A;
}

.brand-panel--accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
}

/* --- Component: Swatches --- */
.swatch {
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease;
}

.swatch:hover { transform: scale(1.02); }

.swatch-color {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 6px;
  margin-bottom: 10px;
  border: 1px solid var(--color-border);
}

.swatch-name {
  font-family: var(--font-display);
  font-size: 8px;
  color: var(--color-text);
  letter-spacing: 0.03em;
}

.swatch-hex {
  font-size: 12px;
  color: var(--color-accent);
  margin-top: 2px;
  font-family: var(--font-body);
}

.swatch-rgb {
  font-size: 10px;
  color: var(--color-text-muted);
  margin-top: 2px;
}

.swatch-usage {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: 6px;
  line-height: 1.4;
}

.swatch .copied-flash {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  padding: 4px 10px;
  border-radius: 4px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}

.swatch .copied-flash.show { opacity: 1; }

/* --- Component: Logo showcase --- */
.logo-showcase {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
  padding: 24px;
  border-radius: 6px;
}

.logo-showcase img {
  max-height: 60px;
  width: auto;
}

/* --- Logo Suite (Snapchat-style rows) --- */
.logo-suite-row {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  align-items: center;
  margin-bottom: 32px;
}

.logo-suite-name {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 8px;
}

.logo-suite-desc {
  font-size: 13px;
  color: var(--color-text-dim);
  line-height: 1.7;
}

.logo-suite-preview {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  border-radius: 8px;
}

.logo-suite-preview img {
  max-width: 80%;
  height: auto;
}

.logo-suite-preview--dark {
  background: linear-gradient(to right, rgba(255,255,255,0.02), rgba(255,255,255,0));
  border: 1px solid var(--color-border);
}

.logo-suite-preview--light {
  background: #FFFFFF;
}

.logo-suite-preview--light img {
  filter: invert(1);
}

@media (max-width: 768px) {
  .logo-suite-row {
    grid-template-columns: 1fr;
  }
}

.logo-showcase--dark {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: #FFFFFF;
}

.logo-showcase--light {
  background: #FFFFFF;
}

.logo-showcase--light img {
  filter: invert(1);
}

.logo-label {
  font-size: 10px;
  color: var(--color-text-faint);
  margin-top: 8px;
}

/* --- Component: Do / Don't --- */
.do-dont-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--gutter);
}

.do-column h4, .dont-column h4 {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--color-border);
}

.do-column h4 { color: var(--color-success); }
.dont-column h4 { color: var(--color-danger); }

.do-column li, .dont-column li {
  font-size: 13px;
  color: var(--color-text-dim);
  margin-bottom: 10px;
  list-style: none;
  padding-left: 18px;
  position: relative;
}

.do-column li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--color-success);
}

.dont-column li::before {
  content: '\2022';
  position: absolute;
  left: 0;
  color: var(--color-danger);
}

/* --- Component: Stat cards --- */
.stat-card {
  text-align: center;
  padding: 24px 16px;
}

.stat-value {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--color-text);
  margin-bottom: 6px;
}

.stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
}

/* --- Component: Type specimen --- */
.type-specimen {
  margin-bottom: 24px;
}

.type-sample {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.type-sample-text {
  color: var(--color-text);
}

.type-sample-meta {
  font-size: 10px;
  color: var(--color-text-faint);
  text-align: right;
  white-space: nowrap;
  margin-left: 24px;
}

/* --- Component: Personality pillars --- */
.pillar {
  padding: 24px;
  border-left: 2px solid var(--color-accent);
}

.pillar-icon {
  font-size: 28px;
  color: var(--color-accent);
  margin-bottom: 12px;
  line-height: 1;
}

.pillar-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-accent);
  margin-bottom: 6px;
}

.pillar-tagline {
  font-size: 13px;
  color: var(--brand-white);
  margin-bottom: 10px;
}

.pillar-desc {
  font-size: 12px;
  color: var(--color-text-dim);
  line-height: 1.6;
}

/* --- Component: Thin rule --- */
.rule {
  border: none;
  height: 1px;
  background: var(--color-border);
  margin: 40px 0;
}

/* --- Component: Combo swatch (Aa samples) --- */
.combo-swatch {
  display: flex;
  align-items: center;
  gap: 14px;
}

.combo-preview {
  width: 80px;
  height: 48px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  border: 1px solid var(--color-border);
}

.combo-info {
  font-size: 11px;
}

.combo-label {
  color: var(--color-text-dim);
}

.combo-usage {
  color: var(--color-text-faint);
  font-size: 10px;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
  overflow: hidden;
  padding: 60px;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(0deg, transparent, transparent 39px, rgba(255,255,255,0.02) 39px, rgba(255,255,255,0.02) 40px),
    repeating-linear-gradient(90deg, transparent, transparent 39px, rgba(255,255,255,0.02) 39px, rgba(255,255,255,0.02) 40px);
  pointer-events: none;
}

.hero-icon {
  width: 64px;
  height: 64px;
  margin-bottom: 24px;
}

.hero-wordmark {
  max-width: 700px;
  height: auto;
}

.hero-wordmark sup {
  font-size: 12px;
  color: var(--color-text-muted);
  vertical-align: super;
}

.hero-accent {
  width: 50px;
  height: 2px;
  background: var(--color-accent);
  margin: 20px auto;
}

.hero-label {
  font-size: 13px;
  color: var(--color-text-dim);
}

.hero-meta {
  position: absolute;
  bottom: 60px;
  font-size: 10px;
  color: var(--color-text-faint);
  text-align: center;
  line-height: 1.8;
}

/* --- Mobile --- */
.mobile-header {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  z-index: 200;
  align-items: center;
  padding: 0 16px;
  gap: 12px;
}

.hamburger {
  background: none;
  border: none;
  color: var(--color-text);
  font-size: 20px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.mobile-brand {
  height: 12px;
  width: auto;
}

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 99;
}

@media (max-width: 768px) {
  .mobile-header { display: flex; }
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.open { display: block; }
  .main { margin-left: 0; padding-top: 52px; }
  .brand-section { padding: 60px 24px 40px; }
  .section-divider { padding: 60px 24px; min-height: 50vh; }
  .section-number { font-size: 32px; }
  .section-title { font-size: 28px; }
  .hero { padding: 40px 24px; }
  .hero-wordmark { font-size: 32px; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-2-1, .grid-1-2 { grid-template-columns: 1fr; }
  .do-dont-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand-section { padding: 40px 16px 32px; }
}
