/* ==========================================================================
   The Tabla Era — design system ("Classical")
   Tokens, base typography and the component primitives the site builds on.
   Hex declarations are sRGB fallbacks; the OKLCH line that follows wins in
   any browser that supports it (all current ones).
   ========================================================================== */

:root {
  /* — ground & ink — */
  --color-bg: #fbf2d0;              --color-bg: oklch(96% 0.045 95);
  --color-bg-sunk: #f5e8bf;         --color-bg-sunk: oklch(93% 0.055 92);
  --color-surface: #fefaeb;         --color-surface: oklch(98.5% 0.02 95);
  --color-divider: #e0d0a5;         --color-divider: oklch(86% 0.06 90);
  /* light green ground for alternating bands */
  --color-bg-green: #e3f4e2;        --color-bg-green: oklch(95% 0.03 145);
  --color-divider-green: #c3ddc2;   --color-divider-green: oklch(87% 0.045 145);
  --color-text: #201f1d;

  /* accent ramp: the logo's deep green */
  --color-accent: #195c2e;          --color-accent: oklch(42% 0.1 150);
  --color-accent-100: #e3f4e6;      --color-accent-100: oklch(95% 0.025 150);
  --color-accent-200: #cae7cf;      --color-accent-200: oklch(90% 0.045 150);
  --color-accent-300: #a4d1ac;      --color-accent-300: oklch(82% 0.07 150);
  --color-accent-400: #63a471;      --color-accent-400: oklch(66% 0.1 150);
  --color-accent-500: #2b7440;      --color-accent-500: oklch(50% 0.11 150);
  --color-accent-600: #134924;      --color-accent-600: oklch(36% 0.085 150);
  --color-accent-700: #17552a;      --color-accent-700: oklch(40% 0.095 150);
  --color-accent-800: #0d371a;      --color-accent-800: oklch(30% 0.07 150);
  --color-accent-900: #072610;      --color-accent-900: oklch(24% 0.055 150);

  /* form errors stay red so they never read as on-brand */
  --color-danger: #a3222f;

  /* — brand marks taken from the logo — */
  --brand-green: #195c2e;           --brand-green: oklch(42% 0.1 150);
  --brand-gold: #ca9d33;            --brand-gold: oklch(72% 0.13 85);

  /* — neutral ramp — */
  --color-neutral-100: #f8f4f4;
  --color-neutral-200: #eae7e7;
  --color-neutral-300: #d7d3d3;
  --color-neutral-400: #bab6b6;
  --color-neutral-500: #9b9797;
  --color-neutral-600: #7d7979;
  --color-neutral-700: #605d5d;
  --color-neutral-800: #444141;
  --color-neutral-900: #2d2b2b;

  /* — type — Cormorant Garamond carries the display voice (it is what the
     Classical system specifies); DM Sans keeps body and UI legible at size. */
  --font-display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --font-body: "DM Sans", system-ui, sans-serif;
  --font-ui: var(--font-body);

  --space-1: 4.6px;
  --space-2: 9.2px;
  --space-3: 13.8px;
  --space-4: 18.4px;
  --space-6: 27.6px;
  --space-8: 36.8px;

  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 10px;

  /* Shadows carry the ground's warmth rather than neutral black. */
  --shadow-warm-sm: 0 1px 2px color-mix(in srgb, #4a3209 12%, transparent);
  --shadow-warm-md: 0 8px 24px color-mix(in srgb, #4a3209 14%, transparent);
  --shadow-warm-lg: 0 26px 60px color-mix(in srgb, #4a3209 18%, transparent);

  /* Motion */
  --dur-fast: 140ms;
  --dur: 220ms;
  --dur-slow: 460ms;
  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);

  /* Stacking scale — no arbitrary magic numbers. */
  --z-base: 0;
  --z-raised: 1;
  --z-sticky: 10;
  --z-overlay: 20;
  --z-skip: 30;

  /* Vertical rhythm for a full-width band; sections override it. */
  --section-y: clamp(64px, 9vw, 112px);
  --shell-w: 1160px;
}

/* ==========================================================================
   Base
   ========================================================================== */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  font-weight: 400;
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  /* Keeps the footer on the floor of short pages (404, privacy). */
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }
body > .site-footer { flex: none; }

/* A fixed film of grain, so the flat cream reads as paper rather than fill. */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  pointer-events: none;
  opacity: 0.042;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 160px 160px;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0 0 var(--space-2);
}

