/* =============================================================================
   PRISM — Idle Light design system
   Tokens, themes, reset, and the shared site chrome (header, footer,
   page header, mode toggle). Product-specific systems — Calibre for Lunet,
   Sprocket for Spool — extend these tokens in each product's own codebase.
   ============================================================================= */

/* -----------------------------------------------------------------------------
   Tokens
   ----------------------------------------------------------------------------- */

:root {
  /* Neutrals */
  --n-50:  #FAFAF8;
  --n-100: #F4F4F5;
  --n-200: #E4E4E7;
  --n-300: #D4D4D8;
  --n-400: #A1A1AA;
  --n-500: #71717A;
  --n-600: #52525B;
  --n-700: #3F3F46;
  --n-800: #27272A;
  --n-900: #18181B;
  --n-950: #09090B;

  /* Spacing (4pt grid) */
  --space-xxs: 2px;
  --space-xs:  4px;
  --space-sm:  8px;
  --space-md:  12px;
  --space-lg:  16px;
  --space-xl:  24px;
  --space-2xl: 32px;
  --space-3xl: 48px;
  --space-4xl: 64px;
  --space-5xl: 96px;
  --space-6xl: 144px;

  /* Typography */
  --font-sans:  'Inter', system-ui, -apple-system, sans-serif;
  --font-serif: 'Instrument Serif', Georgia, 'Times New Roman', serif;
  --font-mono:  'IBM Plex Mono', 'SF Mono', Menlo, monospace;

  /* Product accents — used only when referencing products */
  --lunet-blue: #506786;
  --lunet-tint: #1e2a38;
  --spool-red:  #C8402D;
  --spool-tint: #2a0f08;

  /* Motion */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  /* Theme — dark only */
  --bg:            #09090B;
  --bg-elevated:   #18181B;
  --bg-tint:       #18181B;
  --bg-sunken:     #050506;
  --text:          #FAFAF8;
  --text-muted:    #A1A1AA;
  --text-soft:     #71717A;
  --text-whisper:  rgba(250, 250, 248, 0.3);
  --border:        #27272A;
  --border-subtle: #1a1a1c;
  --callout-bg:     #2a0f08;
  --callout-text:   #FEE7E2;
  --callout-border: #E06B52;
}

/* -----------------------------------------------------------------------------
   Reset & base
   ----------------------------------------------------------------------------- */

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  transition: background 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Subtle grain overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 128px 128px;
  mix-blend-mode: screen;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

::selection {
  background: var(--text);
  color: var(--bg);
}

/* -----------------------------------------------------------------------------
   Layout — 12-column editorial shell
   ----------------------------------------------------------------------------- */

.shell {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
}

/* -----------------------------------------------------------------------------
   Site header
   ----------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px) saturate(1.2);
  -webkit-backdrop-filter: blur(20px) saturate(1.2);
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  border-bottom: 1px solid var(--border-subtle);
  padding: var(--space-lg) 0;
  transition: border-color 0.3s ease, background 0.3s ease;
}

.site-header__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2xl);
}

.wordmark {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: -0.01em;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.wordmark__mark {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text);
  transform: translateY(-1px);
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1;   transform: translateY(-1px) scale(1); }
  50%      { opacity: 0.6; transform: translateY(-1px) scale(0.85); }
}

.nav {
  display: flex;
  align-items: center;
  gap: var(--space-2xl);
}

.nav__link {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-soft);
  transition: color 0.2s ease;
  position: relative;
}

.nav__link:hover {
  color: var(--text);
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -4px;
  height: 1px;
  background: var(--text);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.nav__link:hover::after {
  transform: scaleX(1);
}

/* -----------------------------------------------------------------------------
   Content pages — shared chrome for /privacy, /support, and similar
   ----------------------------------------------------------------------------- */

.content {
  flex: 1;
  padding: var(--space-5xl) 0;
}

.page-header {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: var(--space-xl);
  align-items: baseline;
  margin-bottom: var(--space-4xl);
  padding-bottom: var(--space-xl);
  border-bottom: 1px solid var(--border);
}

.page-header__kicker {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--text-whisper);
  text-transform: uppercase;
}

.page-header__title {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(40px, 5.6vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text);
}

.page-header__title em {
  font-style: italic;
}

/* -----------------------------------------------------------------------------
   Site footer
   ----------------------------------------------------------------------------- */

.site-footer {
  padding: var(--space-3xl) 0 var(--space-2xl);
  border-top: 1px solid var(--border);
}

.site-footer__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  align-items: baseline;
}

@media (min-width: 720px) {
  .site-footer__row {
    grid-template-columns: auto 1fr auto;
    gap: var(--space-4xl);
  }
}

.site-footer__copy {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.05em;
  color: var(--text-whisper);
}

.site-footer__links {
  display: flex;
  gap: var(--space-2xl);
  justify-self: center;
}

.site-footer__link {
  font-family: var(--font-sans);
  font-size: 13px;
  color: var(--text-soft);
  transition: color 0.2s ease;
}

.site-footer__link:hover {
  color: var(--text);
}

.site-footer__meta {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-whisper);
  justify-self: end;
}

/* -----------------------------------------------------------------------------
   Responsive — shared chrome
   ----------------------------------------------------------------------------- */

@media (max-width: 640px) {
  .page-header {
    grid-template-columns: 1fr;
    gap: var(--space-sm);
  }

  .site-footer__links {
    justify-self: start;
    gap: var(--space-lg);
  }

  .site-footer__meta {
    justify-self: start;
  }
}

/* -----------------------------------------------------------------------------
   Motion accessibility
   ----------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
