/* ==========================================================================
   Sidenote - design system
   Palette  : Mint Frost (Bank A-1)
   Type     : Bitter + IBM Plex Sans (Bank B-5)
   Direction: Aurora / mesh gradient (Bank C-5) - the mesh is a fixed
              composition; the gate's sonar rings are the only ambient motion
   Edges    : Editorial soft-drop (Bank E2-6)
   Header   : Card header (Bank E1-4)
   Accent   : strategy 1 - colour lands on the call to action and on links
   ========================================================================== */

:root {
  /* ---- palette, light ---- */
  --bg:          #F2FAF6;
  --surface:     #FDFFFE;
  --ink:         #15291F;
  /* one step darker than the bank's #51685C: over the aurora blobs at full
     strength the bank value composites to 4.23:1, just under AA */
  --muted:       #4A6054;
  --accent:      #2E7D5B;
  --accent-2:    #7FC8A9;
  --link:        #256A4C;
  --on-accent:   #FFFFFF;
  --tint:        #E4F3EB;
  --line:        rgba(21, 41, 31, .10);
  --line-strong: rgba(21, 41, 31, .18);

  /* the gate wash is a gradient, so its ink gets its own token */
  --grad:        linear-gradient(135deg, #EAF7F0 0%, #D7EFE2 45%, #C4E7D4 100%);
  --on-grad:     #15291F;
  --on-grad-mut: #3F5A4C;
  --ring:        rgba(46, 125, 91, .30);

  /* aurora blobs */
  --blob-a: rgba(127, 200, 169, .55);
  --blob-b: rgba(146, 197, 224, .40);
  --blob-c: rgba(206, 226, 168, .42);

  /* ---- shadows (E2-6: one long diffuse drop) ---- */
  --shadow:    0 24px 48px -16px rgba(31, 36, 48, .14);
  --shadow-lg: 0 34px 60px -18px rgba(31, 36, 48, .20);
  --radius:    10px;
  --radius-lg: 16px;

  /* ---- spacing scale ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;

  /* ---- type scale, ratio 1.25 ---- */
  --fs-xs: .8125rem;
  --fs-sm: .9375rem;
  --fs-md: 1.0625rem;
  --fs-lg: clamp(1.15rem, .95rem + .8vw, 1.375rem);
  --fs-h3: clamp(1.1rem, .98rem + .5vw, 1.25rem);
  --fs-h2: clamp(1.45rem, 1.15rem + 1.2vw, 1.95rem);
  --fs-h1: clamp(1.95rem, 1.35rem + 2.6vw, 3.1rem);
  --fs-num: clamp(4.5rem, 3rem + 12vw, 9rem);

  --font-head: "Bitter", Georgia, "Times New Roman", serif;
  --font-body: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --column: 44rem;
  --wrap:   1140px;
  --head-h: 68px;
  --sticky-h: 0px;

  /* stacking order, written down once so nothing guesses */
  --z-sticky: 30;
  --z-cookie: 35;
  --z-head:   40;
  --z-scrim:  50;
  --z-sheet:  52;
  --z-skip:   60;
}

:root:not([data-theme="light"]) {
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #101B16;
    --surface:     #16241D;
    --ink:         #E3EFE8;
    --muted:       #9CB8A9;
    --accent:      #32815C;
    --accent-2:    #6FAE92;
    --link:        #8CC9B0;
    --on-accent:   #FFFFFF;
    --tint:        #1B2E25;
    --line:        rgba(227, 239, 232, .12);
    --line-strong: rgba(227, 239, 232, .22);
    --grad:        linear-gradient(135deg, #16241D 0%, #1B2E25 45%, #21382C 100%);
    --on-grad:     #E3EFE8;
    --on-grad-mut: #A9C4B5;
    --ring:        rgba(111, 174, 146, .38);
    --blob-a: rgba(50, 129, 92, .40);
    --blob-b: rgba(58, 96, 128, .34);
    --blob-c: rgba(88, 106, 62, .30);
    --shadow:    0 24px 48px -16px rgba(0, 0, 0, .55);
    --shadow-lg: 0 34px 60px -18px rgba(0, 0, 0, .65);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #101B16;
  --surface:     #16241D;
  --ink:         #E3EFE8;
  --muted:       #9CB8A9;
  --accent:      #32815C;
  --accent-2:    #6FAE92;
  --link:        #8CC9B0;
  --on-accent:   #FFFFFF;
  --tint:        #1B2E25;
  --line:        rgba(227, 239, 232, .12);
  --line-strong: rgba(227, 239, 232, .22);
  --grad:        linear-gradient(135deg, #16241D 0%, #1B2E25 45%, #21382C 100%);
  --on-grad:     #E3EFE8;
  --on-grad-mut: #A9C4B5;
  --ring:        rgba(111, 174, 146, .38);
  --blob-a: rgba(50, 129, 92, .40);
  --blob-b: rgba(58, 96, 128, .34);
  --blob-c: rgba(88, 106, 62, .30);
  --shadow:    0 24px 48px -16px rgba(0, 0, 0, .55);
  --shadow-lg: 0 34px 60px -18px rgba(0, 0, 0, .65);
}

/* --------------------------------------------------------------------------
   Page ground: a fixed mesh of three blurred blobs plus a fine grain.
   Nothing here moves - the gate carries the page's one animation.
   -------------------------------------------------------------------------- */

body {
  background-color: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
}

body::before {
  background:
    radial-gradient(38rem 30rem at 12% -6%,  var(--blob-a), transparent 62%),
    radial-gradient(42rem 34rem at 96% 22%,  var(--blob-b), transparent 64%),
    radial-gradient(46rem 32rem at 42% 108%, var(--blob-c), transparent 66%);
  filter: blur(60px);
  opacity: .9;
}

/* F-14 grain: takes the plastic off the flat fills */
body::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: .04;
}

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

.sdn-wrap {
  width: min(100% - clamp(32px, 8vw, 64px), var(--wrap));
  margin-inline: auto;
}

.sdn-skip {
  position: fixed;
  inset-block-start: -100%;
  inset-inline-start: var(--space-4);
  z-index: var(--z-skip);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow);
  text-decoration: none;
}
.sdn-skip:focus { inset-block-start: var(--space-4); }

/* --------------------------------------------------------------------------
   Header (E1-4): a rounded card floating off the page edges.
   The strip around the card is painted once the page scrolls, otherwise the
   article runs through it and the bar looks torn off the top on a phone.
   -------------------------------------------------------------------------- */

.sdn-head {
  position: sticky;
  inset-block-start: 0;
  z-index: var(--z-head);
  padding: 12px clamp(12px, 3vw, 20px);
  background: transparent;
  transition: background-color .25s ease, padding .25s ease, box-shadow .25s ease;
}

.sdn-head.is-stuck {
  background: var(--bg);
  padding-block: 8px;
  box-shadow: 0 1px 0 var(--line);
}

.sdn-head.is-open { z-index: var(--z-sheet); }

.sdn-head__card {
  width: min(100%, var(--wrap));
  margin-inline: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .25s ease;
}

.sdn-head.is-stuck .sdn-head__card { transform: scale(.99); }

.sdn-head__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--head-h);
  padding-inline: clamp(12px, 2.4vw, 20px);
}