p { margin: 0 0 var(--space-3); }

a {
  color: var(--color-accent-700);
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease);
}
a:hover { color: var(--color-accent-600); }

img { display: block; max-width: 100%; }
figure { margin: 0; }
figcaption {
  font-size: 11px;
  margin-top: var(--space-1);
  color: color-mix(in srgb, var(--color-text) 55%, transparent);
}

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }

/* Anchor targets must clear the sticky header. Scoped to the sections that are
   actually linked — a bare [id] would also shift form fields on focus. */
section[id], main[id] { scroll-margin-top: 92px; }

.skip-link {
  position: absolute;
  left: var(--space-3);
  top: -100%;
  z-index: var(--z-skip);
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--color-surface);
  border: 1px solid var(--color-accent);
  color: var(--color-accent-700);
  text-decoration: none;
  font-size: 14px;
  box-shadow: var(--shadow-warm-md);
}
.skip-link:focus-visible { top: var(--space-3); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* ==========================================================================
   Design-system components
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 500;
  font-size: 14px;
  line-height: 1.2;
  letter-spacing: 0.005em;
  color: var(--color-text);
  background: transparent;
  border: 1px solid transparent;
  padding: var(--space-2) calc(var(--space-3) * 1.2);
  border-radius: var(--radius-md);
  transition:
    background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease),
    color var(--dur) var(--ease),
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn:active { transform: translateY(1px); }

.btn-primary { color: var(--color-surface); background: var(--color-accent); border-color: var(--color-accent); }
.btn-primary:hover {
  color: var(--color-surface);
  background: var(--color-accent-600);
  border-color: var(--color-accent-600);
  box-shadow: var(--shadow-warm-md);
}
.btn-primary:active { background: var(--color-accent-800); border-color: var(--color-accent-800); }

.btn-secondary { border-color: color-mix(in srgb, var(--brand-gold) 70%, transparent); color: var(--color-text); }
.btn-secondary:hover {
  background: color-mix(in srgb, var(--brand-gold) 14%, transparent);
  border-color: var(--brand-gold);
  color: var(--color-text);
}

.field > label {
  display: block;
  font-size: 12px;
  letter-spacing: 0.01em;
  margin-bottom: 5px;
  color: color-mix(in srgb, var(--color-text) 70%, transparent);
}

.input {
  width: 100%;
  min-height: 36px;
  padding: 6px 10px;
  font: inherit;
  font-size: 14px;
  color: var(--color-text);
  caret-color: var(--color-accent);
  background: color-mix(in srgb, var(--color-surface) 60%, transparent);
  border: 1px solid var(--color-divider);
  border-radius: var(--radius-sm);
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}
.input:hover { border-color: color-mix(in srgb, var(--color-text) 40%, transparent); }
.input:focus-visible {
  border-color: var(--color-accent);
  background: var(--color-surface);
  outline-offset: 0;
}
.input[aria-invalid="true"] { border-color: var(--color-danger); }
textarea.input { min-height: 96px; resize: vertical; }

/* Sepia-toned photographic plate with a mounted border. */
.plate {
  box-sizing: border-box;
  filter: sepia(0.22) saturate(0.82) contrast(1.05);
  border: 6px solid var(--color-surface);
  outline: 1px solid var(--color-divider);
  box-shadow: var(--shadow-warm-md);
  transition:
    transform var(--dur-slow) var(--ease),
    box-shadow var(--dur-slow) var(--ease),
    filter var(--dur-slow) var(--ease);
}

/* Shared framing for every 4:5 photo; --pos picks the crop.
   height:auto is load-bearing — the intrinsic width/height attributes on the
   <img> are presentational hints, and a definite height would beat
   aspect-ratio and stretch the plate to the photo's full pixel height. */
.plate-portrait {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: var(--pos, 50% 50%);
}
