/* KD Site — site-wide skin (body.kd-skin) + widgets (.kd).
   Palette (user's choice): white, black, the brand greens (#07F368 signal, #0C2C20 deep) and one very light gray.
   Type: Peyda for everything; heavy weights (800/900) for display. Fonts are inline @font-face from inc/nav.php. */

/* ───────── Tokens ───────── */
:root {
  --kd-white: #ffffff;
  --kd-ink-c: #101210;
  --kd-muted-c: rgb(16 18 16 / .66);
  --kd-gray: #f4f5f2;
  --kd-line: #e3e6e1;
  --kd-deep: #000000;
  --kd-signal: #07f368;
  --kd-signal-2: #05d65b;
  --kd-r: 18px;
  --kd-font: 'Peyda', Tahoma, system-ui, sans-serif;
}
html[dir=rtl] { --kd-font: 'KD Digits', 'Peyda', Tahoma, system-ui, sans-serif; }

/* ───────── Site skin ───────── */
body.kd-skin { --fb: var(--kd-font); --fh: var(--kd-font); --kd-display: var(--kd-font); background: var(--kd-white); color: var(--kd-ink-c); font-family: var(--kd-font); }
body.kd-skin .hd, body.kd-skin .dr, body.kd-skin .bn, body.kd-skin .tp { display: none !important; }
body.kd-skin main, body.kd-skin .dy { background: transparent; }
body.kd-skin ::selection { background: var(--kd-signal); color: var(--kd-ink-c); }
.kd-paper { background: var(--kd-white) !important; color: var(--kd-ink-c); --kd-box: var(--kd-gray); --kd-box-line: transparent; }
.kd-paper-2, .kd-felt { background: var(--kd-tex-paper), var(--kd-gray) !important; color: var(--kd-ink-c); --kd-box: var(--kd-white); --kd-box-line: var(--kd-line); }
.kd-deep, .kd-felt-deep { background: var(--kd-tex-felt), var(--kd-deep) !important; color: var(--kd-white); --kd-muted-c: rgb(255 255 255 / .74); --kd-line: rgb(255 255 255 / .16); --kd-box: rgb(255 255 255 / .05); --kd-box-line: rgb(255 255 255 / .14); }
.kd-cut { position: relative; }

/* Theme widgets on inner pages, in the same language. */
body.kd-skin .dy-hd { display: flex; flex-direction: column; gap: .6rem; }
body.kd-skin .dy-hd > p { order: -1; margin: 0; color: var(--kd-deep); font-size: .92rem; font-weight: 800; display: flex; align-items: center; gap: .6rem; }
body.kd-skin .dy-hd > p::before { content: ''; width: 22px; height: 4px; border-radius: 2px; background: var(--kd-signal); }
.kd-deep .dy-hd > p { color: var(--kd-signal); }
body.kd-skin .dy-hd h1, body.kd-skin .dy-hd h2 { font-weight: 900 !important; line-height: 1.4; letter-spacing: 0; color: inherit; }
html[dir=ltr] body.kd-skin .dy-hd h1, html[dir=ltr] body.kd-skin .dy-hd h2 { line-height: 1.1; letter-spacing: -.02em; }
body.kd-skin .ft-it { background: var(--kd-box, var(--kd-gray)) !important; border: 1px solid var(--kd-box-line, transparent) !important; border-radius: var(--kd-r) !important; box-shadow: none !important; transform: none !important; padding: 1.6rem 1.5rem 1.7rem !important; text-align: start; align-items: flex-start; }
body.kd-skin .ft-it .ib-i { width: 48px; height: 48px; border-radius: 14px; background: var(--kd-signal); color: var(--kd-ink-c); display: grid; place-items: center; }
body.kd-skin .ft-it b { font-weight: 800; font-size: 1.2rem; }
body.kd-skin .ft-it p { color: var(--kd-muted-c); font-size: .98rem; line-height: 1.9; }
body.kd-skin .shw-ss-cards li { background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); box-shadow: none; }
body.kd-skin .shw-ss-cards h3 { font-weight: 800; font-size: 1.3rem; }
body.kd-skin .shw-n { background: var(--kd-signal) !important; color: var(--kd-ink-c) !important; font-weight: 900; }
body.kd-skin .dy-btn, body.kd-skin .btn { border-radius: 12px !important; }

/* ───────── Widgets base ───────── */
.kd {
  --kd-ink: var(--kd-ink-c); --kd-paper: var(--kd-white); --kd-paper-2: var(--kd-gray); --kd-forest: var(--kd-deep); --kd-green: #04b84d;
  --kd-lime: var(--kd-signal); --kd-muted: var(--kd-muted-c); --kd-pencil: #b4b9b3;
  --kd-c-pulse: #04b84d; --kd-c-ink: #101210; --kd-c-order: #0c2c20; --kd-c-clock: #0c2c20; --kd-c-pop: #0c2c20; --kd-c-popline: #ffffff; --kd-c-socket: #ffffff;
  color: inherit;
}
.kd [hidden] { display: none !important; }
.kd *, .kd *::before, .kd *::after { box-sizing: border-box; }
.kd :where(h1, h2, h3, h4, p, dl, dd, ul, ol, figure, blockquote) { margin: 0; }
.kd button { font: inherit; color: inherit; cursor: pointer; }
.kd :focus-visible, .kd-nav :focus-visible, .kd-astro :focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.kd a { color: inherit; }
.kd-ic { flex: none; display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--kd-signal); color: var(--kd-ink-c); }
.kd-ic svg { display: block; }

.kd-kicker { display: flex; align-items: center; gap: .6rem; color: var(--kd-deep); font-size: .95rem; font-weight: 800; }
.kd-kicker::before { content: ''; flex: none; width: 22px; height: 4px; border-radius: 2px; background: var(--kd-signal); }
.kd-deep .kd-kicker { color: var(--kd-signal); }
.kd-cta { display: inline-flex; align-items: center; gap: .6rem; background: var(--kd-signal); color: var(--kd-ink-c) !important; font-weight: 800; font-size: 1rem; padding: .85rem 1.6rem; border: 0; border-radius: 12px; text-decoration: none; transition: background-color .15s ease, transform .15s ease; }
.kd-cta::after { content: '←'; font-weight: 400; }
html[dir=ltr] .kd-cta::after { content: '→'; }
.kd-cta:hover { background: var(--kd-signal-2); }
.kd-cta:active { transform: translateY(1px); }
.kd-stage .kd-cta::after, .kd-over-card .kd-cta::after { content: none; }
.kd-more { display: inline-flex; align-items: center; gap: .5rem; color: var(--kd-deep); font-weight: 800; text-decoration: none; padding: .4rem 0; }
.kd-deep .kd-more { color: var(--kd-signal); }
.kd-more::after { content: '←'; transition: transform .2s ease; }
html[dir=ltr] .kd-more::after { content: '→'; }
.kd-more:hover::after { transform: translateX(-4px); }
html[dir=ltr] .kd-more:hover::after { transform: translateX(4px); }
.kd-text-btn { background: none; border: 0; border-bottom: 1.5px solid currentColor; padding: .35rem 0; min-height: 40px; font-size: .9rem; font-weight: 700; color: inherit; opacity: .8; text-decoration: none; }
.kd-text-btn:hover:not(:disabled) { opacity: 1; }
.kd-text-btn:disabled { opacity: .35; cursor: default; }

.kd-head { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(20px, 5vw, 80px); align-items: end; }
.kd-h2 { margin-top: .7rem; font-weight: 900; font-size: clamp(2rem, 3.8vw, 3.4rem); line-height: 1.4; }
/* No one-word last lines ("گوگل", "سئو", "پشتیبانی") on big headings. */
.kd-h1, .kd-h2, .kd-quote blockquote, .kd-foot-say { text-wrap: balance; }
html[dir=ltr] .kd-h2 { line-height: 1.08; letter-spacing: -.02em; }
.kd-intro { font-size: 1.05rem; line-height: 2; color: var(--kd-muted-c); max-width: 46ch; }
html[dir=ltr] .kd-intro { line-height: 1.65; }

