/* Taste Matrix — Shared Styles */
/* Informed by: github.com/Leonxlnx/taste-skill */
/* Design language: Launchpad (Instrument Sans, white, black accent) */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Sans:wght@400;500;600&family=IBM+Plex+Mono:wght@400;500&display=swap');

/* ─── TOKENS ────────────────────────────────────────────────────────── */
:root {
  --bg: #ffffff;
  --bg-alt: #fafafa;
  --text: #1a1a1a;
  --text-secondary: #666666;
  --text-tertiary: #999999;
  --accent: #1a1a1a;
  --accent-hover: #333333;
  --accent-muted: rgba(26, 26, 26, 0.06);
  --border: #f0f0f0;
  --border-light: #f5f5f5;

  --font-body: 'Instrument Sans', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  --content-narrow: 520px;
  --content-mid: 720px;
  --content-wide: 960px;

  --radius: 10px;
  --radius-sm: 8px;
  --ease: 0.2s ease;
  --transition: 0.2s ease;
  --transition-slow: 0.4s ease;
  --nav-height: 56px;

  /* Kept for backward compat with canvas morphing */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
}

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

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

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 15.5px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100dvh;
  position: relative;
}

/* No grain texture overlay */

img, video, svg { display: block; max-width: 100%; }

a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition);
}
a:hover { color: var(--accent-hover); }

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

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

ul, ol { list-style: none; }

/* ─── TYPOGRAPHY ────────────────────────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
}
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.6rem); }
h4 { font-size: clamp(1rem, 1.8vw, 1.25rem); }
h5 {
  font-size: 0.9375rem;
  font-weight: 600;
  font-family: var(--font-body);
}
h6 {
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-family: var(--font-mono);
  color: var(--text-tertiary);
}

/* max-width on prose paragraphs — apply via class, not globally */
.prose p, article p { max-width: 60ch; }

code, pre {
  font-family: var(--font-mono);
  font-size: 0.8125em;
  font-variant-numeric: tabular-nums;
}

pre {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: var(--space-sm);
  overflow-x: auto;
  line-height: 1.5;
}

code {
  background: var(--bg-alt);
  padding: 0.1em 0.3em;
  border-radius: 4px;
}
pre code { background: none; padding: 0; }

blockquote {
  border-left: 2px solid var(--accent);
  padding-left: var(--space-sm);
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-style: italic;
  font-size: 1.0625rem;
  line-height: 1.5;
}

small, .text-sm { font-size: 0.8125rem; }
.text-xs { font-size: 0.6875rem; }
.text-secondary { color: var(--text-secondary); }
.text-tertiary { color: var(--text-tertiary); }
.text-accent { color: var(--accent); }
.font-display { font-family: var(--font-body); }
.font-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.label {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

/* ─── LAYOUT ────────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: 0 2rem;
}
.narrow { max-width: var(--content-narrow); }
.mid { max-width: var(--content-mid); }

/* ─── BUTTONS ───────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.005em;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  line-height: 1;
  white-space: nowrap;
  transform: translateY(0);
}
.btn:active {
  transform: translateY(1px) scale(0.98);
  transition-duration: 80ms;
}

/* Focus ring — accessibility requirement */
.btn:focus-visible,
.input:focus-visible,
.input-bordered:focus-visible,
.textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: 1px solid var(--accent);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--accent-muted);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid transparent;
  padding: 0.5rem 0.75rem;
}
.btn-ghost:hover { color: var(--text); }

.btn-text {
  background: none;
  color: var(--accent);
  padding: 0;
  border: none;
  font-weight: 500;
}
.btn-text:hover { color: var(--accent-hover); }

.btn-lg { padding: 0.75rem 1.5rem; font-size: 0.9375rem; }
.btn-sm { padding: 0.5rem 1rem; font-size: 0.8125rem; }

/* ─── INPUTS ────────────────────────────────────────────────────────── */
.input {
  width: 100%;
  padding: 0.625rem 0;
  font-size: 0.9375rem;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  outline: none;
  transition: border-color var(--transition);
}
.input:focus { border-bottom-color: var(--accent); }

.input-bordered {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}
.input-bordered:focus { border-color: var(--accent); }

.textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.9375rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  outline: none;
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
  transition: border-color var(--transition);
}
.textarea:focus { border-color: var(--accent); }

/* ─── PROGRESS BAR ──────────────────────────────────────────────────── */
.progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--border);
  z-index: 100;
}
.progress-bar__fill {
  height: 100%;
  background: var(--accent);
  transition: width 400ms ease;
  width: 0%;
}

/* ─── CARDS ─────────────────────────────────────────────────────────── */
.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-md);
  background: var(--bg);
  transition: border-color var(--transition);
}
.card--selected { border-color: var(--accent); }
.card--flat { border: none; background: var(--bg-alt); }
.card--interactive {
  cursor: pointer;
  transition: border-color var(--transition), transform var(--transition);
}
.card--interactive:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.card--interactive:active {
  transform: translateY(0) scale(0.995);
}

/* ─── DIVIDERS ──────────────────────────────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: var(--border);
  border: none;
}
.divider--accent {
  background: var(--accent);
  width: 2rem;
  height: 2px;
}

/* ─── ANIMATIONS ────────────────────────────────────────────────────── */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fillWidth { from { width: 0; } }

/* Reveal on scroll */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 500ms ease, transform 500ms ease;
}
.fade-in.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children — cascade via CSS custom property */
.stagger-children > * {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 400ms ease, transform 400ms ease;
}
.stagger-children.visible > * {
  opacity: 1;
  transform: translateY(0);
}
.stagger-children.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger-children.visible > *:nth-child(2) { transition-delay: 60ms; }
.stagger-children.visible > *:nth-child(3) { transition-delay: 120ms; }
.stagger-children.visible > *:nth-child(4) { transition-delay: 180ms; }
.stagger-children.visible > *:nth-child(5) { transition-delay: 240ms; }
.stagger-children.visible > *:nth-child(6) { transition-delay: 300ms; }

/* ─── RESPONSIVE ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  :root {
    --space-lg: 2rem;
    --space-xl: 3rem;
  }
  .container { padding: 0 1.25rem; }
  h1 { font-size: 1.875rem; }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  :root {
    --space-md: 1.25rem;
    --space-lg: 1.5rem;
    --space-xl: 2.5rem;
  }
}

/* ─── UTILITY ───────────────────────────────────────────────────────── */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}
.hidden { display: none !important; }
.mt-xs { margin-top: var(--space-xs); }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-xs { margin-bottom: var(--space-xs); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
