/* Castelverdi — Mediterranean pottery atelier
   Inspired by Italian hand-painted ceramics: cobalt + lemon + cream */

:root {
  /* Warm cream (default) — sun-bleached Amalfi linen */
  --bg: #faf4e8;
  --bg-2: #f2e8d3;
  --bg-3: #ead7b0;
  --ink: #1a2d6b;         /* cobalt ink */
  --ink-2: #365092;
  --ink-3: #6d7fa8;
  --line: #c9b895;
  --accent: #1a2d6b;      /* cobalt */
  --gold: #e8a838;        /* lemon */
  --lemon: #f4c842;
  --terracotta: #c7703a;
  --leaf: #4d6b3f;
  --paper: #fffdf7;
}

[data-palette="cool"] {
  /* Fresh cobalt & cream — the Santorini/Capri mood */
  --bg: #fbf8ee;
  --bg-2: #e9ebf0;
  --bg-3: #c4d1e0;
  --ink: #142a6b;
  --ink-2: #2f4a8f;
  --ink-3: #6b80a8;
  --line: #a8b8cc;
  --accent: #142a6b;
  --gold: #e8a838;
  --lemon: #f4c842;
  --terracotta: #b86536;
  --leaf: #4d6b3f;
  --paper: #ffffff;
}

[data-palette="dark"] {
  /* Midnight cobalt with citrus */
  --bg: #0f1a3d;
  --bg-2: #1a2754;
  --bg-3: #243467;
  --ink: #faf0d9;
  --ink-2: #e6d7a8;
  --ink-3: #9aa8c8;
  --line: #3a4a78;
  --accent: #f4c842;
  --gold: #f4c842;
  --lemon: #f4c842;
  --terracotta: #d87f42;
  --leaf: #8eb070;
  --paper: #182450;
}

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

html, body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background-color 400ms ease, color 400ms ease;
}

body.rtl { direction: rtl; }

.serif {
  font-family: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  font-weight: 400;
  letter-spacing: 0.005em;
}

.italic { font-style: italic; }

.mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Typography */
.display {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(56px, 9vw, 144px);
  line-height: 0.95;
  letter-spacing: -0.01em;
}
.h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 300;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1.05;
}
.h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: clamp(28px, 3.2vw, 44px);
  line-height: 1.1;
}
.h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-weight: 400;
  font-size: 22px;
  line-height: 1.2;
}
.eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-2);
}

/* Nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: color-mix(in oklab, var(--bg) 90%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid color-mix(in oklab, var(--ink) 15%, transparent);
}
.nav-logo {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px;
  font-style: italic;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.01em;
  cursor: pointer;
}
.nav-links { display: flex; gap: 28px; align-items: center; list-style: none; }
.nav-link {
  font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-2); cursor: pointer; background: none; border: none;
  font-family: inherit; padding: 6px 0; position: relative; transition: color 200ms;
}
.nav-link:hover { color: var(--ink); }
.nav-link.active { color: var(--ink); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 2px; background: var(--lemon);
}
.nav-right { display: flex; align-items: center; gap: 18px; }
.lang-switch { display: flex; gap: 8px; font-size: 11px; color: var(--ink-3); letter-spacing: 0.1em; }
.lang-switch button { background: none; border: none; font: inherit; color: inherit; cursor: pointer; padding: 2px 4px; text-transform: uppercase; }
.lang-switch button.active { color: var(--ink); }
.lang-sep { color: var(--line); }

.cart-btn {
  background: var(--ink); border: 1px solid var(--ink); color: var(--bg);
  cursor: pointer; font: inherit;
  font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; transition: all 200ms;
}
.cart-btn:hover { background: var(--lemon); color: var(--ink); border-color: var(--lemon); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase;
  border: 1.5px solid var(--ink); background: transparent; color: var(--ink);
  cursor: pointer; transition: all 250ms ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn.filled { background: var(--ink); color: var(--bg); }
.btn.filled:hover { background: var(--lemon); color: var(--ink); border-color: var(--lemon); }
.btn-ghost {
  background: none; border: none; color: var(--ink);
  font-family: inherit; font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; padding: 4px 0;
  border-bottom: 1.5px solid var(--lemon);
}
.btn-ghost:hover { color: var(--ink-2); }

/* Layout */
.page { padding-top: 72px; min-height: 100vh; }
.container { max-width: 1440px; margin: 0 auto; padding: 0 36px; }
.container-narrow { max-width: 960px; margin: 0 auto; padding: 0 36px; }
.section { padding: 96px 0; }

