:root {
  /* paper and brand match js/palette.js, so the 3D town and the page agree */
  --paper: #ECEBE7;
  --brand: #3341F0; /* fills: buttons, the live tag */
  --brand-ink: #3341F0; /* brand as text and thin lines */
  --ink: #1C1E23;
  --ink-2: #50545D;
  --plaster: #F9F8F5;
  --surface: #FFFFFF; /* tiles and cards that sit on plaster */
  --line: rgba(28, 30, 35, 0.14);
  --inverse: #1C1E23; /* the dark panels: "how we start", tooltips */
  --on-inverse: #FFFFFF;
  --shadow: var(--shadow);
  --font: "Readex Pro", system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(20px, 5vw, 72px);
  --t-small: 0.875rem;
  --t-body: clamp(1rem, 0.96rem + 0.2vw, 1.125rem);
  --t-h2: clamp(2.1rem, 1.5rem + 2.4vw, 3.7rem);
  --t-h1: clamp(2.5rem, 1.6rem + 3.4vw, 4.9rem);
  --t-h2-long: clamp(1.75rem, 1.35rem + 1.5vw, 2.75rem); /* headings that are a whole sentence */
  --track: -0.03em; /* tight headings; Arabic letters join, so ar.html sets 0 */
}
:root:lang(ar) { --track: 0; }
/* Dark: set on <html> by the script in each page's head (js/theme.js changes it). */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0B0C0F;
  --brand: #3341F0;
  --brand-ink: #8F98FF;
  --ink: #E9EAEE;
  --ink-2: #A2A6AF;
  --plaster: #15171C;
  --surface: #1C1F26;
  --line: rgba(255, 255, 255, 0.11);
  --inverse: #E9EAEE;
  --on-inverse: #0B0C0F;
  --shadow: rgba(0, 0, 0, 0.7);
}

* { box-sizing: border-box; }
html { background: var(--paper); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; scroll-padding-top: 88px; }
body { margin: 0; overflow-x: hidden; }
h1, h2, h3 { font-weight: 500; letter-spacing: var(--track); margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 3px; border-radius: 4px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.skip { position: absolute; inset-inline-start: 12px; top: -48px; z-index: 30; background: var(--inverse); color: var(--on-inverse); padding: 10px 14px; border-radius: 8px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ------------------------------------------------------------------ top bar */
/* The same header on every page (markup in index.html; menu behaviour in js/nav.js).
   Pages add class="bar-solid" to <html> for a solid backing from the start. */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 20; height: 72px;
  display: flex; align-items: center; gap: clamp(16px, 2.6vw, 34px);
  padding: 0 var(--gutter);
  pointer-events: none;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.bar > * { pointer-events: auto; }
.bar-solid .bar, .past-story .bar, .bar.open {
  pointer-events: auto; background: color-mix(in srgb, var(--paper) 94%, transparent); box-shadow: 0 1px 0 var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 10px; margin-inline-end: auto; text-decoration: none; font-weight: 600; font-size: 1.15rem; letter-spacing: -0.02em; }
.bar-nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 30px); font-size: 0.95rem; }
.bar-nav a:not(.btn) { text-decoration: none; color: var(--ink-2); padding: 8px 0; }
.bar-nav a:not(.btn):hover, .bar-nav a[aria-current="page"] { color: var(--ink); }
.bar-nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand-ink); }
.bar-nav .nav-book { display: none; } /* the phone menu's copy of the main button */
.bar-actions { display: flex; align-items: center; gap: 10px; }
.signin, .lang {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; color: var(--ink); font-size: 0.95rem; font-weight: 500;
  background: color-mix(in srgb, var(--plaster) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms ease;
}
.lang { min-width: 42px; padding: 0 12px; font-size: 1.15rem; line-height: 1; }
.signin:hover, .lang:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.menu-btn { display: none; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  background: var(--brand); color: #fff; text-decoration: none; border: 0; cursor: pointer;
  font: 500 0.95rem/1 var(--font); padding: 12px 18px; border-radius: 999px;
  transition: transform 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}
.btn.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ink) 30%, transparent); }
.btn.btn-line:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.bar .btn { white-space: nowrap; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-big { font-size: 1.05rem; padding: 16px 24px; }
.btn:focus-visible { border-radius: 999px; }
:lang(ar) .arrow { display: inline-block; transform: scaleX(-1); } /* arrows point the way you read */

/* ------------------------------------------------------------------ hero */
.hero {
  position: relative; overflow: clip; /* the town bleeds to the page edge, never past it */
  min-height: min(100svh, 920px); padding: 120px var(--gutter) 64px;
  display: grid; grid-template-columns: minmax(0, 36rem) minmax(0, 1fr); align-items: center; gap: 24px;
}
.hero-copy { position: relative; z-index: 1; }
.hero h1 { font-size: var(--t-h1); line-height: 0.98; margin-bottom: 24px; }
.hero-copy > p { font-size: clamp(1.05rem, 0.98rem + 0.35vw, 1.25rem); line-height: 1.6; color: var(--ink-2); max-width: 40ch; }
.hero-doors { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
/* the town sits to the side, bleeding off the page edge */
.hero-town { width: 118%; height: auto; margin-inline-start: -8%; max-width: none; justify-self: start; pointer-events: none; user-select: none; }
:lang(ar) .hero h1 { line-height: 1.2; }

/* ------------------------------------------------------------------ bands: the sections after the hero */
.band { padding: clamp(72px, 12vh, 128px) var(--gutter); border-top: 1px solid var(--line); }
.band > h2, .build-head h2 { font-size: var(--t-h2); line-height: 1.04; max-width: 22ch; }
:lang(ar) .band > h2, :lang(ar) .build-head h2, :lang(ar) .contact h2 { line-height: 1.3; }
.band h3 { font-size: clamp(1.2rem, 1.08rem + 0.5vw, 1.5rem); line-height: 1.25; letter-spacing: -0.015em; }
:lang(ar) .band h3 { letter-spacing: 0; line-height: 1.45; }

/* the problem: two leaks side by side */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 5vw, 72px); margin-top: clamp(36px, 6vh, 56px); max-width: 74rem; }
.pair > div { border-top: 2px solid var(--ink); padding-top: 22px; }
.pair h3 { margin-bottom: 12px; }
.pair p, .why-grid p { font-size: var(--t-body); line-height: 1.65; color: var(--ink-2); max-width: 46ch; }

