/* ==========================================================================
   Data Architect — site.css (single stylesheet for the whole site)

   1. Fonts         5. Header & navigation
   2. Tokens        6. Components
   3. Base          7. Page sections
   4. Layout        8. Forms
                    9. Utilities & motion

   Mobile-first. Breakpoints: 640px (sm) · 960px (md) · 1200px (lg)
   (custom properties cannot be used inside @media, so the values are repeated)
   ========================================================================== */

/* 1. Fonts — all SIL OFL 1.1 (licences in /assets/fonts/)
   Body: IBM Plex Sans Thai 400/600 (Thai + Latin).
   Headings: Khand 600 renders Latin, Kanit 500/600 renders Thai glyphs
   (approved Option B design). Each family ships only the subset it renders. */
@font-face {
  font-family: "Khand";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/khand-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Kanit";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/assets/fonts/kanit-500-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "Kanit";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/kanit-600-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-thai-400-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-thai-400-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-thai-600-thai.woff2") format("woff2");
  unicode-range: U+02D7, U+0303, U+0331, U+0E01-0E5B, U+200C-200D, U+25CC;
}
@font-face {
  font-family: "IBM Plex Sans Thai";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/assets/fonts/ibm-plex-sans-thai-600-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* 2. Tokens — change brand colours here and nowhere else.
   Palette: indigo + orange sampled from the official logo, on a navy ground
   (approved "Option B — Data Night" design). Contrast notes are vs. the
   ground each colour is meant for; all text pairs pass WCAG 2.1 AA. */
:root {
  /* Brand */
  --color-brand: #414095;            /* indigo — 8.6:1 on white */
  --color-brand-light: #8b8ae0;      /* indigo for use on navy — 6.3:1 on --color-ink */
  --color-brand-deep: #34337a;       /* fields inside indigo panels */
  --color-brand-line: #7c7bc9;
  --color-accent: #f4a233;           /* orange — CTAs and highlights; never small text on white */
  --color-accent-hover: #ffc46b;
  --color-accent-tint: #fbd9a6;      /* small labels on indigo */

  /* Grounds */
  --color-ink: #001530;              /* navy page ground */
  --color-ink-1: #04204a;            /* panels on navy */
  --color-ink-2: #0b1b33;            /* dark card on light grounds */
  --color-line-dark: #1c3a6e;
  --color-line-dark-strong: #3a5a94;
  --color-divider-dark: #123059;
  --color-paper: #ffffff;
  --color-paper-2: #f5f6fb;
  --color-line: #e1e3ee;
  --color-line-strong: #b9bed0;

  /* Text */
  --color-text: #0b1b33;
  --color-text-muted: #4a5468;       /* 7.6:1 on white */
  --color-text-subtle: #5a6478;      /* 6.0:1 on white */
  --color-text-nav: #33415c;
  --color-text-inverse: #ffffff;
  --color-text-inverse-muted: #b6c2d9;   /* 10:1 on --color-ink */
  --color-text-inverse-soft: #cfd7e8;
  --color-text-inverse-subtle: #8fa0bf;  /* 6.6:1 on --color-ink */
  --color-text-on-brand: #e4e4f6;        /* 7.3:1 on --color-brand */

  /* Feedback */
  --color-error: #b42318;
  --color-error-on-dark: #ff8a8a;
  --color-success: #067647;
  --color-success-bg: #ecfdf3;
  --color-error-bg: #fef3f2;
  --color-todo-bg: #fff3a3;
  --color-todo-text: #4d3b00;
  --color-todo-line: #d9a400;

  /* Typography */
  --font-sans: "IBM Plex Sans Thai", system-ui, -apple-system, "Segoe UI", "Noto Sans Thai", Tahoma, sans-serif;
  --font-display: "Khand", "Kanit", "IBM Plex Sans Thai", system-ui, sans-serif;
  --weight-regular: 400;
  --weight-medium: 500;      /* Kanit only (h3, labels) */
  --weight-semibold: 600;
  /* Every font-size in this file uses one of these. Kanit runs large for its
     px size, so the heading steps are deliberately modest. */
  --text-xs: 0.75rem;                                           /* 12px */
  --text-sm: 0.8125rem;                                         /* 13px */
  --text-base: 0.9375rem;                                       /* 15px body */
  --text-md: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);            /* lead 16–18 */
  --text-lg: clamp(1.0625rem, 1rem + 0.3vw, 1.25rem);           /* h3 17–20 */
  --text-xl: clamp(1.25rem, 1.1rem + 0.7vw, 1.625rem);          /* feature h3 20–26 */
  --text-2xl: clamp(1.5rem, 1.2rem + 1.3vw, 2.25rem);           /* h2 24–36 */
  --text-page: clamp(1.75rem, 1.35rem + 1.8vw, 2.75rem);        /* interior h1 28–44 */
  --text-3xl: clamp(2rem, 1.3rem + 3.2vw, 3.75rem);             /* hero h1 32–60 */
  --text-display: clamp(4rem, 2.6rem + 6vw, 6.5rem);            /* big stat 64–104 */
  /* Khand is condensed, so Latin-only (EN) headings run larger and tighter */
  --text-2xl-en: clamp(1.875rem, 1.45rem + 1.9vw, 2.875rem);    /* EN h2 30–46 */
  --text-page-en: clamp(2.125rem, 1.5rem + 2.8vw, 3.5rem);      /* EN interior h1 34–56 */
  --text-3xl-en: clamp(2.5rem, 1.5rem + 4.4vw, 4.75rem);        /* EN hero 40–76 */
  --leading-body: 1.7;       /* Thai body text needs ≥ 1.6 */
  --leading-heading: 1.25;   /* Thai h1/h2 need room for tone marks */
  --leading-heading-sm: 1.35;/* Thai h3 */
  --leading-tight: 1.2;

  /* Spacing — 4/8 px scale */
  --space-1: 0.25rem;   /* 4 */
  --space-2: 0.5rem;    /* 8 */
  --space-3: 0.75rem;   /* 12 */
  --space-4: 1rem;      /* 16 */
  --space-5: 1.5rem;    /* 24 */
  --space-6: 2rem;      /* 32 */
  --space-7: 2.5rem;    /* 40 */
  --space-8: 3rem;      /* 48 */
  --space-9: 4rem;      /* 64 */
  --space-10: 5rem;     /* 80 */
  --section-y: clamp(4rem, 2.6rem + 5.6vw, 7rem);
  --gutter: clamp(1rem, 0.5rem + 2vw, 1.5rem);
  --container: 77.5rem;          /* 1240px */
  --container-narrow: 48rem;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-pill: 999px;

  /* Effects */
  --shadow-header: 0 6px 24px -12px rgb(0 21 48 / 0.35);
  --shadow-pop: 0 16px 40px -16px rgb(0 21 48 / 0.35);
  --pattern-dots: radial-gradient(circle, rgb(139 138 224 / 0.22) 1.2px, transparent 1.6px);
  --pattern-dots-size: 28px 28px;
  --tap: 44px;
  --duration: 150ms;
  --ease: ease;
  --header-h: 72px;
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--leading-body);
  color: var(--color-text);
  background: var(--color-paper);
  -webkit-font-smoothing: antialiased;
}

