/* Design tokens */
:root {
  /* Fluid 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.2rem + 2.5vw, 3.5rem);
  --text-3xl: clamp(2.5rem, 1.5rem + 3vw, 4.5rem);

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

  /* ByHomeOwner brand colours — canonical hex values from official SVG logo */
  --brand: #fa52a3;              /* Magenta — logo canonical (large text ≥ 18pt bold, buttons, decorative) */
  --brand-text: #c7217a;         /* AA-compliant magenta for small text on light bg (4.7:1 on white) */
  --brand-strong: #e13e92;       /* Deeper magenta for hover/pressed */
  --brand-hover: #e13e92;
  --brand-highlight: #fee9f2;    /* Magenta tint for backgrounds */
  --brand-cyan: #34c0e3;         /* Cyan — logo canonical (decorative only on light bg) */
  --brand-cyan-text: #0f7a95;    /* AA-compliant cyan for small text on light bg */
  --brand-cyan-strong: #2ba4c2;  /* Deeper cyan for hover */
  --brand-cyan-highlight: #e9f7fb;

  /* Neutral system (warm off-white) */
  --color-bg: #fbfaf8;
  --color-surface: #ffffff;
  --color-surface-2: #f5f2ee;
  --color-surface-3: #ebe7e0;
  --color-border: #e0dcd4;
  --color-divider: #eeeae3;

  --color-text: #171412;
  --color-text-muted: #6b6560;
  --color-text-faint: #a9a29a;
  --color-text-inverse: #fbfaf8;

  /* Dark surfaces for hero + CTA sections */
  --color-dark: #14110f;
  --color-dark-2: #1c1815;
  --color-dark-border: #302a25;

  /* Radius */
  --radius-sm: 0.5rem;
  --radius-md: 0.75rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(23, 20, 18, 0.06);
  --shadow-md: 0 6px 20px rgba(23, 20, 18, 0.08);
  --shadow-lg: 0 24px 48px rgba(23, 20, 18, 0.12);

  /* Content widths */
  --content-wide: 1240px;

  /* Fonts */
  --font-body: 'Inter', system-ui, -apple-system, 'Helvetica Neue', sans-serif;
  --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
}

[data-theme='dark'] {
  --color-bg: #14110f;
  --color-surface: #1c1815;
  --color-surface-2: #221d1a;
  --color-surface-3: #2a2521;
  --color-border: #34302b;
  --color-divider: #2a2521;
  --color-text: #f0ece7;
  --color-text-muted: #9c948b;
  --color-text-faint: #625b54;
  --color-text-inverse: #14110f;
  --color-dark: #0d0b0a;
  --color-dark-2: #14110f;
  --brand: #fa52a3;              /* Canonical magenta — already bright enough for dark bg */
  --brand-text: #fa52a3;         /* Full-saturation magenta is AA on dark */
  --brand-hover: #fb6cb0;
  --brand-highlight: #3d0a25;
  --brand-cyan: #34c0e3;         /* Canonical cyan — pops beautifully on dark */
  --brand-cyan-text: #34c0e3;    /* Full-saturation cyan is AA on dark */
  --brand-cyan-highlight: #0f2f38;
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
}

/* Belt-and-braces: `hidden` attribute must always hide, even when a
   component uses display: grid/flex which would otherwise override it. */
[hidden] {
  display: none !important;
}

body {
  min-height: 100dvh;
  line-height: 1.55;
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background-color: var(--color-bg);
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

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

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

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

h1,
h2,
h3,
h4 {
  text-wrap: balance;
  line-height: 1.12;
  letter-spacing: -0.01em;
  font-weight: 600;
}

p {
  text-wrap: pretty;
}

::selection {
  background: var(--brand-highlight);
  color: var(--color-text);
}

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

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

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

/* Layout wrapper */
.wrap {
  width: min(100% - var(--space-8), var(--content-wide));
  margin-inline: auto;
}

@media (max-width: 640px) {
  .wrap {
    width: min(100% - var(--space-6), var(--content-wide));
  }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-full);
  border: 1px solid transparent;
  transition:
    background var(--transition),
    color var(--transition),
    border-color var(--transition),
    transform var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--brand);
  color: white;
}
.btn-primary:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border);
}
.btn-ghost:hover {
  border-color: var(--color-text);
  background: var(--color-surface-2);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* Section head */
.section {
  padding-block: clamp(var(--space-16), 8vw, var(--space-24));
}
.section-alt {
  background: var(--color-surface-2);
}

.section-head {
  max-width: 60ch;
  margin-bottom: var(--space-12);
}
.section-head.with-actions {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: var(--space-8);
  max-width: none;
  flex-wrap: wrap;
}
.section-head h2 {
  font-size: var(--text-xl);
  margin-top: var(--space-3);
}
.section-sub {
  color: var(--color-text-muted);
  margin-top: var(--space-4);
  font-size: var(--text-base);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--brand);
}
.eyebrow-inverse {
  color: var(--brand);
}

.link-arrow {
  color: var(--color-text);
  font-weight: 600;
  font-size: var(--text-sm);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 2px;
  transition: border-color var(--transition);
}
.link-arrow:hover {
  border-color: var(--brand);
}
