/* ============================================
   CiaoItalia — Design System
   ============================================ */

:root, [data-theme="cream"] {
  /* Base — warm Italian heritage */
  --bg: oklch(0.975 0.012 80);
  --bg-elev: oklch(0.99 0.008 80);
  --bg-sunk: oklch(0.95 0.018 80);
  --ink: oklch(0.18 0.015 60);
  --ink-2: oklch(0.35 0.015 60);
  --ink-3: oklch(0.55 0.012 60);
  --rule: oklch(0.88 0.015 70);
  --rule-strong: oklch(0.75 0.018 70);

  /* Italian tricolor accents */
  --it-green: oklch(0.52 0.13 145);
  --it-red: oklch(0.55 0.17 25);
  --it-red-ink: oklch(0.45 0.17 25);

  /* Accent */
  --accent: oklch(0.45 0.16 25); /* deep red */
  --accent-ink: oklch(0.99 0 0);

  /* Type */
  --font-display: "Cormorant Garamond", "Playfair Display", Georgia, serif;
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-sans: "Inter", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;

  /* Radii (Italian heritage = low radii) */
  --r-sm: 2px;
  --r-md: 3px;
  --r-lg: 4px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 48px;
  --s-8: 64px;
  --s-9: 96px;
  --s-10: 128px;
}

[data-theme="charcoal"] {
  --bg: oklch(0.17 0.008 60);
  --bg-elev: oklch(0.22 0.008 60);
  --bg-sunk: oklch(0.13 0.008 60);
  --ink: oklch(0.96 0.008 80);
  --ink-2: oklch(0.78 0.012 80);
  --ink-3: oklch(0.58 0.012 80);
  --rule: oklch(0.30 0.012 60);
  --rule-strong: oklch(0.42 0.012 60);

  --it-green: oklch(0.62 0.15 145);
  --it-red: oklch(0.62 0.18 25);
  --it-red-ink: oklch(0.70 0.18 25);

  --accent: oklch(0.68 0.17 25);
  --accent-ink: oklch(0.13 0.008 60);
}

[data-theme="terracotta"] {
  --bg: oklch(0.93 0.035 55);
  --bg-elev: oklch(0.96 0.025 55);
  --bg-sunk: oklch(0.89 0.045 55);
  --ink: oklch(0.22 0.06 45);
  --ink-2: oklch(0.38 0.06 45);
  --ink-3: oklch(0.55 0.05 45);
  --rule: oklch(0.80 0.04 55);
  --rule-strong: oklch(0.65 0.05 55);

  --it-green: oklch(0.48 0.14 145);
  --it-red: oklch(0.48 0.18 25);
  --it-red-ink: oklch(0.40 0.18 25);

  --accent: oklch(0.48 0.18 25);
  --accent-ink: oklch(0.97 0.015 80);
}

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

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-sans);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
  font-size: 15px;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul, ol { list-style: none; margin: 0; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }

/* Typography helpers */
.font-display { font-family: var(--font-display); font-weight: 400; letter-spacing: -0.01em; }
.font-serif { font-family: var(--font-serif); }
.font-sans { font-family: var(--font-sans); }
.font-mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.eyebrow-accent { color: var(--it-red-ink); }

/* Italian tricolor stripe motif */
.tricolor {
  display: inline-flex;
  gap: 2px;
  align-items: center;
}
.tricolor > span {
  display: block;
  width: 6px;
  height: 14px;
}
.tricolor > span:nth-child(1) { background: var(--it-green); }
.tricolor > span:nth-child(2) { background: var(--bg-elev); border: 1px solid var(--rule); }
.tricolor > span:nth-child(3) { background: var(--it-red); }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border-radius: var(--r-md);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 150ms ease;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
}
.btn-primary {
  background: var(--ink);
  color: var(--bg);
}
.btn-primary:hover { background: var(--accent); color: var(--accent-ink); }
.btn-outline {
  border-color: var(--ink);
  color: var(--ink);
}
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { color: var(--ink); }
.btn-lg { padding: 16px 28px; font-size: 13px; }
.btn-sm { padding: 8px 14px; font-size: 11px; }
.btn-block { width: 100%; }

/* Placeholders — striped SVG style */
.ph {
  background:
    repeating-linear-gradient(
      135deg,
      color-mix(in oklch, var(--ink) 5%, transparent) 0 1px,
      transparent 1px 14px
    ),
    var(--bg-sunk);
  border: 1px solid var(--rule);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  padding: 16px;
  position: relative;
  overflow: hidden;
}
.ph-tag {
  position: absolute;
  top: 10px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.ph-label {
  background: var(--bg);
  padding: 4px 8px;
  border: 1px solid var(--rule);
  font-size: 10px;
}

/* Dot divider */
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; display: inline-block; opacity: 0.5; }

/* Scrollbars */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--rule-strong); border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* Utility */
.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;
}
.flex { display: flex; }
.grid { display: grid; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-2 { gap: 8px; } .gap-3 { gap: 12px; } .gap-4 { gap: 16px; } .gap-6 { gap: 24px; } .gap-8 { gap: 32px; }