main {
  flex: 1 0 auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-heading);
  text-wrap: balance;
}

h3,
h4 {
  line-height: var(--leading-heading-sm);
}

p,
ul,
ol,
dl,
dd,
figure,
blockquote {
  margin: 0;
}

p {
  text-wrap: pretty;
}

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

img {
  height: auto;
}

strong,
b {
  font-weight: var(--weight-semibold);
}

a {
  color: inherit;
  text-underline-offset: 0.2em;
}

button {
  font: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus, var(--color-brand));
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

::selection {
  background: var(--color-accent-tint);
  color: var(--color-ink);
}

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

.container--narrow {
  max-width: calc(var(--container-narrow) + 2 * var(--gutter));
}

.section {
  padding-block: var(--section-y);
}

.section--tight {
  padding-block: calc(var(--section-y) * 0.6);
}

.section--flush-top {
  padding-top: 0;
}

.section--paper {
  background: var(--color-paper);
}

.section--light {
  background: var(--color-paper-2);
}

.section--dark {
  --focus: var(--color-text-inverse);
  background-color: var(--color-ink);
  color: var(--color-text-inverse);
}

.section--dots {
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
}

.section--divided {
  border-top: 1px solid var(--color-divider-dark);
}

.grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
}

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

@media (min-width: 640px) {
  .grid--2,
  .grid--3,
  .grid--4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .grid--4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.section-head {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  max-width: var(--container-narrow);
  margin-bottom: var(--space-7);
}

.section-head--center {
  margin-inline: auto;
  text-align: center;
  align-items: center;
}

@media (min-width: 960px) {
  .section-head--split {
    max-width: none;
    flex-direction: row;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--space-7);
  }

  .section-head--split > * {
    flex: 1 1 0;
  }
}

.section-head__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.section-title {
  font-size: var(--text-2xl);
}

.section-title:lang(en) {
  font-size: var(--text-2xl-en);
  line-height: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--color-brand);
}

.section-head--center .eyebrow {
  align-self: center;
}

.section--dark .eyebrow,
.page-hero .eyebrow {
  color: var(--color-accent);
}

