/* ==========================================================================
   Reserva Conchal Open — design tokens & base
   Brand system v2.1: Conchal Sand base, Guanacaste Slate text, Forest Green
   actions, Deep Palm surfaces, Lotus Gold signature accent (80/20).
   Display: Fraunces. Body: Inter.
   ========================================================================== */

:root {
  /* Type scale */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.5rem);
  --text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2.25rem);
  --text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1rem + 4vw, 5rem);
  --text-hero: clamp(2.75rem, 0.5rem + 6.5vw, 7rem);

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-pill: 999px;

  --font-display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --maxw: 78rem;
  --maxw-prose: 62ch;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow-sm: 0 1px 2px rgba(30, 41, 59, 0.07), 0 4px 14px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 24px 60px -20px rgba(30, 41, 59, 0.3);

  /* Brand palette (locked) */
  --sand: #f2efe4;
  --slate: #1e293b;
  --forest: #357759;
  --palm: #3a5749;
  --gold: #d1bb45;
  --plum: #551935;
  --orchid: #ab368c;
}

/* ---------- Light (Conchal Sand) ---------- */
:root,
[data-theme='light'] {
  --bg: #f2efe4;
  --surface: #f7f5ec;
  --surface-2: #eae5d4;
  --surface-3: #e0dac6;
  --border: #d9d3bf;
  --border-strong: #c3bc9f;
  --text: #1e293b;
  --muted: #475569;
  --faint: #7c8598;
  --accent: #357759;
  --accent-hover: #2b6148;
  --on-accent: #f2efe4;
  --gold: #d1bb45;
  --gold-deep: #a8941f; /* gold darkened for text on sand */
  --clay: #a8492f; /* error/warning only */
  --hero-scrim: linear-gradient(90deg, rgba(15, 23, 38, 0.82) 0%, rgba(15, 23, 38, 0.55) 55%, rgba(15, 23, 38, 0.3) 100%), linear-gradient(180deg, rgba(15, 23, 38, 0.55) 0%, rgba(15, 23, 38, 0.45) 50%, rgba(15, 23, 38, 0.88) 100%);
}

