/* ==========================================================================
   base.css — reset, tokens, primitives
   Pourly by 916 Pour Decisions
   ========================================================================== */

:root {
  /* Type scale (fluid) */
  --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);

  /* Spacing (4px base) */
  --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 */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.875rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1240px;

  /* Motion */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  /* Typography families */
  --font-display: 'Boska', 'Iowan Old Style', Georgia, serif;
  --font-body: 'Switzer', 'Inter', 'Helvetica Neue', system-ui, sans-serif;

  /* Section rhythm */
  --section-pad: clamp(var(--space-16), 9vw, var(--space-32));
  --gutter: clamp(var(--space-5), 5vw, var(--space-12));
}

/* --------------------------------------------------------------------------
   Colour — Pourly palette: blush rose, cocoa brown, muted antique gold
   -------------------------------------------------------------------------- */
:root,
[data-theme='light'] {
  --color-bg: #fbf5f1;
  --color-surface: #fffcfa;
  --color-surface-2: #f6ece6;
  --color-surface-offset: #f1e3db;
  --color-surface-deep: #2c1b16;
  --color-divider: #ead9d0;
  --color-border: #ddc6ba;

  --color-text: #2c1b16;
  --color-text-muted: #6c5047;
  --color-text-faint: #7d6058;
  --color-text-inverse: #fdf7f3;

  --color-primary: #a71455; /* rose — CTA. 5.9:1 on cream */
  --color-primary-hover: #85073f;
  --color-primary-active: #6a0532;
  --color-primary-soft: #f7dbe6;
  --color-primary-ink: #fff6fa;

  --color-gold: #8f6b21; /* muted antique gold — 4.9:1 on cream */
  --color-gold-bright: #c2a05a; /* decorative rules / large marks only */
  --color-gold-soft: #f0e5cf;

  --color-cocoa: #4c3128;
  --color-error: #a3231b;
  --color-success: #2f6b3c;

  --shadow-sm: 0 1px 2px rgba(64, 34, 24, 0.07);
  --shadow-md: 0 8px 24px -8px rgba(64, 34, 24, 0.16);
  --shadow-lg: 0 28px 60px -24px rgba(64, 34, 24, 0.3);

  --grain-opacity: 0.35;
  color-scheme: light;
}

[data-theme='dark'] {
  --color-bg: #150f0e;
  --color-surface: #1d1514;
  --color-surface-2: #241a18;
  --color-surface-offset: #2b1f1c;
  --color-surface-deep: #0e0a09;
  --color-divider: #2e211d;
  --color-border: #43312c;

  --color-text: #f2e6e0;
  --color-text-muted: #bda69c;
  --color-text-faint: #a89087;
  --color-text-inverse: #1d1514;

  --color-primary: #f79cbd;
  --color-primary-hover: #ffbdd3;
  --color-primary-active: #ffd3e2;
  --color-primary-soft: #3a1e2a;
  --color-primary-ink: #2a0d1a;

  --color-gold: #dcb972;
  --color-gold-bright: #dcb972;
  --color-gold-soft: #33291a;

  --color-cocoa: #e2cec5;
  --color-error: #f09189;
  --color-success: #8ccb9c;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 28px 60px -24px rgba(0, 0, 0, 0.7);

  --grain-opacity: 0.22;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #150f0e;
    --color-surface: #1d1514;
    --color-surface-2: #241a18;
    --color-surface-offset: #2b1f1c;
    --color-surface-deep: #0e0a09;
    --color-divider: #2e211d;
    --color-border: #43312c;
    --color-text: #f2e6e0;
    --color-text-muted: #bda69c;
    --color-text-faint: #a89087;
    --color-text-inverse: #1d1514;
    --color-primary: #f79cbd;
    --color-primary-hover: #ffbdd3;
    --color-primary-active: #ffd3e2;
    --color-primary-soft: #3a1e2a;
    --color-primary-ink: #2a0d1a;
    --color-gold: #dcb972;
    --color-gold-bright: #dcb972;
    --color-gold-soft: #33291a;
    --color-cocoa: #e2cec5;
    --color-error: #f09189;
    --color-success: #8ccb9c;
    --grain-opacity: 0.22;
    color-scheme: dark;
  }
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -moz-text-size-adjust: none;
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: clamp(4.5rem, 9vw, 6rem);
}

body {
  min-height: 100dvh;
  line-height: 1.6;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
  overflow-x: hidden;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

ul[role='list'],
ol[role='list'] {
  list-style: none;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.08;
  font-weight: 400;
}

p,
li,
figcaption,
label {
  text-wrap: pretty;
}

a {
  color: inherit;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

::selection {
  background: var(--color-primary-soft);
  color: var(--color-text);
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

a,
button,
[role='button'],
input,
textarea,
select,
summary {
  transition:
    color var(--transition-interactive),
    background-color var(--transition-interactive),
    border-color var(--transition-interactive),
    box-shadow var(--transition-interactive),
    transform var(--transition-interactive);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