.sdn-head__actions {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex: 0 0 auto;
}

/* the admin bar is only fixed above 783px; below that it scrolls away and a
   46px offset would hang the header permanently below the viewport top */
@media (min-width: 783px) {
  body.admin-bar .sdn-head { inset-block-start: 32px; }
}
@media (max-width: 782px) {
  body.admin-bar .sdn-head { inset-block-start: 0; }
}

/* ---- brand ---- */

.sdn-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.sdn-brand__icon { width: 32px; height: 32px; flex: 0 0 32px; }
.sdn-brand__icon--foot { width: 28px; height: 28px; flex: 0 0 28px; }

.sdn-mark__field { fill: var(--accent); }
.sdn-mark__bar { fill: var(--on-accent); opacity: .75; }
.sdn-mark__bar--hi { opacity: 1; }

.sdn-brand__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(.95rem, .82rem + .5vw, 1.15rem);
  letter-spacing: -.01em;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}

@media (max-width: 400px) {
  .sdn-brand__name { font-size: .9rem; }
}

/* ---- icon-only buttons ----
   Fixed box so an SVG-only child cannot collapse. The theme toggle stacks its
   two glyphs in one grid cell on purpose; the burger's three bars need a flex
   column, because auto grid rows stretch and swallow any gap between them. */

.sdn-icobtn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border-radius: var(--radius);
  color: var(--ink);
  transition: background-color .2s ease;
}
.sdn-icobtn:hover { background: var(--tint); }

