/* ============================================================
   Canterbury Design Services — base.css
   Design tokens, reset, theme definitions
   ============================================================ */

/* ---------- Tokens ---------- */
:root {
  /* Type */
  --font-display: 'Satoshi', 'General Sans', system-ui, sans-serif;
  --font-body: 'Satoshi', 'General Sans', system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 2.75rem;
  --text-hero: clamp(2.75rem, 7vw, 5.25rem);

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

  /* Geometry */
  --radius-sm: 3px;
  --radius: 6px;
  --radius-lg: 10px;
  --container: 1240px;
  --header-h: 76px;

  /* Motion */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.35s;

  /* Brand */
  --brand-red: #c8102e;
  --brand-red-bright: #e8283c;
}

/* ---------- Dark theme (default) ---------- */
:root,
:root[data-theme='dark'] {
  --color-bg: #0a0a0b;
  --color-bg-alt: #101012;
  --color-surface: #16161a;
  --color-surface-2: #1e1e23;
  --color-border: #2b2b31;
  --color-border-strong: #3a3a42;
  --color-text: #f4f4f5;
  --color-text-soft: #c9c9cf;
  --color-text-muted: #8d8d96;
  --color-accent: #e8283c;
  --color-accent-hover: #ff4053;
  --color-accent-soft: rgba(232, 40, 60, 0.14);
  --color-on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.6);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.65);
  --header-bg: rgba(10, 10, 11, 0.88);
}

/* ---------- Light theme ---------- */
:root[data-theme='light'] {
  --color-bg: #ffffff;
  --color-bg-alt: #f5f5f6;
  --color-surface: #ffffff;
  --color-surface-2: #f0f0f2;
  --color-border: #e2e2e6;
  --color-border-strong: #cfcfd5;
  --color-text: #0c0c0e;
  --color-text-soft: #33333a;
  --color-text-muted: #63636d;
  --color-accent: #c8102e;
  --color-accent-hover: #a80d26;
  --color-accent-soft: rgba(200, 16, 46, 0.09);
  --color-on-accent: #ffffff;
  --shadow-sm: 0 1px 2px rgba(12, 12, 14, 0.08);
  --shadow: 0 10px 30px rgba(12, 12, 14, 0.09);
  --shadow-lg: 0 24px 60px rgba(12, 12, 14, 0.14);
  --header-bg: rgba(255, 255, 255, 0.9);
}

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

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-wrap: balance;
}

p {
  text-wrap: pretty;
}

img,
video,
iframe {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

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

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

ul[role='list'] {
  list-style: none;
  padding: 0;
}

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

::selection {
  background: var(--color-accent);
  color: #fff;
}

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.section {
  padding-block: var(--space-12);
}

@media (max-width: 640px) {
  .section {
    padding-block: var(--space-10);
  }
}

/* ---------- Reveal ---------- */
.fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

.fade-in.is-visible {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .fade-in {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