/* Reveal — visible by default */
.reveal { opacity: 1; transform: none; transition: opacity 900ms cubic-bezier(0.2, 0.8, 0.2, 1), transform 900ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.pre { opacity: 0; transform: translateY(20px); }
.reveal.in { opacity: 1; transform: none; }

/* Placeholder — hand-painted ceramic vibe */
.placeholder {
  position: relative;
  background: var(--paper);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid color-mix(in oklab, var(--ink) 10%, transparent);
}
.placeholder .ph-label {
  position: relative;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  letter-spacing: 0.14em;
  color: var(--ink-2);
  text-transform: uppercase;
  background: var(--bg);
  padding: 5px 9px;
  border: 1px solid var(--ink);
  z-index: 2;
}

/* Product card */
.product-card { cursor: pointer; transition: transform 400ms ease; }
.product-card:hover { transform: translateY(-6px); }
.product-card .img-wrap {
  aspect-ratio: 4 / 5;
  margin-bottom: 16px;
  position: relative;
  background: var(--paper);
}
.product-card .p-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px; font-style: italic; font-weight: 500;
  line-height: 1.15; margin-bottom: 4px; color: var(--ink);
}
.product-card .p-meta {
  font-size: 11px; color: var(--ink-3);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 6px;
}
.product-card .p-price {
  font-size: 14px; color: var(--ink-2); letter-spacing: 0.03em;
  font-family: 'Cormorant Garamond', serif; font-style: italic;
}

/* Forms */
.input, .textarea, .select {
  width: 100%; background: transparent; border: none;
  border-bottom: 1.5px solid var(--ink-3);
  padding: 14px 0; font-family: inherit; font-size: 14px;
  color: var(--ink); outline: none; transition: border-color 200ms;
}
.input:focus, .textarea:focus, .select:focus { border-bottom-color: var(--ink); }
.label {
  font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--ink-2); display: block; margin-bottom: 4px;
}

/* Drawer */
.drawer-backdrop {
  position: fixed; inset: 0;
  background: color-mix(in oklab, var(--ink) 50%, transparent);
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity 300ms;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(480px, 92vw); background: var(--bg); z-index: 101;
  transform: translateX(100%); transition: transform 400ms cubic-bezier(0.2, 0.8, 0.2, 1);
  display: flex; flex-direction: column; border-left: 2px solid var(--ink);
}
.drawer.open { transform: none; }
body.rtl .drawer { left: 0; right: auto; border-left: none; border-right: 2px solid var(--ink); transform: translateX(-100%); }
body.rtl .drawer.open { transform: none; }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  background: var(--paper); border: 1.5px solid var(--ink);
  padding: 18px 20px; width: 240px;
  box-shadow: 6px 6px 0 var(--lemon);
}
.tweaks-panel.hidden { display: none; }
.tweaks-title {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--ink); margin-bottom: 14px;
  font-weight: 600;
}
.tweaks-row { margin-bottom: 14px; }
.tweaks-label { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 8px; }
.palette-swatches { display: flex; gap: 6px; }
.swatch {
  width: 100%; height: 40px; border: 1.5px solid var(--ink);
  cursor: pointer; display: flex; align-items: flex-end; justify-content: center;
  font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase;
  padding-bottom: 4px; transition: transform 150ms; font-weight: 500;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.active { outline: 2px solid var(--lemon); outline-offset: 3px; }
.swatch.warm { background: #faf4e8; color: #1a2d6b; }
.swatch.cool { background: #fbf8ee; color: #142a6b; }
.swatch.dark { background: #0f1a3d; color: #f4c842; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg-2); }
::-webkit-scrollbar-thumb { background: var(--ink-3); }

.grid { display: grid; }
.flex { display: flex; }
.text-center { text-align: center; }
.muted { color: var(--ink-3); }
.subdued { color: var(--ink-2); }
.gold { color: var(--gold); }
.lemon { color: var(--lemon); }
.cobalt { color: var(--ink); }

/* Marquee */
.marquee {
  overflow: hidden;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  padding: 20px 0; background: var(--ink); color: var(--bg);
}
.marquee-track {
  display: flex; gap: 48px; white-space: nowrap;
  animation: marquee 40s linear infinite;
  font-family: 'Cormorant Garamond', serif; font-style: italic; font-size: 22px;
}
@keyframes marquee { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.marquee-track span::after { content: '🍋'; margin-left: 48px; font-style: normal; }

/* Decorative */
.ornate-rule {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  color: var(--ink); font-size: 16px; margin: 24px 0;
}
.ornate-rule::before, .ornate-rule::after {
  content: ''; flex: 1; height: 1.5px;
  background: var(--ink);
  max-width: 80px;
}
.ornate-rule svg { color: var(--lemon); }

.drop-cap::first-letter {
  font-family: 'Cormorant Garamond', serif; font-style: italic;
  font-size: 5em; float: left; line-height: 0.85;
  padding: 6px 12px 0 0; color: var(--lemon); font-weight: 500;
}

/* Hand-painted tile border */
.tile-border { border: 2px solid var(--ink); position: relative; }
.tile-border::before {
  content: ''; position: absolute; inset: 6px;
  border: 1px solid var(--ink); pointer-events: none;
}

/* Lemon-shadow card */
.offset-shadow { box-shadow: 10px 10px 0 var(--lemon); transition: all 300ms ease; }
.offset-shadow:hover { box-shadow: 14px 14px 0 var(--lemon); transform: translate(-2px, -2px); }
