/* ============================================================
   IDEA JUNKIES — Shared Styles
   Variables, resets, typography, nav, buttons, section rules,
   annotation system, footer, animations, responsive base
   ============================================================ */

/* SCRATCHY FONT
   76 glyphs (basic ASCII, one ligature: a+t).
   Stars/asterisks: use Scratchy '*' glyph
   Arrows: SVG fallback (no arrow glyph in font)
   Underlines: SVG overlay (positional, cannot be a glyph)
   Circles: SVG overlay (positional, cannot be a glyph)
*/
@font-face {
  font-family: 'Scratchy';
  src: url('../fonts/Scratchy.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'ScratchySwashes';
  src: url('../fonts/ScratchySwashes.woff') format('woff');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg-primary: #0D1117;
  --bg-elevated: #161B22;
  --bg-belief: #111820;
  --border-subtle: rgba(255,255,255,0.07);
  --border-hover: rgba(255,255,255,0.14);
  --text-primary: rgba(255,255,255,0.92);
  --text-secondary: rgba(255,255,255,0.6);
  --text-tertiary: rgba(255,255,255,0.35);
  --gold: #F2B441;
  --coral: #F24968;
  --gradient: linear-gradient(135deg, #F2B441 0%, #F24968 100%);
  --purple: #7C3AED;
  --font-display: 'Clash Display', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --font-hand: 'Scratchy', 'Caveat', cursive;
  --sp-xs: 0.5rem; --sp-sm: 1rem; --sp-md: 1.5rem; --sp-lg: 2rem;
  --sp-xl: 3rem; --sp-2xl: 4rem; --sp-3xl: 6rem; --sp-4xl: 8rem; --sp-5xl: 10rem;
  --max-w: 1200px;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--font-body); background: var(--bg-primary);
  color: var(--text-primary); line-height: 1.7; overflow-x: hidden;
}
body::before {
  content: ''; position: fixed; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' 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)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none; z-index: 9999; opacity: 0.5;
}
.container { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-lg); }
section { padding: var(--sp-4xl) 0; position: relative; }

/* SKIP LINK */
.skip-link {
  position: absolute; top: -100%; left: var(--sp-lg);
  background: var(--gradient); color: var(--bg-primary);
  padding: 0.5rem 1rem; border-radius: 0 0 6px 6px;
  font-weight: 600; font-size: 0.875rem; text-decoration: none;
  z-index: 10000; transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* NAV */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  padding: var(--sp-md) 0; background: rgba(13,17,23,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
}
.nav-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-lg);
  display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { display: flex; align-items: center; text-decoration: none; }
.nav-logo img {
  height: 28px; width: auto; display: block;
}
.nav-links { display: flex; gap: var(--sp-lg); align-items: center; list-style: none; }
.nav-links a { color: var(--text-secondary); text-decoration: none; font-size: 0.875rem; font-weight: 500; transition: color 0.2s; }
.nav-links a:hover { color: var(--text-primary); }
.nav-cta {
  padding: 0.5rem 1.25rem; background: var(--gradient);
  color: var(--bg-primary) !important; -webkit-text-fill-color: var(--bg-primary) !important;
  border-radius: 6px; font-weight: 600; font-size: 0.8125rem;
}

/* HAMBURGER */
.nav-toggle {
  display: none; background: none; border: none; cursor: pointer;
  width: 40px; height: 40px; padding: 8px;
  color: var(--text-primary);
}
.nav-toggle svg { width: 100%; height: 100%; }

/* MOBILE NAV OVERLAY */
.nav-overlay {
  display: none; position: fixed; inset: 0; z-index: 999;
  background: rgba(13,17,23,0.95);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  flex-direction: column; align-items: center; justify-content: center;
  gap: var(--sp-lg); opacity: 0; transition: opacity 0.3s ease;
}
.nav-overlay.open { display: flex; opacity: 1; }
.nav-overlay a {
  color: var(--text-primary); text-decoration: none;
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 500;
  padding: 0.75rem 1.5rem; transition: color 0.2s;
}
.nav-overlay a:hover { color: var(--gold); }
.nav-overlay .nav-cta-mobile {
  margin-top: var(--sp-md); padding: 0.875rem 2rem;
  background: var(--gradient); color: var(--bg-primary);
  border-radius: 8px; font-weight: 600; font-size: 1rem;
  font-family: var(--font-body);
}
.nav-close {
  position: absolute; top: var(--sp-md); right: var(--sp-lg);
  background: none; border: none; cursor: pointer;
  color: var(--text-primary); width: 40px; height: 40px; padding: 8px;
}
.nav-close svg { width: 100%; height: 100%; }

