/* mydgttest.com — "road signs" design system (2026-11).
   Paper and asphalt, Spanish sign colours, Overpass (a Highway-Gothic descendant).
   Markup: Tools/Landing/chrome.py + build_*.py. Behaviour: /assets/mdt.js. */

:root {
  --paper: #F3F0E9;
  --paper-2: #E9E5DB;
  --card: #FBFAF6;
  --ink: #141A1B;
  --ink-2: #485254;
  --ink-3: #727B7C;
  --line: #D9D4C8;
  --asphalt: #10191A;
  --asphalt-2: #182324;
  --on-asphalt: #E9ECE8;
  --teal: #0E6B6A;
  --teal-2: #0A5554;
  --teal-soft: #D5E7E3;
  --clay: #C8714B;
  --clay-soft: #F2DED2;
  --blue: var(--teal);
  --blue-ink: var(--teal-2);
  --red: #C2463C;
  --yellow: var(--clay);
  --green: #2E8B57;
  --shadow: 5px 5px 0 var(--ink);
  --radius: 14px;
  --font: 'Overpass', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'Overpass Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1516; --paper-2: #172021; --card: #1A2324; --ink: #E7EBE7; --ink-2: #AEB8B6; --ink-3: #85908E; --line: #2A3536;
    --asphalt: #0A0F10; --asphalt-2: #121A1B; --teal: #3FB2A6; --teal-2: #6CCBC0; --teal-soft: #173533; --clay: #E28B63; --clay-soft: #3A2A22;
    --shadow: 5px 5px 0 #000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1516; --paper-2: #172021; --card: #1A2324; --ink: #E7EBE7; --ink-2: #AEB8B6; --ink-3: #85908E; --line: #2A3536;
  --asphalt: #0A0F10; --asphalt-2: #121A1B; --teal: #3FB2A6; --teal-2: #6CCBC0; --teal-soft: #173533; --clay: #E28B63; --clay-soft: #3A2A22;
  --shadow: 5px 5px 0 #000; color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.6 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
html[dir="rtl"] body { font-family: 'Cairo', var(--font); }
html[lang="zh-Hans"] body { font-family: var(--font), 'PingFang SC', 'Noto Sans SC', 'Microsoft YaHei', sans-serif; }
img { max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; line-height: 1.05; letter-spacing: -.025em; font-weight: 800; text-wrap: balance; }
p { margin: 0; text-wrap: pretty; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); }
.skip { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 100; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; background: var(--teal); color: #fff; padding: 8px 14px; border-radius: 8px; font-weight: 700; }
.skip:focus { width: auto; height: auto; clip-path: none; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 4px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.mono { font-family: var(--mono); }

/* --------------------------------------------------------- signs, plates, lanes */
.sign { display: inline-block; flex: none; }
.plate { display: inline-flex; align-items: center; gap: 10px; padding: 6px 14px 5px 10px; border: 1.5px solid var(--teal); border-radius: 999px; background: var(--teal-soft); color: var(--teal-2); font: 700 12.5px/1.2 var(--mono); letter-spacing: .05em; text-transform: uppercase; }
.plate::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 4px color-mix(in srgb, var(--teal) 25%, transparent); }
.plate--blue { background: var(--blue); color: #fff; border-color: #0d2f66; box-shadow: 3px 3px 0 #0d2f66; }
.kicker { font: 700 13px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); display: inline-flex; align-items: center; gap: 10px; }
.kicker::before { content: ""; width: 22px; height: 2px; background: var(--teal); }
/* road lane: dashed centre line that rolls as the page scrolls */
.lane { height: 6px; background: repeating-linear-gradient(90deg, var(--ink) 0 46px, transparent 46px 78px); opacity: .9; background-size: 78px 6px; }
.lane--yellow { background-image: repeating-linear-gradient(90deg, var(--clay) 0 46px, transparent 46px 78px); opacity: .85; }
.lane--light { background-image: repeating-linear-gradient(90deg, #ECE9E1 0 46px, transparent 46px 78px); opacity: .55; }
@keyframes lane-roll { from { background-position: 0 0; } to { background-position: -780px 0; } }
@supports (animation-timeline: scroll()) {
  .lane { animation: lane-roll linear both; animation-timeline: scroll(root); }
}

/* --------------------------------------------------------- header */
.hdr { position: sticky; top: 0; z-index: 40; background: var(--paper); border-bottom: 2px solid transparent; transition: border-color .25s; view-transition-name: hdr; }
.hdr.is-scrolled { border-bottom-color: var(--ink); }
.hdr__in { display: flex; align-items: center; gap: 24px; height: 68px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; white-space: nowrap; }
.brand img { width: 36px; height: 36px; border-radius: 10px; }
.hdr__nav { display: flex; gap: 4px; margin-inline-start: auto; }
.hdr__nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; font-weight: 600; font-size: 15.5px; color: var(--ink-2); transition: background .2s, color .2s; }
.hdr__nav a:hover, .hdr__nav a[aria-current] { color: var(--ink); background: var(--paper-2); }
.hdr__act { display: flex; align-items: center; gap: 8px; }
.lang { position: relative; }
.lang__btn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; border: 2px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); font: 700 13px var(--mono); cursor: pointer; }
.lang__menu { position: absolute; inset-inline-end: 0; top: calc(100% + 8px); display: none; grid-template-columns: 1fr 1fr; gap: 2px; width: 330px; padding: 8px; background: var(--card); border: 2px solid var(--ink); border-radius: 12px; box-shadow: var(--shadow); }
.lang.is-open .lang__menu { display: grid; }
.lang__menu a, .mpanel__langs a { display: flex; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: 8px; text-decoration: none; font-size: 14.5px; color: var(--ink-2); }
.lang__menu a b, .mpanel__langs a b { font: 700 11.5px var(--mono); color: var(--ink-3); width: 20px; }
.lang__menu a:hover, .lang__menu a[aria-current] { background: var(--paper-2); color: var(--ink); }
.lang__menu a[aria-current] b { color: var(--blue); }
.hdr__get { height: 38px; display: inline-flex; align-items: center; padding: 0 16px; border-radius: 8px; background: var(--ink); color: var(--paper); font-weight: 700; font-size: 15px; text-decoration: none; transition: transform .15s var(--ease); }
.hdr__get:hover { transform: translateY(-1px); }
.burger { display: none; width: 42px; height: 38px; border: 2px solid var(--ink); border-radius: 8px; background: transparent; cursor: pointer; padding: 0; position: relative; }
.burger i { position: absolute; left: 10px; right: 10px; height: 2px; background: var(--ink); transition: transform .25s var(--ease); }
.burger i:first-child { top: 13px; } .burger i:last-child { top: 21px; }
.burger[aria-expanded="true"] i:first-child { transform: translateY(4px) rotate(45deg); }
.burger[aria-expanded="true"] i:last-child { transform: translateY(-4px) rotate(-45deg); }
.mpanel { position: fixed; inset: 68px 0 0; z-index: 39; background: var(--paper); overflow-y: auto; }
.mpanel__in { padding: 20px clamp(16px, 4vw, 40px) 40px; display: grid; gap: 22px; }
.mpanel__nav { display: grid; }
.mpanel__nav a { padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 22px; font-weight: 700; text-decoration: none; }
.mpanel__langs { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; }
.mpanel__langs a[aria-current] { background: var(--paper-2); color: var(--ink); }
.mpanel__stores { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mpanel__stores a { display: flex; align-items: center; justify-content: center; min-height: 50px; padding: 10px 12px; border: 2px solid var(--ink); border-radius: 10px; font-weight: 700; text-align: center; text-decoration: none; transition: background .2s, color .2s; }
.mpanel__stores a:last-child { grid-column: 1 / -1; }
.mpanel__stores a:hover, .mpanel__stores a:active { background: var(--ink); color: var(--paper); }
.mpanel__close { justify-self: start; padding: 10px 16px; border-radius: 8px; border: 0; background: var(--paper-2); color: var(--ink); font: 700 15px var(--font); cursor: pointer; }
body.is-locked { overflow: hidden; }
@media (max-width: 880px) {
  .hdr__nav, .lang { display: none; }
  .burger { display: block; }
  .hdr__act { margin-inline-start: auto; }
}
@media (max-width: 420px) { .hdr__get { display: none; } }

/* --------------------------------------------------------- buttons, badges */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 22px; border-radius: 12px; border: 2px solid var(--ink); background: var(--card); color: var(--ink); font: 700 16px var(--font); text-decoration: none; box-shadow: var(--shadow); transition: transform .15s var(--ease), box-shadow .15s var(--ease); cursor: pointer; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 7px 7px 0 var(--ink); }
.btn:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 var(--ink); }
.btn--accent { background: var(--teal); color: #fff; border-color: var(--ink); }
.btn svg { width: 18px; height: 18px; }
html[dir="rtl"] .btn svg[data-flip] { transform: scaleX(-1); }
.badges { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.badge { display: inline-flex; border-radius: 10px; transition: transform .18s var(--ease); }
.badge img { display: block; height: 48px; width: auto; }
.badge:hover { transform: translateY(-3px) rotate(-1deg); }
.badge picture { display: block; }
.textlink { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; text-decoration: none; background: linear-gradient(var(--clay-soft), var(--clay-soft)) 0 92% / 100% 6px no-repeat; padding-bottom: 2px; transition: background-size .25s var(--ease); }
.textlink:hover { background-size: 100% 100%; }
.textlink svg { width: 16px; height: 16px; }
html[dir="rtl"] .textlink svg { transform: scaleX(-1); }

/* --------------------------------------------------------- sections */
.sec { padding: clamp(64px, 9vw, 120px) 0; }
.sec--tight { padding: clamp(40px, 6vw, 72px) 0; }
.sec__head { display: grid; gap: 14px; max-width: 760px; margin-bottom: clamp(22px, 3vw, 32px); }
.sec__head h2 { font-size: clamp(2rem, 4.4vw, 3.4rem); }
.sec__head p { font-size: 1.12rem; color: var(--ink-2); }
.dark { background: var(--asphalt); color: var(--on-asphalt); --ink-2: #B9B6AE; --ink-3: #8D8B85; --line: #2E3138; }
.dark .btn { box-shadow: 5px 5px 0 var(--clay); border-color: var(--on-asphalt); background: transparent; color: var(--on-asphalt); }

/* --------------------------------------------------------- hero */
.home .hero { padding: clamp(36px, 6vw, 80px) 0 clamp(48px, 7vw, 96px); overflow: clip; }
.home .hero__grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 72px); align-items: center; }
.home .hero h1 { font-size: clamp(2.7rem, 6.6vw, 5.6rem); line-height: .98; margin: 22px 0 22px; letter-spacing: -.035em; }
.home .hero h1 span { display: inline; color: var(--blue); }
.home .hero h1 br { display: block; }
.home .hero__lead { font-size: clamp(1.05rem, 1.4vw, 1.22rem); color: var(--ink-2); max-width: 600px; }
.home .hero__lead strong { color: var(--ink); font-weight: 700; }
.home .hero__cta { display: grid; gap: 18px; margin-top: 32px; }
.home .hero__visual { position: relative; min-height: 520px; display: grid; place-items: center; }
.home .phone { position: relative; width: min(280px, 70vw); border-radius: 40px; padding: 9px; background: #0d0e10; box-shadow: 0 2px 0 1px #2b2e33 inset, 0 30px 60px -20px rgba(22, 24, 27, .45); }
.home .phone img { display: block; width: 100%; border-radius: 32px; }
.home .hero__phone { transform: rotate(4deg) translateX(16%); }
html[dir="rtl"] .home .hero__phone { transform: rotate(-4deg) translateX(-16%); }
.home .hero__sign { position: absolute; top: 4%; inset-inline-start: 4%; width: 76px; height: auto; transform: rotate(-6deg); filter: drop-shadow(4px 6px 0 rgba(20, 26, 27, .22)); z-index: 1; }

/* live exam question */
.home .q { position: absolute; inset-inline-start: -4%; bottom: 4%; width: min(360px, 88%); background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; display: grid; gap: 12px; z-index: 2; }
.home .q__top { display: flex; justify-content: space-between; align-items: center; font: 700 12px var(--mono); color: var(--ink-3); letter-spacing: .05em; text-transform: uppercase; }
.home .q__timer { display: inline-flex; align-items: center; gap: 6px; color: var(--ink); }
.home .q__timer i { width: 8px; height: 8px; border-radius: 50%; background: var(--red); animation: blink 1.2s steps(2, start) infinite; }
@keyframes blink { to { opacity: 0; } }
.home .q__text { font-weight: 700; font-size: 17px; line-height: 1.3; }
.home .q__opts { display: grid; gap: 8px; }
.home .q__opt { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border: 2px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: 600 15px var(--font); text-align: start; cursor: pointer; transition: border-color .15s, background .15s, transform .15s; }
.home .q__opt b { display: grid; place-items: center; width: 26px; height: 26px; flex: none; border-radius: 6px; background: var(--paper-2); font: 700 13px var(--mono); }
.home .q__opt:hover:not([disabled]) { border-color: var(--ink); transform: translateX(3px); }
html[dir="rtl"] .home .q__opt:hover:not([disabled]) { transform: translateX(-3px); }
.home .q__opt.is-right { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.home .q__opt.is-right b { background: var(--green); color: #fff; }
.home .q__opt.is-wrong { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.home .q__opt.is-wrong b { background: var(--red); color: #fff; }
.home .q__opt[disabled] { cursor: default; }
.home .q__why { display: none; font-size: 14px; line-height: 1.45; color: var(--ink-2); border-top: 2px dashed var(--line); padding-top: 10px; }
.home .q.is-done .q__why { display: block; animation: rise .35s var(--ease) both; }
.home .q__why a { font-weight: 700; color: var(--blue-ink); }

/* --------------------------------------------------------- numbers band */
.home .band { background: var(--asphalt); color: var(--on-asphalt); }
.home .band__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.home .stat { padding: 34px 24px 30px; border-inline-start: 1px solid #2E3138; }
.home .stat:first-child { border-inline-start: 0; padding-inline-start: 0; }
.home .stat b { display: block; font: 700 clamp(2rem, 4vw, 3rem)/1 var(--mono); color: #EBA27F; letter-spacing: -.02em; }
.home .stat span { display: block; margin-top: 10px; font-size: 14.5px; color: #B9B6AE; }

/* --------------------------------------------------------- features */
.home .feat-top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-bottom: 20px; }
.home .panelcard { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 18px; align-items: end; padding: 28px; border: 2px solid var(--ink); border-radius: 20px; background: var(--card); min-height: 280px; }
.home .panelcard h3 { font-size: clamp(1.4rem, 2.2vw, 1.9rem); margin: 14px 0 10px; }
.home .panelcard p { color: var(--ink-2); font-size: 15.5px; }
.home .panelcard--blue { background: #0E6B6A; color: #fff; border-color: var(--ink); }
.home .panelcard--blue p { color: rgba(255, 255, 255, .88); }
.home .panelcard__shot { width: 150px; margin-bottom: -60px; border-radius: 22px 22px 0 0; padding: 6px 6px 0; background: #0d0e10; transform: rotate(-3deg); transition: transform .4s var(--ease); }
.home .panelcard__shot img { display: block; border-radius: 17px 17px 0 0; }
.home .panelcard:hover .panelcard__shot { transform: rotate(0) translateY(-6px); }
.home .feat-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; border-top: 2px solid var(--ink); }
.home .feat { display: grid; grid-template-columns: auto 1fr; align-content: start; gap: 6px 16px; padding: 24px 22px 26px 0; border-bottom: 1px solid var(--line); }
.home .feat:nth-child(3n+2), .home .feat:nth-child(3n+3) { padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
.home .feat__n { grid-row: span 2; font: 700 13px/1.9 var(--mono); color: var(--teal); min-width: 26px; }
.home .feat h3 { font-size: 1.12rem; letter-spacing: -.01em; line-height: 1.25; }
.home .feat p { grid-column: 2; color: var(--ink-2); font-size: 15px; line-height: 1.55; }

/* --------------------------------------------------------- generated blocks (apps, guides) */
.home .apps-dl { padding: clamp(56px, 8vw, 100px) 0 0; }
.home .guides { padding: clamp(56px, 8vw, 100px) 0 clamp(64px, 9vw, 120px); }
.home .apps-dl .section-header, .home .guides .section-header { width: 100%; max-width: 1200px; margin: 0 auto 28px; padding: 0 clamp(16px, 4vw, 40px); display: grid; gap: 12px; }
.home .apps-dl .section-header h2, .home .guides .section-header h2 { font-size: clamp(1.8rem, 3.6vw, 2.7rem); }
.home .apps-dl .section-header p, .home .guides .section-header p { color: var(--ink-2); font-size: 1.05rem; max-width: 680px; }
.home .apps-grid, .home .guides-grid { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(16px, 4vw, 40px); display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.home .apps-grid a, .home .guides-grid a { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 22px 22px 24px; border: 2px solid var(--ink); border-radius: 16px; background: var(--card); color: var(--ink); text-decoration: none; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.home .apps-grid a:hover, .home .guides-grid a:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
.home .apps-grid svg { width: 30px; height: 30px; color: var(--blue); }
.home .apps-grid strong, .home .guides-grid strong { font-size: 1.12rem; font-weight: 800; letter-spacing: -.01em; }
.home .apps-grid span, .home .guides-grid span { color: var(--ink-2); font-size: 15px; }
.home .guides-grid a { padding-inline-end: 44px; }
.home .guides-grid a::after { content: "→"; position: absolute; top: 18px; inset-inline-end: 20px; font: 700 18px var(--mono); color: var(--ink-3); transition: transform .2s var(--ease), color .2s; }
html[dir="rtl"] .home .guides-grid a::after { content: "←"; }
.home .guides-grid a:hover::after { color: var(--blue); transform: translateX(4px); }

/* --------------------------------------------------------- book */
.home .book { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: clamp(20px, 4vw, 48px); padding: clamp(24px, 4vw, 40px); background: var(--clay-soft); color: var(--ink); border: 2px solid var(--ink); border-radius: 22px; box-shadow: var(--shadow); }
.home .book img { width: clamp(110px, 14vw, 170px); transform: rotate(-5deg); box-shadow: 8px 10px 0 rgba(22, 24, 27, .28); border-radius: 4px; transition: transform .4s var(--ease); }
.home .book:hover img { transform: rotate(-2deg) translateY(-4px); }
.home .book h2 { font-size: clamp(1.6rem, 3.2vw, 2.5rem); }
.home .book p { margin-top: 10px; font-size: 1.05rem; color: var(--ink-2); max-width: 520px; }
.home .book .btn { background: var(--ink); color: var(--paper); border-color: var(--ink); box-shadow: 4px 4px 0 var(--clay); }

/* --------------------------------------------------------- FAQ */
.home .faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(28px, 5vw, 72px); align-items: start; }
.home .faq-grid .sec__head { position: sticky; top: 100px; }
.home .qa { border-top: 2px solid var(--ink); }
.home .qa details { border-bottom: 1px solid var(--line); }
.home .qa summary { list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; padding: 22px 0; cursor: pointer; }
.home .qa summary::-webkit-details-marker { display: none; }
.home .qa summary h3 { font-size: 1.15rem; letter-spacing: -.01em; line-height: 1.3; font-weight: 700; }
.home .qa summary i { position: relative; width: 30px; height: 30px; border-radius: 50%; background: var(--teal); flex: none; transition: transform .3s var(--ease); }
.home .qa summary i::before, .home .qa summary i::after { content: ""; position: absolute; left: 8px; right: 8px; top: 14px; height: 2px; background: #fff; }
.home .qa summary i::after { transform: rotate(90deg); transition: transform .3s var(--ease); }
.home .qa details[open] summary i { transform: rotate(180deg); background: var(--clay); }
.home .qa details[open] summary i::after { transform: rotate(0); }
.home .qa details p { padding: 0 52px 24px 0; color: var(--ink-2); }
html[dir="rtl"] .home .qa details p { padding: 0 0 24px 52px; }

/* --------------------------------------------------------- final CTA */
.home .cta { position: relative; overflow: hidden; text-align: center; }
.home .cta h2 { font-size: clamp(2.2rem, 5.4vw, 4.4rem); max-width: 900px; margin: 0 auto; }
.home .cta p { max-width: 640px; margin: 18px auto 0; font-size: 1.12rem; color: #B9B6AE; }
.home .cta .badges { justify-content: center; margin-top: 34px; }
.home .cta .textlink { margin-top: 22px; color: var(--on-asphalt); }
.home .cta .textlink { background-image: linear-gradient(color-mix(in srgb, var(--clay) 45%, transparent), color-mix(in srgb, var(--clay) 45%, transparent)); }
.home .cta__signs { display: flex; justify-content: center; gap: 14px; margin-bottom: 26px; }
.home .cta__signs .sign { width: 48px; height: 48px; }

/* --------------------------------------------------------- footer */
.ftr { background: var(--asphalt); color: var(--on-asphalt); margin-top: 0; }
.ftr__in { display: grid; grid-template-columns: 1.4fr repeat(3, minmax(0, 1fr)); gap: 32px; padding-top: 56px; padding-bottom: 40px; }
.brand--inv { color: var(--on-asphalt); }
.ftr__brand p { margin-top: 14px; color: #B9B6AE; font-size: 15px; max-width: 340px; }
.ftr__signs { display: flex; gap: 10px; margin-top: 20px; }
.ftr__h { font: 700 12.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: #8D8B85; margin-bottom: 14px; }
.ftr ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.ftr a, .ftr .linkish { color: #DAD7CF; text-decoration: none; font-size: 15px; }
.ftr a:hover, .ftr .linkish:hover { color: #EBA27F; }
.ftr__base { display: grid; gap: 10px; padding-top: 22px; padding-bottom: 36px; border-top: 1px solid #2E3138; font-size: 13.5px; color: #8D8B85; }
.ftr__base a { color: #B9B6AE; font-size: inherit; }
.ftr__disc { max-width: 820px; }

/* --------------------------------------------------------- content pages (guides, apps, schools, legal) */
.page { padding: clamp(28px, 4vw, 56px) 0 clamp(56px, 8vw, 96px); }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font: 600 13px var(--mono); color: var(--ink-3); margin-bottom: 26px; }
.crumbs a { color: var(--ink-3); text-decoration: none; } .crumbs a:hover { color: var(--blue); }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); margin-bottom: 18px; }
.prose h2 { font-size: clamp(1.5rem, 2.6vw, 2rem); margin: 48px 0 14px; scroll-margin-top: 90px; }
.prose h3 { font-size: 1.2rem; margin: 28px 0 10px; letter-spacing: -.01em; }
.prose p, .prose li { color: var(--ink-2); }
.prose p + p { margin-top: 14px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 12px 0; }
.prose li { margin: 6px 0; }
.prose li::marker { color: var(--blue); }
.prose a { color: var(--blue-ink); text-underline-offset: 3px; }
.prose strong { color: var(--ink); }
.lead { font-size: 1.2rem; color: var(--ink-2); }
.note { border-inline-start: 6px solid var(--clay); background: var(--card); padding: 14px 18px; border-radius: 0 10px 10px 0; }
.table-wrap { overflow-x: auto; margin: 18px 0; border: 2px solid var(--ink); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { text-align: start; padding: 12px 16px; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 15.5px; }
tr:last-child th, tr:last-child td { border-bottom: 0; }
th { font-weight: 700; color: var(--ink); }

/* --------------------------------------------------------- motion */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes sign-in { from { opacity: 0; transform: rotateY(90deg) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes drift { from { transform: translateY(24px); } to { transform: translateY(-24px); } }
.home .hero .plate, .home .hero h1, .home .hero__lead, .home .hero__cta { animation: rise .7s var(--ease) both; }
.home .hero h1 { animation-delay: .06s; } .home .hero__lead { animation-delay: .14s; } .home .hero__cta { animation-delay: .22s; }
.home .q { animation: rise .8s var(--ease) .35s both; }
.home .hero__sign { animation: sign-in .9s var(--ease) .5s both; }
@supports (animation-timeline: view()) {
  .reveal { animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 55%; }
  .home .hero__phone img { animation: drift linear both; animation-timeline: view(); animation-range: cover; }
}
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: .2s ease both fade-out; }
::view-transition-new(root) { animation: .32s var(--ease) both rise; }
@keyframes fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* --------------------------------------------------------- responsive */
@media (max-width: 980px) {
  .home .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .home .hero__visual { min-height: 480px; }
  .home .feat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .feat:nth-child(3n+2), .home .feat:nth-child(3n+3) { padding-inline-start: 0; border-inline-start: 0; }
  .home .feat:nth-child(2n) { padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
  .home .faq-grid { grid-template-columns: minmax(0, 1fr); }
  .home .faq-grid .sec__head { position: static; }
  .ftr__in { grid-template-columns: 1fr 1fr; }
  .ftr__brand { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  body { font-size: 16px; }
  .home .band__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .home .stat { padding: 24px 16px 22px; border-inline-start: 0; border-top: 1px solid #2E3138; }
  .home .stat:nth-child(-n+2) { border-top: 0; }
  .home .stat:nth-child(odd) { padding-inline-start: 0; }
  .home .feat-top { grid-template-columns: minmax(0, 1fr); }
  .home .panelcard { min-height: 0; grid-template-columns: 1fr; }
  .home .panelcard__shot { display: none; }
  .home .feat-list { grid-template-columns: minmax(0, 1fr); }
  .home .feat, .home .feat:nth-child(2n), .home .feat:nth-child(3n+2), .home .feat:nth-child(3n+3) { padding: 20px 0; border-inline-start: 0; }
  .home .book { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .home .book p { margin-inline: auto; }
  .home .hero__visual { min-height: 0; padding-bottom: 210px; }
  .home .hero__phone { transform: rotate(3deg); width: 220px; }
  .home .q { inset-inline-start: 0; right: 0; margin: 0 auto; bottom: 0; }
  .home .hero__sign { width: 58px; }
  .badge img { height: 44px; }
  .ftr__in { grid-template-columns: 1fr; }
  .home .qa details p { padding-inline-end: 0; }
}

/* theme toggle */
.theme { width: 38px; height: 38px; display: inline-grid; place-items: center; border: 2px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); cursor: pointer; padding: 0; }
.theme svg { width: 18px; height: 18px; }
.theme .i-sun { display: none; }
:root[data-theme="dark"] .theme .i-sun { display: block; }
:root[data-theme="dark"] .theme .i-moon { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme .i-sun { display: block; } :root:not([data-theme="light"]) .theme .i-moon { display: none; } }
.mpanel__theme { justify-self: start; display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border: 2px solid var(--ink); border-radius: 8px; background: transparent; color: var(--ink); font: 700 15px var(--font); cursor: pointer; }

/* ===================================================== motion + infographics (v2) */
.sec--paper2 { background: var(--paper-2); }

/* hero question: deck flip + 30-minute clock drained by scrolling */
.home .q { perspective: 900px; }
.home .q.is-flip { animation: q-flip .55s var(--ease); }
@keyframes q-flip { 0% { transform: rotateX(0); } 45% { transform: rotateX(90deg); opacity: .4; } 55% { transform: rotateX(-90deg); opacity: .4; } 100% { transform: rotateX(0); } }
.home .q__clock { height: 4px; border-radius: 4px; background: var(--paper-2); overflow: hidden; }
.home .q__clock i { display: block; height: 100%; width: 100%; background: var(--teal); transform-origin: left; }
html[dir="rtl"] .home .q__clock i { transform-origin: right; }
@keyframes drain { from { transform: scaleX(1); background: var(--teal); } 70% { background: var(--teal); } to { transform: scaleX(.04); background: var(--red); } }
@supports (animation-timeline: scroll()) {
  .home .q__clock i { animation: drain linear both; animation-timeline: scroll(root); animation-range: 0 90vh; }
}

/* sign strip inside the asphalt band */
.strip { position: relative; display: flex; overflow: hidden; padding: 6px 0 28px; mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.strip__track { display: flex; gap: 26px; flex: none; margin: 0; padding: 0 13px; list-style: none; animation: strip 70s linear infinite; }
.strip:hover .strip__track { animation-play-state: paused; }
@keyframes strip { to { transform: translateX(-100%); } }
html[dir="rtl"] .strip__track { animation-name: strip-rtl; }
@keyframes strip-rtl { to { transform: translateX(100%); } }
.strip li { position: relative; display: grid; justify-items: center; width: 74px; }
.strip img { width: 58px; height: 58px; object-fit: contain; transition: transform .25s var(--ease); }
.strip li span { position: absolute; top: calc(100% - 4px); left: 50%; transform: translate(-50%, 6px); width: max-content; max-width: 220px; padding: 6px 10px; border-radius: 8px; background: var(--on-asphalt); color: var(--asphalt); font-size: 12.5px; line-height: 1.3; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 2; }
.strip li span b { display: block; font: 700 11px var(--mono); color: var(--teal); }
.strip li:hover img { transform: translateY(-4px) scale(1.08); }
.strip li:hover span { opacity: 1; transform: translate(-50%, 0); }

/* features with a sticky phone */
.home .feat-stick { display: grid; grid-template-columns: minmax(220px, 300px) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.home .feat-stick__phone { position: sticky; top: 96px; }
.home .feat-stick__phone .phone { width: 100%; }
.home .feat-stick__phone .phone { display: grid; }
.home .feat-stick__phone img { grid-area: 1 / 1; opacity: 0; transform: scale(.97); transition: opacity .45s var(--ease), transform .45s var(--ease); }
.home .feat-stick__phone img.is-on { opacity: 1; transform: none; }
.home .feat-stick .feat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.home .feat-stick .feat, .home .feat-stick .feat:nth-child(n) { padding: 24px 22px 26px 0; border-inline-start: 0; }
.home .feat-stick .feat:nth-child(2n) { padding-inline-start: 22px; border-inline-start: 1px solid var(--line); }
.home .feat.is-active .feat__n { color: var(--clay); }
.home .feat.is-active h3 { color: var(--teal); }

/* infographic 1: exam by licence */
.ex { border-top: 2px solid var(--ink); }
.ex__head, .ex__row { display: grid; grid-template-columns: minmax(150px, 1.2fr) repeat(3, minmax(64px, .45fr)) minmax(160px, 1.6fr); align-items: center; gap: 12px; }
.ex__head { padding: 12px 0; font: 700 12px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.ex__rows { list-style: none; margin: 0; padding: 0; }
.ex__row { padding: 16px 0; border-bottom: 1px solid var(--line); }
.ex__lic { display: flex; align-items: baseline; gap: 12px; font-weight: 600; color: var(--ink-2); }
.ex__lic b { display: inline-grid; place-items: center; min-width: 54px; height: 34px; padding: 0 8px; border-radius: 8px; border: 2px solid var(--ink); font: 800 15px var(--mono); color: var(--ink); background: var(--card); }
.ex__n { font: 700 1.5rem var(--mono); }
.ex__n--err { color: var(--clay); }
.ex__bank { position: relative; display: flex; align-items: center; gap: 10px; }
.ex__bank i { display: block; height: 14px; width: var(--w); border-radius: 4px; background: var(--teal); transform-origin: left; }
html[dir="rtl"] .ex__bank i { transform-origin: right; }
.ex__bank b { font: 700 15px var(--mono); white-space: nowrap; }
@keyframes grow { from { transform: scaleX(0); } }
@supports (animation-timeline: view()) {
  .ex__row .ex__bank i { animation: grow linear both; animation-timeline: view(); animation-range: entry 20% entry 90%; }
}

/* infographic 2: topic treemap */
.tm { position: relative; list-style: none; margin: 0; padding: 0; width: 100%; aspect-ratio: 100 / 56; }
.tm__t { position: absolute; display: flex; flex-direction: column; justify-content: space-between; gap: 4px; padding: 10px 12px; overflow: hidden; border: 2px solid var(--paper-2); border-radius: 10px; transition: transform .25s var(--ease), filter .25s; }
.tm__t--a { background: var(--teal); color: #fff; }
.tm__t--b { background: color-mix(in srgb, var(--teal) 55%, var(--paper-2)); color: #fff; }
.tm__t--c { background: var(--clay-soft); color: var(--ink); }
:root[data-theme="dark"] .tm__t--c { color: var(--ink); }
.tm__t:hover { transform: scale(1.02); z-index: 2; filter: brightness(1.08); }
.tm__name { font-weight: 700; font-size: clamp(11px, 1.15vw, 15px); line-height: 1.2; }
.tm__n { font: 600 clamp(10px, .95vw, 13px) var(--mono); opacity: .85; }
.tm__t--sm { padding: 6px 8px; justify-content: flex-end; }
.tm__t--sm .tm__name { display: none; }
.tm__t--sm .tm__n { font-size: 11px; }
@keyframes tile-in { from { opacity: 0; transform: scale(.9); } }
@supports (animation-timeline: view()) {
  .tm__t { animation: tile-in linear both; animation-timeline: view(); animation-range: entry 0% entry 60%; }
}
.tm-bars { display: none; list-style: none; margin: 0; padding: 0; }
.tm-bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.tm-bars li i { grid-column: 1 / -1; height: 8px; width: var(--w); border-radius: 4px; background: var(--teal); }
.tm-bars li b { font: 700 13px var(--mono); }

/* infographic 4: split-flap language board */
.lb { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(28px, 5vw, 64px); align-items: center; }
.home .lb .sec__head { margin-bottom: 0; }
.home .lb__board { padding: clamp(20px, 3vw, 32px); border-radius: 18px; background: #0b1112; border: 1px solid #263132; box-shadow: inset 0 2px 0 rgba(255,255,255,.04); }
.home .lb__line { min-height: 2.4em; display: block; font: 800 clamp(1.5rem, 3vw, 2.3rem)/1.15 var(--font); color: #F1EFEA; letter-spacing: -.02em; }
.home .lb__line .w { display: inline-block; white-space: nowrap; }
.home .lb__line .ch { display: inline-block; animation: flap .32s var(--ease) both; animation-delay: calc(var(--i) * 18ms); }
@keyframes flap { 0% { transform: rotateX(90deg); opacity: 0; } 100% { transform: none; opacity: 1; } }
.home .lb__chips { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.home .lb__chips li { padding: 4px 9px; border-radius: 6px; border: 1px solid #2c3839; font: 700 12px var(--mono); color: #8F9C9A; transition: all .25s; }
.home .lb__chips li.is-on { background: var(--clay); border-color: var(--clay); color: #10191A; }
html[dir="rtl"] .home .lb__line { direction: rtl; }

@media (max-width: 980px) {
  .home .feat-stick { grid-template-columns: minmax(0, 1fr); }
  .home .feat-stick__phone { display: none; }
  .home .lb { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .ex__head { display: none; }
  .ex__row { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px 12px; }
  .ex__lic { grid-column: 1 / -1; }
  .ex__n::before { content: attr(data-k); display: block; font: 600 11px var(--mono); text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); margin-bottom: 2px; }
  .ex__bank { grid-column: 1 / -1; }
  .tm { display: none; }
  .tm-bars { display: block; }
}
@media (max-width: 680px) {
  .home .feat-stick .feat-list { grid-template-columns: minmax(0, 1fr); }
  .home .feat-stick .feat:nth-child(2n) { padding-inline-start: 0; border-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .strip__track { animation: none !important; }
  .strip { overflow-x: auto; }
}

/* ===================================================== content pages (guides, legal, book, 404) */
.doc main { width: 100%; max-width: 820px; margin: 0 auto; padding: clamp(24px, 4vw, 48px) clamp(16px, 4vw, 40px) clamp(56px, 8vw, 96px); }
.doc h1 { font-size: clamp(2.1rem, 5vw, 3.4rem); margin: 6px 0 18px; }
.doc h2 { font-size: clamp(1.45rem, 2.6vw, 1.95rem); margin: 52px 0 14px; scroll-margin-top: 90px; }
.doc h3 { font-size: 1.15rem; margin: 26px 0 8px; letter-spacing: -.01em; }
.doc main p, .doc main li { color: var(--ink-2); }
.doc main p + p { margin-top: 14px; }
.doc main ul, .doc main ol { padding-inline-start: 22px; margin: 12px 0; }
.doc main li { margin: 6px 0; }
.doc main li::marker { color: var(--teal); }
.doc main a { color: var(--teal-2); text-underline-offset: 3px; }
.doc main strong { color: var(--ink); }
.doc .lead { font-size: 1.18rem; color: var(--ink-2); }
.doc .meta { margin: 10px 0 30px; font: 600 13px var(--mono); color: var(--ink-3); }
.doc .toc { margin: 0 0 36px; padding: 18px 22px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); }
.doc .toc strong { display: block; margin-bottom: 8px; font: 700 12.5px var(--mono); letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); }
.doc .toc ol { margin: 0; }
.doc .toc a { color: var(--ink); text-decoration: none; } .doc .toc a:hover { color: var(--teal); }
.doc .note { border-inline-start: 6px solid var(--clay); background: var(--card); padding: 14px 18px; border-radius: 0 10px 10px 0; margin: 18px 0; }
.doc .table-wrap { overflow-x: auto; margin: 18px 0; border: 2px solid var(--ink); border-radius: 12px; }
.doc th { width: 42%; }
.doc .cta { margin: 48px 0; padding: clamp(22px, 4vw, 34px); border-radius: 18px; background: var(--asphalt); color: var(--on-asphalt); text-align: center; }
.doc .cta h2 { margin: 0 0 8px; color: var(--on-asphalt); }
.doc .cta p { margin: 0 0 20px; color: #B9C2C0; }
.btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.btns .btn { padding: 11px 18px; font-size: 15px; box-shadow: 4px 4px 0 var(--clay); }
.btns .btn.web { background: var(--teal); color: #fff; border-color: var(--teal); }
.dark .btns .btn, .doc .cta .btn { border-color: var(--on-asphalt); background: transparent; color: var(--on-asphalt); }
.doc .cta .btn.web { background: var(--teal); border-color: var(--teal); }
.doc .faq details, .faqs details { border-bottom: 1px solid var(--line); }
.doc .faq { border-top: 2px solid var(--ink); margin-top: 40px; }
.doc .faq h2 { margin-top: 24px; }
.doc .faq summary, .faqs summary { list-style: none; position: relative; padding: 18px 40px 18px 0; cursor: pointer; font-weight: 700; color: var(--ink); }
html[dir="rtl"] .doc .faq summary, html[dir="rtl"] .faqs summary { padding: 18px 0 18px 40px; }
.doc .faq summary::-webkit-details-marker, .faqs summary::-webkit-details-marker { display: none; }
.doc .faq summary::after, .faqs summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: 14px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font: 700 18px/1 var(--mono); transition: transform .3s var(--ease), background .3s; }
.doc .faq details[open] summary::after, .faqs details[open] summary::after { transform: rotate(45deg); background: var(--clay); }
.doc .faq details p, .faqs details p { margin: 0 0 18px; }
.doc .sources { margin-top: 40px; font-size: .92rem; }
.doc .sources h2 { font-size: 1.1rem; margin-top: 0; }
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.related a { display: block; padding: 18px 20px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); color: var(--ink) !important; text-decoration: none; font-weight: 800; transition: transform .2s var(--ease), box-shadow .2s var(--ease); }
.related a span { display: block; margin-top: 4px; font-weight: 400; font-size: .92rem; color: var(--ink-2); }
.related a:hover { transform: translate(-3px, -3px); box-shadow: var(--shadow); }
/* free test quiz */
.doc .quiz { counter-reset: q; }
.doc .quiz .q { margin: 0 0 16px; padding: 20px; border: 2px solid var(--ink); border-radius: 14px; background: var(--card); }
.doc .quiz .q h3 { margin: 0 0 14px; font-size: 1.05rem; line-height: 1.45; }
.doc .quiz .q h3::before { counter-increment: q; content: counter(q, decimal-leading-zero) "  "; font: 700 13px var(--mono); color: var(--teal); }
.doc .opt { display: block; width: 100%; margin: 0 0 8px; padding: 11px 14px; border: 2px solid var(--line); border-radius: 10px; background: transparent; color: var(--ink); font: 600 15px var(--font); text-align: start; cursor: pointer; transition: border-color .15s, transform .15s; }
.doc .opt:hover:not([disabled]) { border-color: var(--ink); transform: translateX(3px); }
.doc .opt.ok { border-color: var(--green); background: color-mix(in srgb, var(--green) 14%, transparent); }
.doc .opt.bad { border-color: var(--red); background: color-mix(in srgb, var(--red) 12%, transparent); }
.doc .opt[disabled] { cursor: default; }
.doc .why { margin: 10px 0 0; padding: 12px 14px; border-radius: 10px; background: var(--teal-soft); }
.doc .q:not(.done) .why { display: none; }
.doc .score { position: sticky; bottom: 12px; z-index: 3; text-align: center; padding: 12px; border-radius: 12px; background: var(--ink); color: var(--paper); font: 700 15px var(--mono); }
/* legal & simple pages written by hand: their own markup inside <main> keeps working */
.doc main .container, .doc main .wrapper { max-width: none; padding: 0; }

/* Arabic: Cairo needs normal tracking and a calmer headline size */
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3 { letter-spacing: 0; line-height: 1.25; }
html[dir="rtl"] .home .hero h1 { font-size: clamp(2.2rem, 4.8vw, 4rem); line-height: 1.2; }
html[dir="rtl"] .kicker, html[dir="rtl"] .plate { letter-spacing: 0; }
/* 404 */
.nf main { text-align: center; }
.nf__code { font: 800 clamp(5rem, 18vw, 9rem)/1 var(--mono); color: var(--teal); letter-spacing: -.04em; }
.nf__langs { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; }
.nf__langs a { color: var(--ink-2); text-decoration: none; } .nf__langs a:hover { color: var(--teal); }
/* book pages (hand-written body, own inline CSS): page frame and a dark plate behind the white Amazon logo */
.bookpage main.book { width: 100%; max-width: 1160px; margin: 0 auto; padding: 12px clamp(16px, 4vw, 40px) clamp(56px, 8vw, 96px); }
.bookpage .crumbs { margin: 10px 0 18px; }
.bookpage .amz img { content: url(/img/book/amazon-es-ink.png); }
:root[data-theme="dark"] .bookpage .amz img { content: normal; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .bookpage .amz img { content: normal; } }
/* editions: every edition is available, the per-card label only repeated it */
.bookpage .eds a > span { display: none; }
/* FAQ and closing call to action of the book page */
.bookpage .faq { max-width: 860px; margin-inline: auto; }
.bookpage .faq .head { padding-bottom: 14px; border-bottom: 2px solid var(--ink); }
.bookpage .faq .head { margin-bottom: 4px; max-width: none; width: 100%; }
.bookpage .faq details { border-bottom: 1px solid var(--line); }
.bookpage .faq summary { list-style: none; position: relative; padding: 18px 40px 18px 0; cursor: pointer; font-weight: 700; color: var(--ink); }
html[dir="rtl"] .bookpage .faq summary { padding: 18px 0 18px 40px; }
.bookpage .faq summary::-webkit-details-marker { display: none; }
.bookpage .faq summary::after { content: "+"; position: absolute; inset-inline-end: 0; top: 14px; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 50%; background: var(--teal); color: #fff; font: 700 18px/1 var(--mono); transition: transform .3s var(--ease), background .3s; }
.bookpage .faq details[open] summary::after { transform: rotate(45deg); background: var(--clay); }
.bookpage .faq details p { margin: 0 0 18px; color: var(--ink-2); }
.bookpage .cta { max-width: 860px; margin: clamp(56px, 8vw, 96px) auto 0; padding: clamp(28px, 5vw, 44px); border: 2px solid var(--ink); border-radius: 20px; background: var(--card); text-align: center; display: grid; justify-items: center; gap: 14px; }
.bookpage .cta h2 { margin: 0; font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
.bookpage .cta p { margin: 0; color: var(--ink-2); max-width: 620px; }
.bookpage .cta .stores { display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end; gap: 14px 28px; margin-top: 6px; }
.bookpage .cta small a { color: var(--teal-2); }
.bookpage .disc { max-width: 860px; margin-inline: auto; }

/* Book: "what is inside" and "who it is for" as a ruled spec sheet instead of boxed cards */
.bookpage .grid3, .bookpage .grid2 { gap: 0; border-top: 2px solid var(--ink); counter-reset: spec; }
.bookpage .grid3 .tile, .bookpage .grid2 .tile {
  position: relative; counter-increment: spec; border: 0; border-radius: 0; background: none;
  padding: 28px 28px 34px; border-bottom: 1px solid var(--line); isolation: isolate; overflow: hidden;
}
.bookpage .grid3 .tile:not(:nth-child(3n+1)) { border-inline-start: 1px solid var(--line); }
.bookpage .grid2 .tile:nth-child(2n) { border-inline-start: 1px solid var(--line); }
.bookpage .grid3 .tile::before, .bookpage .grid2 .tile::before {
  content: counter(spec, decimal-leading-zero); display: block; font: 600 .82rem/1 var(--mono);
  letter-spacing: .08em; color: var(--clay); margin-bottom: 26px;
}
.bookpage .grid3 .tile::after, .bookpage .grid2 .tile::after {
  content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--teal) 7%, transparent);
  transform: scaleY(0); transform-origin: bottom; transition: transform .45s var(--ease);
}
.bookpage .grid3 .tile:hover::after, .bookpage .grid2 .tile:hover::after { transform: scaleY(1); }
.bookpage .grid3 .ico {
  position: absolute; top: 20px; inset-inline-end: 24px; width: 46px; height: 46px; border-radius: 50%;
  background: none; border: 1.5px solid color-mix(in srgb, var(--ink) 22%, transparent); color: var(--teal-2);
  transition: transform .45s var(--ease), border-color .3s, background .3s, color .3s;
}
.bookpage .grid3 .tile:hover .ico { transform: rotate(-12deg) scale(1.06); border-color: var(--teal); background: var(--teal); color: #fff; }
.bookpage .grid3 .tile h3, .bookpage .grid2 .tile h3 { margin: 0 0 10px; font-size: 1.22rem; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
.bookpage .grid3 .tile p, .bookpage .grid2 .tile p { color: var(--ink-2); max-width: 38ch; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .bookpage .grid3 .tile, .bookpage .grid2 .tile { animation: spec-in linear both; animation-timeline: view(); animation-range: entry 5% cover 28%; }
    .bookpage .grid3 .tile:nth-child(3n+2), .bookpage .grid2 .tile:nth-child(2n) { animation-range: entry 12% cover 32%; }
    .bookpage .grid3 .tile:nth-child(3n) { animation-range: entry 19% cover 36%; }
  }
}
@keyframes spec-in { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@media (max-width: 900px) {
  .bookpage .grid3 .tile:not(:nth-child(3n+1)) { border-inline-start: 0; }
  .bookpage .grid3 .tile:nth-child(2n) { border-inline-start: 1px solid var(--line); }
}
@media (max-width: 680px) {
  .bookpage .grid3 .tile, .bookpage .grid2 .tile { border-inline-start: 0 !important; padding: 24px 4px 28px; }
  .bookpage .grid3 .ico { inset-inline-end: 4px; }
}

/* Book: sample pages as a cover-flow reel (scroll-driven perspective; controls added by mdt.js) */
.bookpage #samples { counter-reset: page; }
.bookpage .samples {
  --pw: clamp(220px, 27vw, 330px);
  display: flex; gap: clamp(14px, 2.4vw, 30px); overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scrollbar-width: none; padding: 34px calc(50% - var(--pw) / 2) 20px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent);
}
.bookpage .samples::-webkit-scrollbar { display: none; }
.bookpage .samples figure { flex: 0 0 var(--pw); margin: 0; scroll-snap-align: center; counter-increment: page; cursor: pointer; }
.bookpage .samples img {
  border-radius: 4px; background: #fff; transform-origin: center;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--ink) 10%, transparent), 0 30px 60px -22px rgba(16, 25, 26, .55), 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.bookpage .samples figcaption { display: flex; gap: 10px; align-items: baseline; margin-top: 18px; text-align: start; color: var(--ink-2); font-size: .9rem; line-height: 1.45; }
.bookpage .samples figcaption::before { content: counter(page, decimal-leading-zero); font: 600 .78rem/1 var(--mono); letter-spacing: .06em; color: var(--clay); flex: none; }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .bookpage .samples figure { animation: reel-dim linear both; animation-timeline: view(inline); }
    .bookpage .samples img { animation: reel linear both; animation-timeline: view(inline); }
  }
}
@keyframes reel { 0% { transform: perspective(1400px) rotateY(-34deg) scale(.82); } 50% { transform: perspective(1400px) rotateY(0) scale(1); } 100% { transform: perspective(1400px) rotateY(34deg) scale(.82); } }
@keyframes reel-dim { 0%, 100% { opacity: .45; } 35%, 65% { opacity: 1; } }
.bookpage .reel-ctl { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 6px; }
.bookpage .reel-ctl button {
  width: 46px; height: 46px; border-radius: 50%; border: 1.5px solid var(--ink); background: none; color: var(--ink);
  display: grid; place-items: center; cursor: pointer; transition: background .25s, color .25s, transform .25s var(--ease);
}
.bookpage .reel-ctl button:hover { background: var(--ink); color: var(--paper); }
.bookpage .reel-ctl button:active { transform: scale(.94); }
.bookpage .reel-ctl button:disabled { opacity: .3; pointer-events: none; }
/* RTL: the reel and its controls run left-to-right (scroll timelines misplace the focus point in RTL); captions stay RTL */
html[dir="rtl"] .bookpage .samples, html[dir="rtl"] .bookpage .reel-ctl { direction: ltr; }
html[dir="rtl"] .bookpage .samples figure { direction: rtl; }
.bookpage .reel-ctl output { font: 600 .9rem/1 var(--mono); letter-spacing: .08em; color: var(--ink-2); min-width: 7ch; text-align: center; }
.bookpage .reel-ctl output b { color: var(--ink); }
@media (max-width: 680px) { .bookpage .samples { --pw: 68vw; padding-inline: calc(50% - var(--pw) / 2); } }

/* Book: edition switcher as flat pills (no gradient) */
.bookpage .eds { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.bookpage .eds a {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 11px 20px; border-radius: 999px;
  background: none; border: 1.5px solid var(--line); color: var(--ink); font-weight: 700;
  transition: border-color .25s, background .25s, color .25s, padding .3s var(--ease);
}
.bookpage .eds a::after { content: "→"; font: 600 .9rem/1 var(--mono); width: 0; overflow: hidden; opacity: 0; transition: width .3s var(--ease), opacity .25s; }
html[dir="rtl"] .bookpage .eds a::after { content: "←"; }
.bookpage .eds a:hover { border-color: var(--ink); background: none; }
.bookpage .eds a:hover::after { width: 1ch; opacity: 1; }
.bookpage .eds a[aria-current], .bookpage .eds a[aria-current]:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.bookpage .eds a[aria-current]::after { content: none; }

/* Phones: store badges as an even grid (App Store + Mac App Store, then Google Play full width), same frame and height */
@media (max-width: 560px) {
  .badges { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; max-width: 420px; }
  .home .cta .badges { margin-inline: auto; }
  .badge {
    display: flex; align-items: center; justify-content: center; height: 52px; min-width: 0;
    background: #000; border: 1px solid #A6A6A6; border-radius: 11px; overflow: hidden;
  }
  .badge[data-store="android"], .badge:only-child { grid-column: 1 / -1; }
  .badge[data-store="android"] { background: #040707; }
  .badge picture { display: contents; }
  .badge img { width: auto; height: auto; max-width: 100%; max-height: 44px; }
  .badge:hover { transform: none; }
}
