/* ChaosCafe — site styles.
   Token values come from the ChaosCafe design system (Claude Design export);
   only the tokens this page uses are defined here. Semantic colours must stay
   #rrggbb literals: test/unit/tokens.test.mjs reads them to check contrast. */

/* ----- Fonts (self-hosted, Latin subset, from Fontsource 5.3.0) ---- */

@font-face {
  font-family: "Crimson Pro";
  src: url("../fonts/crimson-pro-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Crimson Pro";
  src: url("../fonts/crimson-pro-latin-500-normal.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Inter Tight";
  src: url("../fonts/inter-tight-latin-600-normal.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ----- Tokens -------------------------------------------------- */

:root {
  color-scheme: light dark;

  --bg: #F4EFE6;
  --surface: #FBF8F2;
  --fg: #1A1814;
  --fg-muted: #5A4836;
  --link: #2B3A67;
  --link-hover: #934414;
  --primary: #2B3A67;
  --primary-fg: #FBF8F2;
  --accent: #D2691E;
  --selection: #F4DBC1;
  --border: rgba(132, 106, 80, 0.18);
  --header-bg: rgba(244, 239, 230, 0.78);

  --font-display: "Crimson Pro", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  --text-sm: 14px;
  --text-base: 17px;
  --text-lg: 22px;
  --text-2xl: 36px;
  --text-4xl: 64px;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  --shadow-1: 0 1px 2px rgba(26, 24, 20, 0.04), 0 1px 1px rgba(26, 24, 20, 0.03);
  --shadow-2: 0 4px 12px rgba(26, 24, 20, 0.06), 0 2px 4px rgba(26, 24, 20, 0.04);

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-micro: 120ms;

  --max-prose: 680px;
  --max-content: 1100px;
  --gutter: 16px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131A2E;
    --surface: #1B2441;
    --fg: #FBF8F2;
    --fg-muted: #A9B2CB;
    --link: #EAB78A;
    --link-hover: #F4DBC1;
    --primary: #FBF8F2;
    --primary-fg: #1B2441;
    --selection: #4F6391;
    --border: rgba(214, 218, 232, 0.14);
    --header-bg: rgba(19, 26, 46, 0.78);
  }
}

@media (min-width: 768px) {
  :root { --gutter: 32px; }
}

/* ----- Base ---------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(var(--text-2xl), 6vw, var(--text-4xl)); line-height: 1.15; }
h2 { font-size: var(--text-2xl); line-height: 1.3; }
h3 { font-size: var(--text-lg); line-height: 1.3; }

p { margin: 0; max-width: var(--max-prose); text-wrap: pretty; }
p + p { margin-top: var(--space-4); }

a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur-micro) var(--ease);
}

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

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

::selection { background: var(--selection); color: var(--fg); }

.lead {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  line-height: 1.5;
}

/* ----- Layout -------------------------------------------------- */

.container {
  width: 100%;
  max-width: calc(var(--max-content) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-4);
  z-index: 20;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-2);
}

.skip-link:focus { top: var(--space-2); }

/* ----- Header -------------------------------------------------- */

.site-header {
  z-index: 10;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
}

@media (min-height: 721px) {
  .site-header {
    position: sticky;
    top: 0;
    background: var(--header-bg);
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
  }
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--fg);
  text-decoration: none;
}

.wordmark:hover { color: var(--fg); }

.cc-accent-c { color: var(--accent); }

.header-cta {
  font-size: var(--text-sm);
  font-weight: 600;
}

/* ----- Buttons ------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--primary-fg);
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-1);
  transition:
    box-shadow var(--dur-micro) var(--ease),
    transform var(--dur-micro) var(--ease);
}

.button:hover {
  color: var(--primary-fg);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}

.button:active {
  box-shadow: var(--shadow-1);
  transform: translateY(1px);
}

/* ----- Sections ------------------------------------------------ */

main > section { padding-block: var(--space-8); }

main > section > h2 { margin-bottom: var(--space-6); }

.hero {
  display: grid;
  gap: var(--space-7);
  align-items: center;
  padding-block: var(--space-8) var(--space-9);
}

.hero-text > * + * { margin-top: var(--space-5); }

.hero-text > .overline + h1,
.hero-text > h1 + .tagline { margin-top: var(--space-3); }

.overline {
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-muted);
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(var(--text-lg), 3.6vw, var(--text-2xl));
  line-height: 1.25;
  text-wrap: balance;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-4) var(--space-5);
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--accent);
}

.hero-art {
  display: none;
  border-radius: var(--radius-lg);
}

.cards {
  display: grid;
  gap: var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.card {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}

.card h3 { margin-bottom: var(--space-3); }

@media (min-width: 900px) {
  .hero { grid-template-columns: 3fr 2fr; }
  .hero-art { display: block; }
  .cards { grid-template-columns: repeat(3, 1fr); }
}

.contact .button { margin-top: var(--space-6); }

.contact-email { margin-top: var(--space-5); }

.profiles {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3) var(--space-5);
  margin: var(--space-6) 0 0;
  padding: 0;
  list-style: none;
}

/* ----- Footer -------------------------------------------------- */

.site-footer {
  padding-block: var(--space-7);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--fg-muted);
}

.site-footer p { max-width: none; }

.legal { overflow-wrap: anywhere; }

.colophon { margin-top: var(--space-3); }

/* ----- 404 ----------------------------------------------------- */

.notfound { padding-block: var(--space-9); }

.notfound > * + * { margin-top: var(--space-5); }

/* ----- Motion -------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition: none !important;
    animation: none !important;
  }

  .button:hover, .button:active { transform: none; }
}