.sdn-theme {
  display: inline-grid;
  place-items: center;
}
.sdn-theme svg {
  grid-area: 1 / 1;
  width: 21px;
  height: 21px;
  transition: opacity .25s ease, transform .35s ease;
}
.sdn-theme__moon { opacity: 0; transform: rotate(-35deg) scale(.7); }
[data-theme="dark"] .sdn-theme__sun { opacity: 0; transform: rotate(35deg) scale(.7); }
[data-theme="dark"] .sdn-theme__moon { opacity: 1; transform: none; }

.sdn-burger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sdn-burger__glyph {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 20px;
}
.sdn-burger__glyph i {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .25s ease, opacity .2s ease;
}
.sdn-burger[aria-expanded="true"] .sdn-burger__glyph i:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.sdn-burger[aria-expanded="true"] .sdn-burger__glyph i:nth-child(2) { opacity: 0; }
.sdn-burger[aria-expanded="true"] .sdn-burger__glyph i:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* ---- language control (always in the main header row) ---- */

.sdn-lang { position: relative; }

.sdn-lang__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  height: 44px;
  padding-inline: var(--space-3);
  border-radius: var(--radius);
  font-size: var(--fs-sm);
  font-weight: 500;
  color: var(--ink);
  transition: background-color .2s ease;
}
.sdn-lang__btn:hover { background: var(--tint); }
.sdn-lang__globe { width: 18px; height: 18px; flex: 0 0 18px; }
.sdn-lang__chev { width: 12px; height: 12px; flex: 0 0 12px; transition: transform .2s ease; }
.sdn-lang__btn[aria-expanded="true"] .sdn-lang__chev { transform: rotate(180deg); }

.sdn-lang__panel {
  position: absolute;
  inset-block-start: calc(100% + 8px);
  inset-inline-end: 0;
  min-width: 200px;
  padding: var(--space-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  display: none;
}
.sdn-lang__panel.is-open { display: block; }

.sdn-lang__list { margin: 0; padding: 0; list-style: none; }
.sdn-lang__list li a,
.sdn-lang__list li > span {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  padding: var(--space-2) var(--space-3);
  border-radius: 8px;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--ink);
}
.sdn-lang__list li a:hover { background: var(--tint); }
.sdn-lang__list img,
.sdn-lang__list .trp-flag-image { width: 18px; height: auto; border-radius: 2px; }

/* the plugin's own shortcode fallback, when no menu exists yet */
.sdn-lang__panel .trp-language-switcher-container,
.sdn-sheet .trp-language-switcher-container { width: 100%; }
.sdn-lang__panel .trp_language_switcher_shortcode,
.sdn-sheet .trp_language_switcher_shortcode { font-size: var(--fs-sm); }

/* TranslatePress ships a floating switcher that is ON by default. The theme
   provides its own, so the plugin's is taken out of the page. */
#trp-floater-ls,
.trp-floater,
#trp-floater-ls-current-language,
.trp-floater-ls-name { display: none !important; }

/* ---- the accordion sheet (mobile) ---- */

.sdn-sheet {
  border-block-start: 1px solid var(--line);
  padding: var(--space-4) clamp(12px, 2.4vw, 20px) var(--space-5);
}
.sdn-sheet__label {
  margin-block: 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.sdn-sheet__links {
  margin-block: var(--space-4) 0;
  padding: 0;
  list-style: none;
  border-block-start: 1px solid var(--line);
}
.sdn-sheet__links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: var(--fs-sm);
  text-decoration: none;
  color: var(--muted);
}
.sdn-sheet__links a:hover { color: var(--link); }

.sdn-scrim {
  position: fixed;
  inset: 0;
  z-index: var(--z-scrim);
  background: rgba(9, 20, 15, .42);
  backdrop-filter: blur(2px);
}

/* the dropdown and the burger are a pair: exactly one of them is on screen at
   any width, which takes two rules. The small-screen hide is scoped to the
   actions row so the copy inside the sheet survives it. */
@media (max-width: 768px) {
  .sdn-head__actions .sdn-lang { display: none; }
}
@media (min-width: 769px) {
  .sdn-burger { display: none; }
  .sdn-sheet  { display: none; }
  .sdn-scrim  { display: none; }
}

/* --------------------------------------------------------------------------
   Reading column
   Every direct child of the article shares one centred 44rem column. Only the
   age gate opts out. Widths are set in rem, never ch - a heading and a
   paragraph at the same ch value do not line up.
   -------------------------------------------------------------------------- */

.sdn-main { padding-block-end: var(--space-8); }