/* Latin-only labels may be tracked; Thai text never gets letter-spacing. */
.eyebrow:lang(en) {
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.lead {
  font-size: var(--text-md);
  color: var(--color-text-muted);
}

.section--dark .lead {
  color: var(--color-text-inverse-muted);
}

.section-foot {
  margin-top: var(--space-7);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* 5. Header & navigation */
.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 100;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: var(--color-ink);
  color: var(--color-text-inverse);
  font-weight: var(--weight-semibold);
  transform: translateY(-200%);
}

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

.site-header {
  position: relative;
  z-index: 50;
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
  box-shadow: var(--shadow-header);
  color: var(--color-text);
}

.site-header__inner {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  min-height: var(--header-h);
  padding-block: var(--space-2);
}

.brand {
  display: flex;
  flex: 0 0 auto;
  margin-right: auto;
  border-radius: var(--radius-sm);
}

.brand img {
  width: auto;
  height: 52px;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-text);
  font-weight: var(--weight-semibold);
  text-decoration: none;
  cursor: pointer;
}

.nav-toggle__close,
.site-header.is-open .nav-toggle__open {
  display: none;
}

.site-header.is-open .nav-toggle__close {
  display: block;
}

.site-menu {
  display: none;
}

.site-header.is-open .site-menu {
  display: block;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  padding: var(--space-2) var(--gutter) var(--space-6);
  background: var(--color-paper);
  border-bottom: 1px solid var(--color-line);
  box-shadow: var(--shadow-pop);
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.primary-nav a,
.primary-nav summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0 var(--space-1);
  color: var(--color-text-nav);
  text-decoration: none;
  cursor: pointer;
}

.primary-nav > ul > li {
  border-bottom: 1px solid var(--color-line);
}

.primary-nav a:hover,
.primary-nav summary:hover {
  color: var(--color-brand);
}

/* Mobile menu: tint the row under the finger/pointer (desktop resets this) */
.primary-nav a,
.primary-nav summary {
  padding-inline: var(--space-2);
  border-radius: var(--radius-sm);
  transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.primary-nav a:hover,
.primary-nav a:active,
.primary-nav summary:hover,
.primary-nav summary:active {
  background: var(--color-paper-2);
}

@keyframes menu-in {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
}

.primary-nav a[aria-current],
.nav-group:has(a[aria-current]) > details > summary {
  color: var(--color-brand);
  font-weight: var(--weight-semibold);
}

.nav-group summary {
  list-style: none;
}

.nav-group summary::-webkit-details-marker {
  display: none;
}

.nav-group__chevron {
  width: 16px;
  height: 16px;
  transition: transform var(--duration) var(--ease);
}

.nav-group details[open] .nav-group__chevron {
  transform: rotate(180deg);
}

.primary-nav .nav-group__menu {
  padding: 0 0 var(--space-2) var(--space-4);
}

.nav-group__menu a {
  min-height: 44px;
}

.site-menu__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  color: var(--color-text-subtle);
  text-decoration: none;
  white-space: nowrap;
}

.lang-switch {
  transition: color var(--duration) var(--ease), background-color var(--duration) var(--ease);
}

.lang-switch:hover {
  color: var(--color-brand);
  background: var(--color-paper-2);
}

.lang-switch__current {
  color: var(--color-brand);
}

@media (min-width: 960px) {
  .brand img {
    height: 68px;
  }

  .nav-toggle {
    display: none !important;
  }

  .site-menu,
  .site-header.is-open .site-menu {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: var(--space-4);
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0;
    border: 0;
    box-shadow: none;
    background: none;
  }

  .primary-nav {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
  }

  .primary-nav > ul {
    display: flex;
    gap: var(--space-1);
  }

  .primary-nav > ul > li {
    border-bottom: 0;
  }

  .primary-nav > ul > li > a,
  .primary-nav summary {
    position: relative;
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border-radius: 0;
    background: none;
    white-space: nowrap;
    transition: color var(--duration) var(--ease);
  }

  .primary-nav > ul > li > a:hover,
  .primary-nav > ul > li > a:active,
  .primary-nav summary:hover,
  .primary-nav summary:active {
    background: none;
  }

  /* Orange underline: grows from the centre on hover/focus, stays on the
     current page and while the dropdown is open. */
  .primary-nav > ul > li > a::after,
  .primary-nav summary::after {
    content: "";
    position: absolute;
    left: var(--space-3);
    right: var(--space-3);
    bottom: 0;
    height: 2px;
    border-radius: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 200ms var(--ease);
  }

  .primary-nav > ul > li > a:hover::after,
  .primary-nav > ul > li > a:focus-visible::after,
  .primary-nav summary:hover::after,
  .primary-nav summary:focus-visible::after,
  .nav-group details[open] > summary::after,
  .primary-nav > ul > li > a[aria-current]::after,
  .nav-group:has(a[aria-current]) > details > summary::after {
    transform: scaleX(1);
  }

  .nav-group details[open] > summary {
    color: var(--color-brand);
  }

  .nav-group {
    position: relative;
  }

  .primary-nav .nav-group__menu {
    position: absolute;
    top: calc(100% + var(--space-2));
    left: 0;
    min-width: 23rem;
    padding: var(--space-2);
    background: var(--color-paper);
    border: 1px solid var(--color-line);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-pop);
  }

  .nav-group details[open] .nav-group__menu {
    animation: menu-in 160ms var(--ease) both;
  }

  .nav-group__menu a {
    padding: var(--space-2) var(--space-3);
    border-radius: var(--radius-sm);
    transition: background-color var(--duration) var(--ease), color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
  }

  .nav-group__menu a:hover,
  .nav-group__menu a:focus-visible,
  .nav-group__menu a[aria-current] {
    background: var(--color-paper-2);
    color: var(--color-brand);
    box-shadow: inset 3px 0 0 var(--color-accent);
  }

  .site-menu__actions {
    flex-wrap: nowrap;
    margin-top: 0;
  }
}

