/* Fonts */
@font-face {
  font-family: "Space Grotesk";
  src: url("/assets/fonts/space-grotesk-latin.woff2") format("woff2");
  font-weight: 500 700;
  font-style: normal;
  font-display: swap;
}

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

/* Tokens */
:root {
  color-scheme: dark;

  /* Dark theme, so video reads as distinct from the light tech site */
  --bg: #0d0f13;
  --surface: #171a21;
  --text: #e8eaed;
  --text-muted: #9aa3ae;
  --border: #2a2f38;
  --dot: #252a33;
  --status: #4ade80;
  --status-glow: rgb(74 222 128 / 0.45);
  --status-glow-end: rgb(74 222 128 / 0);
  --shadow: 0 8px 24px rgb(0 0 0 / 0.45);

  /* One colour per service, same order as the tech site's cards. On this
     background each passes AA at any size; -strong is a lighter tint. */
  --c-production: #22d3ee;
  --c-production-strong: #67e8f9;
  --c-editing: #fb923c;
  --c-editing-strong: #fdba74;
  --c-motion: #c084fc;
  --c-motion-strong: #d8b4fe;
  --c-else: #4ade80;
  --c-else-strong: #86efac;

  --accent: var(--c-production);
  --accent-strong: var(--c-production-strong);

  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;

  --text-xs: 0.75rem;
  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-lede: clamp(1rem, 2vw, 1.15rem);
  --text-h1: clamp(1.7rem, 5.8vw, 3.4rem);
  --text-h1-page: clamp(1.7rem, 4vw, 2.3rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 2.5rem;
  --space-8: 4rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);

  --radius: 14px;
  --radius-sm: 8px;
  --focus-width: 2px;
  --dot-gap: 26px;
  --glow-radius: 160px;
  --nudge: 32px;
  --ease: 0.15s ease;
}

/* Service themes: set on a card, or on <body> for that service's page */
.theme-production {
  --accent: var(--c-production);
  --accent-strong: var(--c-production-strong);
}

.theme-editing {
  --accent: var(--c-editing);
  --accent-strong: var(--c-editing-strong);
}

.theme-motion {
  --accent: var(--c-motion);
  --accent-strong: var(--c-motion-strong);
}

.theme-else {
  --accent: var(--c-else);
  --accent-strong: var(--c-else-strong);
}

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

html {
  background: var(--bg);
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-md);
  line-height: 1.55;
}

a {
  color: inherit;
}

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--text);
  color: var(--surface);
  border-radius: var(--radius-sm);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

/* Dot grid background, with a cursor-following highlight added by cursor-fx.js */
.dot-grid,
.dot-grid-highlight {
  position: fixed;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, var(--dot) 1px, transparent 1px);
  background-size: var(--dot-gap) var(--dot-gap);
  pointer-events: none;
}

.dot-grid-highlight {
  background-image: radial-gradient(circle, var(--accent) 1.5px, transparent 1.5px);
  opacity: 0.55;
  mask-image: radial-gradient(
    circle var(--glow-radius) at var(--x, 50%) var(--y, 50%),
    black,
    transparent 70%
  );
}

@media (prefers-reduced-motion: reduce), (hover: none) {
  .dot-grid-highlight {
    display: none;
  }
}

.site-header,
.page,
.site-footer {
  position: relative;
  z-index: 1;
}

/* Header */
.site-header {
  padding: var(--space-5) var(--gutter) 0;
}

.wordmark {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  text-decoration: none;
}

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

.wordmark__sub {
  margin-left: var(--space-1);
  color: var(--accent);
}

/* Page shell */
.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: var(--space-7) var(--gutter) var(--space-8);
  text-align: center;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  margin: 0 0 var(--space-5);
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.status__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status);
  animation: pulse 2.2s infinite;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 var(--status-glow); }
  70% { box-shadow: 0 0 0 8px var(--status-glow-end); }
  100% { box-shadow: 0 0 0 0 var(--status-glow-end); }
}

@media (prefers-reduced-motion: reduce) {
  .status__dot {
    animation: none;
  }
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
}

h1 {
  font-size: var(--text-h1-page);
  line-height: 1.15;
  margin: 0 0 var(--space-4);
}

.lede {
  max-width: 46ch;
  margin: 0 0 var(--space-7);
  font-size: var(--text-lede);
  color: var(--text-muted);
}

.panel .lede {
  margin-bottom: 0;
}

/* Hero headline (index). Lines are visible by default; line-swap.js adds
   .is-cycling before it starts animating, so the text shows with JS off. */
.hero {
  max-width: 90vw;
  min-height: calc(2 * 1.16em + 0.35em);
  margin: 0 0 var(--space-5);
  font-size: var(--text-h1);
  line-height: 1.16;
  text-align: left;
}

.hero__line {
  display: block;
  white-space: nowrap;
}

.hero__line--bottom {
  color: var(--c-production);
}

.hero__line[data-tone="editing"] { color: var(--c-editing); }
.hero__line[data-tone="motion"] { color: var(--c-motion); }
.hero__line[data-tone="else"] { color: var(--c-else); }

.hero.is-cycling .hero__line {
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s ease;
  will-change: opacity, transform;
}

.hero.is-cycling .hero__line.is-left {
  transform: translateX(calc(-1 * var(--nudge)));
}

.hero.is-cycling .hero__line.is-right {
  transform: translateX(var(--nudge));
}

.hero.is-cycling .hero__line.is-visible {
  opacity: 1;
  transform: none;
}

.hero.is-cycling .hero__line.is-leaving {
  opacity: 0;
  transform: none;
  transition: opacity 0.35s ease;
}

/* Choice cards (index) */
.choices {
  display: grid;
  gap: var(--space-4);
  width: 100%;
  max-width: 720px;
}

@media (min-width: 640px) {
  .choices {
    grid-template-columns: 1fr 1fr;
  }
}

.card {
  display: block;
  padding: var(--space-5);
  text-align: left;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform var(--ease), box-shadow var(--ease);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

@media (prefers-reduced-motion: reduce) {
  .card:hover,
  .card:focus-visible {
    transform: none;
  }
}

.card__tag {
  display: block;
  margin-bottom: var(--space-3);
  color: var(--accent);
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.card__title {
  margin: 0 0 var(--space-2);
  font-size: var(--text-lg);
}

.card__text {
  margin: 0;
  font-size: var(--text-base);
  color: var(--text-muted);
}

.card__go {
  display: inline-block;
  margin-top: var(--space-4);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--accent-strong);
}

.card:hover,
.card:focus-visible {
  border-color: var(--accent);
}

/* Panels (sub pages) */
.panel {
  width: 100%;
  max-width: 560px;
  padding: clamp(var(--space-5), 4vw, var(--space-7));
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.panel--wide {
  max-width: 720px;
}

.back-link {
  display: inline-block;
  margin-bottom: var(--space-5);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
}

.back-link:hover {
  color: var(--text);
}

.crosslink {
  margin: var(--space-5) 0 0;
  font-size: var(--text-base);
  color: var(--text-muted);
}

.crosslink a {
  font-weight: 600;
  color: var(--text);
}

/* Template placeholder: marks copy still to be written */
.placeholder {
  margin: var(--space-5) 0 0;
  padding: var(--space-5);
  font-size: var(--text-base);
  color: var(--text-muted);
  border: 1px dashed var(--accent);
  border-radius: var(--radius-sm);
}

/* Footer */
.site-footer {
  padding: var(--space-5);
  font-size: var(--text-xs);
  text-align: center;
  color: var(--text-muted);
}
