/*
Theme Name: Rana Ahson 2026
Theme URI: https://ranaahson.com
Author: Rana Ahson
Author URI: https://ranaahson.com
Description: Dark, WCAG 2.2 AA conscious theme for ranaahson.com. Semantic landmarks, skip link, visible focus, reduced-motion support, and SEO-friendly markup (single H1 per page, ordered headings, descriptive link text).
Version: 2.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: rana-ahson-2026
*/

  /* ── theme tokens ─────────────────────────────────────
     Every colour in the templates is a var() off this palette. :root is the
     dark theme (the original look). Light values arrive two ways: when the
     visitor has chosen light (html[data-theme="light"]), and when they have
     chosen nothing and their system asks for light (the @media rule). The
     masthead and footer keep the dark palette in light mode via .on-dark,
     which re-scopes the same tokens - so the white logo and nav stay readable
     and every descendant that uses a token flips with its surface, with no
     per-element overrides. */
  :root {
    color-scheme: dark;
    --bg: #000000; --panel: #0F0F0F; --surface: #151515; --surface-2: #1F1F1F;
    --border: #272727; --border-strong: #595959;
    --fg-strong: #FFFFFF; --fg: #D6D6D3; --fg-dim: #ADADA8;
    --accent: #1053F3; --accent-soft: #8CBCFF; --accent-cyan: #00D4FF; --accent-purple: #7B5CFF;
    --on-accent: #FFFFFF;
  }
  :root[data-theme="light"] {
    color-scheme: light;
    --bg: #F7F9FC; --panel: #EEF2FB; --surface: #FFFFFF; --surface-2: #F1F4FB;
    --border: #E2E6ED; --border-strong: #C4CCDB;
    --fg-strong: #0B1220; --fg: #3A4251; --fg-dim: #5A6273;
    --accent: #0D47D9; --accent-soft: #0F4FC7; --accent-cyan: #0A7E99; --accent-purple: #5A3FF0;
    --on-accent: #FFFFFF;
  }
  @media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
      color-scheme: light;
      --bg: #F7F9FC; --panel: #EEF2FB; --surface: #FFFFFF; --surface-2: #F1F4FB;
      --border: #E2E6ED; --border-strong: #C4CCDB;
      --fg-strong: #0B1220; --fg: #3A4251; --fg-dim: #5A6273;
      --accent: #0D47D9; --accent-soft: #0F4FC7; --accent-cyan: #0A7E99; --accent-purple: #5A3FF0;
      --on-accent: #FFFFFF;
    }
  }
  /* Surfaces that stay dark whatever the theme (masthead, footer): re-scope the
     tokens back to their dark values so descendants invert with them. */
  :root[data-theme="light"] .on-dark,
  :root:not([data-theme="dark"]) .on-dark {
    color-scheme: dark;
    --bg: #000000; --panel: #0F0F0F; --surface: #151515; --surface-2: #1F1F1F;
    --border: #272727; --border-strong: #595959;
    --fg-strong: #FFFFFF; --fg: #D6D6D3; --fg-dim: #ADADA8;
    --accent: #1053F3; --accent-soft: #8CBCFF; --accent-cyan: #00D4FF; --accent-purple: #7B5CFF;
  }

  body { margin: 0; font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; color: var(--fg-strong); background: var(--bg); -webkit-font-smoothing: antialiased; }
  a { color: var(--accent-soft); }
  a:hover { color: var(--fg-strong); }
  *:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }
  .panel { background: var(--panel); border-radius: 28px; }
  .card { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; }
  a:not(.btn):not(.soc):not(.sk):not(.wbtn) { padding-block: 3px; }
  .nv a { color: var(--fg-strong); text-decoration: none; }
  .nv a:hover { color: var(--accent-soft); }
  .sk { position: absolute; left: 20px; top: -80px; z-index: 60; background: var(--accent); color: var(--on-accent); padding: 14px 24px; border-radius: 999px; font-size: 15px; font-weight: 600; text-decoration: none; transition: top 150ms cubic-bezier(.2,0,0,1); }
  .sk:focus { top: 20px; color: var(--on-accent); }
  /* ── motion ───────────────────────────────────────── */
  @keyframes riseIn { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
  @keyframes spinSlow { to { transform: rotate(360deg); } }
  @keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
  @keyframes pulseRing { 0%,100% { transform: scale(1); opacity: .55; } 50% { transform: scale(1.035); opacity: 1; } }

  .rise { animation: riseIn .72s cubic-bezier(.2,0,0,1) both; }
  .d1 { animation-delay: .06s } .d2 { animation-delay: .12s } .d3 { animation-delay: .18s }
  .d4 { animation-delay: .24s } .d5 { animation-delay: .30s } .d6 { animation-delay: .36s }

  .card { transition: transform .25s cubic-bezier(.2,0,0,1), border-color .25s, background .25s; }
  .card:hover { transform: translateY(-6px); border-color: var(--border-strong); background: var(--surface); }
  /* ── ambient movement ─────────────────────────────── */
  @keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }

  .ic { animation: floaty 5.6s ease-in-out infinite; }
  .rise:nth-of-type(2) .ic, li:nth-of-type(2) .ic { animation-delay: .7s; }
  .rise:nth-of-type(3) .ic, li:nth-of-type(3) .ic { animation-delay: 1.4s; }
  .rise:nth-of-type(4) .ic, li:nth-of-type(4) .ic { animation-delay: 2.1s; }
  .rise:nth-of-type(5) .ic, li:nth-of-type(5) .ic { animation-delay: 2.8s; }
  .rise:nth-of-type(6) .ic, li:nth-of-type(6) .ic { animation-delay: 3.5s; }
  .card:hover .ic { animation: none; transform: translateY(-6px) scale(1.07); transition: transform .3s cubic-bezier(.2,0,0,1); }

  .crow { transition: transform .3s cubic-bezier(.2,0,0,1); }
  .crow:hover { transform: translateX(7px); }
  .crow:hover .ic { animation: none; transform: scale(1.08); transition: transform .3s cubic-bezier(.2,0,0,1); }

  footer a { display: inline-block; transition: transform .25s cubic-bezier(.2,0,0,1), color .25s; }
  footer a:hover { transform: translateX(4px); }

  .stat { transition: transform .3s cubic-bezier(.2,0,0,1); }
  .card:hover .stat { transform: scale(1.06); }

  .quoteMark { animation: floaty 7s ease-in-out infinite; }
  /* primary button — modelled on the Weblance .btn-default */
  .wbtn { position: relative; display: inline-flex; align-items: center; box-sizing: border-box; min-height: 58px; padding: 16px 60px 16px 26px; border: 0; border-radius: 14px; background: var(--accent); color: var(--on-accent); font-family: inherit; font-size: 17px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; overflow: hidden; z-index: 1; transition: color .4s ease-in-out; }
  .wbtn::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; width: 0; background: var(--fg-strong); transition: width .4s ease-in-out; z-index: -1; }
  .wbtn:hover { color: var(--bg); }
  .wbtn:hover::after { right: auto; left: 0; width: 100%; }
  .wic { position: absolute; top: 50%; right: 7px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--on-accent); transition: background .4s ease-in-out; }
  .wic svg { stroke: var(--accent); transition: stroke .4s ease-in-out; }
  .wbtn:hover .wic { background: var(--accent); }
  .wbtn:hover .wic svg { stroke: var(--on-accent); }
  .wbtn.sm { min-height: 52px; padding: 14px 56px 14px 24px; font-size: 16px; }
  .wbtn.full { width: 100%; justify-content: center; padding-left: 60px; }
  .wbtn.sm .wic { width: 38px; height: 38px; right: 7px; }
  .btn { transition: transform .2s cubic-bezier(.2,0,0,1), filter .2s; }
  .btn:hover { transform: translateY(-2px); filter: brightness(1.08); }
  .soc { transition: border-color .2s, background .2s, transform .2s; }
  .soc:hover { border-color: var(--accent-soft); background: var(--panel); transform: translateY(-2px); }
  .arrow { transition: transform .25s cubic-bezier(.2,0,0,1); }
  a:hover .arrow, button:hover .arrow { transform: translate(3px,-3px); }
  .ring { animation: pulseRing 7s ease-in-out infinite; }
  .ring2 { animation: pulseRing 7s ease-in-out infinite 1.2s; }
  .badgeRing { animation: spinSlow 22s linear infinite; }
  .bdot { position: absolute; left: 50%; top: 50%; margin: -3px 0 0 -3px; border-radius: 999px; }
  .track { display: flex; width: max-content; animation: drift 34s linear infinite; }

  /* visually hidden, still read by screen readers */
  .vh { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }

  /* marquee pause control — WCAG 2.2.2 Pause, Stop, Hide */
  /* The strip only moves when the Pause control is live, so motion is never
     shown without a way to stop it. JS adds .mq-on. */
  .mqBtn { font-family: inherit; }
  .mqWrap { overflow: hidden; }
  /* The fade used to be an element sitting on top of the scrolling text, which
     stopped any tool (and any reader) from judging the contrast underneath.
     A mask fades the strip itself, so nothing overlaps the words. */
  .mqFade { display: none; }
  .mqWrap { -webkit-mask-image: linear-gradient(to right, var(--bg) 0%, var(--bg) 70%, transparent 95%);
            mask-image: linear-gradient(to right, var(--bg) 0%, var(--bg) 70%, transparent 95%); }
  .mqBtn { position: absolute; right: 36px; top: 50%; transform: translateY(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 10px; min-height: 44px; box-sizing: border-box; padding: 10px 20px; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; color: var(--fg-strong); font-size: 15px; font-weight: 600; cursor: pointer; }
  .mqBtn:hover { border-color: var(--accent-soft); background: var(--panel); }
  .mqBtn .lbl { display: inline-flex; align-items: center; gap: 9px; }
  .marquee .track { animation: none; }
  .marquee.mq-on .track { animation: drift 34s linear infinite; }
  .marquee.mq-on.mq-paused .track { animation-play-state: paused; }
  .mqBtn[hidden] { display: none; }

  /* orbiting dots around the portrait */
  @keyframes orbit { to { transform: rotate(360deg); } }
  .orb { position: absolute; border-radius: 999px; left: 50%; top: 50%; }
  .orbA { width: 440px; height: 440px; margin: -220px 0 0 -220px; animation: orbit 30s linear infinite; }
  .orbB { width: 366px; height: 366px; margin: -183px 0 0 -183px; animation: orbit 21s linear infinite reverse; }
  .orbC { width: 332px; height: 332px; margin: -166px 0 0 -166px; border: 1px dashed var(--border); animation: orbit 52s linear infinite; }
  .odot { position: absolute; border-radius: 999px; }

  @media (prefers-reduced-motion: reduce) {
    *, .rise, .track, .badgeRing, .ring, .ring2, .orb, .ic, .quoteMark { animation: none !important; transition: none !important; }
    .ic, .crow, .stat, footer a { transform: none !important; }
    .rise { opacity: 1 !important; transform: none !important; }
  }

/* ── hero artwork ─────────────────────────────────── */
  @keyframes sweep { to { transform: rotate(360deg); } }
  @keyframes pulseOut { 0% { transform: scale(.72); opacity: .85; } 100% { transform: scale(1.5); opacity: 0; } }
  @keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
  @keyframes tilt { 0%,100% { transform: rotate(var(--r)) translateY(0); } 50% { transform: rotate(var(--r)) translateY(-12px); } }
  @keyframes hue { 0%,100% { filter: hue-rotate(0deg); } 50% { filter: hue-rotate(28deg); } }

  .art { position: relative; width: 440px; height: 440px; display: flex; align-items: center; justify-content: center; }
  .artSweep { position: absolute; width: 300px; height: 300px; border-radius: 999px;
    background: conic-gradient(from 0deg, rgba(0,212,255,0) 0deg, rgba(0,212,255,.75) 70deg, rgba(16,83,243,.95) 140deg, rgba(123,92,255,0) 220deg, rgba(0,212,255,0) 360deg);
    animation: sweep 9s linear infinite; }
  .artDisc { position: relative; width: 230px; height: 230px; border-radius: 999px; background: var(--bg);
    border: 1px solid var(--border); display: flex; align-items: center; justify-content: center; }
  .artGlow { position: absolute; width: 230px; height: 230px; border-radius: 999px;
    background: radial-gradient(circle at 32% 28%, rgba(0,212,255,.35), rgba(16,83,243,.18) 45%, transparent 70%); }
  .artTile { width: 108px; height: 108px; border-radius: 30px; display: flex; align-items: center; justify-content: center;
    background: linear-gradient(145deg, var(--accent-cyan) 0%, var(--accent) 55%, var(--accent-purple) 100%); animation: bob 6s ease-in-out infinite, hue 11s ease-in-out infinite; }
  .wave { position: absolute; width: 230px; height: 230px; border-radius: 999px; border: 2px solid var(--accent-cyan); animation: pulseOut 3.6s ease-out infinite; }
  .wave.w2 { animation-delay: 1.2s; border-color: var(--accent); }
  .wave.w3 { animation-delay: 2.4s; border-color: var(--accent-purple); }
  .chip { position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 999px;
    background: var(--panel); border: 1px solid var(--border); font-size: 14px; font-weight: 600; color: var(--fg-strong); white-space: nowrap; z-index: 5;
    animation: bob 7s ease-in-out infinite; }
  .chip i { width: 8px; height: 8px; border-radius: 999px; display: block; }
  .stack { position: relative; width: 250px; height: 250px; }
  .sheet { position: absolute; inset: 0; border-radius: 22px; border: 1px solid var(--border); background: var(--panel);
    padding: 22px; box-sizing: border-box; transform: rotate(var(--r)); animation: tilt 7s ease-in-out infinite; }
  .sheet b { display: block; height: 10px; border-radius: 999px; background: linear-gradient(90deg,var(--accent-cyan),var(--accent)); margin-bottom: 12px; width: 62%; }
  .sheet s { display: block; height: 8px; border-radius: 999px; background: var(--surface-2); margin-bottom: 9px; text-decoration: none; }
  .globe { position: relative; width: 210px; height: 210px; border-radius: 999px; border: 1px solid var(--border); overflow: hidden;
    background: radial-gradient(circle at 34% 30%, rgba(0,212,255,.3), rgba(16,83,243,.14) 48%, transparent 72%); }
  .mer { position: absolute; inset: 0; border-radius: 999px; border: 1px solid var(--border); animation: sweep 26s linear infinite; }
  .mer.m2 { inset: 0 44px; animation-duration: 20s; }
  .mer.m3 { inset: 0 80px; animation-duration: 15s; animation-direction: reverse; }
  .lat { position: absolute; left: 0; right: 0; height: 1px; background: var(--border); }

  @media (prefers-reduced-motion: reduce) {
    .artSweep, .artTile, .wave, .chip, .sheet, .mer { animation: none !important; }
    .wave { opacity: .35; }
    .sheet { transform: rotate(var(--r)) !important; }
  }

/* ============================================================
   Responsive layer — the design is drawn at 1440; these rules
   bring it down to tablet and phone. Inline styles need !important.
   ============================================================ */
html, body { overflow-x: hidden; max-width: 100%; }
img { max-width: 100%; height: auto; }

/* No hanging words: headings wrap into even lines, and paragraphs avoid
   leaving one word alone on the last line. Ignored by older browsers,
   which simply wrap as before. */
h1, h2, h3, h4 { text-wrap: balance; }
p, li, figcaption, blockquote { text-wrap: pretty; }
.art { max-width: 100%; }
.wbtn { max-width: 100%; }
.sec, header, footer.panel { max-width: 1440px; margin-left: auto; margin-right: auto; }

/* Panel sections carry an inline `margin: 0 20px` for a side gutter, which
   also pins them left once the viewport is wider than the 1440 max-width.
   Past that point, centre them like every other section. Below 1440 the
   inline gutter (and the <=860 mobile rule) are left untouched. */
@media (min-width: 1441px) {
  .panel { margin-left: auto !important; margin-right: auto !important; }
}

@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .art { transform: scale(.86); }
}
@media (max-width: 1024px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  h1 { font-size: clamp(34px, 6.2vw, 60px) !important; }
  h2 { font-size: clamp(28px, 4.6vw, 52px) !important; }
}
@media (max-width: 900px) {
  /* the orbit decoration is drawn at 440px; below this it would push the page
     sideways, so the page keeps the core graphic and drops the rings. */
  .ring, .ring2, .orb, .chip { display: none !important; }
  .art { width: 320px !important; height: 320px !important; transform: none !important; margin: 0 auto !important; }
  .artSweep, .artGlow, .artDisc { width: 220px !important; height: 220px !important; }
  .wave { width: 220px !important; height: 220px !important; }
  .stack { width: 220px !important; height: 220px !important; }
  .globe { width: 200px !important; height: 200px !important; }
}
@media (max-width: 860px) {
  .sec { padding-left: 24px !important; padding-right: 24px !important; }
  header { padding-left: 20px !important; padding-right: 20px !important; gap: 16px !important; }
  footer.panel { margin-left: 10px !important; margin-right: 10px !important; padding: 44px 24px !important; }
  .panel { margin-left: 10px !important; margin-right: 10px !important; padding-left: 24px !important; padding-right: 24px !important; }
  .g2, .g3, .g4 { grid-template-columns: 1fr !important; }
  .nv { display: grid !important; grid-template-columns: repeat(3, auto) !important; gap: 14px 22px !important;
        font-size: 15px !important; justify-content: center !important; width: 100%; margin: 0 !important; }
  .nv a { text-align: center; }
  header { justify-content: center !important; text-align: center; }
  header img { height: 58px !important; margin: 0 auto; }
  header > .wbtn { width: 100%; justify-content: center; }
  .mqBtn { right: 16px !important; }
}
@media (max-width: 560px) {
  h1 { font-size: clamp(30px, 8.4vw, 40px) !important; }
  h2 { font-size: clamp(24px, 6.6vw, 32px) !important; }
  .chip { font-size: 12px !important; padding: 8px 12px !important; }
  .wbtn { width: 100%; justify-content: flex-start; }
}