/* what we build: the service areas, each one a way into the services page */
.build-head { max-width: 54rem; margin-bottom: clamp(32px, 5vh, 48px); }
.build-head h2 { margin-bottom: 18px; }
.build-lead { font-size: clamp(1.1rem, 1rem + 0.45vw, 1.35rem); line-height: 1.5; max-width: 44ch; margin-bottom: 12px; }
.build-who { font-size: var(--t-small); line-height: 1.6; color: var(--ink-2); max-width: 60ch; }
.areas { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
.areas a {
  height: 100%; display: flex; flex-direction: column; padding: 24px; border-radius: 20px;
  background: var(--plaster); box-shadow: 0 1px 0 var(--line); text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease;
}
.areas a:hover { transform: translateY(-2px); box-shadow: 0 1px 0 var(--line), 0 18px 36px -24px var(--shadow); }
.areas a:focus-visible { border-radius: 20px; }
.areas h3 { font-size: clamp(1.1rem, 1.02rem + 0.35vw, 1.3rem); line-height: 1.25; margin-bottom: 10px; transition: color 160ms ease; }
.areas li:not(.area-all) a:hover h3 { color: var(--brand-ink); }
.areas p { font-size: 0.95rem; line-height: 1.6; color: var(--ink-2); }
.area-go { margin-top: auto; padding-top: 18px; align-self: flex-start; color: var(--brand-ink); font-weight: 500; font-size: 1.1rem; }
:lang(ar) .area-go { transform: scaleX(-1); }
.area-all a { background: var(--brand); color: #fff; box-shadow: none; }
.area-all p { color: color-mix(in srgb, #fff 80%, transparent); }
.area-all .area-go { color: #fff; }
.area-note { white-space: nowrap; }
.start strong { color: inherit; font-weight: 600; }
.start {
  display: flex; align-items: center; justify-content: space-between; gap: 18px 32px; flex-wrap: wrap;
  margin-top: clamp(20px, 3vh, 28px); padding: clamp(24px, 3vw, 36px); border-radius: 20px; background: var(--inverse); color: var(--on-inverse);
}
.start p { font-size: var(--t-body); line-height: 1.6; max-width: 62ch; color: color-mix(in srgb, var(--on-inverse) 82%, transparent); }
.start .btn { flex-shrink: 0; }

/* why Northmere */
.why-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(28px, 4vw, 56px) clamp(28px, 5vw, 72px); margin-top: clamp(36px, 6vh, 56px); max-width: 74rem; }
.why-grid > div { padding-inline-start: 20px; border-inline-start: 2px solid var(--brand-ink); }
.why-grid h3 { margin-bottom: 10px; }

/* questions */
.faq-list { margin-top: clamp(28px, 5vh, 44px); max-width: 52rem; border-top: 1px solid var(--line); }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  padding: 22px 0; font-size: clamp(1.05rem, 1rem + 0.3vw, 1.2rem); font-weight: 500;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; flex: 0 0 auto; margin-inline-start: auto; width: 12px; height: 12px;
  background: linear-gradient(currentColor, currentColor) center / 12px 1.6px no-repeat, linear-gradient(currentColor, currentColor) center / 1.6px 12px no-repeat;
  transition: transform 200ms ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--brand-ink); }
.faq details p { padding: 0 0 24px; font-size: var(--t-body); line-height: 1.7; color: var(--ink-2); max-width: 62ch; }

/* ------------------------------------------------------------------ the scroll story: How we work */
.story { position: relative; height: calc(var(--steps, 5) * 105svh); border-top: 1px solid var(--line); }
.story-stage { position: sticky; top: 0; height: 100svh; overflow: hidden; }
#world { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.scrim {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--paper) 85%, transparent) 0, transparent 120px),
    linear-gradient(0deg, color-mix(in srgb, var(--paper) 92%, transparent) 0, transparent 120px);
}

/* each step's words sit on a card, so they read over any part of the town */
.steps article {
  position: absolute; inset-inline-start: var(--gutter); bottom: clamp(110px, 17vh, 180px);
  width: min(30rem, calc(100vw - 2 * var(--gutter)));
  padding: 24px 26px; border-radius: 20px;
  background: color-mix(in srgb, var(--plaster) 92%, transparent);
  box-shadow: 0 1px 0 var(--line), 0 22px 44px -30px var(--shadow);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  opacity: 0; pointer-events: none; will-change: opacity, transform;
}
.steps .num { font-size: var(--t-small); color: var(--brand-ink); font-weight: 500; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.steps h3 { font-size: clamp(1.6rem, 1.25rem + 1.4vw, 2.5rem); line-height: 1.08; margin-bottom: 12px; }
:lang(ar) .steps h3 { line-height: 1.35; }
.steps p:not(.num):not(.hint) { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); max-width: 36ch; }
.steps .intro { width: auto; max-width: min(40rem, calc(100vw - 2 * var(--gutter))); }
.steps .intro h2 { font-size: var(--t-h2); line-height: 1.02; }
.hint { display: flex; align-items: center; gap: 12px; margin-top: 18px; font-size: var(--t-small); color: var(--ink-2); }
.hint span { width: 1px; height: 30px; background: var(--ink); transform-origin: top; animation: drip 2.2s ease-in-out infinite; }
@keyframes drip { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }

/* step rail */
.rail {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 28px;
  display: flex; gap: 0; margin: 0; padding: 0; list-style: none;
  border-top: 1px solid var(--line);
}
.rail li { flex: 1; }
.rail button {
  all: unset; box-sizing: border-box; cursor: pointer; width: 100%;
  display: flex; gap: 8px; align-items: baseline; padding-block: 12px 4px; padding-inline: 0 8px;
  font-size: var(--t-small); color: var(--ink-2); position: relative;
}
.rail button::before { content: ""; position: absolute; inset-inline: 0 10px; top: -1px; height: 2px; background: transparent; transition: background-color 200ms ease; }
.rail button:hover { color: var(--ink); }
.rail button[aria-current="step"] { color: var(--ink); }
.rail button[aria-current="step"]::before { background: var(--brand-ink); }
.rail-n { font-variant-numeric: tabular-nums; color: var(--brand-ink); font-weight: 500; }
.rail button:focus-visible { outline: 2px solid var(--brand-ink); outline-offset: 2px; }

/* labels pinned into the 3D town */
.tags { position: absolute; inset: 0; pointer-events: none; }
.tag {
  position: absolute; left: 0; top: 0; white-space: nowrap; visibility: hidden;
  font: 500 0.8rem/1 var(--font); letter-spacing: -0.005em; color: var(--ink);
}
:lang(ar) .tag { letter-spacing: 0; line-height: 1.3; }
.tag-quiet { color: var(--ink-2); font-size: 0.75rem; }
.tag-lane { font-size: 0.8rem; font-weight: 600; color: var(--ink); }
.tag-tip {
  display: grid; gap: 2px; padding: 8px 11px; border-radius: 10px;
  background: var(--inverse); color: var(--on-inverse); font-weight: 400; font-size: 0.8rem;
}
.tag-tip b { font-weight: 500; font-size: 0.7rem; color: color-mix(in srgb, var(--on-inverse) 65%, transparent); }
.tag-live { background: var(--brand); color: #fff; padding: 6px 10px; border-radius: 999px; }
.tag-mark {
  pointer-events: auto; cursor: pointer; border: 0;
  background: var(--plaster); color: var(--ink); padding: 8px 12px; border-radius: 999px;
  box-shadow: 0 1px 0 var(--line), 0 6px 18px -10px var(--shadow);
  transition: background-color 160ms ease, color 160ms ease;
}
.tag-mark:hover { background: var(--brand); color: #fff; }

/* loading */
.loading {
  position: absolute; inset: 0; display: grid; place-content: center; gap: 14px; justify-items: center;
  background: var(--paper); transition: opacity 500ms ease, visibility 500ms;
  font-size: var(--t-small); color: var(--ink-2);
}
.loading-bar { width: 160px; height: 2px; background: var(--line); overflow: hidden; }
.loading-bar span { display: block; height: 100%; background: var(--brand); transform-origin: left; transform: scaleX(var(--loaded, 0.08)); transition: transform 200ms ease; }
:lang(ar) .loading-bar span { transform-origin: right; }
.loading.done { opacity: 0; visibility: hidden; }

/* ------------------------------------------------------------------ contact */
.contact { padding: clamp(80px, 14vh, 160px) var(--gutter) clamp(60px, 10vh, 120px); border-top: 1px solid var(--line); }
.contact h2 { font-size: var(--t-h1); line-height: 0.98; margin-bottom: 22px; max-width: 16ch; }
.contact p { font-size: var(--t-body); line-height: 1.6; color: var(--ink-2); max-width: 44ch; margin-bottom: 30px; }
.contact-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; }
.contact-mail { font-size: 1.05rem; font-weight: 500; text-underline-offset: 4px; }
.foot { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 28px var(--gutter); border-top: 1px solid var(--line); font-size: var(--t-small); color: var(--ink-2); }
.foot a { text-decoration: none; }
.foot a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------------ narrower screens */
@media (max-width: 1100px) {
  .areas { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 52rem; }
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; padding-top: 112px; padding-bottom: 24px; gap: 8px; }
  .hero-town { width: 120%; margin-inline: -10%; justify-self: center; }
}

/* ------------------------------------------------------------------ phones */
@media (max-width: 760px) {
  .bar { height: 64px; }
  html { scroll-padding-top: 76px; }
  /* phones: the links fold into a menu under the bar; the language switch stays visible */
  .bar-nav {
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    padding: 4px var(--gutter) 20px; background: var(--paper);
    box-shadow: 0 1px 0 var(--line), 0 24px 30px -26px var(--shadow);
  }
  .bar.open .bar-nav { display: flex; }
  .bar-nav a:not(.btn) { padding: 15px 0; font-size: 1.05rem; color: var(--ink); border-bottom: 1px solid var(--line); }
  .bar-nav a[aria-current="page"] { box-shadow: none; color: var(--brand-ink); }
  .bar-nav .nav-book { display: inline-flex; margin-top: 18px; }
  .bar-actions .bar-book { display: none; }
  .signin, .lang { min-height: 44px; }
  .signin { padding: 0 14px; }
  .lang { min-width: 44px; }
  .menu-btn {
    display: inline-grid; place-items: center; width: 44px; height: 44px; margin-inline-end: -8px;
    border: 0; border-radius: 12px; background: transparent; color: var(--ink); cursor: pointer;
  }
  .btn { padding: 10px 14px; font-size: 0.875rem; }
  .btn-big { padding: 14px 20px; font-size: 1rem; }
  .bar .btn { min-height: 44px; }

  .hero { padding-top: 96px; }
  .hero h1 { margin-bottom: 18px; }
  .hero-doors { margin-top: 26px; }
  .hero-doors .btn { flex: 1 1 auto; white-space: nowrap; }
  .pair, .why-grid { grid-template-columns: 1fr; }
  .areas { grid-template-columns: 1fr; gap: 10px; }
  .areas a { padding: 20px; border-radius: 18px; }
  .area-go { padding-top: 12px; }
  .start { padding: 22px 20px; border-radius: 18px; }
  .start .btn { width: 100%; }

  .scrim {
    background:
      linear-gradient(180deg, color-mix(in srgb, var(--paper) 85%, transparent) 0, transparent 80px),
      linear-gradient(0deg, color-mix(in srgb, var(--paper) 96%, transparent) 0%, color-mix(in srgb, var(--paper) 70%, transparent) 26%, transparent 44%);
  }
  .steps article { bottom: 76px; padding: 18px 20px; border-radius: 18px; }
  .steps .num { margin-bottom: 6px; }
  .steps h3 { margin-bottom: 8px; }
  .hint { margin-top: 12px; }
  .rail { bottom: 12px; }
  .rail-l { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } /* named for screen readers */
  .rail button { justify-content: center; align-items: center; padding: 0; min-height: 44px; }
  .rail button::before { inset-inline: 4px; }
  .tag-mark { display: none; } /* the step rail does this job on phones */
  .tag-lane { font-size: 0.66rem; }
  .contact-actions .btn { flex: 1 1 100%; }
}

/* short phone screens: tighter step text leaves room for the 3D above it */
@media (max-width: 760px) and (max-height: 720px) {
  .steps article { bottom: 66px; padding: 14px 16px; }
  .steps h3 { font-size: 1.4rem; margin-bottom: 6px; }
  .steps .intro h2 { font-size: 1.9rem; }
  .steps p:not(.num):not(.hint) { font-size: 0.94rem; line-height: 1.5; }
  .steps .num { margin-bottom: 4px; }
}

@media (max-width: 380px) {
  .mark { font-size: 1rem; gap: 7px; }
  .bar .btn { padding: 9px 12px; font-size: 0.8rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hint span { animation: none; }
  .btn, .tag-mark, .loading, .faq summary::after { transition: none; }
}

/* ------------------------------------------------------------------ light and dark (js/theme.js) */
/* The hero's town is a <picture> with a night version; the picture itself takes no part in the grid. */
.hero picture { display: contents; }
.hero picture > source, .hero picture > script { display: none; } /* or they'd each take a grid cell */

/* The theme switch: one press swaps light and dark (js/theme.js). */
.theme-btn {
  display: inline-grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 0; border-radius: 999px; cursor: pointer;
  color: var(--ink); background: color-mix(in srgb, var(--plaster) 80%, transparent); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 160ms ease;
}
.theme-btn:hover { box-shadow: inset 0 0 0 1px var(--ink); }
.theme-btn:focus-visible { border-radius: 999px; }
.theme-row {
  display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 12px; border-radius: 10px;
  cursor: pointer; font-size: 0.95rem; color: var(--ink);
}
.theme-row input { position: absolute; opacity: 0; pointer-events: none; }
.theme-row:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.theme-row:has(input:checked) { color: var(--brand-ink); background: color-mix(in srgb, var(--brand-ink) 12%, transparent); }
.theme-row:has(input:focus-visible) { outline: 2px solid var(--brand-ink); outline-offset: -2px; }
.theme-menu { display: none; border: 0; margin: 0; padding: 0; min-width: 0; } /* the phone menu's copy, below */

/* The change of colours. Around the swap no CSS transitions run, so nothing fades on its own;
   the new page then grows as a circle from the button (--reveal-*), or fades in with less motion. */
html[data-theme-switching] *, html[data-theme-switching] *::before, html[data-theme-switching] *::after { transition: none !important; }
::view-transition-group(root) { animation: none; }
::view-transition-old(root) { animation: none; mix-blend-mode: normal; }
::view-transition-new(root) { animation: theme-fade 200ms ease both; mix-blend-mode: normal; }
html[data-theme-reveal]::view-transition-new(root) { animation: theme-reveal 640ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
@keyframes theme-fade { from { opacity: 0; } }
@keyframes theme-reveal {
  from { clip-path: circle(0 at var(--reveal-x) var(--reveal-y)); }
  to { clip-path: circle(var(--reveal-r) at var(--reveal-x) var(--reveal-y)); }
}

@media (max-width: 760px) {
  .theme-btn { display: none; } /* phones: the switch is in the menu */
  .theme-menu { display: block; margin-top: 18px; }
  .theme-menu legend { padding: 0 0 10px; font-size: var(--t-small); color: var(--ink-2); }
  .theme-seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px; padding: 4px; border-radius: 14px; background: var(--plaster); box-shadow: inset 0 0 0 1px var(--line); }
  .theme-seg .theme-row { justify-content: center; gap: 8px; padding: 0 6px; font-size: 0.85rem; text-align: center; }
  .theme-seg .theme-row svg { flex: 0 0 auto; }
}
/* small phones: Sign in shows its icon only (its name stays for screen readers) */
@media (max-width: 480px) {
  .signin { width: 44px; padding: 0; }
  .signin span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}