.sdn-entry {
  padding-block: clamp(24px, 5vw, 48px) clamp(48px, 8vw, 88px);
}

.sdn-entry > :where(*:not(.sdn-gate)) {
  max-width: var(--column);
  margin-inline: auto;
}

/* belt and braces at class specificity: the two components that historically
   knock themselves flush-left with a margin shorthand */
.sdn-entry > .sdn-figure,
.sdn-entry > .sdn-cards,
.sdn-entry > .sdn-compare,
.sdn-entry > .wp-block-quote {
  margin-inline: auto;
  max-width: var(--column);
}

.sdn-entry h1,
.sdn-entry h2,
.sdn-entry h3 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -.015em;
  scroll-margin-top: calc(var(--head-h) + 28px);
}

.sdn-entry h1 {
  font-size: var(--fs-h1);
  margin-block: 0 var(--space-5);
  text-wrap: balance;
}

.sdn-entry h2 {
  font-size: var(--fs-h2);
  margin-block: var(--space-7) var(--space-4);
  text-wrap: balance;
}

.sdn-entry p { margin-block: 0 var(--space-4); }
.sdn-entry p:last-child { margin-block-end: 0; }

.sdn-entry strong { font-weight: 600; color: var(--ink); }

/* Gutenberg lists carry .wp-block-list, so the unclassed selector misses them */
.sdn-entry .wp-block-list {
  margin-block: var(--space-4) var(--space-5);
  padding-inline-start: 1.35em;
  list-style: disc;
}
.sdn-entry .wp-block-list li { margin-block-end: var(--space-3); }
.sdn-entry .wp-block-list li::marker { color: var(--accent-2); }

/* Links inside the article take the accent. Anything with a class of its own
   is a button and keeps its own colour and background. */
.sdn-entry a:not([class]) {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.sdn-entry a:not([class]):hover { text-decoration-thickness: 2px; }

/* ---- pull quote (E3-6) ---- */

.sdn-entry .wp-block-quote {
  position: relative;
  margin-block: var(--space-6);
  padding: var(--space-6) var(--space-5) var(--space-5);
  border: 1px solid var(--line);
  border-inline-start: 3px solid var(--accent-2);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sdn-entry .wp-block-quote::before {
  content: "\201C";
  position: absolute;
  inset-block-start: -.15em;
  inset-inline-start: .28em;
  font-family: var(--font-head);
  font-size: 4.5rem;
  line-height: 1;
  color: var(--accent-2);
  opacity: .55;
}
.sdn-entry .wp-block-quote p {
  position: relative;
  font-family: var(--font-head);
  font-size: var(--fs-lg);
  font-weight: 600;
  line-height: 1.45;
  margin-block-end: 0;
}

/* ---- feature cards (E3-9) ---- */

.sdn-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
  gap: var(--space-4);
  margin-block: var(--space-5) var(--space-6);
  padding: 0;
  list-style: none;
}

.sdn-card {
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}
.sdn-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }

.sdn-card__icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius);
  background: var(--tint);
  color: var(--accent);
  margin-block-end: var(--space-3);
}
.sdn-card__icon svg { width: 21px; height: 21px; }

.sdn-card__title {
  font-family: var(--font-head);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin-block: 0 var(--space-2);
}
.sdn-card__text {
  font-size: var(--fs-sm);
  line-height: 1.65;
  color: var(--muted);
  margin-block-end: 0;
}

/* ---- illustration (H-11 waveform) ---- */

.sdn-figure {
  margin-block: var(--space-6);
  margin-inline: auto;
  max-width: var(--column);
}

