/* ============================================================
   LUTHIER — Design tokens & base styles
   "Construction, fine-tuned."
   ============================================================ */

:root {
  /* ---- Surface ---- */
  --parchment: #f5f4ed;
  --ivory: #faf9f5;
  --warm-sand: #e8e6dc;

  /* ---- Ink (warm) ---- */
  --ebony: #141413;
  --dark-surface: #30302e;
  --charcoal-warm: #4d4c48;
  --dark-warm: #3d3d3a;
  --olive: #5e5d59;
  --stone: #87867f;
  --warm-silver: #b0aea5;

  /* ---- Accent (used sparingly) ---- */
  --terracotta: #c96442;
  --coral: #d97757;

  /* ---- Borders ---- */
  --border-cream: #f0eee6;
  --border-warm: #e8e6dc;
  --border-dark: #30302e;
  --ring-warm: #d1cfc5;
  --ring-deep: #c2c0b6;

  /* ---- Semantic ---- */
  --focus-blue: #3898ec;
  --error-crimson: #b53333;

  /* ---- Type stacks ---- */
  --font-serif: "EB Garamond", Georgia, "Times New Roman", serif;
  --font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* ---- Radii ---- */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 12px;
  --r-xl: 16px;
  --r-2xl: 24px;
  --r-3xl: 32px;

  /* ---- Shadows ---- */
  --ring-1: 0 0 0 1px var(--border-cream);
  --ring-warm-1: 0 0 0 1px var(--ring-warm);
  --whisper: 0 4px 24px rgba(0, 0, 0, 0.05);

  /* ---- Layout ---- */
  --container: 1200px;
  --narrow: 720px;
  --reading: 640px;
}

/* ============================================================ */
/* Reset / base                                                  */
/* ============================================================ */

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ebony);
  background: var(--parchment);
  font-feature-settings: "ss01", "ss02";
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

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

button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0; }
a { color: inherit; text-decoration: none; }

::selection { background: var(--terracotta); color: var(--ivory); }

/* ============================================================ */
/* Type scale                                                    */
/* ============================================================ */

.t-display     { font-family: var(--font-serif); font-weight: 500; font-size: clamp(40px, 7vw, 88px); line-height: 1.05; letter-spacing: -0.01em; }
.t-h1          { font-family: var(--font-serif); font-weight: 500; font-size: clamp(36px, 5vw, 52px); line-height: 1.15; letter-spacing: -0.005em; }
.t-h2          { font-family: var(--font-serif); font-weight: 500; font-size: clamp(28px, 3.4vw, 36px); line-height: 1.25; }
.t-h3          { font-family: var(--font-serif); font-weight: 500; font-size: 32px; line-height: 1.1; }
.t-h4          { font-family: var(--font-serif); font-weight: 500; font-size: 25px; line-height: 1.2; }
.t-pullquote   { font-family: var(--font-serif); font-weight: 500; font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; font-style: italic; }

.t-body-serif  { font-family: var(--font-serif); font-weight: 400; font-size: 18px; line-height: 1.65; }
.t-body-lg     { font-family: var(--font-sans); font-weight: 400; font-size: 20px; line-height: 1.6; color: var(--olive); }
.t-body        { font-family: var(--font-sans); font-weight: 400; font-size: 16px; line-height: 1.6; }
.t-body-sm     { font-family: var(--font-sans); font-weight: 400; font-size: 15px; line-height: 1.6; }
.t-caption     { font-family: var(--font-sans); font-weight: 400; font-size: 14px; line-height: 1.45; color: var(--stone); }

.t-label {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.12px;
  text-transform: uppercase;
}

.t-overline {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--stone);
}

.t-mono {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: 15px;
  line-height: 1.6;
  letter-spacing: -0.01em;
  font-feature-settings: "tnum", "zero";
}

.t-italic { font-style: italic; }

.color-olive   { color: var(--olive); }
.color-stone   { color: var(--stone); }
.color-ebony   { color: var(--ebony); }
.color-coral   { color: var(--coral); }
.color-terra   { color: var(--terracotta); }
.color-ivory   { color: var(--ivory); }
.color-silver  { color: var(--warm-silver); }
.color-charcoal { color: var(--charcoal-warm); }