/* WordPress bits */
.wp-block-image img { border-radius: 16px; }
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { display: block; margin: 0 auto; }
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }

/* long-form article typography */
.prose { max-width: 72ch; }
.prose p, .prose li { font-size: 18px; line-height: 31px; color: var(--fg); }
.prose h2 { margin: 48px 0 16px; font-size: 34px; line-height: 1.2; font-weight: 700; letter-spacing: -0.02em; color: var(--fg-strong); }
.prose h3 { margin: 36px 0 12px; font-size: 24px; line-height: 1.25; font-weight: 600; color: var(--fg-strong); }
.prose a { color: var(--accent-soft); }
.prose ul, .prose ol { padding-left: 22px; }
.prose li { margin-bottom: 10px; }
.prose blockquote { margin: 32px 0; padding: 22px 26px; border-left: 3px solid var(--accent); background: var(--panel); border-radius: 0 16px 16px 0; }
.prose code { font-family: 'JetBrains Mono', ui-monospace, monospace; font-size: 15px; background: var(--surface); padding: 2px 6px; border-radius: 6px; }
.prose table { width: 100%; border-collapse: collapse; margin: 28px 0; }
.prose th, .prose td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 16px; }

/* ============================================================
   Consent banner — the plugin's own styling leaves its buttons
   small and its focus ring invisible on white. Markup repairs
   are in assets/consent-a11y.js.
   ============================================================ */