@media (min-width: 960px) and (max-width: 1199px) {
  .primary-nav > ul > li > a,
  .primary-nav summary {
    padding: 0 var(--space-2);
  }

  .primary-nav > ul > li > a::after,
  .primary-nav summary::after {
    left: var(--space-2);
    right: var(--space-2);
  }
}

/* 6. Components */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--tap);
  padding: 0 1.375rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  font-weight: var(--weight-semibold);
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--duration) var(--ease), border-color var(--duration) var(--ease), color var(--duration) var(--ease);
}

.btn svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.btn--lg {
  min-height: 52px;
  padding: 0 1.75rem;
}

.btn--primary {
  background: var(--color-accent);
  color: var(--color-ink);
}

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

.btn--outline-light {
  border-color: var(--color-line-dark-strong);
  color: var(--color-text-inverse);
}

.btn--outline-light:hover {
  border-color: var(--color-text-inverse);
}

.btn--white {
  background: var(--color-paper);
  color: var(--color-brand);
}

.btn--white:hover {
  background: #ececfa;
}

.btn--outline {
  border-color: var(--color-line-strong);
  color: var(--color-text);
}

.btn--outline:hover {
  border-color: var(--color-brand);
  color: var(--color-brand);
}

.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

.btn.is-loading::before {
  content: "";
  width: 18px;
  height: 18px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

/* Text link with arrow */
.link-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tap);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

.link-arrow svg {
  width: 18px;
  height: 18px;
}

.section--dark .link-arrow {
  color: var(--color-accent);
}

/* Pill label + dot */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.375rem 1rem 0.375rem 0.75rem;
  border: 1px solid #23417a;
  border-radius: var(--radius-pill);
  background: var(--color-ink-1);
  font-size: var(--text-sm);
  color: var(--color-text-inverse-soft);
}

.dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-accent);
}

.dot--brand {
  background: var(--color-brand-light);
}

.dots-row {
  display: flex;
  gap: 0.625rem;
}

.dots-row span {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-accent);
}

.dots-row span:nth-child(2) {
  opacity: 0.7;
}

.dots-row span:nth-child(3) {
  opacity: 0.4;
}

/* Cards */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 1.75rem;
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-paper);
  color: var(--color-text);
}

.card__icon {
  width: 32px;
  height: 32px;
  color: var(--color-brand);
}

.card__label {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.card__title {
  font-size: var(--text-lg);
}

.card__text {
  color: var(--color-text-muted);
}

.card__more {
  margin-top: auto;
  padding-top: var(--space-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-weight: var(--weight-semibold);
  color: var(--color-brand);
}

.card__more svg {
  width: 18px;
  height: 18px;
}

/* Whole-card link: the link sits on the title, its ::after covers the card */
.card__link {
  text-decoration: none;
}

.card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card__link:focus-visible {
  outline: none;
}

.card:has(.card__link:focus-visible) {
  outline: 3px solid var(--focus, var(--color-brand));
  outline-offset: 2px;
}

.card--interactive {
  transition: transform var(--duration) var(--ease), border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}

.card--interactive:hover {
  transform: translateY(-2px);
  border-color: var(--color-line-strong);
  box-shadow: var(--shadow-pop);
}

.card--brand {
  --focus: var(--color-text-inverse);
  border-color: transparent;
  background: var(--color-brand);
  color: var(--color-text-inverse);
}

.card--brand .card__label {
  color: var(--color-accent-tint);
}

.card--brand .card__text {
  color: var(--color-text-on-brand);
}

.card--brand .card__title {
  font-size: var(--text-xl);
}

.card--brand .card__more {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 1.375rem;
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  color: var(--color-brand);
}

.card--brand .card__icon {
  color: var(--color-accent);
}

.card--brand .bullet-list {
  color: var(--color-text-on-brand);
}

.card--brand a.card__more {
  text-decoration: none;
  transition: background-color var(--duration) var(--ease);
}

.card--brand a.card__more:hover {
  background: #ececfa;
}

/* Spans every column of its grid, e.g. a featured service under a 2-up list */
@media (min-width: 640px) {
  .card--wide {
    grid-column: 1 / -1;
  }
}

.card--ink {
  --focus: var(--color-text-inverse);
  border-color: transparent;
  background: var(--color-ink-2);
  color: var(--color-text-inverse);
}

.card--ink .card__text,
.card--ink .bullet-list {
  color: var(--color-text-inverse-soft);
}

.card--ink .card__more {
  color: var(--color-accent);
}

.card--panel {
  border-color: var(--color-line-dark);
  background: var(--color-ink-1);
  color: var(--color-text-inverse);
}

.card--panel .card__icon {
  width: 28px;
  height: 28px;
  color: var(--color-accent);
}

.card--panel .card__text {
  color: var(--color-text-inverse-muted);
}

.card--interactive.card--panel:hover {
  border-color: var(--color-line-dark-strong);
}

/* Bullets */
.bullet-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
}

.bullet-list li::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-top: 0.7em;
  border-radius: 50%;
  background: var(--color-accent);
}

