/* =========================================================
   WordyTrainer — design tokens
   ========================================================= */
:root {
  /* Palette — warm neutral + orange accent */
  --bg: #FAFAF7;
  --bg-soft: #F3F2ED;
  --bg-paper: #FFFFFF;
  --ink: #15151A;
  --ink-2: #2B2B33;
  --ink-mute: #6C6C75;
  --ink-faint: #9A9AA2;
  --line: #E7E5DF;
  --line-strong: #D6D3CC;

  --dark: #151419;           /* matches app window bg tone */
  --dark-2: #1F1E24;
  --dark-elev: #28262D;
  --dark-line: #37353D;
  --dark-ink: #F3F1EC;
  --dark-mute: #9A98A0;

  --accent: #FF5A1F;         /* app orange */
  --accent-2: #FF7A3D;
  --accent-soft: #FFEEE4;
  --accent-ink: #2B0F03;

  /* Radii & shadows */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --r-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(20, 14, 5, 0.04), 0 2px 6px rgba(20, 14, 5, 0.04);
  --shadow-md: 0 4px 12px rgba(20, 14, 5, 0.06), 0 12px 32px rgba(20, 14, 5, 0.06);
  --shadow-lg: 0 14px 34px rgba(20, 14, 5, 0.08), 0 40px 80px rgba(20, 14, 5, 0.10);
  --shadow-window: 0 20px 40px rgba(10, 8, 3, 0.18), 0 60px 120px rgba(10, 8, 3, 0.22);

  /* Typography — runtime-swappable by --font-preset */
  --font-display: 'Instrument Serif', 'Times New Roman', serif;
  --font-sans: 'Geist', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --font-hero: var(--font-sans);
  --font-heading: var(--font-sans);
  --hero-weight: 500;
  --heading-weight: 600;
  --hero-tracking: -0.04em;
  --heading-tracking: -0.03em;
  --hero-italic-weight: 600;
  --hero-italic-style: normal;
  --hero-italic-family: var(--font-sans);

  /* Layout */
  --maxw: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --section-y: clamp(72px, 10vw, 128px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
a { color: inherit; text-decoration: none; }

/* Utility: section container */
.wrap {
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ------ Typography classes ------ */
.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-mute);
}

h1, h2, h3, h4 { margin: 0; font-weight: 600; letter-spacing: -0.02em; line-height: 1.05; }
p { margin: 0; }

/* ------ Buttons ------ */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-size: 15px; font-weight: 500;
  transition: transform .15s ease, background .15s ease, box-shadow .15s ease;
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 6px 18px -4px rgba(255, 90, 31, 0.5);
}
.btn-primary:hover { transform: translateY(-1px); background: var(--accent-2); }
.btn-secondary {
  background: var(--bg-paper);
  color: var(--ink);
  border: 1px solid var(--line-strong);
}
.btn-secondary:hover { background: var(--bg-soft); }
.btn-ghost-dark {
  background: transparent; color: var(--dark-ink);
  border: 1px solid rgba(255,255,255,0.2);
}
.btn-ghost-dark:hover { background: rgba(255,255,255,0.06); }
.btn-white {
  background: white; color: var(--ink);
}
.btn-white:hover { transform: translateY(-1px); }

/* ------ macOS window chrome ------ */
.macos-window {
  background: var(--dark);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-window);
  border: 1px solid rgba(255,255,255,0.06);
}
.macos-bar {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: #201F25;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.macos-bar .dot { width: 12px; height: 12px; border-radius: 50%; }
.macos-bar .dot.r { background: #FF5F56; }
.macos-bar .dot.y { background: #FFBD2E; }
.macos-bar .dot.g { background: #27C93F; }

/* ------ Pop-up card (the product's hero metaphor) ------ */
.popup-card {
  background: #1A191F;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 22px 24px 20px;
  color: var(--dark-ink);
  box-shadow: 0 30px 60px rgba(0,0,0,0.45), 0 8px 16px rgba(0,0,0,0.3);
  min-width: 280px;
  position: relative;
  overflow: hidden;
}
.popup-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--accent);
}
.popup-word {
  font-size: 24px; font-weight: 600; letter-spacing: -0.01em;
  display: flex; align-items: baseline; gap: 12px;
  margin-bottom: 4px;
}
.popup-transcription {
  font-family: var(--font-mono);
  font-size: 14px; color: var(--dark-mute);
  font-weight: 400;
}
.popup-translation {
  font-size: 20px; color: var(--dark-ink);
  margin-top: 6px;
}
.popup-meta {
  display: flex; align-items: center; gap: 8px;
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid rgba(255,255,255,0.06);
  font-size: 12px; color: var(--dark-mute);
  font-family: var(--font-mono);
}

/* ------ Tag/chip ------ */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  border-radius: var(--r-pill);
  background: var(--bg-soft);
  color: var(--ink-2);
  font-size: 13px; font-weight: 500;
}
.chip-accent { background: var(--accent-soft); color: var(--accent); }

/* ------ Animations ------ */
@keyframes popIn {
  0% { opacity: 0; transform: translateY(8px) scale(0.96); }
  60% { opacity: 1; }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes fadeUp {
  0% { opacity: 0; transform: translateY(12px); }
  100% { opacity: 1; transform: translateY(0); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

.fade-up { animation: fadeUp 0.7s ease both; }
.pop-in { animation: popIn 0.5s cubic-bezier(.2,.9,.3,1) both; }

/* Motion off */
[data-motion="off"] * { animation: none !important; transition: none !important; }

/* ------ Responsive helpers ------ */
@media (max-width: 860px) {
  :root { --section-y: 64px; }
  body { font-size: 16px; }
  .v1-nav-links { display: none !important; }
  .v1-hero-grid { grid-template-columns: 1fr !important; }
  .v1-footer { grid-template-columns: 1fr !important; }
  .v2-pain-row { grid-template-columns: 60px 1fr !important; }
  .v2-pain-row > div:nth-child(3) { grid-column: 2 / -1 !important; }
}

@media (max-width: 640px) {
  body { font-size: 15px; }
  h1, h2 { word-break: break-word; }
  .btn { padding: 12px 18px; font-size: 14px; }
  .popup-card { min-width: auto !important; }
}

/* Prevent horizontal overflow from oversized headlines / shadows */
section, footer, header, nav { overflow-x: clip; }

/* Small text */
.small { font-size: 13px; color: var(--ink-mute); }
.micro { font-size: 12px; color: var(--ink-mute); font-family: var(--font-mono); letter-spacing: 0.04em; }
