/* Clacket. Identity follows BassamAI Lab: paper, ink, teal, coral. */
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url(../assets/fonts/tajawal-arabic-400-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url(../assets/fonts/tajawal-arabic-500-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url(../assets/fonts/tajawal-arabic-700-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url(../assets/fonts/tajawal-arabic-800-normal.woff2) format('woff2'); unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC; }
@font-face { font-family: 'Tajawal'; font-weight: 400; font-display: swap; src: url(../assets/fonts/tajawal-latin-400-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200F, U+2012-204E, U+2050-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 500; font-display: swap; src: url(../assets/fonts/tajawal-latin-500-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200F, U+2012-204E, U+2050-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 700; font-display: swap; src: url(../assets/fonts/tajawal-latin-700-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200F, U+2012-204E, U+2050-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Tajawal'; font-weight: 800; font-display: swap; src: url(../assets/fonts/tajawal-latin-800-normal.woff2) format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-200B, U+200F, U+2012-204E, U+2050-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  --paper: #f7f7f2; --paper-2: #efefe7; --white: #fffefa;
  --ink: #163b39; --muted: #566b68; --line: #dce2d9;
  --teal: #0d827a; --teal-dark: #105b57; --teal-pale: #dcece6;
  --coral: #eea17d; --yellow: #f0cf76; --danger: #a3341f;
  --hall: #0c2624; --hall-2: #123532; --screen: #e9f1ec; --lamp: #f0cf76;
  --radius: 24px; --r-sm: 14px;
  --shadow: 0 24px 60px rgba(22, 59, 57, .09);
  --content: 880px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 17px/1.8 "Tajawal", "Noto Sans Arabic", Tahoma, sans-serif; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
a:hover { color: var(--teal); }
h1, h2, h3, h4 { line-height: 1.35; margin: 0; }
.wrap { width: min(100% - 32px, var(--content)); margin-inline: auto; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: 10px; z-index: 20; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--teal); outline-offset: 3px; border-radius: 6px; }

.top { position: sticky; top: 0; z-index: 10; background: var(--hall); color: var(--screen); }
.top .brand, .top .nav a { color: var(--screen); }
.top .brand-mark { color: var(--lamp); }
.top .nav a:hover { background: rgba(233, 241, 236, .12); color: var(--screen); }
.top-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 62px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.brand-mark { width: 30px; height: 30px; color: var(--ink); }
.brand-name { font-weight: 800; font-size: 22px; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.nav a { text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 500; font-size: 15px; }
.nav a:hover { background: var(--teal-pale); }

.maker { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px 18px; margin-top: 26px; overflow: hidden; }
@media (min-width: 640px) { .maker { padding: 30px 34px; } }

.steps { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding: 0; margin: 0 0 24px; }
.steps li { display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 14px; font-weight: 500; color: var(--muted); padding: 8px 2px; border-bottom: 3px solid var(--line); text-align: center; }
.steps li span { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); font-weight: 700; }
.steps li.done { cursor: pointer; color: var(--teal-dark); border-color: var(--teal-pale); }
.steps li.done span { background: var(--teal-pale); }
.steps li.on { color: var(--ink); border-color: var(--teal); font-weight: 700; }
.steps li.on span { background: var(--teal); color: var(--white); }
@media (min-width: 640px) { .steps li { flex-direction: row; justify-content: center; gap: 10px; font-size: 16px; } }

fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
legend, .legend { font-size: 24px; font-weight: 800; padding: 0; margin-bottom: 16px; }
.field { display: block; margin: 0 0 22px; }
.lab { display: block; font-weight: 700; margin-bottom: 8px; }
.lab em { font-style: normal; font-weight: 400; color: var(--muted); font-size: 14px; margin-inline-start: 6px; }
.hint { color: var(--muted); font-size: 15px; margin: 0 0 12px; }
.row { display: grid; gap: 0 20px; }
@media (min-width: 640px) { .row { grid-template-columns: 1fr 1.300fr; } }

input[type=text], input[type=number], textarea { width: 100%; font: inherit; color: inherit; background: var(--paper); border: 1.500px solid var(--line); border-radius: var(--r-sm); padding: 12px 14px; min-height: 50px; }
input:focus, textarea:focus { outline: none; border-color: var(--teal); box-shadow: 0 0 0 3px var(--teal-pale); }
input::placeholder { color: #8a9a97; }
textarea { line-height: 1.700; resize: vertical; font-size: 15px; }
.err { color: var(--danger); font-size: 15px; font-weight: 500; display: block; margin-top: 6px; }
input.bad { border-color: var(--danger); }
#f-clicker-model { margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label, .cards label { position: relative; cursor: pointer; }
.chips input, .cards input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.chips span { display: inline-flex; align-items: center; min-height: 46px; padding: 6px 18px; border: 1.500px solid var(--line); border-radius: 999px; background: var(--paper); font-weight: 500; }
.chips input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.chips input:focus-visible + span, .cards input:focus-visible + span { outline: 3px solid var(--teal); outline-offset: 2px; }
.cards { display: grid; gap: 10px; }
@media (min-width: 640px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.cards span { display: flex; flex-direction: column; justify-content: center; gap: 2px; height: 100%; min-height: 64px; padding: 12px 16px; border: 1.500px solid var(--line); border-radius: var(--r-sm); background: var(--paper); }
.cards b { font-weight: 700; }
.cards i { font-style: normal; font-size: 14px; color: var(--muted); line-height: 1.500; }
.cards input:checked + span { border-color: var(--teal); background: var(--teal-pale); box-shadow: inset 0 0 0 1.500px var(--teal); }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 22px; height: 22px; margin-top: 5px; accent-color: var(--teal); flex: none; }

.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 26px 16px; border: 2px dashed #b9c8c2; border-radius: var(--radius); background: var(--paper); cursor: pointer; position: relative; margin-bottom: 10px; }
.drop input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.drop svg { width: 42px; height: 42px; color: var(--teal); }
.drop i { font-style: normal; color: var(--muted); font-size: 14px; }
.drop.over, .drop:focus-within { border-color: var(--teal); background: var(--teal-pale); }
.status { font-size: 15px; margin: 0 0 14px; min-height: 0; }
.status .ok { background: var(--teal-pale); border-radius: var(--r-sm); padding: 10px 14px; display: block; }
.status .warn { background: #fbf1d9; border-radius: var(--r-sm); padding: 10px 14px; display: block; margin-top: 8px; }
.status .bad { background: #f8e3dc; color: var(--danger); border-radius: var(--r-sm); padding: 10px 14px; display: block; }

.btn { font: inherit; font-weight: 700; min-height: 50px; padding: 10px 24px; border-radius: 999px; border: 1.500px solid var(--ink); background: var(--white); color: var(--ink); cursor: pointer; }
.btn:hover { background: var(--paper-2); }
.btn.primary { background: var(--teal); border-color: var(--teal); color: var(--white); }
.btn.primary:hover { background: var(--teal-dark); border-color: var(--teal-dark); }
.btn.ghost { border-color: var(--line); }
.navbtns { display: flex; justify-content: space-between; gap: 10px; margin-top: 10px; flex-direction: row-reverse; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 10px; }
.out { background: #10302e; color: #e9f1ec; border-radius: var(--r-sm); padding: 16px; margin: 0 0 22px; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; font: 13.500px/1.650 ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace; text-align: left; unicode-bidi: plaintext; }
.next { background: var(--paper); border-radius: var(--r-sm); padding: 16px 20px; }
.next h4 { font-size: 18px; margin-bottom: 6px; }
.next ol { margin: 0 0 10px; padding-inline-start: 22px; }
.next p { margin: 0; }

[hidden] { display: none !important; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ================= the film: the whole page is one dark hall =================
   One fixed layer carries the pictures and the dots; the sections scroll over it.
   The pictures are printed in the hall's two inks (tools/treat-images.py).
   The generator is the one lit screen in the hall: plain, calm, unanimated. */
html { scroll-padding-top: 62px; }
body { background: var(--hall); color: var(--screen); }
#film a, .foot a { color: var(--lamp); }
#film a:hover, .foot a:hover { color: var(--white); }
#film :focus-visible, .deck-btns :focus-visible, .top :focus-visible { outline-color: var(--lamp); }
.maker, .maker a { color: var(--ink); }
.maker a { color: var(--teal-dark); }
.maker :focus-visible { outline-color: var(--teal); }

.top { border-bottom: 1px solid rgba(233, 241, 236, .1); }

.bg { position: fixed; inset: 0; z-index: 0; pointer-events: none; background: var(--hall); transition: opacity .6s ease; }
.bg .pic { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 28% 50%; opacity: 0; transform-origin: 35% 50%; }
.bg .cloud { position: absolute; inset: 0; width: 100%; height: 100%; }
/* the text side is the right: the picture sinks into the hall behind it */
.bg .scrim { position: absolute; inset: 0; background: linear-gradient(to left, rgba(12, 38, 36, .94) 0%, rgba(12, 38, 36, .86) 36%, rgba(12, 38, 36, 0) 62%); }
body.quiet .bg { opacity: .28; }
body.quiet .bg .cloud { visibility: hidden; }

#film { position: relative; z-index: 1; }

/* ---------- the show at the top ---------- */
.reel { position: relative; min-height: calc(100svh - 62px); cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.scene { position: absolute; inset-block: 0; inset-inline-start: 0; width: min(52%, 720px); padding: 40px clamp(20px, 5vw, 80px) 96px; display: flex; flex-direction: column; justify-content: center; gap: clamp(14px, 1.6vw, 24px); }
body:not(.film-ready) .reel .scene:not(:first-child) { visibility: hidden; }
.scene h1, .scene .head { margin: 0; font-weight: 800; font-size: clamp(36px, 4.7vw, 72px); line-height: 1.28; }
.scene .head em { font-style: normal; color: var(--lamp); }
.scene .line { margin: 0; font-size: clamp(19px, 1.9vw, 28px); line-height: 1.6; font-weight: 500; color: #c3d6cf; }
.scene .line.big { font-size: clamp(22px, 2.2vw, 32px); color: var(--screen); font-weight: 700; }
.scene .kick { margin: 0; font-size: clamp(16px, 1.4vw, 20px); font-weight: 700; color: var(--coral); }
.scene .cue { margin: 6px 0 0; font-size: clamp(16px, 1.4vw, 19px); font-weight: 700; color: var(--hall); background: var(--lamp); align-self: flex-start; padding: .5em 1.2em; border-radius: 999px; }
.scene .bignum { margin: 0; font-size: clamp(120px, 15vw, 230px); line-height: 1; font-weight: 800; color: var(--lamp); font-variant-numeric: tabular-nums; }
.w { display: inline-block; }
.keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: auto auto; justify-content: start; gap: 14px 40px; font-size: clamp(18px, 1.7vw, 24px); font-weight: 700; white-space: nowrap; }
.keys li { display: flex; align-items: center; gap: 12px; }
.keys kbd { font: inherit; min-width: 2.2em; height: 2.2em; padding-inline: .45em; display: grid; place-items: center; border: .1em solid var(--screen); border-bottom-width: .22em; border-radius: .4em; color: var(--lamp); }

/* ---------- the scenes below it ---------- */
.take { position: relative; min-height: calc(100svh - 62px); display: flex; align-items: center; padding: 72px 0 104px; cursor: pointer; }
.take-in { width: min(52%, 700px); padding-inline: clamp(20px, 5vw, 80px); }
.take-h { font-weight: 800; font-size: clamp(34px, 4.2vw, 64px); line-height: 1.25; margin: 0 0 .45em; }
.take-p { font-size: clamp(17px, 1.5vw, 21px); line-height: 1.75; color: #c3d6cf; margin: 0 0 .8em; max-width: 34em; }
.take-list { list-style: none; padding: 0; margin: 1.1em 0 0; display: grid; gap: .85em; font-size: clamp(18px, 1.55vw, 22px); line-height: 1.6; font-weight: 500; }
.take-list li { padding-inline-start: 1em; border-inline-start: 2px solid rgba(240, 207, 118, .6); }
.take-list strong { color: var(--white); }
.take-list b[dir] { font-weight: 700; color: var(--white); }
/* a real sequence, so it is numbered */
.steps-n, .gate-list { counter-reset: step; }
.steps-n li, .gate-list li { counter-increment: step; border: 0; position: relative; padding-inline-start: 2.1em; }
.steps-n li::before, .gate-list li::before { content: counter(step); position: absolute; inset-inline-start: 0; top: 0; font-weight: 800; color: var(--lamp); font-size: 1.15em; line-height: 1.4; }
.gate-list { gap: .8em; }
.gate-list li { font-size: .86em; line-height: 1.55; }
.gate-list li::before { font-size: 1.3em; line-height: 1.25; }
.gate-list b { display: block; font-size: 1.15em; font-weight: 800; color: var(--white); }
.gate-list li > span { display: block; }
.gate-list i { font-style: normal; color: var(--lamp); font-weight: 700; }

/* ---------- the generator: a lit screen in the hall ---------- */
.booth { position: relative; padding: 56px 0 64px; }
.booth .maker { margin-top: 0; box-shadow: 0 0 0 1px rgba(240, 207, 118, .25), 0 30px 120px rgba(240, 207, 118, .12); }

.notes { position: relative; padding: 24px 0 48px; }
.more { background: rgba(233, 241, 236, .05); border: 1px solid rgba(233, 241, 236, .16); border-radius: var(--r-sm); padding: 4px 18px; margin-top: 12px; }
.more summary { cursor: pointer; font-weight: 700; padding: 10px 0; }
.plain { padding-inline-start: 20px; margin: 8px 0; }
.cmd-lab { margin: 10px 0 4px; font-weight: 700; font-size: 15px; }
.cmd { background: #081b1a; color: #e9f1ec; border-radius: 10px; padding: 12px 14px; margin: 0 0 8px; overflow-x: auto; font: 14px/1.6 ui-monospace, Consolas, Menlo, monospace; text-align: left; }

.foot { position: relative; z-index: 1; border-top: 1px solid rgba(233, 241, 236, .12); background: var(--hall); padding: 22px 0; font-size: 15px; color: #c3d6cf; }
.foot-in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; }
.foot p { margin: 0; }
.ver { color: #9fb5ae; }

/* ---------- the presenter's furniture: page number, progress, buttons, black screen ---------- */
.hud, .deck-btns { transition: opacity .3s ease, visibility .3s; }
body.quiet .hud, body.quiet .deck-btns { opacity: 0; visibility: hidden; }
.pageno { position: fixed; left: 20px; bottom: 18px; z-index: 5; display: flex; align-items: center; gap: 10px; font-size: 18px; font-weight: 700; direction: ltr; color: var(--screen); }
.pageno i { display: flex; gap: 6px; }
.pageno u { width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--screen); }
.pageno u.on { background: var(--lamp); border-color: var(--lamp); }
.progress { position: fixed; inset-inline: 0; bottom: 0; height: 4px; z-index: 5; background: rgba(233, 241, 236, .14); }
.progress i { display: block; height: 100%; background: var(--lamp); transform: scaleX(0); transform-origin: 100% 50%; transition: transform .45s ease; }
.deck-btns { position: fixed; inset-inline-start: 16px; bottom: 14px; z-index: 6; display: flex; gap: 8px; }
.dbtn { font: inherit; font-weight: 700; font-size: 15px; min-height: 44px; padding: 6px 18px; border-radius: 999px; border: 1.5px solid rgba(233, 241, 236, .5); background: rgba(12, 38, 36, .7); color: var(--screen); cursor: pointer; }
.dbtn:hover { background: rgba(233, 241, 236, .14); }
.dbtn.main { background: var(--lamp); border-color: var(--lamp); color: var(--hall); }
.cover { position: fixed; inset: 0; z-index: 50; background: #000; opacity: 0; pointer-events: none; transition: opacity .35s ease; }
.cover.on { opacity: 1; pointer-events: auto; }
.no-film .hud, .no-film .deck-btns { display: none; }
.no-film .bg .pic[data-pic="hall"] { opacity: .5; }
.no-film .reel .scene:not(:first-child) { display: none; }

/* ---------- a phone: the picture and the dots above, the words below ---------- */
@media (max-width: 699px) {
  .bg .pic { object-position: 22% 50%; }
  .bg .scrim { background: linear-gradient(to top, rgba(12, 38, 36, .96) 0%, rgba(12, 38, 36, .9) 46%, rgba(12, 38, 36, 0) 68%); }
  .scene { width: 100%; justify-content: flex-end; padding: 0 16px 92px; gap: 14px; }
  .scene h1, .scene .head { font-size: clamp(30px, 8.6vw, 40px); }
  .scene .line { font-size: 19px; }
  .scene .line.big { font-size: 21px; }
  .scene .bignum { font-size: 120px; }
  .keys { grid-template-columns: auto auto; gap: 10px 22px; font-size: 18px; }
  .take { align-items: flex-end; padding: 36svh 0 84px; }
  .take-in { width: 100%; padding: 40px 16px 16px; background: linear-gradient(to bottom, rgba(12, 38, 36, 0) 0, rgba(12, 38, 36, .93) 30px); }
  .take-h { font-size: clamp(30px, 8.4vw, 40px); }
  .take-list { font-size: 18px; }
  .gate-list li { font-size: 17px; }
  .booth { padding: 36px 0 48px; }
  .pageno { left: 16px; bottom: 22px; font-size: 16px; }
  .deck-btns { inset-inline-start: 12px; bottom: 12px; }
  #show-full { display: none; }
}
@media (prefers-reduced-motion: reduce) { .bg, .hud, .deck-btns { transition: none; } }
@media (max-width: 420px) { .nav a[href^="https"] { display: none; } }

/* a step answers the press that opened it: it wipes in from the right */
@keyframes step-in { from { clip-path: inset(0 0 0 100%); opacity: .4; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.panel:not([hidden]) { animation: step-in .320s cubic-bezier(.2, .7, .2, 1); }
@media (prefers-reduced-motion: reduce) { .panel:not([hidden]) { animation: none; } .progress i, .cover { transition: none; } }
