/*
 * theme.css — Wildmoor Tea Estate. Cream, moss and clay: organic-earthy,
 * read against a Darjeeling garden photograph and one deep forest band.
 */

:root {
  --canvas: #f3efe3;
  --surface: #faf8f2;
  --surface-2: #ece4cf;
  --border: #ddd2b4;
  --border-strong: #c2b28a;
  --ink: #263420;
  --muted: #5d6356;
  --accent: #35492c;
  --accent-hover: #2a3a23;
  --accent-ink: #f6f2e4;
  --accent-text: #4c6b41;
  --accent-strong: #35492c;
  --accent-soft: #e4e6d3;
  --accent-border: #b9c2a0;
  --success: #3f7d3a;
  --success-ink: #ffffff;
  --success-soft: #dfead9;
  --success-strong: #2f5e2b;
  --warning: #a8672a;
  --warning-ink: #ffffff;
  --warning-soft: #f1e1c9;
  --warning-strong: #834f1c;
  --danger: #9c4130;
  --danger-ink: #ffffff;
  --danger-soft: #f1ddd4;
  --danger-strong: #7c3224;
  --chart-1: #35492c;
  --chart-2: #a8894f;
  --chart-3: #4c6b41;
  --chart-4: #a8672a;
  --chart-5: #6f8f68;
  --chart-6: #7a6a86;

  --font-display: "Fraunces", ui-serif, Georgia, serif;
  --font-body: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-sans: "Inter", ui-sans-serif, system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --display-weight: 560;
  --display-tracking: -0.01em;
  --eyebrow-tracking: 0.14em;

  --radius-btn: 999px;
  --radius-card: 20px;
  --radius-input: 14px;
  --border-w: 1px;
  --border-strong-w: 1px;
  --shadow-card: 0 1px 2px color-mix(in srgb, var(--ink) 6%, transparent), 0 8px 24px -12px color-mix(in srgb, var(--ink) 22%, transparent);
  --shadow-raised: 0 4px 8px color-mix(in srgb, var(--ink) 8%, transparent), 0 20px 40px -16px color-mix(in srgb, var(--ink) 28%, transparent);
  --shadow-btn: none;
  --card-pad: 1.75rem;
  --caps: uppercase;
  --caps-tracking: 0.09em;
  --btn-weight: 600;
  --measure: 66ch;

  /* On-photo text for the hero: fixed against the estate photograph, not
     the page mode — a visitor toggling dark should never dim the wordmark
     into the mist. Declared in both blocks with the same value. */
  --x-hero-ink: #f8f4e6;
  /* Placeholder ground behind the hero photograph — fixed dark in both
     modes, so the cream hero text is never cream-on-cream before the
     image paints (var(--ink) would be light in dark mode). */
  --x-hero-bg: #14170f;

  /* The farm band's own ground: the page's one dark, non-cream band in
     BOTH modes — never the button's accent, which flips light for dark
     mode and would turn this into the page's brightest surface. */
  --x-band: #2e4025;
  --x-band-ink: #f6f2e4;
  --x-band-ink-soft: #d9e0c9;
}

html[data-theme="dark"] {
  --canvas: #1a2117;
  --surface: #222a1d;
  --surface-2: #2a3323;
  --border: #3a4331;
  --border-strong: #505c42;
  --ink: #eee7d6;
  --muted: #a8ad98;
  --accent: #93b17c;
  --accent-hover: #a3c08d;
  --accent-ink: #182213;
  --accent-text: #b6cf9c;
  --accent-strong: #cfe0b6;
  --accent-soft: #2c3625;
  --accent-border: #48562f;
  --success: #6fae5b;
  --success-ink: #142010;
  --success-soft: #223019;
  --success-strong: #a8d194;
  --warning: #d99757;
  --warning-ink: #241505;
  --warning-soft: #3a2a17;
  --warning-strong: #e8b483;
  --danger: #d0836b;
  --danger-ink: #241109;
  --danger-soft: #3a2018;
  --danger-strong: #e8a48f;
  --chart-1: #93b17c;
  --chart-2: #cdb87f;
  --chart-3: #b6cf9c;
  --chart-4: #d99757;
  --chart-5: #7fa77c;
  --chart-6: #a696b8;

  --x-hero-ink: #f8f4e6;
  --x-hero-bg: #14170f;
  --x-band: #2e4025;
  --x-band-ink: #f6f2e4;
  --x-band-ink-soft: #d9e0c9;
}

