/* ═══════════════════════════════════════════
   base.css — Reset, Variables, Typography
   FrenchWrite
═══════════════════════════════════════════ */

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

:root {
  /* ── Palette: Warm Parchment Light ── */
  --cream:       #f5f0e8;
  --cream-soft:  #ede7da;
  --cream-border:#d8cfbe;
  --ink:         #1a1612;
  --ink-soft:    #3d3530;
  --ink-muted:   #7a6f65;
  --ink-ghost:   #b0a598;
  --rouge:       #c0392b;
  --rouge-soft:  #e74c3c;
  --or:          #c9a84c;
  --bleu:        #2c5f8a;
  --bleu-soft:   #3d7ab5;
  --vert:        #2d8a5f;

  /* ── Semantic Tokens ── */
  --bg:           var(--cream);
  --bg-panel:     var(--cream-soft);
  --bg-input:     #faf7f2;
  --border:       var(--cream-border);
  --text:         var(--ink);
  --text-soft:    var(--ink-soft);
  --text-muted:   var(--ink-muted);
  --text-ghost:   var(--ink-ghost);
  --accent:       var(--rouge);
  --accent-soft:  var(--rouge-soft);
  --highlight:    var(--or);
  --link:         var(--bleu);
  --success:      var(--vert);
  --shadow-sm:    0 1px 3px rgba(26,22,18,.08);
  --shadow-md:    0 4px 16px rgba(26,22,18,.12);
  --shadow-lg:    0 8px 32px rgba(26,22,18,.16);

  /* ── Typography ── */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Lora', 'Georgia', serif;
  --font-mono:    'DM Mono', 'Courier New', monospace;

  /* ── Spacing ── */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;

  /* ── Radii ── */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* ── Transitions ── */
  --ease:      cubic-bezier(.4,0,.2,1);
  --trans-fast: 120ms var(--ease);
  --trans-mid:  240ms var(--ease);
  --trans-slow: 400ms var(--ease);
}

/* ── Accessibility ── */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

.hidden { display: none !important; }

/* ── Base Elements ── */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  transition: background-color var(--trans-slow), color var(--trans-slow);
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color var(--trans-fast);
}
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ── Focus Visible ── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-panel); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-ghost); }

/* ── Selection ── */
::selection {
  background: rgba(192, 57, 43, .15);
  color: var(--text);
}

/* ── Buttons Base ── */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  transition: all var(--trans-fast);
}
button:disabled { cursor: not-allowed; opacity: .4; }

/* ── Input Base ── */
input, select, textarea {
  font-family: inherit;
  border: none;
  outline: none;
  background: none;
}
