@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('../fonts/bricolage-grotesque-800-latin.woff2') format('woff2');
}
@font-face {
  font-family: 'DM Sans';
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url('../fonts/dm-sans-latin.woff2') format('woff2');
}

/* ---------- Brand palette (fixed values) ---------- */
:root {
  --berry: #A61E78;
  --berry-dark: #7A1458;
  --berry-bright: #C02A86;
  --berry-light: #E25BB0;
  --mango: #FF9A2E;
  --ink: #1E1420;
  --ink-deep: #140C15;
  --white: #FFFFFF;

  --font-display: 'Bricolage Grotesque', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

/* ---------- Semantic tokens: light (default) ---------- */
/* Components use only these tokens. Contrast pairs are listed in docs/DARK-MODE.md. */
:root {
  color-scheme: light;
  --bg: #FFFFFF;
  --surface: #F4F1F3;          /* cards */
  --surface-warm: #FFF3E6;     /* hero */
  --text: #1E1420;
  --text-soft: #4A3B46;
  --text-muted: #6B5A66;
  --accent: var(--berry);              /* button fill */
  --accent-hover: var(--berry-dark);
  --accent-text: var(--berry);         /* berry used as text */
  --on-accent: #FFFFFF;
  --rule: #1E1420;
  --field-bg: #FFFFFF;
  --field-border: #1E1420;
  --footer-bg: var(--ink);
  --footer-text: #D9CFD6;
  --footer-border: transparent;
  --dot: var(--mango);
  --focus-inner: var(--ink);   /* inner focus ring, same in both themes */
}

/* ---------- Semantic tokens: dark ---------- */
/* No data-theme: follow the system. data-theme="light" opts out of this block. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1E1420;
    --surface: #2A1E2C;
    --surface-warm: #2B1A24;
    --text: #F7F1F4;
    --text-soft: #D9CFD6;
    --text-muted: #B3A4AE;
    --accent: var(--berry-bright);
    --accent-hover: var(--berry);
    --accent-text: var(--berry-light);
    --on-accent: #FFFFFF;
    --rule: #F7F1F4;
    --field-bg: #2A1E2C;
    --field-border: #8A7A86;
    --footer-bg: var(--ink-deep);
    --footer-text: #D9CFD6;
    --footer-border: #3A2C3B;
  }
}
/* Explicit choice from the toggle (repeats the dark tokens above). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1E1420;
  --surface: #2A1E2C;
  --surface-warm: #2B1A24;
  --text: #F7F1F4;
  --text-soft: #D9CFD6;
  --text-muted: #B3A4AE;
  --accent: var(--berry-bright);
  --accent-hover: var(--berry);
  --accent-text: var(--berry-light);
  --on-accent: #FFFFFF;
  --rule: #F7F1F4;
  --field-bg: #2A1E2C;
  --field-border: #8A7A86;
  --footer-bg: var(--ink-deep);
  --footer-text: #D9CFD6;
  --footer-border: #3A2C3B;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-body); -webkit-font-smoothing: antialiased; }
a { color: var(--accent-text); }
a:hover { color: var(--text); }
/* Mango ring with an Ink ring inside it: Mango alone is only 2.1:1 on white,
   the Ink ring keeps the indicator visible on light grounds (3:1+ in both themes). */
:focus-visible { outline: 3px solid var(--dot); outline-offset: 3px; box-shadow: 0 0 0 3px var(--focus-inner); }
.wrap { max-width: 1200px; margin: 0 auto; padding-inline: 24px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 16px; top: -100px; z-index: 10; padding: 12px 18px; border-radius: 999px; background: var(--text); color: var(--bg); font-weight: 700; text-decoration: none; }
.skip-link:focus, .skip-link:hover { top: 16px; color: var(--bg); }

/* Wordmark */
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.045em; white-space: nowrap; text-decoration: none; color: var(--text); line-height: 1; }
.wordmark:hover { color: var(--text); }
.wordmark .mang { color: var(--accent-text); }
.wordmark .dot { display: inline-block; width: 0.52em; height: 0.52em; border-radius: 50%; background: var(--dot); margin-left: 0.04em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 52px; padding: 0 26px; border-radius: 999px; font-family: var(--font-body); font-weight: 700; font-size: 17px; text-decoration: none; border: 2px solid transparent; cursor: pointer; }
.btn--primary { background: var(--accent); color: var(--on-accent); }
.btn--primary:hover { background: var(--accent-hover); color: var(--on-accent); }
.btn--outline { background: transparent; color: var(--text); border-color: var(--text); }
.btn--outline:hover { background: var(--text); color: var(--bg); }
.btn--small { min-height: 44px; padding: 0 20px; font-size: 16px; }
.btn[disabled] { cursor: progress; background: var(--accent-hover); }

/* Theme toggle: the icon follows the same selectors as the tokens, so it is right before any JS runs. */
.theme-toggle { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; border: 2px solid var(--text); background: transparent; color: var(--text); cursor: pointer; padding: 0; }
.theme-toggle:hover { background: var(--text); color: var(--bg); }
.theme-toggle svg { width: 20px; height: 20px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* Header */
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.site-header .wordmark { font-size: 30px; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; font-weight: 500; }
.site-nav a:not(.btn) { color: var(--text); text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--accent-text); }