/*
 * app.css — Wildmoor Tea Estate's own screen: the full-bleed hero, the
 * tasting menu, the forest story band, the hairline-divided quotes and the
 * harvest-notes signup device. Tokens only, no primitive re-declared.
 */

/* ---------------------------------------------------------------------
   Hero — one photograph edge to edge, the bar laid over it, the headline
   set low against the mist. */
.hero-wrap {
  position: relative;
  min-height: 100svh;
  overflow: hidden;
  /* A fixed dark placeholder behind the photograph — never var(--ink),
     which is a CREAM token in dark mode and would sit cream-on-cream with
     the hero text before the image paints. */
  background: var(--x-hero-bg);
}
.hero-nav {
  position: absolute;
  inset-inline: 0;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.5rem clamp(1.25rem, 4vw, 3rem);
}
.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1;
  font-family: var(--font-display);
  font-weight: 560;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  color: var(--x-hero-ink);
  text-decoration: none;
}
.wordmark span {
  margin-top: 0.2rem;
  font-family: var(--font-body);
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--x-hero-ink) 72%, transparent);
}
.hero-nav-actions { display: flex; align-items: center; gap: 0.5rem; }
.hero-toggle { color: var(--x-hero-ink); }
.hero-toggle:hover { background: color-mix(in srgb, var(--x-hero-ink) 16%, transparent); color: var(--x-hero-ink); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    color-mix(in srgb, black 66%, transparent) 0%,
    color-mix(in srgb, black 18%, transparent) 42%,
    color-mix(in srgb, black 8%, transparent) 62%,
    transparent 82%
  );
}
.hero-copy {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  min-height: 100svh;
  padding: 0 clamp(1.25rem, 4vw, 3rem) clamp(3rem, 8vw, 5.5rem);
}
.hero-copy h1 {
  margin: 0;
  max-width: 22ch;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 4vw + 1.5rem, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  color: var(--x-hero-ink);
  text-wrap: balance;
}
.hero-caption {
  margin: 0;
  padding: 1.1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
}

/* ---------------------------------------------------------------------
   Section rhythm. */
.teas-section, .quotes-section, .newsletter-section {
  padding: clamp(3.5rem, 7vw, 6rem) clamp(1.25rem, 5vw, 3rem);
  max-width: 52rem;
  margin-inline: auto;
}
.eyebrow {
  margin: 0 0 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: var(--eyebrow-tracking, 0.14em);
  text-transform: uppercase;
  color: var(--accent-text);
}
.teas-section h2, .quotes-section h2 {
  margin: 0 0 2.75rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2rem, 1.2vw + 1.7rem, 3.25rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

/* ---------------------------------------------------------------------
   The tasting menu — a single reading column, never a card. */
.tasting-menu { display: flex; flex-direction: column; }
.tea-row {
  padding: 1.75rem 0;
  border-bottom: 1px solid var(--border);
}
.tea-row:first-child { padding-top: 0; }
.tea-row:last-child { border-bottom: none; padding-bottom: 0; }
.tea-row-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}
.tea-name {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.6rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.tea-price {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--accent-strong);
  white-space: nowrap;
}
.tea-meta {
  margin: 0.35rem 0 0;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.tea-note {
  margin: 0.6rem 0 0;
  max-width: 56ch;
  color: var(--muted);
  line-height: 1.6;
}

/* ---------------------------------------------------------------------
   The farm — the page's only dark band. */
.farm-band {
  background: var(--x-band);
  color: var(--x-band-ink);
  padding: clamp(4rem, 8vw, 6.5rem) clamp(1.25rem, 5vw, 3rem);
}
.farm-band-inner { max-width: 42rem; margin-inline: auto; }
.farm-copy {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 350;
  font-size: clamp(1.35rem, 0.8vw + 1.15rem, 1.85rem);
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--x-band-ink);
}
.farm-quote {
  margin: 2.25rem 0 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(1.15rem, 0.4vw + 1.05rem, 1.4rem);
  color: var(--x-band-ink);
}
.farm-quote-attr {
  margin: 0.6rem 0 0;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--x-band-ink-soft);
}