/* ───────── Hero ───────── */
.kd-hero { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
/* Copy column: the score sheet follows the button directly and must end no lower than the game card. */
.kd-hero-copy { display: flex; flex-direction: column; align-items: flex-start; }
.kd-hero-copy > .kd-console { align-self: stretch; margin-top: 0; }
.kd-hero-copy > .kd-cta { margin-bottom: clamp(20px, 2.2vw, 32px); }
.kd-h1 { margin-top: 1rem; font-weight: 900; font-size: clamp(3.4rem, 6.6vw, 6.6rem); line-height: 1.25; }
.kd-hero .kd-h1 { font-size: clamp(3.2rem, 5.6vw, 5.6rem); line-height: 1.2; margin-top: .6rem; }
html[dir=ltr] .kd-h1 { line-height: .98; letter-spacing: -.03em; }
.kd-lead { margin-top: 1.2rem; font-size: clamp(1.08rem, 1.3vw, 1.25rem); line-height: 2; color: var(--kd-muted-c); max-width: 36ch; }
html[dir=ltr] .kd-lead { line-height: 1.6; }
.kd-hero-copy .kd-cta { margin-top: 1.6rem; }
.kd-hero .kd-lead { font-size: clamp(.95rem, 1.05vw, 1.05rem); line-height: 1.95; max-width: none; margin-top: .9rem; }
html[dir=ltr] .kd-hero .kd-lead { line-height: 1.65; }

.kd-console { margin-top: clamp(28px, 3vw, 40px); padding: 1.2rem 1.3rem 1rem; border: 1px solid var(--kd-line); border-radius: var(--kd-r); background: var(--kd-white); }
.kd-console-title { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.02rem; }
.kd-dot { width: 10px; height: 10px; background: var(--kd-signal); border-radius: 50%; }
.kd-brief { margin-top: .35rem; font-size: .95rem; line-height: 1.9; color: var(--kd-muted-c); }
.kd-meter { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-top: .9rem; }
.kd-meter > .kd-meter-score { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.kd-meter > div { background: var(--kd-gray); border-radius: 12px; padding: .55rem .8rem .5rem; }
.kd-meter-score { background: var(--kd-deep) !important; color: var(--kd-white); }
.kd-meter-score dt { color: rgb(255 255 255 / .7) !important; }
.kd-meter dt { font-size: .76rem; color: var(--kd-muted-c); font-weight: 600; }
.kd-meter dd { font-weight: 900; font-size: 1.55rem; line-height: 1.35; font-variant-numeric: tabular-nums; }
.kd-meter-score dd { font-size: 2.1rem; display: flex; align-items: center; gap: .6rem; white-space: nowrap; }
.kd-meter dd { white-space: nowrap; overflow: hidden; text-overflow: clip; }
.kd-combo { font-size: .85rem; font-weight: 800; line-height: 1.5; white-space: nowrap; background: var(--kd-signal); color: var(--kd-ink-c); padding: .05em .45em; border-radius: 6px; }
.kd-meter .urgent { color: #c2410c; }
.kd-wait { font-size: .8rem; color: var(--kd-muted-c); margin-top: .5rem; }
.kd-note { min-height: 3em; margin-top: .6rem; padding: .45rem .8rem; font-size: .9rem; font-weight: 700; border-radius: 10px; }
.kd-note:not(:empty) { background: var(--kd-gray); }
.kd-note.tone-good:not(:empty) { background: rgb(7 243 104 / .16); }
.kd-note.tone-warn:not(:empty) { background: rgb(16 18 16 / .09); }
.kd-note.tone-bad:not(:empty) { background: #fdeee8; }
.kd-actions { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: .4rem; }
.kd-skip { margin-inline-start: auto; }

.kd-machine { min-width: 0; background: var(--kd-gray); border-radius: calc(var(--kd-r) + 6px); padding: clamp(12px, 2vw, 28px); --kd-paper: var(--kd-gray); }
.kd-stage { position: relative; aspect-ratio: 1; width: min(100%, calc(100svh - 220px)); min-width: 300px; margin-inline: auto; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.kd-layer { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.kd-machine figcaption { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .2rem 1rem; margin-top: .6rem; padding-top: .6rem; border-top: 1px solid var(--kd-line); font-size: .8rem; color: var(--kd-muted-c); }
.kd-machine figcaption b { color: var(--kd-ink-c); font-weight: 800; }

/* Drawing. */
.kd .construction { fill: none; }
.kd .guide { stroke: var(--kd-pencil); stroke-width: 1; fill: none; }
.kd .guide.dashed { stroke-dasharray: 3 7; }
.kd .guide.faint { stroke-opacity: .55; }
.kd .tray { fill: none; stroke: var(--kd-ink); stroke-width: 2; stroke-linecap: round; }
.kd .link-pencil { fill: none; stroke: var(--kd-pencil); stroke-width: 1.6; stroke-dasharray: 4 7; stroke-linecap: round; }
.kd .link-ink { fill: none; stroke: var(--kd-ink); stroke-width: 2.6; stroke-linecap: round; }
.kd .link-flow { fill: none; stroke: var(--kd-green); stroke-width: 4; stroke-linecap: round; stroke-dasharray: 1 23; }
.kd .link .link-on { display: none; }
.kd .link.is-on .link-on { display: inline; }
.kd .link.is-on .link-pencil { opacity: 0; }
.kd .link.role-decoy.is-on .link-flow { stroke: #9aa09a; }
.kd .link.role-decoy.is-on .link-ink { stroke: var(--kd-muted); stroke-dasharray: 10 5; }
.kd .link.is-broken .link-pencil { stroke: #c2410c; stroke-opacity: .9; stroke-dasharray: 2 6; }
.kd .nodes path { fill: none; stroke: var(--kd-ink); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.kd .nodes .thin { stroke-width: 1.2; }
.kd .nodes .hatch-line { stroke-width: 1; stroke-dasharray: 2 3; }
.kd .nodes .fill-soft { fill: var(--kd-gray); stroke-width: 0; }
.kd .nodes .fill-ink { fill: var(--kd-ink); stroke: none; }
.kd .socket { fill: var(--kd-white); }
.kd .nodes .socket-ink { stroke-width: 2.2; }
.kd .socket-ghost { fill: var(--kd-white); stroke: var(--kd-pencil); stroke-dasharray: 3 6; }
.kd .nodes .gear-body { fill: var(--kd-signal); stroke: #101210; stroke-width: 2.2; }
.kd .gear { transform-box: fill-box; transform-origin: center; }
.kd .nodes .stamp { fill: var(--kd-signal); stroke: #0c2c20; stroke-width: 2; }
.kd .nodes .stamp-check { stroke: #0c2c20; stroke-width: 3.4; }

.kd-label { position: absolute; transform: translate(-50%, -50%); font-size: clamp(.72rem, 1.05vw, .92rem); font-weight: 800; line-height: 1.3; white-space: nowrap; pointer-events: none; background: var(--kd-paper); color: var(--kd-ink); padding: .08em .45em; border-radius: 6px; }
.kd-label-exit { background: var(--kd-deep); color: var(--kd-white); }
.kd-tray { color: var(--kd-muted-c); }

.kd-joint { position: absolute; transform: translate(-50%, -50%); width: clamp(34px, 4.6%, 46px); aspect-ratio: 1; padding: 0; border-radius: 50%; border: 1.5px dashed var(--kd-ink); background: var(--kd-white); display: grid; place-items: center; transition: transform .16s ease, background-color .16s ease; }
.kd-joint svg { width: 62%; height: 62%; }
.kd-joint path { fill: none; stroke: var(--kd-ink); stroke-width: 3; stroke-linecap: round; }
.kd-joint:hover:not(:disabled) { transform: translate(-50%, -50%) scale(1.1); }
.kd-joint.is-on { border-style: solid; border-color: var(--kd-deep); background: var(--kd-deep); }
.kd-joint.is-on path { stroke: var(--kd-signal); }
.kd-joint.is-on[data-link=sf], .kd-joint.is-on[data-link=am] { background: #6b706b; border-color: #6b706b; }
.kd-joint.is-on[data-link=sf] path, .kd-joint.is-on[data-link=am] path { stroke: var(--kd-white); }
.kd-joint.is-broken { border: 2px solid #101210; background: var(--kd-signal); }
.kd-joint.is-broken path { stroke: #101210; }
.kd-joint:disabled { cursor: default; }
.kd-new { position: absolute; top: -.9em; inset-inline-start: 70%; background: var(--kd-signal); color: #101210; font-size: .66rem; font-weight: 800; padding: 0 .4em; line-height: 1.6; white-space: nowrap; border-radius: 4px; }
.kd-jam { position: absolute; transform: translate(-50%, -50%); width: clamp(64px, 13%, 130px); aspect-ratio: 1; border-radius: 50%; border: 2px dashed #101210; background: rgb(7 243 104 / .3); display: grid; place-items: center; padding: 0; }
.kd-jam span { background: #101210; color: var(--kd-white); font-weight: 900; font-size: clamp(.68rem, 1vw, .85rem); padding: .1em .55em; white-space: nowrap; border-radius: 6px; }

.kd-coach { position: absolute; pointer-events: none; transform: translate(-50%, calc(-100% - 26px)); display: flex; flex-direction: column; align-items: center; }
.kd-coach span { background: var(--kd-ink-c); color: var(--kd-white); font-weight: 800; font-size: clamp(.74rem, 1.1vw, .95rem); padding: .35em .8em; white-space: nowrap; border-radius: 10px; }
.kd-coach svg { width: clamp(26px, 3.6vw, 40px); height: auto; margin-top: 2px; }
.kd-coach path { fill: none; stroke: #101210; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.kd-overlay { position: absolute; inset: 0; display: grid; place-items: center; background: rgb(244 245 242 / .7); }
.kd-over-card { background: var(--kd-white); color: var(--kd-ink-c); padding: clamp(18px, 3vw, 32px); width: min(90%, 30rem); border-radius: var(--kd-r); border: 1px solid var(--kd-line); box-shadow: 0 24px 48px -28px rgb(12 44 32 / .45); }
.kd-over-kicker { font-size: .88rem; font-weight: 800; color: var(--kd-deep); }
.kd-over-card h2 { font-weight: 900; margin: .2rem 0 .3rem; font-size: clamp(1.8rem, 3.2vw, 2.6rem); line-height: 1.35; }
.kd-over-card h2:focus { outline: none; }
.kd-over-score { font-weight: 700; }
.kd-over-score span { font-weight: 900; font-size: clamp(2.1rem, 3.8vw, 3rem); }
.kd-over-score em { font-style: normal; background: var(--kd-signal); padding: .1em .55em; margin-inline-start: .6rem; font-size: .85rem; border-radius: 6px; }
.kd-over-stats, .kd-over-best { font-size: .88rem; color: var(--kd-muted-c); }
.kd-lesson { margin-top: .8rem; padding: .7rem .9rem; background: var(--kd-gray); border-radius: 12px; font-weight: 700; line-height: 1.9; }
.kd-over-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; margin-top: 1.1rem; }

/* ───────── Person ───────── */
.kd-person-top { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(24px, 5vw, 80px); align-items: center; }
.kd-name { margin-top: .7rem; font-weight: 900; font-size: clamp(3rem, 6vw, 5.8rem); line-height: 1.25; }
html[dir=ltr] .kd-name { line-height: 1; letter-spacing: -.03em; }
.kd-role { margin-top: .5rem; font-weight: 800; font-size: clamp(1.2rem, 1.8vw, 1.55rem); line-height: 1.75; max-width: 32ch; }
.kd-bio { margin-top: 1rem; font-size: 1.06rem; line-height: 2.05; color: var(--kd-muted-c); max-width: 62ch; }
html[dir=ltr] .kd-bio { line-height: 1.7; }
.kd-portrait { margin-bottom: 1rem; }
.kd-photo { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: var(--kd-r); }
.kd-facts { list-style: none; padding: 0; display: grid; gap: 12px; }
.kd-facts li { display: flex; align-items: center; gap: 1rem; background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); padding: 1rem 1.1rem; font-weight: 800; font-size: 1.02rem; line-height: 1.6; }

.kd-kit-title { margin-top: clamp(56px, 7vw, 96px); font-weight: 900; font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.45; }
html[dir=ltr] .kd-kit-title { line-height: 1.1; letter-spacing: -.02em; }
.kd-kit { list-style: none; padding: 0; margin-top: 1.4rem; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.kd-kit-item { display: flex; flex-direction: column; gap: .7rem; background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); padding: 1.4rem 1.3rem 1.3rem; }
.kd-kit-top { display: flex; align-items: center; justify-content: space-between; }
.kd-kit-no { color: var(--kd-muted-c); }
.kd-kit-item h4 { font-weight: 900; font-size: 1.3rem; line-height: 1.5; margin-top: .2rem; }
.kd-skills { font-size: .95rem; line-height: 1.95; color: var(--kd-muted-c); }
.kd-gives { margin-top: auto; padding-top: .8rem; border-top: 1px solid var(--kd-line); font-weight: 800; font-size: .98rem; line-height: 1.8; }
.kd-in { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; font-size: .8rem; color: var(--kd-muted-c); }
.kd-in span { margin-inline-end: .2rem; }
.kd-in a { background: var(--kd-white); color: var(--kd-ink-c); padding: .1em .6em; border-radius: 6px; text-decoration: none; font-weight: 700; }
.kd-paper-2 .kd-in a { background: var(--kd-gray); }
.kd-in a:hover { background: var(--kd-signal); }
.kd-closing { margin-top: clamp(40px, 5vw, 72px); padding: clamp(22px, 3vw, 36px); background: var(--kd-deep); color: var(--kd-white); border-radius: calc(var(--kd-r) + 6px); font-weight: 800; font-size: clamp(1.3rem, 2.2vw, 1.9rem); line-height: 1.85; }
html[dir=ltr] .kd-closing { line-height: 1.35; }

/* ───────── Anatomy ───────── */
.kd-explorer { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(24px, 4vw, 64px); margin-top: clamp(28px, 4vw, 52px); align-items: start; }
.kd-diagram { position: relative; aspect-ratio: 940 / 800; }
.kd-diagram-svg { width: 100%; height: 100%; display: block; }
.kd .relation { fill: none; stroke: var(--kd-pencil); stroke-width: 1.6; stroke-dasharray: 4 7; stroke-linecap: round; }
.kd .relation.is-lit { stroke: var(--kd-deep); stroke-width: 2.8; stroke-dasharray: none; }
.kd-diagram .node.is-selected .socket { fill: var(--kd-signal); }
.kd-diagram .node.is-related .socket { fill: #d6fbe4; }
.kd-diagram .node:not(.is-selected):not(.is-related) { opacity: .45; }
.kd-hit { position: absolute; transform: translate(-50%, -50%); width: 15%; aspect-ratio: 1; border: 0; background: transparent; border-radius: 50%; padding: 0; }
.kd-hit span { position: absolute; top: 100%; left: 50%; transform: translate(-50%, 2px); white-space: nowrap; font-size: clamp(.72rem, 1vw, .9rem); font-weight: 800; }
.kd-hit.is-selected span { background: var(--kd-deep); color: var(--kd-white); padding: .05em .55em; border-radius: 6px; }
.kd-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.kd-tabs button { border: 1px solid var(--kd-line); background: var(--kd-white); padding: .45rem .95rem; font-size: .9rem; font-weight: 700; min-height: 44px; border-radius: 10px; }
.kd-tabs button:hover { border-color: var(--kd-ink-c); }
.kd-tabs button[aria-selected=true] { background: var(--kd-deep); border-color: var(--kd-deep); color: var(--kd-white); }
.kd-panel { margin-top: 1rem; background: var(--kd-white); border: 1px solid var(--kd-line); border-radius: var(--kd-r); padding: 1.3rem 1.4rem .6rem; }
.kd-panel-meta { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .8rem; color: var(--kd-muted-c); font-weight: 600; }
.kd-from-game { background: var(--kd-signal); color: var(--kd-ink-c); font-weight: 800; padding: 0 .45em; border-radius: 4px; }
.kd-panel h3 { font-weight: 900; font-size: clamp(1.6rem, 2.4vw, 2.2rem); margin: .3rem 0 .8rem; line-height: 1.45; }
.kd-panel dl > div { display: grid; grid-template-columns: 8rem 1fr; gap: 1rem; padding: .8rem 0; border-top: 1px solid var(--kd-line); }
.kd-panel dt { font-weight: 800; font-size: .92rem; }
.kd-panel dd { line-height: 1.9; }
.kd-related { display: flex; flex-wrap: wrap; gap: .5rem; }
.kd-related button { background: var(--kd-gray); border: 0; padding: .2rem .7rem; border-radius: 8px; font-weight: 700; font-size: .9rem; }
.kd-related button:hover { background: var(--kd-signal); }

/* ───────── kd_index ───────── */
.kd-ix { list-style: none; padding: 0; margin-top: clamp(28px, 3.4vw, 48px); display: grid; gap: 16px; }
.kd-ix li { display: flex; flex-direction: column; align-items: flex-start; gap: .7rem; background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); padding: 1.5rem 1.4rem 1.6rem; }
.kd-ix h3 { font-weight: 800; font-size: 1.25rem; line-height: 1.6; margin-top: .2rem; }
.kd-ix p { font-size: .98rem; line-height: 1.95; color: var(--kd-muted-c); }
html[dir=ltr] .kd-ix p { line-height: 1.6; }
.kd-ix-no { display: inline-grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--kd-deep); color: var(--kd-signal); font-weight: 900; font-size: 1.3rem; }
.kd-secmark + .kd-ix { margin-top: 0; }
.kd-index > .kd-more, .kd-index > .kd-cta { margin-top: clamp(24px, 3vw, 36px); }

.kd-ix-list .kd-ix { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.kd-ix-list .kd-ix:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kd-ix-stairs .kd-ix { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kd-ix-stairs li { position: relative; }
.kd-ix-stairs li:not(:last-child)::after { content: ''; position: absolute; top: calc(1.5rem + 23px); inset-inline-end: -17px; width: 18px; height: 2px; background: var(--kd-signal); }
.kd-ix-rules .kd-ix { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.kd-ix-rules .kd-ix-no { background: var(--kd-signal); color: var(--kd-deep); }
.kd-ix-rules h3 { font-size: clamp(1.3rem, 2vw, 1.65rem); font-weight: 900; }

.kd-ix-call { background: var(--kd-deep); color: var(--kd-white); border-radius: calc(var(--kd-r) + 10px); padding: clamp(28px, 5vw, 72px); --kd-muted-c: rgb(255 255 255 / .74); }
.kd-ix-call .kd-kicker { color: var(--kd-signal); }
.kd-ix-call .kd-head { grid-template-columns: 1fr; }
.kd-ix-call .kd-h2 { font-size: clamp(2rem, 4vw, 3.6rem); max-width: 26ch; }

/* ───────── Page heads / portfolio ───────── */
.kd-pagehead .kd-h1 { font-size: clamp(2.8rem, 5.6vw, 5.4rem); }
.kd-pagehead .kd-lead { max-width: 52ch; }
.kd-contact-note { font-size: .85rem; color: var(--kd-muted-c); margin-top: .8rem; }
.kd-work { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(24px, 5vw, 72px); align-items: center; --kd-lime-c: var(--kd-signal); }
.kd-work-card { background: var(--kd-white); border: 1px solid var(--kd-line); border-radius: var(--kd-r); padding: 1.6rem; }
.kd-work-meta { display: flex; justify-content: space-between; font-size: .82rem; color: var(--kd-muted-c); font-weight: 600; padding-bottom: .6rem; margin-bottom: 1rem; border-bottom: 1px solid var(--kd-line); }
.kd-work-card h3 { font-weight: 900; font-size: clamp(1.9rem, 3vw, 2.6rem); line-height: 1.4; }
.kd-work-card p { margin-top: .6rem; line-height: 2; color: var(--kd-muted-c); }
.kd-work-facts { list-style: none; padding: 0; margin: 1.2rem 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kd-work-facts li { background: var(--kd-gray); border-radius: 12px; padding: .7rem .8rem; }
.kd-work-facts b { display: block; font-weight: 900; font-size: 1.5rem; line-height: 1.3; color: var(--kd-deep); }
.kd-work-facts span { font-size: .8rem; color: var(--kd-muted-c); }
.kd-work-art { position: relative; aspect-ratio: 4 / 3; color: var(--kd-ink-c); background: var(--kd-white); border-radius: calc(var(--kd-r) + 6px); padding: 6%; }
.kd-work-shot { margin: 0; border-radius: calc(var(--kd-r) + 6px); overflow: hidden; border: 1px solid var(--kd-line); background: var(--kd-white); box-shadow: 0 30px 60px -40px rgb(12 44 32 / .5); }
.kd-work-shot img { display: block; width: 100%; height: auto; }
.kd-work-art svg { width: 100%; height: 100%; filter: none !important; stroke-width: 1.8; }

/* ───────── Top bar + menu ───────── */
.kd-nav { position: fixed; inset: 0 0 auto; z-index: 90; height: 68px; padding: 0 clamp(16px, 3vw, 40px); display: flex; align-items: center; gap: clamp(16px, 3vw, 40px); background: var(--kd-white); border-bottom: 1px solid var(--kd-line); color: var(--kd-ink-c); }
.kd-brand { display: inline-flex; align-items: center; gap: .55rem; text-decoration: none; color: inherit; flex: none; }
.kd-brand::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--kd-signal); }
.kd-brand b { font-weight: 900; font-size: 1.2rem; line-height: 1; }
.kd-links { display: flex; align-items: center; gap: .3rem; margin-inline: auto; }
.kd-links a { padding: .5rem .8rem; border-radius: 10px; font-weight: 700; font-size: .95rem; color: var(--kd-ink-c); text-decoration: none; }
.kd-links a:hover { background: var(--kd-gray); }
.kd-links a[aria-current] { background: var(--kd-gray); box-shadow: inset 0 -3px 0 var(--kd-signal); }
.kd-nav-end { display: flex; align-items: center; gap: .8rem; flex: none; }
.kd-nav-lang { font-weight: 800; font-size: .9rem; color: var(--kd-ink-c); text-decoration: none; padding: .5rem .6rem; border-radius: 10px; }
.kd-nav-lang:hover { background: var(--kd-gray); }
.kd-nav-cta { background: var(--kd-ink-c); color: var(--kd-white) !important; font-weight: 800; font-size: .92rem; padding: .6rem 1.1rem; border-radius: 12px; text-decoration: none; }
.kd-nav-cta:hover { background: var(--kd-deep); }
.kd-pill { display: none; align-items: center; border: 0; background: none; color: inherit; padding: 0; font: inherit; cursor: pointer; min-height: 44px; }
.kd-pill-icon { position: relative; width: 44px; height: 44px; border-radius: 12px; background: var(--kd-signal); display: grid; place-items: center; color: var(--kd-ink-c); }
.kd-pill-icon i { position: absolute; width: 18px; height: 2px; border-radius: 1px; background: currentColor; transition: transform .25s ease; }
.kd-pill-icon i:first-child { transform: translateY(-4px); }
.kd-pill-icon i:last-child { transform: translateY(4px); }
.kd-nav.is-open .kd-pill-icon i:first-child { transform: rotate(45deg); }
.kd-nav.is-open .kd-pill-icon i:last-child { transform: rotate(-45deg); }

.kd-astro { position: fixed; inset: 68px 0 0; z-index: 89; display: flex; flex-direction: column; background: var(--kd-white); color: var(--kd-ink-c); overflow: auto; padding: 16px clamp(16px, 3vw, 40px) 32px; }
.kd-astro[hidden] { display: none; }
.kd-astro-dial { display: grid; gap: 6px; }
.kd-astro-item { display: flex; align-items: center; gap: 1rem; padding: 1rem 1.1rem; border-radius: var(--kd-r); background: var(--kd-gray); color: var(--kd-ink-c); text-decoration: none; }
.kd-astro-item span { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: var(--kd-white); font-weight: 800; font-size: .9rem; }
.kd-astro-item b { font-weight: 900; font-size: 1.5rem; line-height: 1.4; }
.kd-astro-item.is-current { background: var(--kd-deep); color: var(--kd-white); }
.kd-astro-item.is-current span { background: var(--kd-signal); color: var(--kd-ink-c); }
.kd-astro-foot { display: flex; gap: 1rem; align-items: center; justify-content: space-between; margin-top: 1rem; }

/* ───────── Motion ───────── */
@keyframes kd-flow { to { stroke-dashoffset: -24; } }
@keyframes kd-spin { to { transform: rotate(360deg); } }
@keyframes kd-spin-back { to { transform: rotate(-360deg); } }
@keyframes kd-beckon { 0%, 100% { box-shadow: 0 0 0 0 rgb(7 243 104 / .7); } 60% { box-shadow: 0 0 0 12px rgb(7 243 104 / 0); } }
@keyframes kd-pop-in { from { transform: translate(-50%, -50%) scale(.2); opacity: 0; } }
@keyframes kd-pop { from { transform: scale(.3); opacity: 0; } }
@keyframes kd-shake { from { rotate: -4deg; } to { rotate: 4deg; } }
@keyframes kd-bob { to { translate: 0 -6px; } }
@keyframes kd-rise { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: no-preference) {
  .kd .link-flow { animation: kd-flow .5s linear infinite; }
  .kd-stage.is-held .link-flow, .kd-stage.is-held .gear { animation-play-state: paused; }
  .kd .gear-main { animation: kd-spin 7s linear infinite paused; }
  .kd-stage.ai-on .gear-main { animation-play-state: running; }
  .kd-joint.is-hinted, .kd-joint.is-broken { animation: kd-beckon 1.2s ease-out infinite; }
  .kd-joint.is-new { animation: kd-pop-in .45s cubic-bezier(.2, 1.6, .4, 1); }
  .kd-jam { animation: kd-shake .5s ease-in-out infinite alternate; }
  .kd-coach { animation: kd-bob 1.2s ease-in-out infinite alternate; }
  .kd-combo.pop { animation: kd-pop .35s cubic-bezier(.2, 1.6, .4, 1); }
  .kd-panel { animation: kd-rise .3s cubic-bezier(.2, .7, .2, 1); }
}
@media (prefers-reduced-motion: reduce) {
  .kd-joint.is-hinted, .kd-joint.is-broken { box-shadow: 0 0 0 4px var(--kd-signal); }
}

/* ───────── Responsive ───────── */
@media (max-width: 1024px) {
  .kd-hero { grid-template-columns: 1fr; }
  .kd-hero-copy { display: contents; }
  .kd-hero-copy > * { max-width: 40rem; }
  .kd-hero-copy > .kd-cta { justify-self: start; }
  .kd-machine { order: 1; }
  .kd-console { order: 2; max-width: none; margin-top: 0; }
  .kd-stage { width: min(100%, 720px); }
  .kd-explorer, .kd-work { grid-template-columns: 1fr; }
  .kd-diagram { max-width: 560px; width: 100%; margin-inline: auto; }
  .kd-person-top { grid-template-columns: 1fr; }
  .kd-kit, .kd-ix-stairs .kd-ix, .kd-ix-list .kd-ix, .kd-ix-list .kd-ix:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kd-ix-stairs li::after { display: none; }
  .kd-links { display: none; }
  .kd-nav { justify-content: space-between; }
  .kd-pill { display: inline-flex; }
}
@media (max-width: 720px) {
  .kd-h1 { font-size: clamp(3rem, 15vw, 4.6rem); }
  .kd-stage { min-width: 0; width: 100%; }
  .kd-machine figcaption { flex-direction: column; }
  .kd-meter dd { font-size: 1.35rem; }
  .kd-meter-score dd { font-size: 1.8rem; }
  .kd-head { grid-template-columns: 1fr; gap: .8rem; }
  .kd-kit, .kd-ix-list .kd-ix, .kd-ix-list .kd-ix:has(> li:nth-child(4):last-child), .kd-ix-stairs .kd-ix, .kd-ix-rules .kd-ix { grid-template-columns: 1fr; }
  .kd-panel dl > div { grid-template-columns: 1fr; gap: .15rem; }
  .kd-work-facts { grid-template-columns: 1fr; }
  .kd-nav-end > .kd-nav-cta, .kd-nav-end > .kd-nav-lang { display: none; }
  .kd-brand b { white-space: nowrap; font-size: 1.1rem; }
}

/* ───────── Texture + annotation layer ─────────
   Textures only in a few places: paper grain on the gray sections, felt on the deep green ones, a drafting
   board behind the game. White sections stay clean. English micro-labels are decorative (aria-hidden). */
:root {
  /* Paper: fine dark specks + a faint low-frequency cloud. */
  --kd-tex-paper: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.95' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .06 0 0 0 0 .08 0 0 0 0 .06 0 0 0 -.75 .4'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.012' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .05 0 0 0 0 .17 0 0 0 0 .12 0 0 0 .08 -.03'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23b)'/%3E%3Crect width='240' height='240' filter='url(%23a)'/%3E%3C/svg%3E");
  /* Felt: light fibres + darker mottling, read as a pool-table cloth. */
  --kd-tex-felt: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .95 0 0 0 0 .7 0 0 0 1.1 -.52'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.018' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 .02 0 0 0 0 .01 0 0 0 .9 -.3'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23b)'/%3E%3Crect width='260' height='260' filter='url(%23a)'/%3E%3C/svg%3E");
  /* Same felt with neutral graphite fibres, for black or other non-green grounds (html[data-felt=graphite]). */
  --kd-tex-felt-graphite: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='260' height='260'%3E%3Cfilter id='a'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .62 0 0 0 0 .63 0 0 0 0 .65 0 0 0 1.05 -.5'/%3E%3C/filter%3E%3Cfilter id='b'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.018' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 -.3'/%3E%3C/filter%3E%3Crect width='260' height='260' filter='url(%23b)'/%3E%3Crect width='260' height='260' filter='url(%23a)'/%3E%3C/svg%3E");
  --kd-tex-grid: radial-gradient(circle, rgb(16 18 16 / .16) 1px, transparent 1.3px) 0 0 / 22px 22px;
}
body.kd-skin { overflow-x: clip; counter-reset: kd-sheet; }

/* Felt on every deep-green surface, not only sections. */
.kd-ix-call, .kd-closing, .kd-meter-score, body.kd-skin .ft { background: var(--kd-tex-felt), var(--kd-deep) !important; }
body.kd-skin .ft { color: rgb(255 255 255 / .8); }

/* Drafting board behind the game. */
.kd-machine { background: var(--kd-tex-grid), var(--kd-tex-paper), var(--kd-gray); position: relative; }
.kd-fig-head { display: flex; justify-content: space-between; gap: 1rem; padding: 0 .2rem .7rem; margin-bottom: .2rem; border-bottom: 1px dashed rgb(16 18 16 / .22); }

/* Registration brackets just outside a figure. */
.kd-crop { position: relative; }
.kd-crop::before { content: ''; position: absolute; inset: -12px; pointer-events: none; --c: rgb(16 18 16 / .45); --l: 14px;
  background:
    linear-gradient(var(--c), var(--c)) 0 0 / var(--l) 1px, linear-gradient(var(--c), var(--c)) 0 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 0 / var(--l) 1px, linear-gradient(var(--c), var(--c)) 100% 0 / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 0 100% / var(--l) 1px, linear-gradient(var(--c), var(--c)) 0 100% / 1px var(--l),
    linear-gradient(var(--c), var(--c)) 100% 100% / var(--l) 1px, linear-gradient(var(--c), var(--c)) 100% 100% / 1px var(--l);
  background-repeat: no-repeat; }
.kd-work-shot.kd-crop { overflow: visible; }
.kd-work-shot.kd-crop img { border-radius: inherit; }

/* Micro type: small, tracked, upper-case Latin. */
.kd-micro { display: inline-block; font-family: 'Peyda', system-ui, sans-serif; font-size: .7rem; font-weight: 700; line-height: 1.4; letter-spacing: .14em; text-transform: uppercase; color: var(--kd-muted-c); white-space: nowrap; }
.kd-deep .kd-micro, .kd-ix-call .kd-micro, .kd-closing .kd-micro { color: rgb(255 255 255 / .6); }

/* Sheet line above each section: № + label, a hairline, an aside. Numbered in page order. */
.kd-secmark { display: flex; align-items: center; gap: 1rem; margin-bottom: clamp(28px, 3.5vw, 48px); }
.kd-secmark i { flex: 1; height: 1px; background: currentColor; opacity: .18; }
.kd-secmark > span:first-child { color: inherit; }
.kd-secno { counter-increment: kd-sheet; font-weight: 800; color: var(--kd-deep); margin-inline-end: .9em; }
.kd-secno::before { content: '№ ' counter(kd-sheet, decimal-leading-zero); }
.kd-deep .kd-secno, .kd-ix-call .kd-secno { color: var(--kd-signal); }
.kd-ix-call .kd-secmark { margin-bottom: 1.6rem; }

/* The other language, whispered under the big titles. */
.kd-echo { margin-top: .35rem; font-size: clamp(.85rem, 1.1vw, 1rem); font-weight: 700; letter-spacing: .16em; text-transform: uppercase; color: var(--kd-muted-c); display: flex; align-items: center; gap: .7rem; }
.kd-echo::before { content: ''; width: 34px; height: 1px; background: currentColor; }
html[dir=ltr] .kd-echo { letter-spacing: 0; text-transform: none; font-size: clamp(1rem, 1.3vw, 1.2rem); }
.kd-name + .kd-echo { margin-top: .1rem; }

/* Per-card labels sit opposite the icon/number. */
.kd-ix li { position: relative; }
.kd-ix-micro { position: absolute; top: 1.7rem; right: 1.4rem; }
html[dir=rtl] .kd-ix-micro { right: auto; left: 1.4rem; }
.kd-ix-stairs .kd-ix-micro, .kd-ix-rules .kd-ix-micro { max-width: calc(100% - 6rem); white-space: normal; text-align: end; }
.kd-closing .kd-micro, .kd-plate { display: block; }
.kd-closing .kd-micro { margin-bottom: .8rem; }
.kd-plate { position: absolute; bottom: calc(100% + 18px); left: 0; }
html[dir=rtl] .kd-plate { left: auto; right: 0; }
.kd-console-title::after { content: 'Score sheet'; margin-inline-start: auto; font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--kd-muted-c); }

/* The band: faint English words looping along the seam under the hero (dir=ltr so the track starts at the left). */
.kd-band { direction: ltr; width: 104vw; margin-inline: calc(50% - 52vw); margin-bottom: clamp(56px, 7vw, 96px); background: var(--kd-tex-felt), var(--kd-deep); color: rgb(255 255 255 / .3); overflow: hidden; border-block: 1px solid rgb(255 255 255 / .06); }
.kd-band-track { display: flex; width: max-content; }
.kd-band p { display: flex; align-items: center; flex: none; padding: .72rem 0; margin: 0; white-space: nowrap; }
.kd-band span { font-size: .74rem; font-weight: 700; letter-spacing: .2em; text-transform: uppercase; padding-inline: 1.4rem; }
.kd-band span[lang=fa] { font-size: .9rem; letter-spacing: 0; }
.kd-band i { width: 4px; height: 4px; border-radius: 50%; background: rgb(255 255 255 / .22); flex: none; }
@media (prefers-reduced-motion: no-preference) {
  .kd-band-track { animation: kd-band 60s linear infinite; }
  .kd-band:hover .kd-band-track { animation-play-state: paused; }
}
@keyframes kd-band { to { transform: translateX(-50%); } }
@media (max-width: 640px) {
  .kd-band p { padding: .42rem 0; }
  .kd-band span { font-size: .62rem; letter-spacing: .18em; padding-inline: 1rem; }
  .kd-fig-head .kd-micro:last-child { display: none; }
  .kd-secmark > span:last-child { display: none; }
  .kd-ix-micro { position: static; order: -1; }
  .kd-crop::before { inset: -8px; --l: 10px; }
}

/* Index blocks without items (e.g. a narrow contact column) stack their head. */
.kd-index:not(:has(.kd-ix)) .kd-head { grid-template-columns: 1fr; gap: .8rem; }
/* Notes archive head (printed by inc/nav.php). */
.kd-notes-head { padding: 120px 0 64px; }
@media (max-width: 640px) { .kd-notes-head { padding: 96px 0 40px; } }
body.kd-skin.blog main.am > .bc, body.kd-skin.blog main.am > .ah { display: none; }
body.kd-skin.blog main.am { padding-block: 48px 96px; }

/* ───────── Diagonal seams + parallax cover ─────────
   .kd-cover: the section rises over the one before it with a slanted top edge (the transparent border
   reserves the slant's height inside the section's own background). .kd-cover-rev slants the other way.
   .kd-stick (home hero): sticky, so the game holds still while the next section slides over it. */
:root { --kd-sl: 5vw; }
.kd-cover { position: relative; z-index: 1; margin-top: calc(-1 * var(--kd-sl)); border-top: var(--kd-sl) solid transparent; clip-path: polygon(0 var(--kd-sl), 100% 0, 100% 100%, 0 100%); }
.kd-cover-rev { clip-path: polygon(0 0, 100% var(--kd-sl), 100% 100%, 0 100%); }
/* Keep the background off the transparent slant border, so a browser that drops the clip-path (seen on an Android
   phone) shows the section above there instead of a white wedge over the band. */
body .kd-cover { background-clip: padding-box !important; }
/* The cover rises --kd-sl into the section above, so that section gets the same room back — otherwise
   its last lines (e.g. a wrapped hero lead) slide under the slant. The sticky home hero is meant to be covered. */
.dy-s:not(.kd-stick):has(+ .kd-cover) > .dy-si { padding-bottom: var(--kd-sl); }
.kd-slant-bottom { clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--kd-sl))); padding-bottom: calc(64px + var(--kd-sl)) !important; }
.kd-stick { position: sticky; top: var(--kd-stick, 0px); z-index: 0; }
.kd-stick ~ .dy-s { position: relative; z-index: 1; }
/* The band lies along the slanted edge: pivot on its left end, tilt by the slant's angle (atan .05). */
.kd-has-band .kd-band { transform-origin: 0 0; transform: rotate(-2.862deg); }
.kd-has-band .dy-ci { gap: 0 !important; }

/* Hero on felt: the board and the score sheet stay paper-coloured, with ink text. */
.kd-deep .kd-console, .kd-deep .kd-machine { color: var(--kd-ink-c); --kd-muted-c: rgb(16 18 16 / .66); --kd-line: #e3e6e1; border-color: transparent; }
.kd-deep .kd-machine .kd-micro, .kd-deep .kd-console .kd-micro { color: rgb(16 18 16 / .66); }
.kd-deep .kd-crop::before { --c: rgb(255 255 255 / .5); }
.kd-deep .kd-hero .kd-lead, .kd-deep .kd-echo { color: rgb(255 255 255 / .74); }
.kd-deep .kd-h1 { color: var(--kd-white); }
.kd-band { background: var(--kd-tex-felt), #0b0f0c; }
.kd-cover, .kd-has-band { overflow-x: clip; }

/* ───────── Scroll reveal ─────────
   The theme fades whole sections in (.dy-rv), so a grey or green band washed in from the white page.
   Here the section's ground is always there; only its content rises out of a mask, list items in turn. */
body.kd-skin .dy-rv { opacity: 1; transform: none; transition: none; }
@media (prefers-reduced-motion: no-preference) {
  .js body.kd-skin .dy-rv .dy-w {
    clip-path: inset(-80px -80px -80px -80px);
    transition: transform 1s cubic-bezier(.16, 1, .3, 1), clip-path 1.1s cubic-bezier(.16, 1, .3, 1);
  }
  .js body.kd-skin .dy-rv:not(.in) .dy-w { transform: translateY(64px); clip-path: inset(-80px -80px 100% -80px); }
  .js body.kd-skin .dy-rv .kd-ix > li { transition: transform .9s cubic-bezier(.16, 1, .3, 1) calc(var(--i, 0) * 90ms + .15s); }
  .js body.kd-skin .dy-rv:not(.in) .kd-ix > li { transform: translateY(48px); }
  /* the section's rule line draws itself across */
  .js body.kd-skin .dy-rv .kd-secmark i { transform-origin: right; transition: transform 1.4s cubic-bezier(.16, 1, .3, 1) .2s; }
  html[dir=ltr].js body.kd-skin .dy-rv .kd-secmark i { transform-origin: left; }
  .js body.kd-skin .dy-rv:not(.in) .kd-secmark i { transform: scaleX(0); }
}

/* Compact score sheet: the small controls share the title row, the status line replaces the
   "starts on first link" hint instead of adding a row, so the sheet stays shorter than the game card. */
.kd-console { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 1rem; padding: 1.05rem 1.2rem 1.05rem; }
.kd-console > * { grid-column: 1 / -1; }
.kd-console > .kd-console-title { grid-column: 1; grid-row: 1; }
.kd-console > .kd-actions { grid-column: 2; grid-row: 1; margin-top: 0; gap: .9rem; align-items: center; font-size: .86rem; }
.kd-console-title::after { content: none; }
.kd-console .kd-skip { margin-inline-start: 0; }
.kd-brief { font-size: .9rem; line-height: 1.8; }
.kd-meter { margin-top: .7rem; }
.kd-meter-score dd { font-size: 1.8rem; line-height: 1.3; }
.kd-meter dd { font-size: 1.35rem; }
.kd-console .kd-wait { min-height: 2.3em; display: flex; align-items: center; margin-top: .45rem; }
.kd-console .kd-note:empty { display: none; }
.kd-console .kd-note:not(:empty) { min-height: 2.3em; margin-top: .45rem; display: flex; align-items: center; padding: .3rem .8rem; }
.kd-console .kd-wait[hidden], .kd-console .kd-wait:has(+ .kd-note:not(:empty)) { display: none; }
@media (max-width: 560px) {
  .kd-console > .kd-actions { grid-column: 1 / -1; grid-row: auto; margin-top: .6rem; }
}

/* ───────── Service scenes (inc/art.php) ─────────
   Base styles are the finished frame (what reduced-motion users see); keyframes run only in view (.is-on). */
.kd-ix li.has-art { padding-top: 1rem; }
.kd-ix li.has-art .kd-ix-micro { position: static; margin-top: .35rem; }
.kd-art { width: 100%; border-radius: 14px; background: var(--kd-gray); line-height: 0; overflow: hidden; }
.kd-paper-2 .kd-art, .kd-felt .kd-art { background: var(--kd-gray); }
.kd-art svg { direction: ltr; display: block; width: 100%; height: auto; overflow: visible; }
.kd-art * { transform-box: fill-box; }
.kd-art .ka-stroke, .kd-art .ka-stroke-k { fill: none; stroke: var(--kd-ink-c); stroke-width: 2; }
.kd-art .ka-stroke-w { fill: none; stroke: #fff; stroke-width: 2; }
.kd-art .ka-stroke-g { fill: none; stroke: var(--kd-signal); stroke-width: 2.6; stroke-linecap: round; }
.kd-art .ka-round { stroke-linecap: round; stroke-linejoin: round; }
.kd-art .ka-paper, .kd-art .ka-white { fill: #fff; }
.kd-art .ka-ink { fill: var(--kd-ink-c); }
.kd-art .ka-soft { fill: #e8eae5; }
.kd-art .ka-soft-d { fill: #d3d8d0; }
.kd-art .ka-signal { fill: var(--kd-signal); }
.kd-art .ka-signal-soft { fill: rgb(7 243 104 / .4); }
.kd-art .ka-deep { fill: var(--kd-deep); }
.kd-art .ka-white-d { fill: rgb(255 255 255 / .45); }
.kd-art .ka-cursor-p { fill: #fff; stroke: var(--kd-ink-c); stroke-width: 1.6; stroke-linejoin: round; }
.kd-art .ka-cursor { transform-box: view-box; transform-origin: 0 0; }
/* shop */
.kd-art-shop .ka-shop-cur { transform: translate(226px, 150px); }
.kd-art-shop .ka-shop-fly { opacity: 0; }
.kd-art-shop .ka-shop-btn, .kd-art-shop .ka-shop-badge, .kd-art-shop .ka-shop-cart { transform-origin: center; }
/* brand */
.kd-art .ka-grid { fill: none; stroke: rgb(16 18 16 / .2); stroke-width: 2.4; stroke-linecap: round; }
.kd-art-brand .ka-brand-guide { fill: none; stroke: var(--kd-signal); stroke-width: 1.2; stroke-dasharray: 3 4; opacity: 0; }
.kd-art-brand .ka-brand-arc { fill: none; stroke: #fff; stroke-width: 9; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.kd-art-brand .ka-brand-disc, .kd-art-brand .ka-brand-dot, .kd-art-brand .ka-brand-sw rect { transform-origin: center; }
.kd-art-brand .ka-brand-aa { font-family: var(--kd-font, inherit); font-weight: 900; font-size: 36px; fill: var(--kd-ink-c); }
.kd-art-brand .ka-click { fill: none; stroke: var(--kd-signal); stroke-width: 2; opacity: 0; transform-origin: center; }
.kd-art-brand .ka-brand-cur { transform: translate(276px, 160px); opacity: 0; }
/* flow */
.kd-art-flow .ka-flow-wire { fill: none; stroke: var(--kd-ink-c); stroke-width: 2; stroke-dasharray: 4 5; }
.kd-art-flow .ka-chip-pins { fill: none; stroke: var(--kd-deep); stroke-width: 3; stroke-linecap: round; }
.kd-art-flow .ka-flow-spark, .kd-art-flow .ka-row { transform-origin: center; }
.kd-art-flow .ka-tok { opacity: 0; }
.kd-art .ka-flow-cap { font-family: var(--kd-font, inherit); font-size: 9px; font-weight: 700; letter-spacing: .14em; fill: rgb(16 18 16 / .55); text-anchor: middle; }
/* growth */
.kd-art-growth .ka-axis { fill: none; stroke: var(--kd-ink-c); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.kd-art-growth .ka-gridline { fill: none; stroke: rgb(16 18 16 / .12); stroke-width: 1.2; stroke-dasharray: 3 5; }
.kd-art-growth .ka-bar { fill: #d3d8d0; transform-origin: bottom; }
.kd-art-growth .ka-bar:nth-of-type(6) { fill: var(--kd-signal); }
.kd-art-growth .ka-trend { fill: none; stroke: var(--kd-ink-c); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.kd-art-growth .ka-peak-ring { fill: none; stroke: var(--kd-signal); stroke-width: 2; opacity: 0; transform-origin: center; }
.kd-art-growth .ka-peak, .kd-art-growth .ka-rank { transform-origin: center; }
.kd-art-growth .ka-typed { transform-origin: left center; }
.kd-art-growth .ka-rank-n { font-family: var(--kd-font, inherit); font-weight: 900; font-size: 18px; fill: var(--kd-ink-c); text-anchor: middle; }

@media (prefers-reduced-motion: no-preference) {
  .kd-art.is-on * { animation-duration: 7s; animation-iteration-count: infinite; animation-timing-function: cubic-bezier(.45, 0, .2, 1); }
  /* shop: point, add to cart, item flies to the cart, badge, paid */
  .kd-art-shop.is-on .ka-shop-cur { animation-name: ka-shop-cur; }
  .kd-art-shop.is-on .ka-shop-btn { animation-name: ka-shop-btn; }
  .kd-art-shop.is-on .ka-shop-fly { animation-name: ka-shop-fly; }
  .kd-art-shop.is-on .ka-shop-badge { animation-name: ka-pop-hold; --at: 50%; }
  .kd-art-shop.is-on .ka-shop-cart { animation-name: ka-shop-cart; }
  .kd-art-shop.is-on .ka-shop-toast { animation-name: ka-shop-toast; }
  /* brand: click, the disc, the mark draws, its colours, type, then a card wearing it */
  .kd-art-brand.is-on * { animation-duration: 8s; }
  .kd-art-brand.is-on .ka-brand-cur { animation-name: ka-brand-cur; }
  .kd-art-brand.is-on .ka-click { animation-name: ka-click; }
  .kd-art-brand.is-on .ka-brand-guide { animation-name: ka-guide; }
  .kd-art-brand.is-on .ka-brand-disc { animation-name: ka-disc; }
  .kd-art-brand.is-on .ka-brand-arc { animation-name: ka-draw-arc; }
  .kd-art-brand.is-on .ka-brand-dot { animation-name: ka-dot; }
  .kd-art-brand.is-on .ka-brand-sw rect { animation-name: ka-sw; }
  .kd-art-brand.is-on .ka-brand-sw rect:nth-child(2) { animation-name: ka-sw2; }
  .kd-art-brand.is-on .ka-brand-sw rect:nth-child(3) { animation-name: ka-sw3; }
  .kd-art-brand.is-on .ka-brand-aa, .kd-art-brand.is-on .ka-brand-type { animation-name: ka-type; }
  .kd-art-brand.is-on .ka-brand-card { animation-name: ka-card; }
  /* flow: work comes in, the engine handles it, rows tick off by themselves */
  .kd-art-flow.is-on * { animation-duration: 6s; }
  .kd-art-flow.is-on .ka-flow-wire { animation: ka-wire 1s linear infinite; }
  .kd-art-flow.is-on .ka-tok-in { animation-name: ka-tok-in; animation-timing-function: linear; }
  .kd-art-flow.is-on .ka-tok-out { animation-name: ka-tok-out; animation-timing-function: linear; }
  .kd-art-flow.is-on .ka-tok-2 { animation-delay: 2s; }
  .kd-art-flow.is-on .ka-tok-3 { animation-delay: 4s; }
  .kd-art-flow.is-on .ka-flow-spark { animation: ka-spark 2s cubic-bezier(.45, 0, .2, 1) infinite; }
  .kd-art-flow.is-on .ka-row-1 { animation-name: ka-row1; }
  .kd-art-flow.is-on .ka-row-2 { animation-name: ka-row2; }
  .kd-art-flow.is-on .ka-row-3 { animation-name: ka-row3; }
  /* growth: a search is typed, bars rise, the trend draws, rank one */
  .kd-art-growth.is-on .ka-typed { animation-name: ka-typed; }
  .kd-art-growth.is-on .ka-bar { animation-name: ka-bar; animation-delay: calc(var(--b) * .16s); }
  .kd-art-growth.is-on .ka-trend { animation-name: ka-trend; }
  .kd-art-growth.is-on .ka-peak { animation-name: ka-peak; }
  .kd-art-growth.is-on .ka-peak-ring { animation-name: ka-ring; }
  .kd-art-growth.is-on .ka-rank { animation-name: ka-rank; }
}

@keyframes ka-shop-cur {
  0% { transform: translate(262px, 200px); opacity: 0; }
  6% { opacity: 1; }
  24%, 27% { transform: translate(226px, 150px) scale(1); }
  29% { transform: translate(226px, 150px) scale(.85); }
  32%, 46% { transform: translate(226px, 150px) scale(1); opacity: 1; }
  62% { transform: translate(300px, 196px); opacity: 1; }
  68%, 100% { transform: translate(300px, 196px); opacity: 0; }
}
@keyframes ka-shop-btn { 0%, 27% { transform: scale(1); } 30% { transform: scale(.93); } 34%, 100% { transform: scale(1); } }
@keyframes ka-shop-fly {
  0%, 29% { transform: translate(0, 0) scale(1); opacity: 0; }
  31% { opacity: 1; }
  47% { transform: translate(56px, -120px) scale(.45); opacity: 1; }
  50%, 100% { transform: translate(56px, -120px) scale(.45); opacity: 0; }
}
@keyframes ka-pop-hold { 0%, 49% { transform: scale(0); } 54% { transform: scale(1.3); } 58%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-shop-cart { 0%, 47% { transform: rotate(0); } 50% { transform: rotate(-10deg); } 53% { transform: rotate(7deg); } 56%, 100% { transform: rotate(0); } }
@keyframes ka-shop-toast {
  0%, 58% { opacity: 0; transform: translateY(-12px); }
  65%, 90% { opacity: 1; transform: translateY(0); }
  96%, 100% { opacity: 0; transform: translateY(0); }
}

@keyframes ka-brand-cur {
  0% { transform: translate(250px, 196px); opacity: 0; }
  5% { opacity: 1; }
  17%, 19% { transform: translate(104px, 100px) scale(1); }
  21% { transform: translate(104px, 100px) scale(.85); }
  24%, 46% { transform: translate(104px, 100px) scale(1); opacity: 1; }
  58% { transform: translate(276px, 160px); opacity: 1; }
  64%, 100% { transform: translate(276px, 160px); opacity: 0; }
}
@keyframes ka-click { 0%, 20% { opacity: 0; transform: scale(.4); } 21% { opacity: .9; } 34%, 100% { opacity: 0; transform: scale(2.4); } }
@keyframes ka-guide { 0%, 20% { opacity: 0; } 26%, 46% { opacity: 1; } 54%, 100% { opacity: 0; } }
@keyframes ka-disc { 0%, 21% { transform: scale(0); } 28% { transform: scale(1.06); } 31%, 92% { transform: scale(1); } 98%, 100% { transform: scale(0); } }
@keyframes ka-draw-arc { 0%, 30% { stroke-dashoffset: 1; opacity: 1; } 46%, 92% { stroke-dashoffset: 0; opacity: 1; } 97% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes ka-dot { 0%, 46% { transform: scale(0); } 51% { transform: scale(1.35); } 55%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-sw { 0%, 54% { transform: scale(0); } 58%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-sw2 { 0%, 57% { transform: scale(0); } 61%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-sw3 { 0%, 60% { transform: scale(0); } 64%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-type { 0%, 62% { opacity: 0; transform: translateY(8px); } 68%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
@keyframes ka-card { 0%, 68% { opacity: 0; transform: translateY(24px); } 76%, 92% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }

@keyframes ka-wire { to { stroke-dashoffset: -18; } }
@keyframes ka-tok-in { 0% { opacity: 0; transform: translateX(-6px); } 6% { opacity: 1; } 32% { opacity: 1; transform: translateX(36px); } 36%, 100% { opacity: 0; transform: translateX(42px); } }
@keyframes ka-tok-out { 0%, 40% { opacity: 0; transform: translateX(0); } 44% { opacity: 1; } 70% { opacity: 1; transform: translateX(36px); } 74%, 100% { opacity: 0; transform: translateX(42px); } }
@keyframes ka-spark { 0% { transform: rotate(0) scale(1); } 20% { transform: rotate(20deg) scale(1.25); } 40%, 100% { transform: rotate(90deg) scale(1); } }
@keyframes ka-row1 { 0%, 20% { transform: scale(0); } 25% { transform: scale(1.3); } 28%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-row2 { 0%, 52% { transform: scale(0); } 57% { transform: scale(1.3); } 60%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }
@keyframes ka-row3 { 0%, 82% { transform: scale(0); } 86% { transform: scale(1.3); } 89%, 92% { transform: scale(1); } 97%, 100% { transform: scale(0); } }

@keyframes ka-typed { 0%, 4% { transform: scaleX(0); } 20%, 92% { transform: scaleX(1); } 97%, 100% { transform: scaleX(0); } }
@keyframes ka-bar { 0%, 18% { transform: scaleY(0); } 30% { transform: scaleY(1.04); } 33%, 88% { transform: scaleY(1); } 93%, 100% { transform: scaleY(0); } }
@keyframes ka-trend { 0%, 42% { stroke-dashoffset: 1; opacity: 1; } 68%, 90% { stroke-dashoffset: 0; opacity: 1; } 95% { stroke-dashoffset: 0; opacity: 0; } 100% { stroke-dashoffset: 1; opacity: 0; } }
@keyframes ka-peak { 0%, 66% { transform: scale(0); } 71% { transform: scale(1.4); } 75%, 90% { transform: scale(1); } 95%, 100% { transform: scale(0); } }
@keyframes ka-ring { 0%, 72% { opacity: 0; transform: scale(1); } 74% { opacity: 1; } 88%, 100% { opacity: 0; transform: scale(2.4); } }
@keyframes ka-rank { 0%, 72% { opacity: 0; transform: translateY(10px) scale(.8); } 78%, 90% { opacity: 1; transform: none; } 95%, 100% { opacity: 0; transform: none; } }

/* Live market layer on felt-green surfaces (canvas from wp-src/net.ts): over the felt, under the content. */
.kd-net-host { isolation: isolate; }
.kd-net-host > .kd-net { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.kd-net-host > .kd-net-up { position: relative; z-index: 1; }

/* ───────── Menu: one hamburger on every screen; the menu opens as a felt-green page ───────── */
.kd-links { display: none !important; }
.kd-nav { justify-content: space-between; transition: background-color .3s ease, color .3s ease, border-color .3s ease; }
.kd-pill { display: inline-flex; }
.kd-nav.is-open { background: transparent; color: var(--kd-white); border-bottom-color: rgb(255 255 255 / .12); }
.kd-nav.is-open .kd-nav-lang, .kd-nav.is-open .kd-nav-cta { visibility: hidden; }
.kd-astro { inset: 0; padding: calc(68px + clamp(24px, 5vh, 56px)) clamp(16px, 6vw, 96px) clamp(24px, 5vh, 48px); background: var(--kd-tex-felt), var(--kd-deep); color: var(--kd-white); }
.kd-astro-dial { counter-reset: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 clamp(24px, 5vw, 80px); grid-template-rows: repeat(var(--kd-rows, 3), auto); grid-auto-flow: column; align-content: center; flex: 1; max-width: 1200px; width: 100%; margin-inline: auto; }
.kd-astro-item { background: none; border-radius: 0; padding: clamp(.6rem, 1.6vh, 1.1rem) 0; border-bottom: 1px solid rgb(255 255 255 / .14); color: var(--kd-white); gap: 1.2rem; transition: color .2s ease; }
.kd-astro-item span { background: none; width: auto; height: auto; color: var(--kd-signal); font-size: .85rem; letter-spacing: .1em; min-width: 2.2em; }
.kd-astro-item b { font-size: clamp(1.7rem, 3.6vw, 3.2rem); line-height: 1.35; transition: transform .25s cubic-bezier(.2, .7, .2, 1); }
.kd-astro-item::after { content: '←'; margin-inline-start: auto; font-size: 1.4rem; color: var(--kd-signal); opacity: 0; transform: translateX(12px); transition: opacity .2s ease, transform .25s ease; }
html[dir=ltr] .kd-astro-item::after { content: '→'; transform: translateX(-12px); }
.kd-astro-item:hover b, .kd-astro-item:focus-visible b { transform: translateX(-10px); }
html[dir=ltr] .kd-astro-item:hover b, html[dir=ltr] .kd-astro-item:focus-visible b { transform: translateX(10px); }
.kd-astro-item:hover::after, .kd-astro-item:focus-visible::after { opacity: 1; transform: none; }
.kd-astro-item.is-current { background: none; color: var(--kd-signal); }
.kd-astro-item.is-current span { background: none; color: var(--kd-signal); }
.kd-astro-foot { max-width: 1200px; width: 100%; margin: clamp(20px, 4vh, 40px) auto 0; }
.kd-astro-foot .kd-nav-lang { color: var(--kd-white); border: 1px solid rgb(255 255 255 / .25); padding: .6rem 1rem; }
.kd-astro-foot .kd-nav-lang:hover { background: rgb(255 255 255 / .08); }
.kd-astro-foot .kd-nav-cta { background: var(--kd-signal); color: var(--kd-ink-c) !important; padding: .8rem 1.4rem; }
.kd-astro-foot .kd-nav-cta:hover { background: #fff; }
@media (max-width: 760px) {
  .kd-astro-dial { grid-template-columns: 1fr; grid-template-rows: none; grid-auto-flow: row; align-content: start; }
}

/* Menu wipe: the felt rises from the bottom with a slanted edge (the reading-start side leads),
   then each item climbs out of a mask line while its rule draws in. Closing plays it back down.
   JS (nav.ts) sets --i on items and holds [hidden] until .is-closing finishes. */
.kd-astro-item { position: relative; border-bottom: 0; }
.kd-astro-item::before { content: ''; position: absolute; inset-inline: 0; bottom: 0; height: 1px; background: rgb(255 255 255 / .14); transform-origin: right; }
html[dir=ltr] .kd-astro-item::before { transform-origin: left; }
@keyframes kd-wipe-in-rtl { from { clip-path: polygon(0 calc(100% + 24vh), 100% 100%, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } to { clip-path: polygon(0 0, 100% -24vh, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } }
@keyframes kd-wipe-in-ltr { from { clip-path: polygon(0 100%, 100% calc(100% + 24vh), 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } to { clip-path: polygon(0 -24vh, 100% 0, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } }
@keyframes kd-wipe-out-rtl { from { clip-path: polygon(0 0, 100% -24vh, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } to { clip-path: polygon(0 calc(100% + 24vh), 100% 100%, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } }
@keyframes kd-wipe-out-ltr { from { clip-path: polygon(0 -24vh, 100% 0, 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } to { clip-path: polygon(0 100%, 100% calc(100% + 24vh), 100% calc(100% + 24vh), 0 calc(100% + 24vh)); } }
@keyframes kd-mask-up { from { transform: translateY(105%); clip-path: inset(0 0 105% 0); } to { transform: none; clip-path: inset(0); } }
@keyframes kd-rule { from { transform: scaleX(0); } }
@keyframes kd-fade-up { from { opacity: 0; transform: translateY(14px); } }
@keyframes kd-fade-out { to { opacity: 0; } }
@media (prefers-reduced-motion: no-preference) {
  .kd-astro:not([hidden]) { animation: kd-wipe-in-rtl .7s cubic-bezier(.76, 0, .24, 1) both; }
  html[dir=ltr] .kd-astro:not([hidden]) { animation-name: kd-wipe-in-ltr; }
  .kd-astro:not([hidden]) .kd-astro-item b,
  .kd-astro:not([hidden]) .kd-astro-item span { animation: kd-mask-up .6s cubic-bezier(.2, .8, .2, 1) backwards; animation-delay: calc(.32s + var(--i, 0) * 55ms); }
  .kd-astro:not([hidden]) .kd-astro-item span { animation-delay: calc(.38s + var(--i, 0) * 55ms); }
  .kd-astro:not([hidden]) .kd-astro-item::before { animation: kd-rule .7s cubic-bezier(.6, 0, .2, 1) both; animation-delay: calc(.28s + var(--i, 0) * 55ms); }
  .kd-astro:not([hidden]) .kd-astro-foot > * { animation: kd-fade-up .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .62s; }
  .kd-astro:not([hidden]) .kd-astro-foot > * + * { animation-delay: .68s; }
  .kd-astro.is-closing { animation: kd-wipe-out-rtl .5s cubic-bezier(.7, 0, .3, 1) both; }
  html[dir=ltr] .kd-astro.is-closing { animation-name: kd-wipe-out-ltr; }
  .kd-astro.is-closing .kd-astro-item b, .kd-astro.is-closing .kd-astro-item span,
  .kd-astro.is-closing .kd-astro-item::before, .kd-astro.is-closing .kd-astro-foot > * { animation: kd-fade-out .18s ease-out both; }
  /* the bar turns white only once the felt has climbed behind it */
  .kd-nav.is-open { transition-delay: .32s; }
}


/* ───────── Game: help button, intro, incident callouts ───────── */
.kd-help { position: absolute; top: 2%; inset-inline-end: 2%; z-index: 4; display: inline-flex; align-items: center; gap: .45rem; border: 1px solid var(--kd-line); background: var(--kd-white); color: var(--kd-ink-c); font: inherit; font-weight: 800; font-size: clamp(.72rem, 1vw, .85rem); padding: .3rem .75rem .3rem .4rem; border-radius: 999px; cursor: pointer; min-height: 34px; }
html[dir=ltr] .kd-help { padding: .3rem .4rem .3rem .75rem; }
.kd-help-t { font-style: normal; }
.kd-help span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--kd-signal); font-weight: 900; font-size: .8rem; }
.kd-help:hover { border-color: var(--kd-ink-c); }
.kd-gintro { z-index: 5; padding: 3%; }
.kd-intro-card { width: min(100%, 34rem); max-height: 100%; overflow: auto; padding: clamp(16px, 2.4vw, 28px); }
.kd-intro-card h2 { font-size: clamp(1.3rem, 2.4vw, 1.9rem); }
.kd-intro-me { background: rgb(7 243 104 / .16); border-radius: 12px; padding: .75rem .9rem .8rem; margin: -.1rem 0 0; }
.kd-intro-me .kd-over-kicker { font-size: .74rem; color: rgb(16 18 16 / .6); }
.kd-intro-card .kd-intro-me h2 { margin: .1rem 0 0; line-height: 1.4; }
.kd-intro-role { margin: .1rem 0 0; font-weight: 800; font-size: clamp(.86rem, 1.1vw, .98rem); color: var(--kd-ink-c); }
.kd-intro-about { margin: .45rem 0 0; font-size: clamp(.82rem, 1vw, .92rem); line-height: 1.85; color: var(--kd-ink-c); }
html[dir=ltr] .kd-intro-about { line-height: 1.55; }
.kd-intro-how { margin: .85rem 0 0; font-weight: 800; font-size: .84rem; }
.kd-intro-steps { list-style: none; padding: 0; margin: .4rem 0 0; display: grid; gap: .3rem; counter-reset: kd-step; }
.kd-intro-steps li { counter-increment: kd-step; display: grid; grid-template-columns: 22px 1fr; gap: .55rem; font-size: clamp(.78rem, .95vw, .86rem); line-height: 1.7; color: var(--kd-muted-c); }
html[dir=ltr] .kd-intro-steps li { line-height: 1.5; }
.kd-intro-steps li::before { content: counter(kd-step, persian); display: grid; place-items: center; width: 22px; height: 22px; border-radius: 7px; background: var(--kd-ink-c); color: var(--kd-white); font-weight: 900; font-size: .74rem; margin-top: .12rem; }
html[dir=ltr] .kd-intro-steps li::before { content: counter(kd-step); }
.kd-gintro .kd-over-actions { margin-top: .8rem; }

.kd-callouts { position: absolute; inset: 0; pointer-events: none; z-index: 3; }
/* trouble spot: a ring (sized to the part in --r, % of the board) that keeps rippling, and a small label beside it */
.kd-call { position: absolute; width: calc(var(--r) * 2%); aspect-ratio: 1; transform: translate(-50%, -50%); }
.kd-ring { position: absolute; inset: 0; border-radius: 50%; border: 2.5px solid var(--kd-call-ring); }
.kd-ring::before, .kd-ring::after { content: ''; position: absolute; inset: -2.5px; border-radius: 50%; border: 2px solid var(--kd-call-ring); opacity: 0; }
.kd-call-b { position: absolute; top: 50%; transform: translateY(-50%); white-space: nowrap; background: var(--kd-call-bg); color: var(--kd-call-fg); border-radius: 7px; padding: .12em .55em .16em; font-size: clamp(.62rem, .9vw, .76rem); font-weight: 800; line-height: 1.5; box-shadow: 0 6px 16px -10px rgb(12 44 32 / .6); }
.kd-call.to-right .kd-call-b { left: calc(100% + 8px); }
.kd-call.to-left .kd-call-b { right: calc(100% + 8px); }
.kd-call.tone-bad { --kd-call-ring: #ff6a3d; --kd-call-bg: #101210; --kd-call-fg: #fff; }
.kd-call.tone-bad .kd-call-b::before { content: '!'; display: inline-grid; place-items: center; width: 1.2em; height: 1.2em; border-radius: 50%; background: #ff6a3d; color: #101210; font-size: .9em; margin-inline-end: .35em; vertical-align: -.1em; }
.kd-call.tone-warn { --kd-call-ring: #101210; --kd-call-bg: #fff; --kd-call-fg: #101210; }
.kd-call.tone-warn .kd-call-b { outline: 1.5px solid #101210; }
.kd-call.tone-good { --kd-call-ring: #04b84d; --kd-call-bg: var(--kd-signal); --kd-call-fg: #101210; }
.kd-call.is-out { opacity: 0; transition: opacity .25s ease; }
/* the broken link itself: dashed orange so the ring sits on something visible */
.kd .link.is-broken .link-pencil { stroke: #ff6a3d; stroke-opacity: 1; stroke-width: 4; stroke-dasharray: 3 9; }
@media (prefers-reduced-motion: no-preference) {
  .kd-call { animation: kd-call-in .3s cubic-bezier(.2, 1.4, .4, 1); }
  .kd-ring::before { animation: kd-ripple 1.5s cubic-bezier(.2, .6, .3, 1) infinite; }
  .kd-ring::after { animation: kd-ripple 1.5s cubic-bezier(.2, .6, .3, 1) .75s infinite; }
  .kd-gintro:not([hidden]) .kd-intro-card { animation: kd-rise .35s cubic-bezier(.2, .7, .2, 1); }
  .kd-hud.bump b { animation: kd-bump .3s cubic-bezier(.2, 1.6, .4, 1); }
}
@keyframes kd-call-in { from { opacity: 0; scale: .7; } }
@keyframes kd-bump { from { transform: scale(1.3); } }
@keyframes kd-ripple { 0% { opacity: .9; transform: scale(1); } 100% { opacity: 0; transform: scale(1.75); } }

/* score on the board, top corner */
.kd-hud { position: absolute; top: 2%; inset-inline-start: 2%; z-index: 4; display: flex; align-items: baseline; gap: .45rem; background: var(--kd-deep); color: var(--kd-white); border-radius: 12px; padding: .3rem .75rem .35rem; pointer-events: none; font-variant-numeric: tabular-nums; }
.kd-hud-l { font-size: clamp(.6rem, .8vw, .7rem); font-weight: 700; opacity: .7; }
.kd-hud b { font-weight: 900; font-size: clamp(1.05rem, 1.9vw, 1.5rem); line-height: 1.2; display: inline-block; }
.kd-hud em { font-style: normal; font-weight: 900; font-size: .78rem; background: var(--kd-signal); color: var(--kd-ink-c); padding: 0 .4em; border-radius: 5px; }
.kd-hud i { font-style: normal; font-size: clamp(.62rem, .85vw, .75rem); font-weight: 700; opacity: .75; }
.kd-hud i:empty { display: none; }
.kd-hud.urgent i { color: #ffb48a; opacity: 1; }
@media (max-width: 560px) {
  .kd-help { gap: 0; padding: .3rem !important; }
  .kd-help-t { display: none; }
}
/* On phones the board is too small for the intro: it becomes a bottom sheet over the page. */
@media (max-width: 640px) {
  .kd-gintro { position: fixed; inset: 0; z-index: 95; padding: 76px 12px 12px; place-items: start center; background: rgb(12 44 32 / .45); }
  .kd-intro-card { width: 100%; max-height: calc(100svh - 88px); }
  .kd-intro-card .kd-intro-me h2 { font-size: 1.45rem; }
  .kd-intro-about { font-size: .86rem; }
  .kd-gintro .kd-cta { width: 100%; justify-content: center; }
  /* the board is ~360px wide here: the drawing shrinks with it, so its text should too */
  .kd-machine { padding: 6px; }
  .kd-label { font-size: .62rem; padding: .04em .35em; }
  .kd-call-b { font-size: .56rem; padding: .08em .45em .1em; border-radius: 5px; }
  .kd-coach span { font-size: .64rem; padding: .3em .65em; }
  .kd-coach svg { width: 20px; }
  .kd-hud { padding: .2rem .55rem .25rem; border-radius: 9px; }
  .kd-hud b { font-size: .95rem; }
}
.kd-jam span { display: none; }

/* ───────── Portfolio strip: square shots laid down slightly askew ───────── */
.kd-gallery-head { align-items: flex-end; }
.kd-gallery-head .kd-more { flex: none; }
.kd-shots { list-style: none; margin: clamp(32px, 4vw, 56px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: clamp(14px, 1.8vw, 26px); }
.kd-shots li { transform: translateY(var(--y)) rotate(var(--t)); transition: transform .45s cubic-bezier(.2, .8, .2, 1); }
.kd-shots li:hover, .kd-shots li:focus-within { transform: translateY(calc(var(--y) - 8px)) rotate(0deg); z-index: 1; }
.kd-shot { display: block; color: inherit; text-decoration: none; }
.kd-shot-img { position: relative; display: block; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--kd-gray); box-shadow: 0 18px 30px -22px rgb(12 44 32 / .6); outline: 6px solid var(--kd-white); }
.kd-paper-2 .kd-shot-img { outline-color: var(--kd-white); }
.kd-shot-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.kd-shot:hover .kd-shot-img img { transform: scale(1.05); }
.kd-shot:focus-visible { outline: none; }
.kd-shot:focus-visible .kd-shot-img { outline-color: var(--kd-signal); }
.kd-sample { position: absolute; top: 8px; inset-inline-end: 8px; font-style: normal; font-size: .66rem; font-weight: 800; letter-spacing: .06em; background: rgb(255 255 255 / .92); color: var(--kd-ink-c); padding: .1em .55em; border-radius: 6px; box-shadow: 0 0 0 1px rgb(16 18 16 / .14); }
.kd-shot-cap { display: block; margin-top: 1rem; padding-inline: .2rem; }
.kd-shot-cap b { display: block; font-weight: 800; font-size: .98rem; line-height: 1.5; }
.kd-shot-cap span { display: inline-block; margin-top: .3rem; font-size: .76rem; font-weight: 700; color: var(--kd-ink-c); background: rgb(7 243 104 / .22); padding: .05em .55em; border-radius: 6px; }
@media (max-width: 1100px) { .kd-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 40px; } }
@media (max-width: 640px) {
  .kd-shots { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 18px; padding: 16px 4px 28px; margin-inline: calc(-1 * var(--gut, 12px)); padding-inline: var(--gut, 12px); scrollbar-width: none; }
  .kd-shots li { flex: 0 0 62%; scroll-snap-align: center; }
  .kd-gallery-head { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) { .kd-shots li, .kd-shot-img img { transition: none; } }

/* ───────── Quote with portrait ───────── */
.kd-quote { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(28px, 5vw, 80px); align-items: center; max-width: 1080px; margin: 0 auto; }
.kd-quote.is-flip { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); }
.kd-quote.is-flip .kd-quote-pic { order: 2; }
.kd-quote-pic { position: relative; transform: rotate(-2.5deg); }
.kd-quote.is-flip .kd-quote-pic { transform: rotate(2deg); }
.kd-quote-pic img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 14px; outline: 8px solid var(--kd-white); box-shadow: 0 24px 40px -26px rgb(12 44 32 / .7); filter: grayscale(1) contrast(1.05); transition: filter .5s ease; }
.kd-quote-pic:hover img { filter: grayscale(0); }
.kd-quote-pic small { display: block; margin-top: 1rem; font-size: .7rem; color: var(--kd-muted-c); line-height: 1.6; }
.kd-quote-body { position: relative; }
.kd-quote-mark { display: block; font-weight: 900; font-size: clamp(5rem, 9vw, 8rem); line-height: .6; height: .45em; color: var(--kd-signal); }
.kd-quote blockquote { margin: 0; }
.kd-quote blockquote p { font-weight: 900; font-size: clamp(1.5rem, 2.9vw, 2.5rem); line-height: 1.6; }
html[dir=ltr] .kd-quote blockquote p { line-height: 1.2; letter-spacing: -.01em; }
.kd-quote-echo { margin-top: .9rem; font-size: clamp(.9rem, 1.1vw, 1.02rem); color: var(--kd-muted-c); font-weight: 600; }
.kd-quote figcaption { margin-top: 1.4rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1rem; padding-top: 1rem; border-top: 1px solid var(--kd-line); }
.kd-quote figcaption b { font-weight: 900; font-size: 1.1rem; }
.kd-quote figcaption span, .kd-quote cite { font-size: .85rem; color: var(--kd-muted-c); font-style: normal; }
.kd-quote cite { flex-basis: 100%; }
@media (max-width: 760px) {
  .kd-quote, .kd-quote.is-flip { grid-template-columns: 1fr; }
  .kd-quote-pic, .kd-quote.is-flip .kd-quote-pic { order: 0; width: min(62%, 260px); }
}

/* TEMPORARY felt colour picker */
.kd-tuner { position: fixed; z-index: 120; bottom: 16px; inset-inline-start: 16px; font-size: .82rem; color: var(--kd-ink-c); }
.kd-tuner-t { border: 0; background: var(--kd-ink-c); color: #fff; font: inherit; font-weight: 800; padding: .55rem .9rem; border-radius: 999px; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem; box-shadow: 0 10px 24px -12px rgb(0 0 0 / .5); }
.kd-tuner-t::before { content: ''; width: 14px; height: 14px; border-radius: 50%; background: var(--kd-deep); border: 2px solid #fff; }
.kd-tuner-p { position: absolute; bottom: calc(100% + 10px); inset-inline-start: 0; width: 250px; background: #fff; border: 1px solid var(--kd-line); border-radius: 14px; padding: .8rem; box-shadow: 0 20px 40px -20px rgb(0 0 0 / .45); }
.kd-tuner-p[hidden] { display: none; }
.kd-tuner-p p { line-height: 1.7; color: var(--kd-muted-c); }
.kd-tuner-sw { display: flex; flex-wrap: wrap; gap: 8px; margin-top: .6rem; }
.kd-tuner-sw button, .kd-tuner-sw label { width: 30px; height: 30px; border-radius: 9px; border: 2px solid var(--kd-line); background: var(--c, conic-gradient(red, yellow, lime, cyan, blue, magenta, red)); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.kd-tuner-sw button[aria-pressed=true] { border-color: var(--kd-signal); box-shadow: 0 0 0 2px var(--kd-ink-c); }
.kd-tuner-sw input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.kd-tuner-v { margin-top: .5rem; direction: ltr; text-align: start; }


/* Portfolio grid (portfolio page): three per row, same slight tilt, category chips */
.kd-gallery.is-grid .kd-shots { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(36px, 4vw, 56px) clamp(24px, 3vw, 44px); }
.kd-gallery.is-grid .kd-shots li { --y: 0px; }
.kd-gallery.is-grid .kd-shots li[hidden] { display: none; }
.kd-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: clamp(24px, 3vw, 36px); }
.kd-chips button { border: 1px solid var(--kd-line); background: var(--kd-white); color: var(--kd-ink-c); font: inherit; font-size: .88rem; font-weight: 700; padding: .45rem 1rem; border-radius: 999px; cursor: pointer; min-height: 40px; }
.kd-chips button:hover { border-color: var(--kd-ink-c); }
.kd-chips button[aria-pressed=true] { background: var(--kd-ink-c); color: var(--kd-white); border-color: var(--kd-ink-c); }
@media (max-width: 900px) { .kd-gallery.is-grid .kd-shots { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .kd-gallery.is-grid .kd-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding: 0; gap: 28px 16px; }
  .kd-gallery.is-grid .kd-shots li { flex: none; }
}

/* ───────── Top bar without its white strip ─────────
   Every page opens on a felt surface, so the bar sits on it (transparent, white type) and scrolls away
   with the page; only the menu button stays fixed in the corner, reachable everywhere. */
.kd-nav { position: absolute; background: transparent; border-bottom: 0; color: var(--kd-white); }
.kd-nav .kd-brand b { color: var(--kd-white); }
.kd-nav .kd-nav-lang { color: var(--kd-white); }
.kd-nav .kd-nav-lang:hover { background: rgb(255 255 255 / .1); }
.kd-nav .kd-nav-cta { background: var(--kd-white); color: var(--kd-ink-c) !important; }
.kd-nav .kd-nav-cta:hover { background: var(--kd-signal); }
.kd-nav-end { padding-inline-end: 56px; }
.kd-pill { position: fixed; top: 12px; inset-inline-end: clamp(16px, 3vw, 40px); z-index: 92; }
.kd-pill-icon { box-shadow: 0 8px 20px -10px rgb(0 0 0 / .45); }
.kd-nav.is-open { border-bottom: 0; }
.admin-bar .kd-pill { top: calc(32px + 12px); }
@media (max-width: 782px) { .admin-bar .kd-pill { top: calc(46px + 12px); } }
html[dir=rtl] .kd .stamp-g { transform: scaleX(-1); transform-box: fill-box; transform-origin: center; }
/* Dark surfaces wear the golf course's grass (owner's request, 2026-12-02): a dark seamless tile from
   wp-src/tools/make-grass.py over the black ground. The graphite felt above stays as a fallback. */
:root { --kd-tex-felt: url("/wp-content/plugins/kd-site/assets/kd-grass.webp") 0 0 / 320px 320px; }

/* Game: start hints at each new connection, tappable outside forces, end-of-day review */
.kd-call.tone-hint { --kd-call-ring: rgb(16 18 16 / .45); --kd-call-bg: #fff; --kd-call-fg: #101210; }
.kd-call.tone-hint .kd-ring { border-style: dashed; border-width: 2px; }
.kd-call.tone-hint .kd-ring::before, .kd-call.tone-hint .kd-ring::after { animation: none; }
.kd-call.tone-hint .kd-call-b { outline: 1px solid rgb(16 18 16 / .25); }
.kd-stage.is-aiming { cursor: crosshair; }
.kd-over-card { max-height: 100%; overflow: auto; }
.kd-review { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: .9rem; text-align: start; }
.kd-review > div { border-radius: 12px; padding: .7rem .8rem; }
.kd-review .is-good { background: rgb(7 243 104 / .14); }
.kd-review .is-bad { background: #fdf0ea; }
.kd-review h3 { font-weight: 900; font-size: .9rem; margin-bottom: .35rem; }
.kd-review ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .35rem; }
.kd-review li { font-size: .8rem; line-height: 1.7; position: relative; padding-inline-start: 1.1em; }
.kd-review li::before { content: ''; position: absolute; inset-inline-start: 0; top: .62em; width: .5em; height: .5em; border-radius: 50%; background: var(--kd-ink-c); }
.kd-review .is-good li::before { background: #04b84d; }
.kd-review .is-bad li::before { background: #ff6a3d; }
@media (max-width: 640px) {
  .kd-over { position: fixed; inset: 0; z-index: 95; padding: 76px 12px 12px; place-items: start center; background: rgb(0 0 0 / .45); }
  .kd-over .kd-over-card { width: 100%; max-height: calc(100svh - 88px); }
  .kd-review { grid-template-columns: 1fr; }
}

/* ───────── Footer (inc/nav.php) ───────── */
body.kd-skin .ft { display: none; }
.kd-foot { position: relative; background: var(--kd-tex-felt), var(--kd-deep); color: var(--kd-white); overflow: hidden; }
/* A page that ends on a dark section (about: principles) would run into the footer with no seam. */
body:has(main .dy-s.kd-deep:last-child) .kd-foot { border-top: 1px solid rgb(255 255 255 / .14); }
.kd-foot-in { width: min(1280px, 100% - 2 * clamp(16px, 4vw, 80px)); margin-inline: auto; padding: clamp(64px, 8vw, 112px) 0 28px; }
.kd-foot-top { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem 3rem; flex-wrap: wrap; padding-bottom: clamp(40px, 5vw, 64px); border-bottom: 1px solid rgb(255 255 255 / .14); }
.kd-foot-say { font-weight: 900; font-size: clamp(1.6rem, 3.2vw, 2.8rem); line-height: 1.45; max-width: 22ch; }
html[dir=ltr] .kd-foot-say { line-height: 1.15; letter-spacing: -.02em; }
.kd-foot-sub { margin-top: .6rem; color: rgb(255 255 255 / .7); font-size: 1rem; }
.kd-foot-cols { display: grid; grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr)); gap: 2rem clamp(24px, 4vw, 64px); padding: clamp(40px, 5vw, 64px) 0; }
.kd-foot-brand b { display: inline-flex; align-items: center; gap: .55rem; font-weight: 900; font-size: 1.3rem; }
.kd-foot-brand b::before { content: ''; width: 12px; height: 12px; border-radius: 50%; background: var(--kd-signal); }
.kd-foot-brand p { margin-top: .8rem; color: rgb(255 255 255 / .68); line-height: 1.9; max-width: 34ch; font-size: .95rem; }
.kd-foot h2 { font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--kd-signal); margin-bottom: 1rem; }
html[dir=rtl] .kd-foot h2 { letter-spacing: 0; font-size: .85rem; }
.kd-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .55rem; }
.kd-foot ul a { color: var(--kd-white); text-decoration: none; font-weight: 600; font-size: .95rem; opacity: .85; transition: opacity .15s ease, color .15s ease; }
.kd-foot ul a:hover, .kd-foot ul a[aria-current] { opacity: 1; color: var(--kd-signal); }
.kd-foot-soon { color: rgb(255 255 255 / .5); font-size: .88rem; }
.kd-foot-word { font-weight: 900; font-size: clamp(3.4rem, 13vw, 12rem); line-height: 1.1; white-space: nowrap; color: transparent; -webkit-text-stroke: 1px rgb(255 255 255 / .22); text-align: center; margin: 0 calc(-1 * clamp(16px, 4vw, 80px)); user-select: none; }
html[dir=ltr] .kd-foot-word { line-height: .95; letter-spacing: -.04em; }
.kd-foot-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; padding-top: 22px; border-top: 1px solid rgb(255 255 255 / .14); font-size: .85rem; color: rgb(255 255 255 / .6); }
.kd-foot-up { color: var(--kd-white); text-decoration: none; font-weight: 700; }
.kd-foot-up:hover { color: var(--kd-signal); }
.kd-foot :focus-visible { outline: 2px solid var(--kd-signal); outline-offset: 3px; }
@media (max-width: 900px) { .kd-foot-cols { grid-template-columns: 1fr 1fr; } .kd-foot-brand { grid-column: 1 / -1; } }
@media (max-width: 520px) { .kd-foot-cols { grid-template-columns: 1fr; } .kd-foot-top .kd-cta { width: 100%; justify-content: center; } }

/* ───────── Notes: archive cards and the single note (theme «split» layout, post_layout in setup) ───────── */
/* Archive cards: flat white boxes, bigger titles, image zoom on hover. */
body.kd-skin .pcs { gap: clamp(16px, 2vw, 28px); }
body.kd-skin .pcard { border: 1px solid var(--kd-line); border-radius: var(--kd-r); background: var(--kd-white); box-shadow: none; overflow: hidden; transition: border-color .2s ease, transform .3s cubic-bezier(.2, .7, .2, 1); }
body.kd-skin .pcard:hover { border-color: var(--kd-ink-c); transform: translateY(-3px); }
body.kd-skin .pcard-i { display: block; overflow: hidden; aspect-ratio: 16 / 9; }
body.kd-skin .pcard-i img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
body.kd-skin .pcard:hover .pcard-i img { transform: scale(1.04); }
body.kd-skin .pcard-b { padding: clamp(18px, 2vw, 26px); }
body.kd-skin .pcard-m { font-size: .8rem; font-weight: 700; color: var(--kd-muted-c); letter-spacing: .02em; }
body.kd-skin .pcard h3 { font-weight: 900; font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.6; margin: .5rem 0 .6rem; }
body.kd-skin .pcard h3 a { color: var(--kd-ink-c); text-decoration: none; background: linear-gradient(var(--kd-signal), var(--kd-signal)) no-repeat 100% 100% / 0 .35em; transition: background-size .35s ease; }
html[dir=ltr] body.kd-skin .pcard h3 a { background-position: 0 100%; }
body.kd-skin .pcard:hover h3 a { background-size: 100% .35em; }
body.kd-skin .pcard p { font-size: .95rem; line-height: 1.95; color: var(--kd-muted-c); }

/* Single note header: black felt with the live network, title and lead beside the cover, slanted bottom. */
body.kd-skin .pl-split .psp { background: var(--kd-tex-felt), var(--kd-deep); color: var(--kd-white); clip-path: polygon(0 0, 100% 0, 100% 100%, 0 calc(100% - var(--kd-sl))); padding: calc(68px + clamp(32px, 5vw, 64px)) 0 calc(clamp(48px, 6vw, 88px) + var(--kd-sl)); }
html[dir=ltr] body.kd-skin .pl-split .psp { clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--kd-sl)), 0 100%); }
body.kd-skin .psp-g { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(28px, 5vw, 80px); padding-block: 0; }
body.kd-skin .psp-g::before { content: 'FIELD NOTE'; grid-column: 1 / -1; direction: ltr; font: 700 .72rem/1 ui-monospace, Menlo, monospace; letter-spacing: .22em; color: rgb(255 255 255 / .55); display: flex; align-items: center; gap: 1rem; }
html[dir=rtl] body.kd-skin .psp-g::before { flex-direction: row-reverse; justify-content: flex-end; }
body.kd-skin .psp-g::before { background: linear-gradient(rgb(255 255 255 / .18), rgb(255 255 255 / .18)) no-repeat right 0 center / calc(100% - 9.5rem) 1px; }
html[dir=ltr] body.kd-skin .psp-g::before { background-position: right center; }
body.kd-skin .psp .pcats { display: flex; gap: .5rem; flex-wrap: wrap; }
body.kd-skin .psp .pcat { display: inline-flex; align-items: center; gap: .55rem; background: none; color: var(--kd-signal); padding: 0; font-weight: 800; font-size: .95rem; border-radius: 0; text-decoration: none; }
body.kd-skin .psp .pcat::before { content: ''; width: 28px; height: 4px; border-radius: 2px; background: currentColor; }
body.kd-skin .psp .art-t { color: var(--kd-white); font-weight: 900; font-size: clamp(2rem, 4.2vw, 3.6rem); line-height: 1.35; margin: 1rem 0 1.1rem; text-wrap: balance; }
html[dir=ltr] body.kd-skin .psp .art-t { letter-spacing: -.02em; word-spacing: .14em; line-height: 1.12; }
body.kd-skin .psp-t p { opacity: 1; color: rgb(255 255 255 / .74); font-size: clamp(1.05rem, 1.3vw, 1.2rem); line-height: 2; max-width: 44ch; margin: 0 0 1.6rem; }
body.kd-skin .psp .pm { color: rgb(255 255 255 / .6); font-size: .88rem; display: flex; flex-wrap: wrap; align-items: center; gap: .35rem .6rem; }
body.kd-skin .psp .pm i { font-style: normal; opacity: .5; }
body.kd-skin .psp .pm .pm-av { display: none; }
body.kd-skin .psp-i img { aspect-ratio: 16 / 10; border-radius: var(--kd-r); box-shadow: 0 30px 60px -30px rgb(0 0 0 / .8); transform: rotate(-2deg); border: 1px solid rgb(255 255 255 / .12); }
html[dir=ltr] body.kd-skin .psp-i img { transform: rotate(2deg); }
body.kd-skin .pl-split .am { margin-top: 0; padding-block: clamp(24px, 4vw, 56px) clamp(64px, 8vw, 112px); }

/* The reading column: ~68 characters, Peyda at a comfortable size; taller leading for Persian. */
body.kd-skin .pl-split .art { max-width: 46rem; margin-inline: auto; background: none; border: 0; box-shadow: none; padding: 0; }
body.kd-skin .pl-split .ent { font-size: clamp(1.05rem, 1.2vw, 1.15rem); line-height: 2.05; color: #262926; }
html[dir=ltr] body.kd-skin .pl-split .ent { line-height: 1.75; }
body.kd-skin .pl-split .ent > * + * { margin-top: 1.15em; }
body.kd-skin .pl-split .ent > p:first-child { font-size: 1.12em; color: var(--kd-ink-c); }
body.kd-skin .pl-split .ent h2 { font-weight: 900; font-size: clamp(1.45rem, 2.2vw, 1.85rem); line-height: 1.5; color: var(--kd-ink-c); margin-top: 2.2em; padding-top: 1.1em; border-top: 1px solid var(--kd-line); }
body.kd-skin .pl-split .ent h3 { font-weight: 800; font-size: 1.25rem; margin-top: 1.8em; }
body.kd-skin .pl-split .ent strong { font-weight: 800; color: var(--kd-ink-c); }
body.kd-skin .pl-split .ent em { font-style: normal; background: linear-gradient(transparent 62%, rgb(7 243 104 / .45) 0); padding-inline: .1em; }
body.kd-skin .pl-split .ent a { color: var(--kd-ink-c); text-decoration-color: var(--kd-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
body.kd-skin .pl-split .ent ul, body.kd-skin .pl-split .ent ol { padding-inline-start: 0; list-style: none; }
body.kd-skin .pl-split .ent li { position: relative; padding-inline-start: 2.1rem; }
body.kd-skin .pl-split .ent li + li { margin-top: .55em; }
body.kd-skin .pl-split .ent ul > li::before { content: ''; position: absolute; inset-inline-start: .35rem; top: .85em; width: 9px; height: 9px; border-radius: 2px; background: var(--kd-signal); }
html[dir=ltr] body.kd-skin .pl-split .ent ul > li::before { top: .65em; }
body.kd-skin .pl-split .ent ol { counter-reset: kd-li; }
body.kd-skin .pl-split .ent ol > li { counter-increment: kd-li; }
body.kd-skin .pl-split .ent ol > li::before { content: counter(kd-li); position: absolute; inset-inline-start: 0; top: .3em; display: grid; place-items: center; width: 1.55rem; height: 1.55rem; border-radius: 7px; background: var(--kd-ink-c); color: var(--kd-signal); font-weight: 900; font-size: .8rem; line-height: 1; }
html[dir=ltr] body.kd-skin .pl-split .ent ol > li::before { top: .12em; }
body.kd-skin .pl-split .ent blockquote { margin: 2.2em 0; padding: .2em 1.4rem; background: none; border: 0; border-inline-start: 6px solid var(--kd-signal); border-radius: 0; }
body.kd-skin .pl-split .ent blockquote p { font-weight: 900; font-size: clamp(1.35rem, 2.4vw, 1.9rem); line-height: 1.65; color: var(--kd-ink-c); margin: 0; }
html[dir=ltr] body.kd-skin .pl-split .ent blockquote p { line-height: 1.3; letter-spacing: -.01em; }
body.kd-skin .pl-split .ent table { display: table; width: 100%; border-collapse: collapse; font-size: .92em; line-height: 1.85; margin-block: 1.8em; }
body.kd-skin .pl-split .ent th, body.kd-skin .pl-split .ent td { border: 0; border-bottom: 1px solid var(--kd-line); padding: .85rem .6rem; text-align: start; vertical-align: top; }
body.kd-skin .pl-split .ent th { background: none; font-weight: 800; font-size: .82rem; color: var(--kd-muted-c); border-bottom: 2px solid var(--kd-ink-c); }
body.kd-skin .pl-split .ent td:first-child { font-weight: 700; color: var(--kd-ink-c); width: 38%; }
@media (max-width: 640px) {
  body.kd-skin .pl-split .ent table, body.kd-skin .pl-split .ent tbody, body.kd-skin .pl-split .ent tr, body.kd-skin .pl-split .ent td { display: block; width: auto; }
  body.kd-skin .pl-split .ent thead { display: none; }
  body.kd-skin .pl-split .ent tr { border-bottom: 1px solid var(--kd-line); padding-block: .8rem; }
  body.kd-skin .pl-split .ent td { border: 0; padding: .1rem 0; }
}

/* After the note: share row and prev/next as two large boxes. */
body.kd-skin .pl-split .psh { max-width: 46rem; margin: 3rem auto 0; padding-top: 1.4rem; border-top: 1px solid var(--kd-line); display: flex; align-items: center; gap: .5rem; font-size: .9rem; }
body.kd-skin .pl-split .psh b { font-weight: 800; margin-inline-end: .4rem; }
body.kd-skin .pl-split .psh .ib { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--kd-line); background: var(--kd-white); color: var(--kd-ink-c); display: inline-grid; place-items: center; }
body.kd-skin .pl-split .psh .ib:hover { background: var(--kd-signal); border-color: var(--kd-signal); }
body.kd-skin .pl-split .post-navigation { max-width: 72rem; margin: clamp(40px, 6vw, 72px) auto 0; }
body.kd-skin .pl-split .post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(12px, 2vw, 24px); margin: 0; }
body.kd-skin .pl-split .post-navigation .nav-next { grid-column: 2; }
body.kd-skin .pl-split .post-navigation a { display: flex; flex-direction: column; gap: .5rem; height: 100%; padding: clamp(20px, 3vw, 32px); border-radius: var(--kd-r); background: var(--kd-gray); color: var(--kd-ink-c); text-decoration: none; font-weight: 900; font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.6; transition: background-color .2s ease, color .2s ease; }
body.kd-skin .pl-split .post-navigation a::before { font-weight: 800; font-size: .8rem; color: var(--kd-muted-c); }
html[dir=rtl] body.kd-skin .pl-split .nav-previous a::before { content: '→ یادداشت قبلی'; }
html[dir=rtl] body.kd-skin .pl-split .nav-next a::before { content: 'یادداشت بعدی ←'; }
html[dir=ltr] body.kd-skin .pl-split .nav-previous a::before { content: '← Previous note'; }
html[dir=ltr] body.kd-skin .pl-split .nav-next a::before { content: 'Next note →'; }
body.kd-skin .pl-split .nav-next a { text-align: end; }
body.kd-skin .pl-split .post-navigation a:hover { background: var(--kd-deep); color: var(--kd-white); }
body.kd-skin .pl-split .post-navigation a:hover::before { color: var(--kd-signal); }
@media (max-width: 860px) {
  body.kd-skin .psp-g { grid-template-columns: 1fr; }
  body.kd-skin .psp-i { order: 2; }
  body.kd-skin .psp-i img { transform: none !important; }
  body.kd-skin .pl-split .post-navigation .nav-links { grid-template-columns: 1fr; }
  body.kd-skin .pl-split .post-navigation .nav-next { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  body.kd-skin .pcard, body.kd-skin .pcard-i img { transition: none; }
  body.kd-skin .pcard:hover, body.kd-skin .pcard:hover .pcard-i img { transform: none; }
}

/* Plain long-form pages (privacy): the same reading column as a note. */
.kd-prose .ent { max-width: 46rem; margin-inline: auto; font-size: clamp(1.02rem, 1.15vw, 1.1rem); line-height: 2.05; color: #262926; }
html[dir=ltr] .kd-prose .ent { line-height: 1.75; }
.kd-prose .ent > * + * { margin-top: 1.1em; }
.kd-prose .ent h2 { font-weight: 900; font-size: clamp(1.3rem, 2vw, 1.6rem); line-height: 1.5; color: var(--kd-ink-c); margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--kd-line); }
.kd-prose .ent ul { list-style: none; padding-inline-start: 0; }
.kd-prose .ent li { position: relative; padding-inline-start: 2.1rem; }
.kd-prose .ent li + li { margin-top: .5em; }
.kd-prose .ent li::before { content: ''; position: absolute; inset-inline-start: .35rem; top: .85em; width: 9px; height: 9px; border-radius: 2px; background: var(--kd-signal); }
html[dir=ltr] .kd-prose .ent li::before { top: .65em; }
.kd-prose .ent a, .kd-formnote a { color: var(--kd-ink-c); text-decoration: underline; text-decoration-color: var(--kd-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kd-prose .ent .kd-updated { font-size: .85rem; font-weight: 700; color: var(--kd-muted-c); }
.kd-formnote { margin-top: 1rem; font-size: .88rem; color: var(--kd-muted-c); }
.kd-foot-priv { color: inherit; text-decoration: none; margin-inline-start: auto; margin-inline-end: 1.5rem; }
.kd-foot-priv:hover { color: var(--kd-white); }

/* ---------------------------------------------------------------- contact channels (inc/contact-info.php) */
.kd-ct { list-style: none; margin: 0; padding: 0; }
.kd-ct a { text-decoration: none; color: inherit; }
.kd-ct-ico { flex: none; width: 20px; height: 20px; }
.kd-ct-val[dir=ltr] { unicode-bidi: isolate; }

/* footer column */
.kd-foot .kd-ct--foot { margin-top: .55rem; }
.kd-foot .kd-ct--foot a { display: inline-flex; align-items: center; gap: .6rem; }
.kd-foot .kd-ct--foot .kd-ct-ico { width: 18px; height: 18px; color: var(--kd-signal); transition: transform .2s ease; }
.kd-foot .kd-ct--foot a:hover .kd-ct-ico { transform: scale(1.12); }
.kd-foot .kd-ct--foot .kd-ct-val { font-size: .92rem; letter-spacing: .01em; }

/* bottom of the full-screen menu */
.kd-astro-foot { align-items: flex-end; flex-wrap: wrap; gap: 1.4rem 2rem; padding-top: clamp(18px, 3vh, 28px); border-top: 1px solid rgb(255 255 255 / .14); }
.kd-astro-ct-h { font-size: .8rem; font-weight: 800; color: var(--kd-signal); margin-bottom: .7rem; }
html[dir=ltr] .kd-astro-ct-h { text-transform: uppercase; letter-spacing: .14em; font-size: .7rem; }
.kd-ct--menu { display: flex; gap: .5rem; }
.kd-ct--menu a { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid rgb(255 255 255 / .22); border-radius: 12px; color: var(--kd-white); transition: background .18s ease, color .18s ease, border-color .18s ease; }
.kd-ct--menu .kd-ct-ico { width: 20px; height: 20px; color: var(--kd-signal); transition: color .18s ease; }
.kd-ct--menu a:hover, .kd-ct--menu a:focus-visible { background: var(--kd-signal); border-color: var(--kd-signal); color: var(--kd-ink-c); }
.kd-ct--menu a:hover .kd-ct-ico, .kd-ct--menu a:focus-visible .kd-ct-ico { color: var(--kd-ink-c); }
.kd-astro-act { display: flex; align-items: center; gap: 1rem; }
@media (max-width: 640px) {
  .kd-astro-foot { flex-direction: column; align-items: stretch; }
  .kd-astro-act { justify-content: space-between; }
}

/* contact page cards */
.kd-contact { margin-top: 1.4rem; }
.kd-ct--cards { display: grid; gap: 10px; }
.kd-ct--cards a { position: relative; display: flex; align-items: center; gap: 1rem; padding: 1.05rem 1.15rem; border-radius: var(--kd-r); background: var(--kd-gray); border: 1px solid var(--kd-line); color: var(--kd-ink-c); transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s cubic-bezier(.2, .7, .2, 1); }
.kd-ct-badge { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--kd-ink-c); color: var(--kd-signal); transition: background .2s ease, color .2s ease; }
.kd-ct-badge .kd-ct-ico { width: 22px; height: 22px; }
.kd-ct-text { display: grid; gap: .1rem; min-width: 0; }
.kd-ct--cards .kd-ct-label { font-size: .8rem; font-weight: 700; color: var(--kd-muted-c); transition: color .2s ease; }
.kd-ct--cards .kd-ct-val { font-weight: 900; font-size: 1.15rem; line-height: 1.5; overflow-wrap: anywhere; }
.kd-ct--cards .kd-ct-val[dir=ltr] { text-align: start; justify-self: start; }
.kd-ct-hint { font-size: .82rem; color: var(--kd-muted-c); transition: color .2s ease; }
.kd-ct-go { margin-inline-start: auto; align-self: flex-start; font-size: 1.1rem; color: var(--kd-muted-c); transition: transform .2s ease, color .2s ease; }
.kd-ct--cards a:hover, .kd-ct--cards a:focus-visible { background: var(--kd-deep); border-color: var(--kd-deep); color: var(--kd-white); transform: translateY(-2px); }
.kd-ct--cards a:hover .kd-ct-badge, .kd-ct--cards a:focus-visible .kd-ct-badge { background: var(--kd-signal); color: var(--kd-ink-c); }
.kd-ct--cards a:hover :is(.kd-ct-label, .kd-ct-hint), .kd-ct--cards a:focus-visible :is(.kd-ct-label, .kd-ct-hint) { color: rgb(255 255 255 / .66); }
.kd-ct--cards a:hover .kd-ct-go, .kd-ct--cards a:focus-visible .kd-ct-go { color: var(--kd-signal); transform: translate(-3px, -3px); }
html[dir=ltr] .kd-ct--cards a:hover .kd-ct-go, html[dir=ltr] .kd-ct--cards a:focus-visible .kd-ct-go { transform: translate(3px, -3px); }
@media (prefers-reduced-motion: reduce) {
  .kd-ct--cards a, .kd-ct-go, .kd-foot .kd-ct--foot .kd-ct-ico { transition: none; transform: none !important; }
}
@media (max-width: 480px) {
  .kd-ct--cards a { gap: .8rem; padding: .95rem; }
  .kd-ct-badge { width: 42px; height: 42px; border-radius: 12px; }
  .kd-ct--cards .kd-ct-email .kd-ct-val { font-size: clamp(.86rem, 4.1vw, 1.05rem); overflow-wrap: normal; }
}

/* Decoy links (sf, am) are told apart by colour, not by a callout: orange = does harm, like the threats. */
.kd .link.role-decoy .link-pencil { stroke: #ff6a3d; stroke-opacity: .75; }
.kd .link.role-decoy.is-on .link-ink { stroke: #ff6a3d; stroke-dasharray: 10 5; }
.kd .link.role-decoy.is-on .link-flow { stroke: #ffb48a; }
.kd-joint[data-link=sf], .kd-joint[data-link=am] { border-color: #ff6a3d; background: #fff1eb; }
.kd-joint[data-link=sf] path, .kd-joint[data-link=am] path { stroke: #e0501f; }
.kd-joint.is-on[data-link=sf], .kd-joint.is-on[data-link=am] { background: #ff6a3d; border-color: #ff6a3d; }
.kd-joint.is-on[data-link=sf] path, .kd-joint.is-on[data-link=am] path { stroke: #101210; }
/* Phones: the coach bubble hangs below its joint so it clears the score box in the top corner. */
@media (max-width: 640px) {
  .kd-coach { transform: translate(-50%, 24px); flex-direction: column-reverse; }
  .kd-coach svg { transform: scaleY(-1); margin: 0 0 2px; }
}

/* ---------- home hero: business golf (kd_golf; the game itself lives in a shadow root, see inc/golf.php) ---------- */
.kd-golf-sec, .kd-golf-sec > .dy-si { padding: 0 !important; }
.kd-golf-sec .dy-row { gap: 0 !important; }
.kd-golf { display: block; min-height: 100svh; background: #000; --kg-under: calc(var(--kd-sl, 5vw) + 28px); }
.kd-golf-intro { color: #fff; }
.kd-golf-intro { font-family: 'Peyda', 'KD Digits', Tahoma, sans-serif; text-align: right; }
.kd-golf:not(.is-on) > .kd-golf-intro { padding: 140px clamp(16px, 3vw, 40px) 40px; max-width: 640px; } /* before the script runs, or without it */
.kd-golf-intro .kd-kicker { color: var(--kd-signal); font-size: .86rem; margin: 0 0 .4rem; }
.kd-golf-h1 { margin: 0; font-weight: 900; font-size: clamp(2.3rem, 4.2vw, 3.6rem); line-height: 1.08; color: #fff; }
.kd-golf-echo { margin: .35rem 0 0; font-family: 'JetBrains Mono', ui-monospace, monospace; font-weight: 700; font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: rgb(255 255 255 / .62); }
.kd-golf-lead { margin: .8rem 0 0; font-size: .95rem; line-height: 1.9; color: rgb(255 255 255 / .8); }
.kd-golf-more { display: inline-block; margin-top: .7rem; color: var(--kd-signal); font-weight: 800; font-size: .92rem; text-decoration: none; }
.kd-golf-more:hover { text-decoration: underline; }
@media (max-width: 640px) { .kd-golf-h1 { font-size: 2rem; } .kd-golf-lead { font-size: .86rem; line-height: 1.8; } }

/* ───────── Service landing pages (2026-12-02): hero with scene, linked cards, long text, FAQ ───────── */
.kd-crumbs ol { list-style: none; padding: 0; margin: 0 0 1.2rem; display: flex; flex-wrap: wrap; gap: .3rem .55rem; font-size: .85rem; font-weight: 600; color: var(--kd-muted-c); }
.kd-crumbs li + li::before { content: '/'; margin-inline-end: .55rem; opacity: .5; }
.kd-crumbs a { color: inherit; text-decoration: none; }
.kd-crumbs a:hover { color: var(--kd-signal); }
.kd-ph-grid { display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 80px); align-items: center; }
.kd-pagehead.has-art .kd-h1 { font-size: clamp(2.5rem, 4.6vw, 4.5rem); }
.kd-pagehead.has-art .kd-lead { max-width: 46ch; }
.kd-ph-art { padding: 10px; }
.kd-ph-art .kd-art { background: #fff; border-radius: calc(var(--kd-r) + 4px); box-shadow: 0 40px 80px -40px rgb(7 243 104 / .35); }
.kd-ph-art .kd-art svg { padding: 4%; }
.kd-deep .kd-crop::before { --c: rgb(255 255 255 / .5); }
.kd-ph-points { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .55rem; }
.kd-ph-points li { display: flex; align-items: flex-start; gap: .65rem; font-weight: 700; line-height: 1.8; }
.kd-ph-points li::before { content: ''; flex: none; width: 18px; height: 18px; margin-top: .3em; border-radius: 6px; background: var(--kd-signal) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M5 9.3l2.6 2.6L13 6.5' fill='none' stroke='%23101210' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 100% no-repeat; }
.kd-ph-acts { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.6rem; margin-top: 1.8rem; }
.kd-deep .kd-more { color: var(--kd-signal); }

.kd-ix li.has-link { position: relative; transition: border-color .2s ease, transform .2s ease, box-shadow .2s ease; }
.kd-ix-link { text-decoration: none; }
.kd-ix-link::after { content: ''; position: absolute; inset: 0; border-radius: inherit; }
.kd-ix-go { margin-top: auto; padding-top: .4rem; display: inline-flex; align-items: center; gap: .45rem; font-weight: 800; font-size: .92rem; color: var(--kd-deep); }
.kd-deep .kd-ix-go { color: var(--kd-signal); }
.kd-ix-go::after { content: '←'; transition: transform .2s ease; }
html[dir=ltr] .kd-ix-go::after { content: '→'; }
.kd-ix li.has-link:hover { border-color: var(--kd-ink-c); transform: translateY(-3px); box-shadow: 0 24px 40px -30px rgb(12 44 32 / .5); }
.kd-ix li.has-link:hover .kd-ix-go::after { transform: translateX(-4px); }
html[dir=ltr] .kd-ix li.has-link:hover .kd-ix-go::after { transform: translateX(4px); }
.kd-ix li.has-link:focus-within { outline: 2px solid var(--kd-ink-c); outline-offset: 3px; }
.kd-ix-link:focus-visible { outline: none; }

.kd-long-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.kd-long-side { position: sticky; top: 96px; }
.kd-long-side .kd-h2 { font-size: clamp(1.9rem, 3.2vw, 2.9rem); }
.kd-long-box { margin-top: 1.6rem; background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); padding: 1.3rem 1.3rem 1.1rem; }
.kd-long-box-t { font-weight: 900; font-size: 1.05rem; margin-bottom: .7rem !important; }
.kd-long-box ul { list-style: none; padding: 0; display: grid; gap: .5rem; }
.kd-long-box li { display: flex; gap: .6rem; line-height: 1.8; font-weight: 600; font-size: .96rem; }
.kd-long-box li::before { content: ''; flex: none; width: 8px; height: 8px; margin-top: .65em; border-radius: 2px; background: var(--kd-signal); }
.kd-long-body { font-size: clamp(1.02rem, 1.15vw, 1.1rem); line-height: 2.1; color: #262926; }
html[dir=ltr] .kd-long-body { line-height: 1.75; }
.kd-long-body > * + * { margin-top: 1.05em !important; }
.kd-long-body h3 { font-weight: 900; font-size: clamp(1.25rem, 1.8vw, 1.5rem); line-height: 1.6; color: var(--kd-ink-c); margin-top: 1.8em !important; }
.kd-long-body strong { color: var(--kd-ink-c); font-weight: 800; }
.kd-long-body a { color: var(--kd-ink-c); text-decoration-color: var(--kd-signal); text-decoration-thickness: 2px; text-underline-offset: 4px; }
.kd-long-body ul { padding: 0; list-style: none; display: grid; gap: .45rem; }
.kd-long-body ul li { position: relative; padding-inline-start: 1.3rem; }
.kd-long-body ul li::before { content: ''; position: absolute; inset-inline-start: 0; top: .85em; width: 8px; height: 8px; border-radius: 2px; background: var(--kd-signal); }

.kd-faq-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(28px, 6vw, 96px); align-items: start; }
.kd-faq-side { position: sticky; top: 96px; }
.kd-faq-side .kd-intro { margin-top: 1rem; }
.kd-faq-list { display: grid; gap: 12px; }
.kd-qa { background: var(--kd-box, var(--kd-gray)); border: 1px solid var(--kd-box-line, transparent); border-radius: var(--kd-r); }
.kd-qa summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1.15rem 1.3rem; min-height: 44px; }
.kd-qa summary::-webkit-details-marker { display: none; }
.kd-qa summary:focus-visible { outline: 2px solid var(--kd-ink-c); outline-offset: 2px; border-radius: var(--kd-r); }
.kd-qa h3 { font-weight: 800; font-size: clamp(1.02rem, 1.3vw, 1.15rem); line-height: 1.75; }
.kd-qa-i { flex: none; position: relative; width: 32px; height: 32px; border-radius: 10px; background: var(--kd-ink-c); transition: background-color .2s ease; }
.kd-qa-i::before, .kd-qa-i::after { content: ''; position: absolute; left: 50%; top: 50%; width: 12px; height: 2px; margin: -1px 0 0 -6px; background: #fff; border-radius: 1px; transition: transform .25s ease; }
.kd-qa-i::after { transform: rotate(90deg); }
.kd-qa[open] .kd-qa-i { background: var(--kd-signal); }
.kd-qa[open] .kd-qa-i::before, .kd-qa[open] .kd-qa-i::after { background: var(--kd-ink-c); }
.kd-qa[open] .kd-qa-i::after { transform: rotate(0); }
.kd-qa p { padding: 0 1.3rem 1.3rem; line-height: 2; color: var(--kd-muted-c); max-width: 68ch; }
html[dir=ltr] .kd-qa p { line-height: 1.65; }

/* web scene: blocks build in, the phone version slides in, the speed needle swings to fast */
.kd-art-web .ka-web-cur { transform: translate(214px, 60px); }
.kd-art-web .ka-web-needle { transform-origin: 0% 100%; transform-box: fill-box; }
@media (prefers-reduced-motion: no-preference) {
  .kd-art-web.is-on .ka-web-b { animation-name: ka-web-b; animation-delay: calc(var(--d) * .35s); }
  .kd-art-web.is-on .ka-web-phone { animation-name: ka-web-phone; }
  .kd-art-web.is-on .ka-web-needle { animation-name: ka-web-needle; }
  .kd-art-web.is-on .ka-web-cur { animation-name: ka-web-cur; }
}
@keyframes ka-web-b { 0% { opacity: 0; transform: translateY(8px); } 8%, 88% { opacity: 1; transform: none; } 96%, 100% { opacity: 0; transform: none; } }
@keyframes ka-web-phone { 0%, 38% { opacity: 0; transform: translateX(26px); } 48%, 90% { opacity: 1; transform: none; } 97%, 100% { opacity: 0; transform: none; } }
@keyframes ka-web-needle { 0%, 52% { transform: rotate(-95deg); } 64%, 90% { transform: rotate(0); } 100% { transform: rotate(-95deg); } }
@keyframes ka-web-cur { 0% { transform: translate(140px, 190px); opacity: 0; } 12% { opacity: 1; } 30% { transform: translate(214px, 52px); } 36% { transform: translate(214px, 54px); } 70% { transform: translate(282px, 168px); opacity: 1; } 85%, 100% { transform: translate(282px, 168px); opacity: 0; } }

@media (max-width: 1024px) {
  .kd-ph-grid, .kd-long-grid, .kd-faq-grid { grid-template-columns: 1fr; }
  .kd-long-side, .kd-faq-side { position: static; }
  .kd-ph-art { max-width: 560px; }
}
@media (prefers-reduced-motion: reduce) { .kd-ix li.has-link, .kd-qa-i, .kd-qa-i::before, .kd-qa-i::after { transition: none; } }
/* short strips (service pages: 3–4 samples) get bigger tiles */
@media (min-width: 1101px) {
  .kd-gallery:not(.is-grid) .kd-shots:has(> li:nth-child(3):last-child) { grid-template-columns: repeat(3, minmax(0, 1fr)); max-width: 1000px; }
  .kd-gallery:not(.is-grid) .kd-shots:has(> li:nth-child(4):last-child) { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ───────── Logo (owner's files, assets/logo) + services row in the menu (2026-12-02) ───────── */
.kd-brand::before { content: none; }
.kd-logo { display: block; height: auto; max-width: none; }
.kd-brand .kd-logo { width: auto; height: 34px; border-radius: 4px; }
.kd-brand:focus-visible { outline: 2px solid var(--kd-signal); outline-offset: 4px; border-radius: 6px; }
.kd-foot-logo { display: inline-block; }
.kd-foot-logo .kd-logo { width: auto; height: 48px; border-radius: 4px; box-shadow: 0 0 0 1px rgb(255 255 255 / .12); }
@media (max-width: 640px) { .kd-brand .kd-logo { height: 30px; } }

.kd-astro-sub { max-width: 1200px; width: 100%; margin: clamp(16px, 3vh, 28px) auto 0; }
.kd-astro-sub ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.kd-astro-sub a { display: inline-flex; align-items: center; min-height: 44px; padding: .5rem 1rem; border: 1px solid rgb(255 255 255 / .22); border-radius: 12px; color: var(--kd-white); text-decoration: none; font-weight: 700; font-size: .98rem; transition: background-color .2s ease, color .2s ease, border-color .2s ease; }
.kd-astro-sub a:hover, .kd-astro-sub a:focus-visible { background: var(--kd-signal); border-color: var(--kd-signal); color: var(--kd-ink-c); }
.kd-astro-sub a[aria-current] { border-color: var(--kd-signal); color: var(--kd-signal); }
@media (prefers-reduced-motion: no-preference) {
  .kd-astro:not([hidden]) .kd-astro-sub { animation: kd-fade-up .5s cubic-bezier(.2, .8, .2, 1) both; animation-delay: .56s; }
  .kd-astro.is-closing .kd-astro-sub { animation: kd-fade-out .18s ease-out both; }
}
@media (max-width: 640px) { .kd-astro-sub a { font-size: .9rem; padding: .45rem .8rem; } }
/* the square mark, fixed beside the menu button and the same size (owner, 2026-12-02) */
.kd-mark-fix { position: fixed; top: 12px; inset-inline-end: calc(clamp(16px, 3vw, 40px) + 44px + 8px); z-index: 92; width: 44px; height: 44px; border-radius: 12px; overflow: hidden; box-shadow: 0 8px 20px -10px rgb(0 0 0 / .45); line-height: 0; }
.kd-mark-fix .kd-logo { width: 44px; height: 44px; }
.kd-mark-fix:focus-visible { outline: 2px solid var(--kd-white); outline-offset: 3px; }
.admin-bar .kd-mark-fix { top: calc(32px + 12px); }
@media (max-width: 782px) { .admin-bar .kd-mark-fix { top: calc(46px + 12px); } }
.kd-nav-end { padding-inline-end: 108px; }
