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

  --bg: #f6f7f9;
  --surface: #ffffff;
  --text: #14171a;
  --text-muted: #5b6470;
  --border: #e3e6ea;
  --dot: #d9dee4;
  --status: #1fa15a;
  --status-glow: rgb(31 161 90 / 0.45);
  --status-glow-end: rgb(31 161 90 / 0);
  --shadow: 0 8px 24px rgb(20 23 26 / 0.08);

  /* One colour per service; cards, hero answers and form pages share them */
  --c-tech-bright: #0891b2;
  --c-tech: #0e7490;
  --c-tech-dark: #155e75;
  --c-install: #a85a09;
  --c-install-dark: #8a4907;
  --c-web: #9d27b0;
  --c-web-dark: #7b1fa2;
  --c-else: #15803d;
  --c-else-dark: #166534;

  --accent-bright: var(--c-tech-bright);
  --accent: var(--c-tech);
  --accent-dark: var(--c-tech-dark);

  --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.
   --accent-bright is for large text and decoration only; small text and
   buttons use --accent and --accent-dark, which pass AA at any size. */
.theme-tech {
  --accent-bright: var(--c-tech-bright);
  --accent: var(--c-tech);
  --accent-dark: var(--c-tech-dark);
}

.theme-install {
  --accent-bright: var(--c-install);
  --accent: var(--c-install);
  --accent-dark: var(--c-install-dark);
}

.theme-web {
  --accent-bright: var(--c-web);
  --accent: var(--c-web);
  --accent-dark: var(--c-web-dark);
}

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

/* 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-bright) 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);
}

/* 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-tech-bright);
}

.hero__line[data-tone="install"] { color: var(--c-install); }
.hero__line[data-tone="web"] { color: var(--c-web); }
.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-dark);
}

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

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

/* Booking embed */
.cal-embed {
  width: 100%;
  margin-top: var(--space-5);
  overflow: auto;
}

/* Form */
.form {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  margin-top: var(--space-5);
}

.field label {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
}

.field__req {
  color: var(--text-muted);
  font-weight: 400;
}

.form__row {
  display: grid;
  gap: var(--space-4);
}

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

.field--group {
  margin: 0;
  padding: 0;
  border: none;
}

.field--group legend {
  margin-bottom: var(--space-2);
  padding: 0;
  font-size: var(--text-sm);
  font-weight: 600;
}

.choices-list {
  display: grid;
  gap: var(--space-2) var(--space-4);
}

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

.check {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  cursor: pointer;
}

.check input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--accent);
}

.field__hint {
  margin: var(--space-1) 0 0;
  font-size: var(--text-sm);
  color: var(--text-muted);
}

.field input:not([type="checkbox"], [type="radio"]),
.field select,
.field textarea {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-size: var(--text-base);
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--text-muted);
  border-radius: var(--radius-sm);
}

.field textarea {
  min-height: 8rem;
  resize: vertical;
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible {
  outline-offset: 1px;
}

.form__hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  min-height: 52px;
  padding: var(--space-3) var(--space-6);
  font: inherit;
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--surface);
  background: var(--accent);
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--ease);
}

.btn:hover {
  background: var(--accent-dark);
}

.btn:focus-visible {
  outline-color: var(--text);
}

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