/* ---------- Dark (Guanacaste Slate) ---------- */
[data-theme='dark'] {
  --bg: #1e293b;
  --surface: #273449;
  --surface-2: #2e3d54;
  --surface-3: #37475f;
  --border: #3b4b63;
  --border-strong: #526379;
  --text: #f2efe4;
  --muted: #b6bdd0;
  --faint: #8994ac;
  --accent: #7cbf9b;
  --accent-hover: #93d0af;
  --on-accent: #1e293b;
  --gold: #d1bb45;
  --gold-deep: #d1bb45;
  --clay: #e0836a;
  --hero-scrim: linear-gradient(90deg, rgba(10, 16, 26, 0.88) 0%, rgba(10, 16, 26, 0.6) 55%, rgba(10, 16, 26, 0.35) 100%), linear-gradient(180deg, rgba(10, 16, 26, 0.6) 0%, rgba(10, 16, 26, 0.5) 50%, rgba(10, 16, 26, 0.93) 100%);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #1e293b;
    --surface: #273449;
    --surface-2: #2e3d54;
    --surface-3: #37475f;
    --border: #3b4b63;
    --border-strong: #526379;
    --text: #f2efe4;
    --muted: #b6bdd0;
    --faint: #8994ac;
    --accent: #7cbf9b;
    --accent-hover: #93d0af;
    --on-accent: #1e293b;
    --gold: #d1bb45;
    --gold-deep: #d1bb45;
    --clay: #e0836a;
    --hero-scrim: linear-gradient(90deg, rgba(10, 16, 26, 0.88) 0%, rgba(10, 16, 26, 0.6) 55%, rgba(10, 16, 26, 0.35) 100%), linear-gradient(180deg, rgba(10, 16, 26, 0.6) 0%, rgba(10, 16, 26, 0.5) 50%, rgba(10, 16, 26, 0.93) 100%);
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4), 0 4px 14px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 24px 60px -20px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}
* {
  margin: 0;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5.5rem;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img,
svg,
video {
  display: block;
  max-width: 100%;
}
img {
  height: auto;
}
a {
  color: inherit;
  text-decoration: none;
}
button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
::selection {
  background: var(--gold);
  color: #1e293b;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Typography ---------- */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.06;
  letter-spacing: -0.012em;
  text-wrap: balance;
  font-variation-settings: 'opsz' 72;
}
h1 {
  font-size: var(--text-2xl);
}
h2 {
  font-size: var(--text-xl);
}
h3 {
  font-size: var(--text-lg);
  font-weight: 600;
  line-height: 1.25;
}
p {
  text-wrap: pretty;
}
.prose {
  max-width: var(--maxw-prose);
}
.prose p + p {
  margin-top: var(--space-4);
}
.lead {
  font-size: var(--text-lg);
  line-height: 1.45;
  color: var(--muted);
}

.eyebrow {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.eyebrow::before {
  content: '';
  width: var(--space-8);
  height: 1px;
  background: currentColor;
  opacity: 0.55;
  flex: none;
}
.eyebrow--plain::before {
  display: none;
}

/* ---------- Layout ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: clamp(var(--space-5), 4vw, var(--space-12));
}
.section {
  padding-block: clamp(var(--space-16), 9vw, var(--space-32));
  position: relative;
}
.section--tight {
  padding-block: clamp(var(--space-12), 6vw, var(--space-20));
}
.section--alt {
  background: var(--surface-2);
}
.section--dark {
  background: #1e293b;
  color: #f2efe4;
}
.section--dark .eyebrow,
.section--dark .stat__num {
  color: #d1bb45;
}
.section--dark .lead,
.section--dark .muted {
  color: #a9b4c6;
}
.section__head {
  display: grid;
  gap: var(--space-5);
  max-width: 46rem;
  margin-bottom: clamp(var(--space-10), 5vw, var(--space-16));
}
.section__head--wide {
  max-width: 58rem;
}
.rule {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 0;
}
.muted {
  color: var(--muted);
}
.grid {
  display: grid;
  gap: clamp(var(--space-5), 2.5vw, var(--space-8));
}
@media (min-width: 640px) {
  .grid--2 {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 900px) {
  .grid--3 {
    grid-template-columns: repeat(3, 1fr);
  }
  .grid--4 {
    grid-template-columns: repeat(4, 1fr);
  }
  .grid--2-1 {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: center;
    gap: clamp(var(--space-8), 5vw, var(--space-20));
  }
}
@media (min-width: 640px) and (max-width: 899px) {
  .grid--4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: var(--accent);
  color: var(--on-accent);
  cursor: pointer;
  transition:
    transform 0.2s var(--ease),
    background 0.2s var(--ease),
    border-color 0.2s var(--ease),
    color 0.2s var(--ease);
  white-space: nowrap;
}
.btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn--ghost:hover {
  background: var(--surface-2);
  border-color: var(--text);
}
.btn--light {
  background: #f2efe4;
  color: #1e293b;
}
.btn--light:hover {
  background: #fbf9f1;
}
.btn--onimage {
  background: transparent;
  color: #f2efe4;
  border-color: rgba(242, 239, 228, 0.45);
}
.btn--onimage:hover {
  background: rgba(242, 239, 228, 0.12);
  border-color: #f2efe4;
}
.btn--lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}
.btn--block {
  width: 100%;
}
.btn[disabled] {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}
.btn__arrow {
  transition: transform 0.25s var(--ease);
}
.btn:hover .btn__arrow {
  transform: translateX(3px);
}

.linkarrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  border-bottom: 1px solid var(--border-strong);
  padding-bottom: 2px;
  transition:
    color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}
.linkarrow:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.section--dark .linkarrow {
  color: #f2efe4;
  border-color: rgba(242, 239, 228, 0.35);
}
.section--dark .linkarrow:hover {
  color: #d1bb45;
  border-color: #d1bb45;
}

/* ---------- Chips / badges ---------- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  border: 1px solid var(--border-strong);
  color: var(--muted);
}
.chip--live {
  border-color: color-mix(in oklab, var(--accent) 60%, transparent);
  color: var(--accent);
}
.chip--onimage {
  border-color: rgba(242, 239, 228, 0.4);
  color: #f2efe4;
  backdrop-filter: blur(6px);
  background: rgba(30, 41, 59, 0.25);
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(var(--space-5), 2.5vw, var(--space-8));
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  transition:
    transform 0.28s var(--ease),
    border-color 0.28s var(--ease),
    box-shadow 0.28s var(--ease);
}
.card--hover:hover {
  transform: translateY(-3px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-lg);
}
.card__num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  color: var(--gold-deep);
  line-height: 1;
}
.section--dark .card {
  background: #273449;
  border-color: #3b4b63;
}
.section--dark .card__num {
  color: #d1bb45;
}

/* ---------- Utilities ---------- */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.stack {
  display: grid;
  gap: var(--space-4);
}
.stack--sm {
  gap: var(--space-2);
}
.stack--lg {
  gap: var(--space-8);
}
.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}
.textcenter {
  text-align: center;
}

/* ---------- Reveal on scroll ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}
