/* ═══════════════════════════════════════════════
   antiSTRAVA — core.css
   Variables · Reset · Container · Theme · Scale
   ═══════════════════════════════════════════════ */

/* ── FONT SCALE (data-font="sm|md|lg" on <html>) ── */
:root { --fs-scale: 1; }
[data-font="sm"] { --fs-scale: 0.88; }
[data-font="md"] { --fs-scale: 1; }
[data-font="lg"] { --fs-scale: 1.18; }

/* ── SAFE AREA (iPhone notch / Dynamic Island) ── */
:root {
  --safe-top:    env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left:   env(safe-area-inset-left, 0px);
  --safe-right:  env(safe-area-inset-right, 0px);
}

/* ── DARK THEME (default) ── */
[data-theme="dark"], :root {
  --bg:           #080808;
  --bg-2:         #0f0f0f;
  --bg-3:         #141414;
  --bg-4:         #181818;
  --border:       #222222;
  --border-2:     #2a2a2a;
  --text:         #F2EDE4;
  --text-2:       #999999;
  --text-3:       #555555;
  --orange:       #FF4D00;
  --orange-dim:   #cc3d00;
  --orange-glow:  rgba(255,77,0,0.12);
  --yellow:       #FFD200;
  --green:        #00FF87;
  --purple:       #a855f7;
  --blue:         #3b82f6;
  --nav-bg:       rgba(8,8,8,0.94);
  --card-shadow:  0 4px 24px rgba(0,0,0,0.5);
  --invert-logo:  0;
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg:           #F5F2EC;
  --bg-2:         #EDEAE3;
  --bg-3:         #E4E0D8;
  --bg-4:         #D8D4CC;
  --border:       #D0CBC0;
  --border-2:     #C4BFB4;
  --text:         #1A1714;
  --text-2:       #5a554e;
  --text-3:       #9a958e;
  --orange:       #E84400;
  --orange-dim:   #c23a00;
  --orange-glow:  rgba(232,68,0,0.1);
  --yellow:       #D4A800;
  --green:        #00C46A;
  --purple:       #7c3aed;
  --blue:         #2563eb;
  --nav-bg:       rgba(245,242,236,0.94);
  --card-shadow:  0 4px 24px rgba(0,0,0,0.12);
  --invert-logo:  1;
}

/* ── RESET ── */
*, *::before, *::after {
  margin: 0; padding: 0; box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: 'IBM Plex Mono', monospace;
  min-height: 100svh;
  overflow-x: hidden;
  transition: background 0.25s, color 0.25s;
}
img { display: block; max-width: 100%; }
a  { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea { font-family: inherit; }

/* ── GRAIN OVERLAY ── */
[data-theme="dark"] body::after {
  content: '';
  position: fixed; inset: 0; z-index: 9999;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 120px;
  opacity: 0.025;
}

/* ── CONTAINER ── */
.container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px;
}

/* Desktop centering wrapper */
.page-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  position: relative;
}

/* Desktop side decoration */
@media (min-width: 640px) {
  body { background: var(--bg-2); }
  .page-wrap {
    background: var(--bg);
    min-height: 100svh;
    box-shadow: 0 0 0 1px var(--border), 0 24px 80px rgba(0,0,0,0.4);
  }
  [data-theme="light"] .page-wrap {
    box-shadow: 0 0 0 1px var(--border), 0 24px 60px rgba(0,0,0,0.15);
  }
}

/* ── BASE TYPOGRAPHY (scale-aware) ── */
.t-eyebrow {
  font-size: calc(10px * var(--fs-scale));
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--orange);
  display: flex; align-items: center; gap: 10px;
}
.t-eyebrow::before { content:''; width:24px; height:1px; background:var(--orange); }

.t-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: calc(clamp(32px, 9vw, 42px) * var(--fs-scale));
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}
.t-title em { font-style: normal; color: var(--orange); }

.t-mono {
  font-size: calc(12px * var(--fs-scale));
  line-height: 1.8;
  color: var(--text-2);
}

/* ── UTILITIES ── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mt-32 { margin-top: 32px; }

.divider { height: 1px; background: var(--border); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-3); border: 1px solid var(--border-2);
  padding: 4px 10px; border-radius: 100px;
  font-size: calc(9px * var(--fs-scale));
  letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--text-3);
}
.badge .dot { width:5px; height:5px; border-radius:50%; }
.badge .dot.green { background: var(--green); animation: blink 1.5s infinite; }
.badge .dot.orange { background: var(--orange); }

@keyframes blink { 0%,100%{opacity:1} 50%{opacity:0.2} }

/* ── SECTION PADDING ── */
.section { padding: 40px 16px; }
.section-sm { padding: 24px 16px; }
