/* XEID prompt library: the idea, three starter instructions, then one field's prompts as a task list beside a reader.
   Visual grammar: charcoal surfaces hold text to copy; outlined panels hold example AI output; plain text explains. */
:root {
  color-scheme: dark;
  --blue: rgb(98,172,255);
  --magenta: rgb(255,92,190);
  --bg: #000;
  --page-font: Outfit, "SF Pro Display", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text: #f4f4f4;
  --text-2: #c6c6c6;
  --text-3: #8c8c8c;
  --line: rgba(255,255,255,.12);
  --line-2: rgba(255,255,255,.22);
  --surface: #181818;
  --wrap: 1120px;
  --band-top: calc(84px + env(safe-area-inset-top));
}
* { box-sizing: border-box; }
html { scroll-behavior: auto; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 300 17px/1.6 var(--page-font); -webkit-font-smoothing: antialiased; overflow-wrap: break-word; }
h1,h2,h3,h4,h5,p,pre,ol,ul,figure { margin: 0; }
h1,h2,h3,h4,h5 { font-weight: 300; }
ul,ol { padding: 0; list-style: none; }
a { color: inherit; text-underline-offset: .24em; text-decoration-thickness: 1px; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent; }
strong { font-weight: 400; }
[hidden] { display: none !important; }
::selection { background: #3d3d3d; color: #fff; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
/* Headings and sections focused by navigation are not controls; they need no focus ring. */
[tabindex="-1"]:focus { outline: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.skip { position: fixed; top: 12px; left: 50%; transform: translate(-50%,-180%); z-index: 100; padding: 12px 20px; border-radius: 999px; background: #fff; color: #000; text-decoration: none; }
.skip:focus { transform: translate(-50%,0); }
/* Only positioning is local; the shared XEID control appearance stays in its shared stylesheet. */
.home-link { position: fixed; top: calc(1rem + env(safe-area-inset-top)); left: calc(1rem + env(safe-area-inset-left)); z-index: 30; line-height: normal; }
.contact-link { position: fixed; right: calc(1.25rem + env(safe-area-inset-right)); bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 30; line-height: normal; }

.page { width: min(var(--wrap), calc(100% - 96px)); margin-inline: auto; padding: 136px 0 168px; }

/* ---------- Start with the headline and categories; guidance is available on request ---------- */
.intro h1 { max-width: 22ch; font-size: clamp(40px, 3.4vw + 12px, 60px); line-height: 1.05; letter-spacing: -.032em; text-wrap: balance; }
.language-picker { position: relative; z-index: 27; width: fit-content; margin: 0 0 24px auto; font-size: 14px; line-height: 1.5; }
.language-picker summary { display: flex; align-items: center; gap: 10px; min-height: 44px; color: var(--blue); cursor: pointer; list-style: none; }
.language-picker summary::-webkit-details-marker { display: none; }
.language-picker summary .icon--chevron { color: var(--text-3); }
.language-picker[open] summary .icon--chevron { transform: rotate(180deg); }
.language-picker summary:focus-visible { outline: none; text-decoration: underline 2px var(--blue); text-underline-offset: 6px; }
.language-nav { position: absolute; top: calc(100% + 6px); right: 0; width: 180px; max-width: calc(100vw - 48px); max-height: min(320px, 50dvh); overflow-y: auto; padding: 8px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--surface); box-shadow: 0 12px 36px rgba(0,0,0,.4); }
.language-nav a { display: flex; align-items: center; min-height: 44px; padding: 8px 12px; color: var(--text-2); font-size: 14px; line-height: 1.5; text-decoration: none; white-space: nowrap; }
.language-nav a[aria-current] { color: var(--blue); }
.language-nav a:hover { color: var(--text); }
.language-nav a:focus-visible { outline: none; text-decoration: underline 2px var(--blue); text-underline-offset: 6px; }
.language-picker [lang="ar"] { font-family: "Noto Sans Arabic", Tahoma, sans-serif; }
.language-picker [lang="zh-Hans"] { font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
.howto-guide { margin-top: 12px; }
.howto-guide summary { display: flex; align-items: center; gap: 8px; width: fit-content; padding: 8px 0; font-size: 14px; color: var(--text-2); cursor: pointer; list-style: none; }
.howto-guide summary::-webkit-details-marker { display: none; }
.howto-guide summary:focus-visible { outline: none; text-decoration: underline 2px var(--blue); text-underline-offset: 6px; }
.howto-guide[open] summary .icon--chevron { transform: rotate(180deg); }
.howto-guide .howto { margin-top: 16px; margin-bottom: 36px; max-width: 100%; }
.howto__lead { max-width: 60em; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.howto__lead + .howto__lead { margin-top: 12px; }

.howto__label { font-size: 13px; line-height: 1.4; color: var(--text-3); }
.howto__list { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 48px; }
.howto__step { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 16px; align-items: start; }
.howto__title { padding-top: 3px; font-size: 18px; line-height: 1.35; color: var(--text); }
.howto__text { margin-top: 4px; font-size: 15.5px; line-height: 1.6; color: var(--text-2); }
.howto__text .ph { font-size: 14px; }

/* ---------- Section heads ---------- */
.section-head h2 { font-size: 32px; line-height: 1.15; letter-spacing: -.022em; }
.section-head p { margin-top: 12px; max-width: 40em; font-size: 17px; line-height: 1.6; color: var(--text-2); }

/* ---------- Library ---------- */
.library { margin-top: 32px; scroll-margin-top: 24px; }
.profession-nav { margin-top: 0; }
.studio { margin-top: 48px; display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 80px; align-items: start; }
.js .profession:not(.is-active), .js .lesson:not(.is-active) { display: none; }
.profession.is-entering, .lesson.is-entering { animation: enter 240ms ease-out; }
@keyframes enter { from { opacity: .35; } to { opacity: 1; } }

/* Task list: a sticky column on wide screens, a picker on narrow ones. */
.rail { position: sticky; top: 96px; }
/* Keep every task reachable above the fixed bottom controls in short desktop windows. */
@media (min-width: 1000px) {
  .js .rail {
    max-height: calc(100vh - 192px);
    max-height: calc(100dvh - 192px);
    overflow-y: auto;
    overscroll-behavior-y: contain;
  }
}
.picker { display: none; }
.rail__title { display: flex; flex-direction: column; gap: 2px; padding: 0 14px 16px; font-size: 15px; line-height: 1.4; color: var(--text); }
.rail__title span { font-size: 13px; color: var(--text-3); }
.rail__list { display: grid; gap: 2px; }
.rail__list a { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 6px; min-height: 44px; padding: 10px 14px; border-radius: 12px; text-decoration: none; font-size: 15px; line-height: 1.4; color: var(--text-3); transition: color .15s ease; }
.rail__num { padding-top: 2px; font-size: 12px; line-height: 1.6; color: #7d7d7d; font-variant-numeric: tabular-nums; }
.rail__list a:hover { color: #e6e6e6; }
.rail__list a[aria-current], .rail__list a[aria-current] .rail__num { color: var(--blue); }
/* Text links show keyboard focus as a blue underline, never a box: a ring would be cut off where lists scroll. */
.rail__list a:focus-visible { outline: none; }
.rail__list a:focus-visible .rail__label { text-decoration: underline 2px var(--blue); text-underline-offset: 5px; }

/* ---------- Lesson ---------- */
.lessons, .lesson { min-width: 0; }
.lesson { scroll-margin-top: 96px; }
.lesson__kicker { font-size: 13px; line-height: 1.5; color: var(--text-3); }
.lesson__title { margin-top: 12px; max-width: 21ch; font-size: clamp(30px, 1.6vw + 16px, 40px); line-height: 1.12; letter-spacing: -.024em; text-wrap: balance; }
.lesson__title:focus:not(:focus-visible) { outline: 0; }
.lesson__problem { margin-top: 20px; max-width: 34em; font-size: 18px; line-height: 1.55; color: var(--text-2); }
.lesson__problem-label { display: block; margin-bottom: 4px; font-size: 13px; color: var(--text-3); }

.step { margin-top: 64px; }
.step__title { display: flex; align-items: center; gap: 14px; font-size: 22px; line-height: 1.3; letter-spacing: -.012em; color: var(--text); }
.step__heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; }
.copy.motion-toggle { display: none; }
.js.speaker-motion-available .motion-toggle { display: inline-flex; }
.step__num { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid var(--line-2); border-radius: 50%; font-size: 13px; font-weight: 400; letter-spacing: 0; color: var(--text-2); }
.step__lead { margin-top: 12px; max-width: 40em; font-size: 16px; line-height: 1.6; color: var(--text-2); }

.need { margin-top: 18px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.need__label { margin-inline-end: 6px; font-size: 14px; color: var(--text-3); }
.need__list { display: contents; }
.need__list li { padding: 3px 8px; border-radius: 6px; background: #2c2c2c; font-size: 14px; line-height: 1.45; color: #fff; }
.need--request .need__list li { padding: 0; background: none; border-radius: 0; color: var(--text-2); }
.need--request .need__list li::before, .need--request .need__list li::after { content: none; }
.need--request .need__list li + li::before { content: ' · '; }
.fragment-alias { display: block; height: 0; }
.need__list li::before { content: '['; }
.need__list li::after { content: ']'; }
.caution { margin-top: 12px; max-width: 46em; font-size: 13.5px; line-height: 1.55; color: var(--text-3); }
.caution--strong { margin-top: 6px; color: var(--text-2); }

/* Copyable text always sits on the charcoal surface; nothing else does. */
.surface { margin-top: 20px; background: var(--surface); border-radius: 20px; }
.surface__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 14px 0 28px; }
.surface__label { font-size: 13px; line-height: 1.4; color: var(--text-3); }
.surface__label .ph { font-size: 12px; }
.prompt { display: block; margin: 0; padding: 18px 28px 30px; white-space: pre-wrap; font: 300 16.5px/1.72 var(--page-font); color: var(--text); overflow-wrap: break-word; tab-size: 2; }
.prompt:focus-visible { outline-offset: -2px; border-radius: 0 0 20px 20px; }
.prompt__label { font-size: 12px; letter-spacing: .14em; font-weight: 400; color: #9b9b9b; }
.ph { color: #fff; background: #2c2c2c; border-radius: 6px; padding: 1px 6px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

.copy-action { position: relative; flex: none; display: inline-flex; }
.copy { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 8px 16px; border: 1px solid var(--line-2); border-radius: 999px; font-size: 13px; line-height: 1; color: #ededed; white-space: nowrap; transition: border-color .2s ease; }
.copy:hover { border-color: rgba(255,255,255,.55); }
.copy.is-done { border-color: #ededed; }
.copy__status { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; }
.icon { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }

/* "See it work": each example is a chat thread. The reader's messages are filled and sit to the right;
   the AI's replies are outlined. "With this prompt" comes first; where a real plain reply was recorded,
   "Without this prompt" follows as a separate, subdued thread. */
.example { margin-top: 24px; }
.thread + .thread { margin-top: 48px; }
.thread__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 16px; margin-bottom: 16px; }
.thread__title { font-size: 17px; line-height: 1.35; font-weight: 400; color: var(--text); }
.thread--without .thread__title { color: var(--text-2); }
.thread__meta { font-size: 13px; line-height: 1.4; color: var(--text-3); }
.thread__disclosure { margin-bottom: 16px; max-width: 46em; font-size: 14px; line-height: 1.55; color: var(--text-2); }
.exchange { display: grid; gap: 16px; }
.turn__panel { position: relative; padding: 22px 28px 26px; border: 1px solid var(--line-2); border-radius: 20px; background: rgba(255,255,255,.018); }
.turn--user .turn__panel { margin-inline-start: min(16%, 104px); border-color: transparent; background: #141414; }
.turn--plain .turn__panel { border-color: var(--line); background: none; }
.turn__head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-bottom: 12px; }
.turn__who { display: inline-flex; align-items: center; gap: 8px; flex: none; font-size: 16px; line-height: 1.35; letter-spacing: .02em; font-weight: 400; color: var(--text); white-space: nowrap; }
/* The owner's colours for who is speaking: the reader in XEID blue, the AI in XEID magenta. */
.turn--user .turn__who { color: var(--blue); }
.turn--ai .turn__who { color: var(--magenta); }
/* Role identity stays legible even when paused. Only the symbol's internal shape moves. */
.role-symbol { display: block; flex: none; width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.45; stroke-linecap: round; stroke-linejoin: round; overflow: visible; }
.role-symbol path { vector-effect: non-scaling-stroke; }
.role-symbol__shoulders { transform-origin: 12px 20px; }
.role-symbol__spark { transform-origin: 12px 12px; }
.js.speaker-motion-available .role-symbol__motion { animation: role-person-breathe 6.4s ease-in-out infinite; animation-play-state: paused; }
.js.speaker-motion-available .role-symbol__spark { animation-name: role-ai-breathe; animation-duration: 7.2s; }
.js.speaker-motion-available .turn__who.is-speaker-visible .role-symbol__motion { animation-play-state: running; }
.js.speaker-motion-available.speaker-motion-paused .turn__who .role-symbol__motion,
.js .example.is-armed .thread--with .turn:not(.is-in) .role-symbol__motion { animation-play-state: paused; }
@keyframes role-person-breathe {
  0%, 100% { transform: translateY(.35px) scaleX(.97); }
  50% { transform: translateY(-.65px) scaleX(1.03); }
}
@keyframes role-ai-breathe {
  0%, 100% { transform: scale(.92, 1.06); }
  50% { transform: scale(1.08, .94); }
}
.turn__what { font-size: 13px; color: var(--text-3); }
.turn__text { font-size: 16px; line-height: 1.65; color: #e6e6e6; }
.turn--plain .turn__text { color: #9d9d9d; }
.turn__text > * + * { margin-top: 14px; }
.turn__subhead { font-size: 14px; font-weight: 400; color: var(--text); }
.turn__subhead + * { margin-top: 6px; }
.turn__text strong { color: #fff; }
.turn__text ul, .turn__text ol { padding-inline-start: 22px; list-style: disc; }
.turn__text ol { list-style: decimal; }
.turn__text li { padding-inline-start: 4px; }
.turn__text li + li { margin-top: 6px; }
.turn__note { margin: 12px 0 0; margin-inline-start: 28px; max-width: 40em; font-size: 15px; line-height: 1.6; color: var(--text-2); }
.turn__note > p + p { margin-top: 10px; }
.turn--user .turn__note { margin-inline-start: calc(min(16%, 104px) + 28px); }
.turn__note-label { display: block; margin-bottom: 2px; font-size: 13px; color: var(--text); }
.turn__cause { color: var(--text); }
.hl { color: #fff; background: linear-gradient(#363636, #363636) no-repeat; background-size: 100% 100%; border-radius: 4px; padding: 1px 3px; margin: 0 -3px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
/* ---------- Motion that teaches ----------
   An element is only hidden while "armed", which JavaScript does only when motion is allowed and the element
   will play. Without JavaScript, with reduced motion or with ?motion=off, everything is visible from the start. */
.js .example.is-armed .thread--with .turn { opacity: 0; transform: translateY(10px); }
.js .example .thread--with .turn { transition: opacity .45s ease, transform .45s cubic-bezier(.2,.7,.2,1); }
.js .example.is-armed .thread--with .turn.is-in { opacity: 1; transform: none; }
.js .example.is-armed .thread--with .turn__note { opacity: 0; transition: opacity .4s ease; }
.js .example.is-armed .thread--with .turn.is-noted .turn__note { opacity: 1; }
.js .example.is-armed .thread--with .hl { background-size: 0 100%; }
.js .example .hl { transition: background-size .8s cubic-bezier(.2,.7,.2,1); }
.js .example.is-armed .thread--with .turn.is-lit .hl { background-size: 100% 100%; }
/* While the AI "writes", its text waits behind a quiet typing indicator. */
.js .example.is-armed .turn.is-typing .turn__text { opacity: 0; }
.js .turn__text { transition: opacity .3s ease; }
.js .example.is-armed .turn.is-typing .turn__panel::after { content: ''; position: absolute; inset-inline-start: 28px; top: 58px; width: 45px; height: 8px;
  background: radial-gradient(circle 3px at 4px 4px, #bdbdbd 98%, transparent) 0 0 / 15px 8px repeat-x; animation: typing 1.2s steps(4, jump-none) infinite; }
@keyframes typing { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }

.table { overflow-x: auto; padding-inline: 3px; margin-inline: -3px; }
.table table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.55; }
.table th { padding: 0 16px 10px 0; border-bottom: 1px solid var(--line); text-align: start; vertical-align: bottom; font-size: 12px; letter-spacing: .04em; font-weight: 400; color: var(--text-3); }
.table td { padding: 12px 16px 12px 0; border-bottom: 1px solid rgba(255,255,255,.06); vertical-align: top; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table tr:last-child td { border-bottom: 0; }
.cell-label { display: none; }

/* The lesson's key instruction is marked in the prompt and lights up when its result is shown. */
mark.move-clause { color: inherit; background: none; text-decoration: underline dotted rgba(255,255,255,.5); text-decoration-thickness: 1px; text-underline-offset: .3em; border-radius: 4px; transition: background-color .5s ease; }
mark.move-clause.is-lit { background: #353535; }
/* Each "You'll need" item lights up the bracket where it goes. */
.need__list li { transition: background-color .25s ease, box-shadow .25s ease; }
.need__list li.is-linked { background: #474747; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.ph { transition: background-color .25s ease, box-shadow .25s ease; }
.ph.is-linked { background: #474747; box-shadow: 0 0 0 1px rgba(255,255,255,.35); }

.why { margin-top: 28px; max-width: 40em; }
.why__title { font-size: 15px; font-weight: 400; color: var(--text); }
.why p { margin-top: 6px; font-size: 17px; line-height: 1.65; color: var(--text-2); }

.checks { margin-top: 18px; display: grid; gap: 14px; max-width: 42em; }
.checks li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 12px; font-size: 16.5px; line-height: 1.55; color: var(--text-2); }
.icon--check { width: 20px; height: 20px; margin-top: 2px; stroke: #8a8a8a; }

.lesson__foot { margin-top: 72px; }
.sources { font-size: 13px; line-height: 1.75; color: var(--text-3); }
.sources__label { display: block; margin-bottom: 2px; color: var(--text-2); }
.sources a:hover { color: var(--text); }
.sources a:focus-visible { outline: none; color: var(--text); text-decoration: underline 2px var(--blue); }
.pager { margin-top: 44px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px; }
/* Typographic links, not cards: the direction, then the lesson's title, with an arrow that leads the way. */
.pager__link { display: grid; gap: 8px; align-content: start; padding: 6px 0; text-decoration: none; }
.pager__link--prev { grid-column: 1; justify-items: start; }
.pager__link--next { grid-column: 2; justify-items: end; text-align: end; }
.pager__dir { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; line-height: 1.4; color: var(--text-3); transition: color .2s ease; }
.pager__title { max-width: 20em; font-size: 19px; line-height: 1.35; letter-spacing: -.01em; color: var(--text-2); text-wrap: balance; transition: color .2s ease; }
.pager__link:hover .pager__title, .pager__link:focus-visible .pager__title { color: var(--text); }
.pager__link:focus-visible { outline: none; }
.pager__link:focus-visible .pager__title { text-decoration: underline 2px var(--blue); text-underline-offset: 6px; }
.pager__link:hover .pager__dir, .pager__link:focus-visible .pager__dir { color: var(--text-2); }
.icon--arrow { width: 16px; height: 16px; transition: transform .2s ease; }
.pager__link--prev:hover .icon--arrow { transform: translateX(-3px); }
.pager__link--next:hover .icon--arrow { transform: translateX(3px); }

/* Footer notes stay on the reading grid; the approved logo anchors the lower-left corner. */
.foot { margin-top: 152px; display: grid; grid-template-columns: 264px minmax(0, 1fr); column-gap: 80px; align-items: start; }
.foot__notes { grid-column: 2; grid-row: 1; max-width: 46em; font-size: 15px; line-height: 1.7; color: var(--text-3); }
.foot__title { margin-bottom: 12px; font-size: 17px; line-height: 1.4; font-weight: 400; color: var(--text-2); }
.foot__notes p + p { margin-top: 8px; }
.foot__brand { position: fixed; left: calc(1.25rem + env(safe-area-inset-left)); bottom: calc(1.25rem + env(safe-area-inset-bottom)); z-index: 30; width: max-content; }
/* The approved homepage lockup (index.html): its locked geometry, at the size the Connect page uses. */
.lockup { font-family: Outfit, "SF Pro Display", -apple-system, sans-serif; display: flex; flex-direction: column; align-items: center; font-size: 26px; line-height: 1; -webkit-font-smoothing: antialiased; }
.lockup__mark { display: block; height: 3.04em; width: auto; margin-bottom: -.305em; }
.lockup__name { position: relative; margin: 0; font-size: 1em; font-weight: 300; letter-spacing: -.03em; line-height: 1.05; color: #8e8e8e; }
.lockup__reg { position: absolute; left: 100%; top: 0; font-size: .38em; letter-spacing: 0; margin-left: .12em; }
.lockup__tagline { margin: .67em 0 0; font-size: .45em; font-weight: 300; letter-spacing: .01em; line-height: 1; color: rgb(242,246,255); }

.copy-dialog { position: fixed; inset: 0; margin: auto; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow: auto; padding: 24px; background: #181818; color: #fff; border: 1px solid #555; border-radius: 20px; }
.copy-dialog::backdrop { background: rgba(0,0,0,.8); }
.copy-dialog h2 { font-size: 24px; }
.copy-dialog > p { margin-top: 8px; font-size: 16px; color: var(--text-2); }
.copy-dialog textarea { display: block; width: 100%; margin: 16px 0; padding: 14px; font: 300 16px/1.6 var(--page-font); color: #fff; background: #000; border: 1px solid #777; border-radius: 10px; resize: vertical; }
.dialog-close { min-height: 44px; padding: 9px 20px; border: 1px solid #777; border-radius: 999px; font-size: 14px; }
.no-script-note { margin-top: 24px; color: var(--text-2); }

/* Without JavaScript every field and prompt stays in the document flow. */
html:not(.js) .copy { display: none; }
html:not(.js) .profession + .profession { margin-top: 96px; }
html:not(.js) .profession__title { position: static; width: auto; height: auto; margin: 0 0 24px; clip: auto; white-space: normal; font-size: 28px; }
html:not(.js) .lesson + .lesson { margin-top: 96px; }
html:not(.js) .rail { position: static; }

/* Fixed navigation and logo need clear space on screens without side margins. */
@media (max-width: 1359px) {
  body::before, body::after { content: ''; position: fixed; left: 0; right: 0; z-index: 25; pointer-events: none; }
  body::before { top: 0; height: var(--band-top); background: linear-gradient(#000 62%, rgba(0,0,0,0)); }
  body::after { bottom: 0; height: calc(168px + env(safe-area-inset-bottom)); background: linear-gradient(rgba(0,0,0,0), #000 24px); }
}

@media (min-width: 1000px) and (max-width: 1359px) {
  .js .rail { max-height: calc(100dvh - 264px - env(safe-area-inset-bottom)); }
}

@media (max-width: 1180px) {
  .studio { grid-template-columns: 240px minmax(0, 1fr); gap: 56px; }
  .foot { grid-template-columns: 240px minmax(0, 1fr); column-gap: 56px; }
}

@media (max-width: 999px) {
  .page { width: min(720px, calc(100% - 48px)); padding-top: 112px; }
  .studio { display: block; margin-top: 32px; }
  .foot { display: flex; flex-direction: column; gap: 48px; margin-top: 112px; }
  .rail { position: sticky; top: calc(66px + env(safe-area-inset-top)); z-index: 26; margin-bottom: 40px; }
  .js .picker { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 58px; padding: 10px 14px 10px 20px; border: 1px solid var(--line-2); border-radius: 20px; background: #0c0c0c; text-align: start; }
  .picker__pos { flex: none; font-size: 12px; color: var(--text-3); white-space: nowrap; }
  .picker__title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; color: var(--blue); }
  .icon--chevron { width: 20px; height: 20px; stroke: var(--text-2); transition: transform .2s ease; }
  .picker[aria-expanded="true"] .icon--chevron { transform: rotate(180deg); }
  .js .rail:not(.is-open) .rail__nav { display: none; }
  .js .rail.is-open .rail__nav { position: absolute; left: 0; right: 0; top: calc(100% + 8px); max-height: calc(100dvh - 310px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); overflow: auto; padding: 8px; border: 1px solid var(--line-2); border-radius: 20px; background: #0c0c0c; box-shadow: 0 24px 64px rgba(0,0,0,.7); }
  .js .rail__title { display: none; }
  .rail__list a { padding: 12px 14px; font-size: 16px; }
  .lesson { scroll-margin-top: 150px; }
  .lesson__kicker { display: none; }
}

@media (max-width: 540px) {
  .page { width: calc(100% - 40px); padding-top: 104px; padding-bottom: calc(168px + env(safe-area-inset-bottom)); }
  .intro h1 { font-size: 38px; line-height: 1.08; }
  .howto__list { margin-top: 16px; grid-template-columns: minmax(0, 1fr); gap: 22px; }
  .howto__step { grid-template-columns: 28px minmax(0, 1fr); gap: 14px; }
  .howto__title { padding-top: 2px; font-size: 17px; }
  .js .example.is-armed .turn.is-typing .turn__panel::after { inset-inline-start: 18px; top: 52px; }
  .section-head h2 { font-size: 27px; }
  .section-head p { font-size: 16px; }
  .library { margin-top: 24px; }
  .lesson__title { font-size: 29px; }
  .lesson__problem { font-size: 17px; }
  .step { margin-top: 52px; }
  .step__title { font-size: 20px; gap: 12px; }
  .step__num { width: 28px; height: 28px; font-size: 12px; }
  .surface { border-radius: 18px; }
  .surface__bar { flex-wrap: wrap; padding: 12px 12px 0 20px; }
  .surface__label { flex: 1 1 140px; }
  .prompt { padding: 16px 20px 24px; font-size: 16px; line-height: 1.68; }
  .thread + .thread { margin-top: 40px; }
  .turn__panel { padding: 18px 18px 20px; border-radius: 18px; }
  .turn--user .turn__panel { margin-inline-start: 28px; }
  .turn__note { margin-inline-start: 18px; }
  .turn--user .turn__note { margin-inline-start: 46px; }
  .table table, .table tbody, .table tr, .table td { display: block; }
  .table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .table tr + tr { margin-top: 16px; }
  .table td { padding: 4px 0; border: 0; }
  .table tr { padding-bottom: 14px; border-bottom: 1px solid rgba(255,255,255,.06); }
  .table tr:last-child { padding-bottom: 0; border-bottom: 0; }
  .cell-label { display: block; font-size: 12px; letter-spacing: .04em; color: var(--text-3); }
  .why p { font-size: 16.5px; }
  .checks li { font-size: 16px; }
  .pager { grid-template-columns: minmax(0, 1fr); gap: 28px; margin-top: 36px; }
  .pager__link--next { grid-column: 1; justify-items: start; text-align: start; }
  .pager__title { font-size: 18px; }
  .foot { margin-top: 96px; gap: 40px; }
  .lockup { font-size: 24px; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
html.no-motion *, html.no-motion *::before, html.no-motion *::after { animation: none !important; transition: none !important; }
@media print {
  .example .turn, .turn__note, .turn__text { opacity: 1 !important; transform: none !important; }
  .role-symbol__motion { animation: none !important; transform: none !important; }
  .motion-toggle { display: none !important; }
  .language-picker { display: none !important; }
  .hl { background-size: 100% 100% !important; }
}

/* Locale support keeps the same surfaces, colours and spacing. Directional reading
   components mirror in Arabic; the approved fixed XEID navigation and logo do not. */
html[lang="ar"] { --page-font: "Noto Sans Arabic", "Geeza Pro", Tahoma, sans-serif; }
html[lang="zh-Hans"] { --page-font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif; }
html[lang="ar"] :is(.intro h1, .lesson__title, .step__title, .pager__title) { letter-spacing: 0; line-height: 1.45; }
html[lang="ar"] :is(.prompt__label, .turn__who, .cell-label, .table th, .home-link, .contact-link) { letter-spacing: 0; }
html[lang="ar"] :is(.home-link, .contact-link, .copy) { line-height: 1.5; }
html[lang="ar"] :is(.prompt, .turn__text, .turn__note, .checks, .foot__notes) { line-height: 1.85; }
html[lang="ar"] .prompt__label { font-size: 14px; }
html[lang="zh-Hans"] :is(.intro h1, .lesson__title) { line-height: 1.35; letter-spacing: 0; }
html[lang="zh-Hans"] .headline-word { display: inline-block; }
html[lang="zh-Hans"] .prompt__label { letter-spacing: .02em; font-size: 13px; }
html[dir="rtl"] .pager .icon--arrow { scale: -1 1; }
html[dir="rtl"] .table :is(th, td) { padding-inline-start: 0; padding-inline-end: 16px; }
html[dir="rtl"] .table :is(th, td):last-child { padding-inline-end: 0; }
@media (max-width: 540px) {
  html[dir="rtl"] .table :is(th, td) { padding-inline: 0; }
}

@media print {
  body { background: #fff; color: #111; }
  body::before, body::after, .home-link, .contact-link, .profession-nav, .rail, .copy, .pager, .skip { display: none !important; }
  .page { width: auto; padding: 0; }
  .foot__brand { position: static; grid-column: 1; grid-row: 1; justify-self: start; margin-top: 24px; }
  .studio { display: block; }
  .js .profession, .js .lesson { display: block !important; }
  .lesson { margin-bottom: 48px; }
  .surface { background: #eee; break-inside: avoid; }
  .prompt, .lesson__problem, .why p, .turn__text, .turn__note, .checks li, .foot, .section-head p, .intro__lead, .howto__text, .starter__effect, .foot__notes { color: #111; }
  .turn__panel { border-color: #bbb; background: none; }
  a { color: #111; }
}