/* ============================================================ */
/* Layout helpers                                                */
/* ============================================================ */

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 32px;
}

@media (max-width: 880px) {
  .container { padding: 0 24px; }
}
@media (max-width: 480px) {
  .container { padding: 0 18px; }
}

.section {
  padding: clamp(64px, 10vw, 144px) 0;
  position: relative;
}

.section--tight { padding: clamp(48px, 7vw, 96px) 0; }

.section--dark {
  background: var(--ebony);
  color: var(--warm-silver);
}

.section--dark .color-stone { color: var(--warm-silver); }

/* ============================================================ */
/* Components                                                    */
/* ============================================================ */

/* --- Buttons --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 500;
  line-height: 1;
  border-radius: var(--r-lg);
  padding: 14px 20px;
  min-height: 44px;
  transition: box-shadow 180ms ease, background-color 180ms ease, transform 200ms ease;
  white-space: nowrap;
}

.btn:active { transform: translateY(0.5px); }

.btn--primary {
  background: var(--terracotta);
  color: var(--ivory);
  box-shadow: 0 0 0 1px var(--terracotta);
}
.btn--primary:hover {
  background: #b75736;
  box-shadow: 0 0 0 1px #b75736, var(--whisper);
}

.btn--ghost {
  background: transparent;
  color: var(--ebony);
  box-shadow: 0 0 0 1px var(--border-warm);
}
.btn--ghost:hover { box-shadow: 0 0 0 1px var(--ring-warm); background: var(--ivory); }

.btn--sand {
  background: var(--warm-sand);
  color: var(--charcoal-warm);
  border-radius: var(--r-md);
  padding: 10px 14px;
  box-shadow: 0 0 0 1px var(--ring-warm);
  font-size: 15px;
}
.btn--sand:hover { box-shadow: 0 0 0 1px var(--ring-deep); }

.btn--dark {
  background: var(--ebony);
  color: var(--warm-silver);
  box-shadow: 0 0 0 1px var(--dark-surface);
  padding: 12px 20px;
}
.btn--dark:hover { background: var(--dark-surface); color: var(--ivory); }

.btn--link {
  color: var(--ebony);
  padding: 0;
  border-radius: 0;
  font-weight: 500;
  position: relative;
}
.btn--link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 1px;
  background: currentColor;
  transition: width 220ms ease;
}
.btn--link:hover::after { width: 100%; }

/* --- Arrow --- */
.btn .arrow { display: inline-block; transition: transform 220ms ease; }
.btn:hover .arrow { transform: translateX(2px); }

/* --- Card --- */

.card {
  background: var(--ivory);
  border-radius: var(--r-xl);
  border: 1px solid var(--border-cream);
  padding: 32px;
  transition: box-shadow 220ms ease, transform 220ms ease, border-color 220ms ease;
}

.card:hover {
  border-color: var(--ring-warm);
  box-shadow: var(--whisper);
}

/* --- Underline link (animated) --- */
.u-link {
  position: relative;
  display: inline-block;
}
.u-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 100%; height: 1px;
  background: currentColor;
  opacity: 0.3;
  transition: opacity 220ms ease;
}
.u-link:hover::after { opacity: 1; }

/* --- Hr / divider --- */
.divider {
  height: 1px;
  background: var(--border-cream);
  border: 0;
  margin: 0;
}
.section--dark .divider { background: var(--dark-surface); }

/* ============================================================ */
/* Reveal — disabled in this preview environment (transitions /
   keyframe animations are unreliable inside the host iframe).
   Elements are simply visible.                                  */
/* ============================================================ */

.reveal { opacity: 1; transform: none; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ============================================================ */
/* Focus                                                         */
/* ============================================================ */

:focus-visible {
  outline: 2px solid var(--focus-blue);
  outline-offset: 3px;
  border-radius: 2px;
}

/* ============================================================ */
/* Tweaks panel — preserve readability                           */
/* ============================================================ */

.tweaks-floating { z-index: 9999; }