/* TODO marker — must not exist anywhere in site/ at launch */
.todo {
  display: inline;
  padding: 0 0.3em;
  border-radius: var(--radius-xs);
  outline: 2px dashed var(--color-todo-line);
  outline-offset: 1px;
  background: var(--color-todo-bg);
  color: var(--color-todo-text);
  font-weight: var(--weight-semibold);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

/* 7. Page sections */

/* Hero */
.hero {
  --focus: var(--color-text-inverse);
  overflow: hidden;
  background-color: var(--color-ink);
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
  color: var(--color-text-inverse);
  text-align: center;
}

.hero__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-5);
  padding-top: clamp(3.5rem, 2rem + 6vw, 7rem);
}

.hero__title {
  font-size: var(--text-3xl);
  line-height: var(--leading-tight);
}

.hero__title:lang(en) {
  font-size: var(--text-3xl-en);
  line-height: 0.95;
}

.hl {
  color: var(--color-accent);
}

.hero__lead {
  max-width: 40em;
  font-size: var(--text-md);
  color: var(--color-text-inverse-muted);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
}

/* Decorative dashboard illustration (aria-hidden; values are illustrative) */
.dashboard {
  width: 100%;
  margin-top: var(--space-6);
  display: grid;
  gap: var(--space-4);
  grid-template-columns: minmax(0, 1fr);
  padding: var(--space-4);
  border: 1px solid var(--color-line-dark);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  background: var(--color-ink-1);
  text-align: left;
}

.dash-panel {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border-radius: 14px;
  background: var(--color-ink);
}

.dash-label {
  font-size: var(--text-sm);
  color: var(--color-text-inverse-soft);
}

.dash-zones,
.dash-heat {
  display: none;
}

.dash-zone {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.5rem 0.75rem;
  border-radius: 10px;
  font-size: var(--text-sm);
  color: var(--color-text-inverse-soft);
}

.dash-zone--active {
  background: var(--color-brand);
  color: var(--color-text-inverse);
}

.heatmap {
  display: grid;
  grid-template-columns: 2fr 1fr;
  grid-template-rows: 90px 70px;
  gap: 6px;
}

.heatmap span {
  border: 1px solid #23417a;
  border-radius: var(--radius-sm);
}

.heatmap span:first-child {
  grid-row: span 2;
  background-image:
    radial-gradient(circle at 30% 40%, rgb(244 162 51 / 0.85) 0 10px, rgb(244 162 51 / 0.25) 11px 28px, transparent 29px),
    radial-gradient(circle at 70% 70%, rgb(139 138 224 / 0.7) 0 8px, rgb(139 138 224 / 0.2) 9px 24px, transparent 25px);
}

.heatmap span:nth-child(2) {
  background-image: radial-gradient(circle at 50% 50%, rgb(139 138 224 / 0.7) 0 6px, rgb(139 138 224 / 0.2) 7px 18px, transparent 19px);
}

.heatmap span:nth-child(3) {
  background-image: radial-gradient(circle at 40% 60%, rgb(244 162 51 / 0.7) 0 5px, rgb(244 162 51 / 0.2) 6px 14px, transparent 15px);
}

.dash-chart {
  width: 100%;
  height: auto;
}

@media (min-width: 640px) {
  .dashboard {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dash-heat {
    display: flex;
  }
}

@media (min-width: 960px) {
  .dashboard {
    grid-template-columns: minmax(200px, 0.8fr) repeat(2, minmax(0, 1.2fr));
  }

  .dash-zones {
    display: flex;
    gap: var(--space-2);
  }
}

/* Interior page hero */
.page-hero {
  --focus: var(--color-text-inverse);
  padding-block: clamp(3rem, 2rem + 4vw, 5.5rem);
  background-color: var(--color-ink);
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
  color: var(--color-text-inverse);
}

.page-hero__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: var(--container-narrow);
}

.page-hero__title {
  font-size: var(--text-2xl);
}

.page-hero .lead {
  color: var(--color-text-inverse-muted);
}

