/* ============================================================
   DESIGN TOKENS V2 — system10h.com
   Sesja R1 / CP1 | 2026-04-18 | Editorial Craft
   DNA: Resend 45% + Raycast 25% + Linear 20% + Arc/Granola 10%
   ============================================================ */

:root {
  /* -----------------------------------------
     PALETTE — warm amber primary, restricted
     ----------------------------------------- */
  --color-bg:              #0A0908;  /* off-black, warm undertone */
  --color-bg-raised:       #131110;  /* cards, elevated surfaces */
  --color-text-primary:    #F7F3EC;  /* cream, paper-like */
  --color-text-secondary:  #A8A29E;  /* stone — metadata, muted */
  --color-text-tertiary:   #57534E;  /* stone-600 — captions */
  --color-border:          #1C1917;  /* stone-900 — dividers */
  --color-border-subtle:   #292524;  /* stone-800 — hover states */

  --color-accent:          #D4A574;  /* warm amber — CTA, keywords */
  --color-accent-dim:      #A67F53;  /* amber-700 — hover */
  --color-accent-faint:    rgba(212, 165, 116, 0.08); /* amber tint bg */

  --color-signal:          #E85D4F;  /* warm red — RARE, max 1-2 places */
  --color-success:         #7FA074;  /* muted sage — sent/active status */

  /* -----------------------------------------
     TYPOGRAPHY — Fraunces + Inter + Geist Mono
     Variable fonts with opsz/wght/SOFT axes
     ----------------------------------------- */
  --font-display: 'Fraunces', 'Times New Roman', serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono:    'Geist Mono', 'JetBrains Mono', ui-monospace, Consolas, monospace;

  /* Modular scale — Perfect Fourth (1.333) */
  --text-xs:   12px;
  --text-sm:   14px;
  --text-base: 16px;
  --text-lg:   19px;
  --text-xl:   24px;
  --text-2xl:  32px;
  --text-3xl:  42px;
  --text-4xl:  56px;
  --text-5xl:  72px;   /* H2 — Fraunces opsz=72 */
  --text-6xl:  96px;
  --text-display: clamp(4rem, 10vw, 9rem);  /* H1 — Fraunces opsz=144 responsive */

  /* Line heights */
  --leading-tight:  1.1;
  --leading-snug:   1.3;
  --leading-normal: 1.5;
  --leading-relaxed: 1.65;

  /* Letter spacing */
  --tracking-tight: -0.03em;   /* display */
  --tracking-snug:  -0.015em;  /* headings */
  --tracking-normal: 0;
  --tracking-wide:  0.05em;    /* caps, chapter markers */

  /* -----------------------------------------
     SPACING — 4/8px base scale
     ----------------------------------------- */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  20px;
  --space-6:  24px;
  --space-8:  32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;
  --space-48: 192px;

  /* -----------------------------------------
     RADII — 2 tiers only (flat premium)
     ----------------------------------------- */
  --radius-sm: 4px;   /* buttons, inputs, small cards */
  --radius-md: 8px;   /* cards, artifact blocks */

  /* -----------------------------------------
     SHADOWS — 2 tiers, subtle, NO glow
     ----------------------------------------- */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.6);

  /* -----------------------------------------
     MOTION — cubic-bezier, reduced-motion safe
     ----------------------------------------- */
  --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 180ms;
  --duration-med:  320ms;
  --duration-slow: 520ms;

  /* -----------------------------------------
     LAYOUT
     ----------------------------------------- */
  --container-narrow: 680px;
  --container-med:    960px;
  --container-wide:   1200px;
}

/* ============================================================
   GRAIN OVERLAY — subtle paper-noise texture (4% opacity)
   Applied to body::before for editorial craft feel
   ============================================================ */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  mix-blend-mode: overlay;
}

/* ============================================================
   BASE
   ============================================================ */

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

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

body {
  background: var(--color-bg);
  color: var(--color-text-primary);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-relaxed);
  font-feature-settings: 'ss01', 'cv11';  /* Inter stylistic sets */
  overflow-x: hidden;
}

/* ============================================================
   TYPOGRAPHY CLASSES
   ============================================================ */

.display-h1 {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 400;
  font-variation-settings: 'opsz' 144, 'SOFT' 50, 'wght' 400;
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text-primary);
}

.display-h2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 5vw, 4.5rem);
  font-weight: 500;
  font-variation-settings: 'opsz' 72, 'SOFT' 30, 'wght' 500;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-snug);
  color: var(--color-text-primary);
}

.chapter-marker {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variation-settings: 'opsz' 24, 'SOFT' 0, 'wght' 600;
  line-height: 1;
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--color-accent);
}

.meta-mono {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--color-text-secondary);
}

.body-lead {
  font-size: var(--text-lg);
  line-height: var(--leading-relaxed);
  color: var(--color-text-secondary);
}

/* ============================================================
   BUTTONS — flat premium, no glow, no lift
   ============================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 500;
  letter-spacing: -0.005em;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out),
              border-color var(--duration-fast) var(--ease-out),
              color var(--duration-fast) var(--ease-out);
  text-decoration: none;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-bg);
  border-color: var(--color-accent);
}

.btn-primary:hover {
  background: var(--color-accent-dim);
  border-color: var(--color-accent-dim);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text-primary);
  border-color: var(--color-border-subtle);
}

.btn-secondary:hover {
  border-color: var(--color-text-secondary);
  background: var(--color-bg-raised);
}

.link-inline {
  color: var(--color-text-primary);
  text-decoration: none;
  border-bottom: 1px solid var(--color-border-subtle);
  transition: border-color var(--duration-fast) var(--ease-out);
}

.link-inline:hover {
  border-color: var(--color-accent);
}

/* ============================================================
   ARTIFACT CARDS — monospace draft fragments
   Hero BOLD MOVE component
   ============================================================ */

.artifact-card {
  background: var(--color-bg-raised);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-5);
  transition: border-color var(--duration-med) var(--ease-out);
}

.artifact-card:hover {
  border-color: var(--color-border-subtle);
}

.artifact-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-4);
}

.artifact-meta {
  display: flex;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.artifact-body {
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.7;
  color: var(--color-text-primary);
  white-space: pre-wrap;
}

.artifact-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--color-text-secondary);
  letter-spacing: 0.02em;
}

.status-sent {
  color: var(--color-success);
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.status-sent::before {
  content: '●';
  font-size: 8px;
  line-height: 1;
}

/* ============================================================
   A11Y — reduced motion
   ============================================================ */

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