.cookieadmin_law_container button,
.cookieadmin_law_container .cookieadmin_btn,
.cookieadmin_law_container a.cookieadmin_btn {
  min-height: 44px !important;
  padding: 11px 20px !important;
  font-size: 15px !important;
  border-radius: 10px !important;
}
.cookieadmin_law_container *:focus-visible {
  outline: 3px solid var(--accent) !important;
  outline-offset: 2px !important;
}
.cookieadmin_law_container [role="heading"] {
  font-size: 18px !important;
  font-weight: 700 !important;
}

/* the page you are on, marked in the header: colour plus an underline,
   so it does not rely on colour alone (WCAG 1.4.1) */
.nv a[aria-current="page"] { color: var(--accent-soft); position: relative; font-weight: 600; }
.nv a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -9px; height: 2px; background: var(--accent-soft); border-radius: 2px; }
.nv a[aria-current="page"]:hover { color: var(--fg-strong); }
.nv a[aria-current="page"]:hover::after { background: var(--fg-strong); }

/* article page: the contents/author rail stops sticking once it stacks */
@media (max-width: 900px) {
  .artSide { position: static !important; flex-basis: 100% !important; }
  .artBody { gap: 32px !important; }
}

/* Links inside running text are underlined, not only coloured.
   axe flagged link-in-text-block as serious on About, Services and Speaking:
   var(--accent-soft) against var(--fg) body text is under 3:1, so colour alone was doing
   the work (WCAG 1.4.1 Use of Colour). Buttons and icon links keep their own
   treatment. */