.sdn-illus {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

/* zero-specificity floor: no shape can ever fall back to black, whatever
   markup the editor leaves behind */
:where(.sdn-illus) :where(rect, circle, ellipse, path) { fill: var(--accent-2); stroke: none; }

.sdn-illus__bg     { fill: var(--tint); }
.sdn-illus__blob   { fill: var(--accent-2); opacity: .30; }
.sdn-illus__blob--b{ fill: var(--accent); opacity: .18; }
.sdn-illus__tile   { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.sdn-illus__head   { fill: var(--accent); opacity: .9; }
.sdn-illus__shoulders { fill: var(--accent); opacity: .55; }
.sdn-illus__bar    { fill: var(--accent-2); }
.sdn-illus__bar--hi{ fill: var(--accent); }
.sdn-illus__line   { fill: var(--surface); stroke: var(--line-strong); stroke-width: 1.5; }
.sdn-illus__caret  { fill: var(--accent); }
.sdn-illus__word   { fill: var(--muted); opacity: .55; }

.sdn-figure__cap {
  margin-block-start: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--muted);
  text-align: center;
}

/* ---- comparison (E3-5) ---- */

.sdn-compare {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
  gap: var(--space-4);
  margin-block: var(--space-5) var(--space-6);
}

.sdn-compare__col {
  padding: var(--space-5) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}
.sdn-compare__col--other { background: var(--tint); box-shadow: none; }

.sdn-compare__head {
  font-family: var(--font-head);
  font-size: var(--fs-h3);
  font-weight: 600;
  margin-block: 0 var(--space-3);
  padding-block-end: var(--space-2);
  border-block-end: 1px solid var(--line);
}

.sdn-compare__list { margin-block: 0; }
.sdn-compare__list dt {
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--muted);
  margin-block-start: var(--space-3);
}
.sdn-compare__list dd {
  margin: 0;
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* --------------------------------------------------------------------------
   Age gate (Bank D-5, Quiet Sonar) - the one animated element on the page
   -------------------------------------------------------------------------- */

.sdn-gate {
  max-width: 62rem;
  margin-inline: auto;
  margin-block-end: clamp(32px, 6vw, 56px);
}

.sdn-gate__card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  align-items: center;
  gap: var(--space-5);
  overflow: hidden;
  padding: clamp(24px, 4.5vw, 44px);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--grad);
  box-shadow: var(--shadow-lg);
  color: var(--on-grad);
}

.sdn-gate__eyebrow {
  margin-block: 0 var(--space-2);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--on-grad-mut);
}

/* the age question is a control label, not a document section - it stays a
   paragraph so nothing outranks the H1 in the heading outline */
.sdn-gate .sdn-gate__q {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(1.35rem, 1.05rem + 1.5vw, 2.15rem);
  line-height: 1.2;
  letter-spacing: -.015em;
  margin-block: 0 var(--space-3);
  color: var(--on-grad);
  text-wrap: balance;
}

.sdn-gate__note {
  margin-block: 0 var(--space-5);
  font-size: var(--fs-sm);
  color: var(--on-grad-mut);
  max-width: 34rem;
}

.sdn-gate__btn,
.sdn-btn,
.sdn-sticky__btn,
.sdn-entry a[href="/chat.html"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius);
  background-color: var(--accent);
  background-image: none;
  color: var(--on-accent);
  font-weight: 600;
  font-size: var(--fs-md);
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: transform .2s ease, box-shadow .25s ease, background-color .2s ease;
}
.sdn-gate__btn:hover,
.sdn-btn:hover,
.sdn-sticky__btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sdn-gate__btn:active,
.sdn-btn:active { transform: translateY(0); }

.sdn-btn { min-height: 48px; }

/* the sonar mark */
.sdn-gate__mark {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 168px;
}

.sdn-gate__badge {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--surface);
  /* --link, not --accent: the accent is a FILL colour and reads only 3.4:1 as
     ink on the dark surface. --link is the text-weight green, in both themes. */
  color: var(--link);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 1.35rem;
  letter-spacing: -.02em;
  box-shadow: 0 8px 20px -8px rgba(31, 36, 48, .35);
}

.sdn-gate__ring {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: 50%;
  width: 78px;
  height: 78px;
  margin-block-start: -39px;
  margin-inline-start: -39px;
  border: 2px solid var(--accent);
  border-radius: 50%;
  opacity: 0;
  animation: sdn-sonar 8s cubic-bezier(.22, .61, .36, 1) infinite;
}
.sdn-gate__ring--b { animation-delay: 2.6s; }
.sdn-gate__ring--c { animation-delay: 5.2s; }