/* Solutions bento */
.bento {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

.bento .card--brand {
  min-height: 24rem;
}

@media (min-width: 640px) {
  .bento {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bento > :first-child {
    grid-row: span 2;
  }
}

@media (min-width: 960px) {
  .bento {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* AI section — static chat illustration */
.ai-layout {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 960px) {
  .ai-layout {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chat {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.chat__window {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  height: 100%;
  padding: 1.25rem;
  border: 1px solid var(--color-line-dark);
  border-radius: var(--radius-lg);
  background: var(--color-ink-1);
}

.chat__head {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  padding-bottom: var(--space-3);
  border-bottom: 1px solid var(--color-line-dark);
  font-weight: var(--weight-semibold);
}

.chat__badge {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--color-accent);
  color: var(--color-ink);
}

.chat__badge svg {
  width: 18px;
  height: 18px;
}

.chat__bubble {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
}

.chat__bubble--user {
  align-self: flex-end;
  max-width: 85%;
  border-radius: 16px 16px 4px 16px;
  background: var(--color-brand);
}

.chat__bubble--ai {
  align-self: flex-start;
  max-width: 92%;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1px solid var(--color-line-dark);
  border-radius: 16px 16px 16px 4px;
  background: var(--color-ink);
  color: var(--color-text-inverse-soft);
}

.chat__bubble--ai strong {
  color: var(--color-text-inverse);
}

.chat__bars {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.chat__bar {
  display: grid;
  grid-template-columns: 3.5rem minmax(0, 1fr);
  align-items: center;
  gap: 0.625rem;
  font-size: var(--text-xs);
  color: var(--color-text-inverse-subtle);
}

.chat__bar span {
  display: block;
  height: 10px;
  border-radius: 6px;
  background: var(--color-brand);
}

.chat__bar--a span { width: 62%; }
.chat__bar--b span { width: 45%; }
.chat__bar--c span { width: 90%; background: var(--color-accent); }

.chat__input {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  margin-top: auto;
  padding: 6px 6px 6px 14px;
  border: 1px solid #2b4a82;
  border-radius: var(--radius-pill);
  background: var(--color-ink);
  font-size: var(--text-sm);
  color: var(--color-text-inverse-subtle);
}

.chat__send {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-ink);
}

.chat__send svg {
  width: 18px;
  height: 18px;
}

.figure-note {
  font-size: var(--text-sm);
  color: var(--color-text-inverse-subtle);
}

/* Why us / stats */
.why-grid {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 960px) {
  .why-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.big-stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.big-stat__value {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: var(--weight-semibold);
  line-height: 0.85;
  color: var(--color-accent);
}

.big-stat__label {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--leading-heading-sm);
}

/* Orange fails contrast on white even at display size; use indigo there */
.big-stat--on-light .big-stat__value {
  color: var(--color-brand);
}

/* Kanit 500 for the quieter h3s on navy, as in the approved design */
.card--panel .card__title,
.value-item h3,
.step h3 {
  font-weight: var(--weight-medium);
}

.value-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding-top: var(--space-5);
  border-top: 2px solid var(--color-brand);
}

.value-item h3 {
  font-size: var(--text-lg);
}

.value-item p {
  color: var(--color-text-inverse-muted);
}

.stats {
  list-style: none;
  margin: var(--space-9) 0 0;
  padding: var(--space-6) 0 0;
  display: grid;
  gap: var(--space-5);
  grid-template-columns: minmax(0, 1fr);
  border-top: 1px solid var(--color-divider-dark);
}

@media (min-width: 640px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.stat {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.stat__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.stat__label {
  color: var(--color-text-inverse-muted);
}

/* Process steps */
.steps {
  list-style: none;
  margin: 0;
  padding: 0;
}

.step {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: 1.75rem;
  border: 1px solid var(--color-line-dark);
  border-radius: 18px;
  background: var(--color-ink-1);
  /* Dark card: carries its own text colour so it also works on light sections */
  color: var(--color-text-inverse);
}

.step__num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-accent);
  color: var(--color-ink);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-semibold);
}

.step:nth-child(2) .step__num {
  background: var(--color-brand-light);
}

.step:nth-child(3) .step__num {
  background: var(--color-paper);
}

.step h3 {
  font-size: var(--text-lg);
}

.step p {
  color: var(--color-text-inverse-muted);
}

/* Client logos */
.logo-wall {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 640px) {
  .logo-wall {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .logo-wall {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

.logo-wall li {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  padding: var(--space-3);
  border: 1px dashed var(--color-line-strong);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  text-align: center;
}

/* Work cards */
.work-card {
  padding: 0;
  overflow: hidden;
}

.work-card__media {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: var(--space-4);
  background-color: var(--color-ink);
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
  text-align: center;
}

.work-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-5);
}

/* CTA panel */
.cta-panel {
  --focus: var(--color-text-inverse);
  display: grid;
  gap: var(--space-7);
  grid-template-columns: minmax(0, 1fr);
  padding: clamp(1.75rem, 1rem + 4vw, 4rem);
  border-radius: var(--radius-xl);
  background: var(--color-brand);
  color: var(--color-text-inverse);
}

@media (min-width: 960px) {
  .cta-panel {
    grid-template-columns: 1.2fr 1fr;
    align-items: center;
  }
}

.cta-panel__title {
  font-size: var(--text-2xl);
}

.cta-panel p {
  font-size: var(--text-md);
  color: var(--color-text-on-brand);
}

.cta-panel .btn-row {
  margin-top: var(--space-5);
}

.contact-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.contact-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.contact-list svg {
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.15em;
  color: var(--color-accent);
}

.contact-list a {
  font-weight: var(--weight-semibold);
}

.cta-panel .contact-list {
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-brand-deep);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--color-line);
  background: var(--color-paper);
  color: var(--color-text);
}

.site-footer__grid {
  display: grid;
  gap: var(--space-7) var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  padding-block: var(--space-9) var(--space-7);
}

@media (min-width: 640px) {
  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 960px) {
  .site-footer__grid {
    grid-template-columns: 1.3fr 1fr 1fr 1.4fr;
  }
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.footer-brand img {
  width: auto;
  height: 80px;
}

.footer-brand p {
  max-width: 26em;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.footer-heading {
  margin-bottom: var(--space-3);
  font-family: var(--font-sans);
  font-size: var(--text-base);
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  font-size: var(--text-sm);
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--color-text-muted);
  text-decoration: none;
}

.footer-links a:hover,
.footer-links a[aria-current] {
  color: var(--color-brand);
  text-decoration: underline;
}

.site-footer .contact-list {
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.site-footer .contact-list svg {
  width: 20px;
  height: 20px;
  color: var(--color-brand);
}

.site-footer .contact-list a {
  color: var(--color-brand);
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-5);
  border-top: 1px solid var(--color-line);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

/* 7b. Interior pages */
.page-hero__title {
  font-size: var(--text-page);
  line-height: var(--leading-tight);
}

.page-hero__title:lang(en) {
  font-size: var(--text-page-en);
  line-height: 1;
}

.page-hero .btn-row {
  margin-top: var(--space-3);
}

.breadcrumb ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-inverse-subtle);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: var(--space-2);
  color: var(--color-line-dark-strong);
}

.breadcrumb a {
  color: var(--color-text-inverse-soft);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.split {
  display: grid;
  gap: var(--space-7);
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
}

@media (min-width: 960px) {
  .split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .split--reverse > :first-child {
    order: 2;
  }
}

.media-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: var(--space-5);
  border: 1px dashed var(--color-line-dark-strong);
  border-radius: var(--radius-lg);
  background-color: var(--color-ink);
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
  text-align: center;
}

.media-placeholder--portrait {
  aspect-ratio: 4 / 5;
}

.check-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.check-list li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.check-list li::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 0.2em;
  border-radius: 50%;
  background: var(--color-brand) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E") center / 14px no-repeat;
}

.section--dark .check-list li::before {
  background-color: var(--color-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23001530' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12 4 4 8-8'/%3E%3C/svg%3E");
}

.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.chip-list li {
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-pill);
  background: var(--color-paper);
  font-size: var(--text-sm);
}

.notice {
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  background: var(--color-paper-2);
  color: var(--color-text);
}

/* FAQ */
.faq {
  border-top: 1px solid var(--color-line);
}

.faq details {
  border-bottom: 1px solid var(--color-line);
}

.faq summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  min-height: 64px;
  padding-block: var(--space-3);
  font-family: var(--font-display);
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  line-height: var(--leading-heading-sm);
  list-style: none;
  cursor: pointer;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-paper-2);
  color: var(--color-brand);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
}