/* Hero */
.hero { background: var(--surface-warm); }
.hero .wrap { padding-block: 96px; display: flex; flex-direction: column; gap: 28px; }
.eyebrow { font-size: 15px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-muted); }
.hero h1 { margin: 0; max-width: 16ch; font-family: var(--font-display); font-weight: 800; font-size: clamp(44px, 7vw, 88px); letter-spacing: -0.045em; line-height: 0.98; }
.hero h1 em { font-style: normal; color: var(--accent-text); }
.hero p { margin: 0; max-width: 34rem; font-size: 21px; line-height: 1.5; color: var(--text-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* Sections */
.section { padding-block: 96px; }
.section h2, .contact-intro h1 { margin: 0 0 40px; font-family: var(--font-display); font-weight: 800; font-size: clamp(36px, 4.5vw, 56px); letter-spacing: -0.04em; line-height: 1; }

/* Services */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.card { background: var(--surface); border-radius: 24px; padding: 32px; display: flex; flex-direction: column; gap: 14px; }
.card .num { font-family: var(--font-display); font-weight: 800; font-size: 20px; color: var(--accent-text); }
.card h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 28px; letter-spacing: -0.03em; }
.card p { margin: 0; font-size: 17px; line-height: 1.55; color: var(--text-soft); }

/* Products: the dark panel uses the footer's colours so it stands out on the dark page too */
.products { padding-top: 0; }
.products h2 { margin-bottom: 12px; }
.section-intro { margin: 0 0 40px; font-size: 19px; line-height: 1.6; color: var(--text-soft); }
.panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 20px; margin: 0; padding: 0; list-style: none; }
.panel { border-radius: 28px; padding: 40px; display: flex; flex-direction: column; gap: 16px; }
.panel h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(30px, 3.5vw, 40px); letter-spacing: -0.04em; line-height: 1; }
.panel p { margin: 0; font-size: 18px; line-height: 1.55; color: var(--text-soft); }
.panel .btn { align-self: flex-start; margin-top: 8px; }
.panel--warm { background: var(--surface-warm); }
.panel--dark { background: var(--footer-bg); color: var(--white); border: 1px solid var(--footer-border); }
.panel--dark p { color: var(--footer-text); }
.tag { align-self: flex-start; display: inline-flex; align-items: center; min-height: 52px; margin-top: 8px; padding: 0 26px; border: 2px solid currentColor; border-radius: 999px; font-size: 17px; font-weight: 700; }

/* Contact */
.contact { padding-top: 0; }
.contact.contact--page { padding-top: 64px; }
.contact-grid { display: flex; flex-wrap: wrap; gap: 48px; border-top: 2px solid var(--rule); padding-top: 72px; }
.contact-intro { flex: 1 1 340px; }
.contact-intro h2, .contact-intro h1 { margin: 0 0 16px; font-size: clamp(40px, 5vw, 64px); letter-spacing: -0.045em; }
.contact-intro .actions { margin-top: 24px; }
.contact-intro p { margin: 0; font-size: 19px; line-height: 1.6; color: var(--text-soft); }
.contact-form { flex: 1 1 420px; min-width: 0; display: flex; flex-direction: column; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 15px; }
.field input, .field textarea { font: inherit; font-weight: 400; font-size: 17px; color: var(--text); background: var(--field-bg); border: 2px solid var(--field-border); border-radius: 14px; width: 100%; }
.field input { min-height: 52px; padding: 0 16px; }
.field textarea { padding: 14px 16px; resize: vertical; min-height: 130px; }
.field input:focus, .field textarea:focus { border-color: var(--accent-text); }
.field [aria-invalid="true"] { border-color: var(--accent-text); }
.field-error { font-weight: 500; font-size: 15px; color: var(--accent-text); }
.field-error:empty { display: none; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.contact-form .btn { align-self: flex-start; }
.form-status { margin: 0; padding: 16px 18px; border-radius: 14px; font-size: 17px; line-height: 1.5; color: var(--text); background: var(--surface); border-left: 6px solid var(--text); }
.form-status:empty { display: none; }
.form-status--success { background: var(--surface-warm); border-left-color: var(--dot); }
.form-status--error { border-left-color: var(--accent-text); }

/* Footer: dark in both themes */
.site-footer { background: var(--footer-bg); color: var(--white); border-top: 1px solid var(--footer-border); }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-block: 40px; }
.site-footer .wordmark { font-size: 26px; color: var(--white); }
.site-footer .wordmark .mang { color: var(--white); }
.site-footer small { font-size: 15px; color: var(--footer-text); }
.site-footer a { color: var(--footer-text); }
.site-footer a:hover { color: var(--white); }

@media (max-width: 600px) {
  .hero .wrap, .section { padding-block: 64px; }
  .contact { padding-top: 0; }
  .contact.contact--page { padding-top: 40px; }
  .contact-grid { padding-top: 56px; }
  .site-nav { gap: 16px; }
  .card { padding: 28px 24px; }
  .panel { padding: 32px 24px; }
}
@media (max-width: 380px) {
  .wrap { padding-inline: 16px; }
}