@keyframes sdn-sonar {
  0%   { transform: scale(1);   opacity: .35; }
  70%  { opacity: .06; }
  100% { transform: scale(2.4); opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sdn-gate__ring { animation: none; opacity: .2; }
  .sdn-gate__ring--b { transform: scale(1.55); opacity: .12; }
  .sdn-gate__ring--c { transform: scale(2.1); opacity: .06; }
}

@media (max-width: 700px) {
  .sdn-gate__card {
    grid-template-columns: 1fr;
    text-align: start;
  }
  .sdn-gate__mark {
    order: -1;
    justify-items: start;
    min-height: 120px;
  }
  .sdn-gate__ring,
  .sdn-gate__badge { justify-self: start; }
  .sdn-gate__mark { place-items: center start; }
  .sdn-gate__ring { inset-inline-start: 39px; }
  .sdn-gate__btn { width: 100%; }
}

/* --------------------------------------------------------------------------
   Sticky call bar + cookie notice
   Both raise on the same signal, so the notice is lifted clear of the bar.
   -------------------------------------------------------------------------- */

.sdn-sticky {
  position: fixed;
  inset-inline: 0;
  inset-block-end: 0;
  z-index: var(--z-sticky);
  padding: var(--space-3) var(--space-4) calc(var(--space-3) + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-block-start: 1px solid var(--line);
  transform: translateY(110%);
  transition: transform .28s ease;
}
.sdn-sticky.is-up { transform: none; }
.sdn-sticky__btn { width: 100%; }

@media (min-width: 769px) {
  .sdn-sticky { display: none; }
}

.sdn-cookie {
  position: fixed;
  inset-inline-end: clamp(12px, 3vw, 24px);
  inset-block-end: clamp(12px, 3vw, 24px);
  z-index: var(--z-cookie);
  width: min(calc(100% - 24px), 26rem);
  padding: var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity .3s ease, transform .3s ease, inset-block-end .25s ease;
}
.sdn-cookie.is-up {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.sdn-cookie__text {
  margin-block: 0 var(--space-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
  color: var(--muted);
}
.sdn-cookie__text a { color: var(--link); }
.sdn-cookie__btn {
  min-height: 44px;
  padding-inline: var(--space-5);
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: var(--fs-sm);
  font-weight: 600;
}

/* while the call bar is up on a phone, the notice sits above it */
@media (max-width: 768px) {
  .sdn-cta-up .sdn-cookie {
    inset-block-end: calc(var(--sticky-h) + 12px);
  }
}

/* the sheet owns the screen while it is open */
.sdn-locked .sdn-cookie,
.sdn-locked .sdn-sticky { opacity: 0; pointer-events: none; transform: translateY(120%); }
.sdn-locked .sdn-cookie { transform: translateY(12px); }

/* --------------------------------------------------------------------------
   Scroll progress (F-2)
   -------------------------------------------------------------------------- */

.sdn-progress {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  height: 3px;
  z-index: calc(var(--z-head) + 1);
  pointer-events: none;
}
.sdn-progress__fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
  transition: width .12s linear;
}
@media (min-width: 783px) {
  body.admin-bar .sdn-progress { inset-block-start: 32px; }
}

/* --------------------------------------------------------------------------
   Reveal (F-10). The veil class is applied per element by JS and cleared on
   intersection, with a timer failsafe. Nothing is hidden by CSS alone, so a
   callback that never fires can only cost the animation, never the page.
   -------------------------------------------------------------------------- */

.sdn-veil {
  opacity: 0;
  transform: translateY(14px);
}
.sdn-veiled {
  transition: opacity .55s ease, transform .55s ease;
}
.sdn-veil.sdn-shown,
.sdn-veiled.sdn-shown {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .sdn-veil { opacity: 1; transform: none; }
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.sdn-foot {
  border-block-start: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  padding-block: var(--space-6);
}

.sdn-foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.sdn-foot__menu {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}
.sdn-foot__menu a {
  font-size: var(--fs-sm);
  color: var(--muted);
  text-decoration: none;
}
.sdn-foot__menu a:hover { color: var(--link); text-decoration: underline; }

.sdn-foot__copy {
  font-size: var(--fs-sm);
  color: var(--muted);
  margin: 0;
}

@media (max-width: 768px) {
  .sdn-foot__inner { flex-direction: column; align-items: flex-start; }
  .sdn-foot { padding-block-end: calc(var(--space-6) + var(--sticky-h)); }
}

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */

.sdn-404 {
  padding-block: clamp(48px, 12vw, 120px);
  max-width: var(--column);
  text-align: center;
}
.sdn-404__num {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: var(--fs-num);
  line-height: .9;
  letter-spacing: -.04em;
  color: var(--accent-2);
  margin-block-end: var(--space-4);
}
.sdn-404__title {
  font-family: var(--font-head);
  font-size: var(--fs-h2);
  font-weight: 800;
  margin-block: 0 var(--space-3);
}
.sdn-404__text { color: var(--muted); margin-block: 0 var(--space-5); }

/* --------------------------------------------------------------------------
   Focus and motion
   -------------------------------------------------------------------------- */

:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