.faq details[open] summary::after {
  content: "−";
}

.faq details > div {
  padding-bottom: var(--space-5);
  color: var(--color-text-muted);
}

/* Prose (articles, case studies, legal) */
.prose {
  max-width: 44rem;
  font-size: var(--text-md);
}

.prose > * + * {
  margin-top: var(--space-4);
}

.prose h2 {
  margin-top: var(--space-8);
  font-size: var(--text-xl);
}

.prose h3 {
  margin-top: var(--space-6);
  font-size: var(--text-lg);
}

.prose h2 + *,
.prose h3 + * {
  margin-top: var(--space-3);
}

.prose ul,
.prose ol {
  padding-left: 1.5rem;
}

.prose li + li {
  margin-top: var(--space-2);
}

.prose a {
  color: var(--color-brand);
}

.prose blockquote {
  padding: var(--space-4) var(--space-5);
  border-left: 4px solid var(--color-brand);
  background: var(--color-paper-2);
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
}

.prose figure {
  margin-block: var(--space-6);
}

.prose figcaption {
  margin-top: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.article-layout {
  display: grid;
  gap: var(--space-8);
  grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 960px) {
  .article-layout {
    grid-template-columns: minmax(0, 1fr) 18rem;
    align-items: start;
  }

  .article-layout__aside {
    position: sticky;
    top: var(--space-5);
  }
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  font-size: var(--text-sm);
  color: var(--color-text-inverse-muted);
}

.toc {
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
}

.toc h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-base);
}