/* BUTTONS */
.btn-primary {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.875rem 2rem; background: var(--gradient); color: var(--bg-primary);
  font-family: var(--font-body); font-weight: 600; font-size: 0.9375rem;
  border: none; border-radius: 8px; cursor: pointer; text-decoration: none;
  transition: all 0.25s ease;
}
.btn-primary:hover { box-shadow: 0 8px 30px rgba(242,180,65,0.15); }
.btn-ghost {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.875rem 1.5rem; background: transparent; color: var(--text-secondary);
  font-family: var(--font-body); font-weight: 500; font-size: 0.9375rem;
  border: 1px solid var(--border-subtle); border-radius: 8px; cursor: pointer;
  text-decoration: none; transition: all 0.25s ease;
}
.btn-ghost:hover { border-color: var(--border-hover); color: var(--text-primary); }
.btn-ghost-gradient {
  border: 1px solid transparent;
  border-image: var(--gradient) 1;
  background: transparent;
  background-image: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  font-weight: 600;
}
.btn-ghost-gradient:hover {
  box-shadow: 0 4px 20px rgba(242,180,65,0.15);
}

/* SECTION RULE */
.section-rule { max-width: var(--max-w); margin: 0 auto; padding: 0 var(--sp-lg); }
.section-rule-line { height: 1px; background: var(--border-subtle); position: relative; }
.section-rule-line::before {
  content: ''; position: absolute; left: 0; top: -1px;
  width: 60px; height: 3px; background: var(--gradient); border-radius: 2px;
}

/* ANNOTATION SYSTEM */
.ann { font-family: var(--font-hand); display: inline-block; position: relative; }
.ann-gradient {
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.ann-label {
  font-size: 2.5rem; transform: rotate(-2deg); transform-origin: left center;
  margin-bottom: var(--sp-sm); display: inline-flex; align-items: center; gap: 0.5rem;
  font-weight: normal; opacity: 1;
}
.ann-underline { position: relative; display: inline; }
.ann-underline svg {
  position: absolute; bottom: -4px; left: -2px;
  width: calc(100% + 4px); height: 8px; overflow: visible;
}
.ann-circle-wrap { position: relative; display: inline; }
.ann-circle-wrap > svg {
  position: absolute; top: -8px; left: -10px;
  width: calc(100% + 20px); height: calc(100% + 16px);
  overflow: visible; pointer-events: none;
}
.ann-arrow { width: 32px; height: 22px; flex-shrink: 0; }
.ann-star {
  font-family: var(--font-hand); font-size: 1.5em;
  font-weight: normal;
  background: var(--gradient); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
  display: inline-block; line-height: 1;
}

/* FOOTER */
footer { padding: var(--sp-2xl) 0; border-top: 1px solid var(--border-subtle); }
.footer-inner {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: var(--sp-md);
}
.footer-brand { display: flex; align-items: center; }
.footer-brand img { height: 22px; width: auto; display: block; }
.footer-links { display: flex; gap: var(--sp-lg); list-style: none; }
.footer-links a { color: var(--text-tertiary); text-decoration: none; font-size: 0.8125rem; transition: color 0.2s; }
.footer-links a:hover { color: var(--text-secondary); }
.footer-copy { font-size: 0.75rem; color: var(--text-tertiary); }

/* ANIMATIONS */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-up { opacity: 0; animation: fadeUp 0.6s ease-out forwards; }
.fade-up-d1 { animation-delay: 0.1s; }
.fade-up-d2 { animation-delay: 0.2s; }
.fade-up-d3 { animation-delay: 0.35s; }

/* SHARED PAGE STYLES */
.page-hero {
  padding: var(--sp-5xl) 0 var(--sp-3xl); position: relative;
}
.page-hero h1 {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(2.5rem, 5vw, 4rem); line-height: 1.1;
  letter-spacing: -0.03em; margin-bottom: var(--sp-md);
}
.page-hero .lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  color: var(--text-secondary); max-width: 640px; line-height: 1.75;
}

/* RESPONSIVE — SHARED */
@media (max-width: 900px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  section { padding: var(--sp-3xl) 0; }
}
@media (max-width: 600px) {
  .container { padding: 0 var(--sp-md); }
}