/* ---------------------------------------------------------------------
   Three tasters, one row, hairlines between them — the one grid on the
   page, and the one thing on the page that stages in. */
.quotes-section { max-width: 68rem; }
.quotes-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
}
@media (min-width: 40rem) {
  .quotes-grid { grid-template-columns: repeat(3, 1fr); gap: 0; }
  .quote-card { padding-inline: 2.25rem; border-left: 1px solid var(--border); }
  .quote-card:first-child { padding-left: 0; border-left: none; }
  .quote-card:last-child { padding-right: 0; }
}
.quote-card { margin: 0; }
.quote-text {
  margin: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.2rem;
  line-height: 1.55;
  color: var(--ink);
}
.quote-attr {
  margin-top: 1rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.quote-city { color: var(--accent-text); font-weight: 600; }

/* JS-driven stagger: default rests fully visible (no-JS, crawlers, reduced
   motion all see this); app.js arms it only once it can also finish it. */
.motion-ready .quotes-grid[data-inview] > .quote-card {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 560ms var(--ease-out), transform 560ms var(--ease-out);
}
.motion-ready .quotes-grid[data-inview].is-inview > .quote-card { opacity: 1; transform: none; }
.motion-ready .quotes-grid[data-inview].is-inview > .quote-card:nth-child(2) { transition-delay: 110ms; }
.motion-ready .quotes-grid[data-inview].is-inview > .quote-card:nth-child(3) { transition-delay: 220ms; }

/* ---------------------------------------------------------------------
   Newsletter — the closing headline, then one deliberate device. */
.newsletter-section { text-align: center; }
.newsletter-section h2 {
  margin: 0 auto 1rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: clamp(2.75rem, 4vw + 1.5rem, 6.5rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  text-wrap: balance;
}
.newsletter-sub {
  margin: 0 auto 2.5rem;
  max-width: 34ch;
  color: var(--muted);
  font-size: 1.05rem;
}
/* A DELIBERATE two-row device, never an ambiguous wrap: name and email
   always share the top row, the button always spans the row beneath —
   fixed by grid-template-areas, not by letting flex decide what fits. */
.newsletter-device {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-areas: "name email" "btn btn";
  gap: 0.5rem;
  align-items: center;
  max-width: 34rem;
  margin: 0 auto;
  padding: 0.6rem;
  border: 1px solid var(--border-strong);
  border-radius: 1.5rem;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.newsletter-field:nth-of-type(1) { grid-area: name; }
.newsletter-field:nth-of-type(2) { grid-area: email; }
.newsletter-field { min-width: 0; }
.newsletter-input {
  width: 100%;
  height: 2.75rem;
  padding-inline: 1.1rem;
  border: none;
  background: transparent;
  color: var(--ink);
  font-size: 0.95rem;
}
.newsletter-input:focus { outline: none; }
.newsletter-input::placeholder { color: var(--muted); }
.newsletter-btn { grid-area: btn; width: 100%; }
.newsletter-device-done {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.5rem;
  color: var(--accent-strong);
  font-weight: 600;
  text-align: left;
}
.newsletter-device-done .icon { color: var(--accent-text); flex-shrink: 0; }
.newsletter-error {
  max-width: 34rem;
  margin: 0.9rem auto 0;
  color: var(--danger-strong);
  font-size: 0.875rem;
}
@media (max-width: 26rem) {
  .newsletter-device { grid-template-columns: 1fr; grid-template-areas: "name" "email" "btn"; }
}

/* ---------------------------------------------------------------------
   Footer. */
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 2rem clamp(1.25rem, 5vw, 3rem) 2.5rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}
@media (max-width: 30rem) {
  .site-footer { flex-direction: column; gap: 0.35rem; }
}