.toc ol {
  margin: 0;
  padding-left: 1.25rem;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}

.toc li + li {
  margin-top: var(--space-2);
}

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

.toc a:hover {
  color: var(--color-brand);
  text-decoration: underline;
}

/* Fact list (case study sidebar, contact details) */
.facts {
  display: grid;
  gap: var(--space-4);
  margin: 0;
  padding: var(--space-5);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-lg);
  background: var(--color-paper);
}

.facts dt {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.facts dd {
  font-weight: var(--weight-semibold);
}

.metric-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background: var(--color-brand);
  color: var(--color-text-inverse);
}

.metric-card__value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: var(--weight-semibold);
  line-height: var(--leading-tight);
}

.metric-card p {
  color: var(--color-text-on-brand);
}

/* Team */
.person {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.person .media-placeholder {
  margin-bottom: var(--space-2);
}

.person__role {
  color: var(--color-text-subtle);
  font-size: var(--text-sm);
}

/* Contact */
.contact-layout {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

@media (min-width: 960px) {
  .contact-layout {
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  }
}

.form-card {
  padding: clamp(1.5rem, 1rem + 2vw, 2.5rem);
  border: 1px solid var(--color-line);
  border-radius: var(--radius-xl);
  background: var(--color-paper);
}

.form-card__title {
  margin-bottom: var(--space-2);
  font-size: var(--text-xl);
}

.form-card > p {
  margin-bottom: var(--space-5);
  color: var(--color-text-muted);
}

@media (min-width: 640px) {
  .form__row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  padding: var(--space-6);
  border-radius: var(--radius-xl);
  background: var(--color-ink);
  color: var(--color-text-inverse);
  --focus: var(--color-text-inverse);
}

.info-card .contact-list a {
  color: var(--color-text-inverse);
}

/* Directions card: a link out to Google Maps (no embedded map, so the CSP
   stays limited to self + Cloudflare) */
.map {
  display: grid;
  justify-items: start;
  gap: var(--space-3);
  padding: var(--space-5);
  border-radius: var(--radius-lg);
  background-color: var(--color-ink-1);
  background-image: var(--pattern-dots);
  background-size: var(--pattern-dots-size);
  color: var(--color-text-inverse-soft);
}

.map__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* 8. Forms */
.form {
  display: grid;
  gap: var(--space-4);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.field label,
.field__label {
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
}

.field__optional {
  font-weight: var(--weight-regular);
  color: var(--color-text-subtle);
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  padding: 0 0.875rem;
  border: 1px solid var(--color-line-strong);
  border-radius: var(--radius-md);
  background: var(--color-paper);
  color: var(--color-text);
  font: inherit;
}

.textarea {
  min-height: 9rem;
  padding-block: var(--space-3);
  resize: vertical;
}

.select {
  appearance: none;
  padding-right: 2.5rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%234a5468' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.875rem center;
}

.input:focus-visible,
.select:focus-visible,
.textarea:focus-visible {
  border-color: var(--color-brand);
}

.field__hint {
  font-size: var(--text-sm);
  color: var(--color-text-subtle);
}

.field__error {
  font-size: var(--text-sm);
  color: var(--color-error);
}

.field--invalid .input,
.field--invalid .select,
.field--invalid .textarea {
  border-color: var(--color-error);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
}

.checkbox input {
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0.2em 0 0;
  accent-color: var(--color-brand);
}

.form-status {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  font-weight: var(--weight-semibold);
}

.form-status--success {
  background: var(--color-success-bg);
  color: var(--color-success);
}

.form-status--error {
  background: var(--color-error-bg);
  color: var(--color-error);
}

/* Honeypot: off-screen for people, still in the DOM for bots */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Form on an indigo panel */
.form--on-brand .input,
.form--on-brand .select,
.form--on-brand .textarea {
  border-color: var(--color-brand-line);
  background-color: var(--color-brand-deep);
  color: var(--color-text-inverse);
}

.form--on-brand .field__hint,
.form--on-brand .field__optional {
  color: var(--color-text-on-brand);
}

.form--on-brand .field__error {
  color: var(--color-error-on-dark);
}

.form--on-brand .field--invalid .input,
.form--on-brand .field--invalid .select,
.form--on-brand .field--invalid .textarea {
  border-color: var(--color-error-on-dark);
}

/* 9. Utilities & motion */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.text-center {
  text-align: center;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .card--interactive:hover {
    transform: none;
  }
}