.prose a:not(.wbtn):not(.soc),
p a:not(.wbtn):not(.soc):not(.sk),
.crow a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
.prose a:not(.wbtn):not(.soc):hover,
p a:not(.wbtn):not(.soc):not(.sk):hover,
.crow a:hover { text-decoration-thickness: 2px; }

/* a button inside article prose is still a button, not a body link */
.prose a.wbtn, .prose a.soc { color: var(--fg-strong); }
.prose a.wbtn:hover { color: var(--bg); }

/* external links: visible marker, plus "(opens in a new window)" for screen readers */
.extIcon { display: inline-block; margin-left: 6px; vertical-align: -1px; opacity: .85; flex: 0 0 auto; }
a:hover .extIcon, a:focus-visible .extIcon { opacity: 1; }

/* form states */
.formNote { margin: 0 0 18px; padding: 14px 18px; border-radius: 12px; font-size: 16px; }
.formNote.ok { background: #0C2A17; border: 1px solid #1F7A45; color: #BFF3D4; }
.formNote.err { background: #2A0F0F; border: 1px solid #8A2B2B; color: #FFD2D2; }
.req { color: var(--accent-soft); }

/* ── theme toggle ───────────────────────────────────── */
.themeToggle { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; border: 1px solid var(--border-strong); background: color-mix(in srgb, var(--surface) 55%, transparent); }
.themeBtn { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 34px; border: 0; border-radius: 999px; background: transparent; color: var(--fg-dim); cursor: pointer; transition: background 160ms ease, color 160ms ease; }
.themeBtn:hover { color: var(--fg-strong); }
.themeBtn[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.themeBtn:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 2px; }
@media (max-width: 860px) { .themeToggle { order: 3; } }

/* The masthead keeps the dark palette (.on-dark) so the white logo and nav stay
   readable; it must paint that dark background itself, since the page shell
   around it turns light. */
.masthead { background: var(--bg); }

/* A dark surface sets its own text colour, so headings and text that inherit
   (rather than set) a colour re-resolve to the light token inside it instead of
   carrying the page's computed dark colour in. */
.on-dark { color: var(--fg-strong); }

/* An accent-coloured surface (a blue chip, a filled button, a step circle)
   keeps light text in both themes: the foreground tokens are re-scoped so every
   descendant that uses one stays readable on the accent. */
.on-accent { --fg-strong: var(--on-accent); --fg: #EAF2FF; --fg-dim: #CFE0FF; color: var(--on-accent); }

/* Social glyphs ship as white SVGs for the dark hero; on the light page body
   they must darken. They sit on the page, not on an accent, so they follow the
   foreground token - white in dark, ink in light. */
.soc svg, .soc svg *:not([fill="none"]) { fill: var(--fg-strong); }
.soc svg [stroke]:not([stroke="none"]) { stroke: var(--fg-strong); }
