/* base.css — reset + design tokens for borrington.com */

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

:root, [data-theme="light"] {
  /* 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.4rem + 2.2vw, 3rem);
  --text-3xl: clamp(2.5rem, 1.6rem + 3.6vw, 4.25rem);

  /* 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;

  /* Palette — deep navy, muted teal, warm brass */
  --color-bg: #faf7f2;              /* warm cream */
  --color-surface: #ffffff;
  --color-surface-2: #f2ede4;       /* subtly tinted alt */
  --color-surface-offset: #ece5d8;
  --color-divider: #e2dbcc;
  --color-border: #d5cdbb;

  --color-text: #14263a;            /* deep navy ink */
  --color-text-muted: #4c5b6e;
  --color-text-faint: #8a94a1;
  --color-text-inverse: #faf7f2;

  --color-primary: #1a3a5c;         /* deep navy accent */
  --color-primary-hover: #0f2740;
  --color-primary-active: #081a2c;

  --color-secondary: #3a6b6f;       /* muted teal */
  --color-accent: #b08d57;          /* warm brass */
  --color-accent-hover: #96743f;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-full: 9999px;

  --transition: 220ms cubic-bezier(0.16, 1, 0.3, 1);

  --shadow-sm: 0 1px 2px rgba(20, 38, 58, 0.05);
  --shadow-md: 0 6px 20px rgba(20, 38, 58, 0.08);
  --shadow-lg: 0 20px 48px rgba(20, 38, 58, 0.12);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;

  --font-display: 'Boska', 'Source Serif 4', Georgia, serif;
  --font-body: 'Satoshi', 'Inter', 'Helvetica Neue', sans-serif;
}

[data-theme="dark"] {
  --color-bg: #0f1620;
  --color-surface: #141d2a;
  --color-surface-2: #18222f;
  --color-surface-offset: #1c2634;
  --color-divider: #253243;
  --color-border: #2f3d4f;

  --color-text: #e6e2d6;
  --color-text-muted: #a3aab6;
  --color-text-faint: #6d7684;
  --color-text-inverse: #0f1620;

  --color-primary: #8fb8dc;
  --color-primary-hover: #b6d1ea;
  --color-primary-active: #d0e0f0;

  --color-secondary: #7db0b4;
  --color-accent: #d0a672;
  --color-accent-hover: #e2bd8b;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.55);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg: #0f1620;
    --color-surface: #141d2a;
    --color-surface-2: #18222f;
    --color-surface-offset: #1c2634;
    --color-divider: #253243;
    --color-border: #2f3d4f;
    --color-text: #e6e2d6;
    --color-text-muted: #a3aab6;
    --color-text-faint: #6d7684;
    --color-text-inverse: #0f1620;
    --color-primary: #8fb8dc;
    --color-primary-hover: #b6d1ea;
    --color-primary-active: #d0e0f0;
    --color-secondary: #7db0b4;
    --color-accent: #d0a672;
    --color-accent-hover: #e2bd8b;
  }
}

html {
  -webkit-text-size-adjust: none;
  -moz-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: 5rem;
}

body {
  min-height: 100dvh;
  line-height: 1.65;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 400;
  color: var(--color-text);
  background-color: var(--color-bg);
  transition: background-color var(--transition), color var(--transition);
}

img, picture, video, 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, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  text-wrap: balance;
  line-height: 1.15;
  color: var(--color-text);
}

p, li, figcaption {
  text-wrap: pretty;
  max-width: 68ch;
}

a {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  transition: color var(--transition);
}

a:hover { color: var(--color-primary-hover); }

::selection {
  background: var(--color-accent);
  color: var(--color-text-inverse);
}

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

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

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

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

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  text-decoration: none;
  z-index: 100;
  transition: top var(--transition);
}
.skip-link:focus {
  top: var(--space-4);
  color: var(--color-text-inverse);
}
