/* /kitchen/ — the kitchen screen (UX run-29, DESIGN.md § 8m). A v2 family page on the css/toys.css tokens:
   putty surface, physical depth, springy keys, light and dark, Geist + Geist Mono. The board itself
   (kitchen/board.css) sits in a drawn tablet: an ink bezel with a camera dot and a soft drop, the board
   as its glass. «Start the kitchen screen» lifts the board out of the bezel to fill the viewport (and
   the display, where the browser allows full screen), with one «Leave the screen» key and a line that
   says whether the screen stays on. Lemon is the page's accent, the colour of «Next» on the board. */
body.kc {
  --t-display: "Geist", ui-sans-serif, system-ui, sans-serif;
  --kc-gutter: max(16px, env(safe-area-inset-left), env(safe-area-inset-right));
  --kc-dark: #141414;
  padding-top: var(--header-h);
  font-family: var(--t-display);
  font-variation-settings: normal;
}
html:has(body.kc) { scroll-padding-top: calc(var(--header-h) + 18px); }
body.kc .t-wrap,
body.kc .container-wide { width: min(100% - 2 * var(--kc-gutter), 1240px); }
body.kc .kc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Until kitchen.js has drawn the board, the room under the masthead is laid out but not painted. */
html.kc-wait #kc-stage,
html.kc-wait #kc-app,
html.kc-wait .site-foot { visibility: hidden; animation: kc-show 0s 3s forwards; }
@keyframes kc-show { to { visibility: visible; } }
@media (scripting: none) { #kc-stage, #kc-app { display: none; } }
.kc-noscript { margin: 0 0 32px; padding: 18px 20px; border-radius: var(--t-r-m); background: var(--t-card); box-shadow: inset 0 0 0 2px var(--t-line); }

/* ---------- Masthead ---------- */
.kc-main { padding-bottom: 40px; }
.kc-mast { display: grid; gap: 0 56px; padding: 36px 0 28px; }
@media (min-width: 1000px) { .kc-mast { grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); align-items: end; padding: 40px 0 36px; } .kc-kicker { grid-column: 1 / -1; } }
.kc-kicker { margin: 0 0 14px; color: var(--t-ink-2); }
.kc-mast h1 {
  margin: 0; max-width: 13ch;
  font-size: 2.5rem; line-height: .94; font-weight: 800; letter-spacing: -.02em; text-wrap: balance;
  animation: kc-rise .7s var(--t-spring) both;
}
.kc-mast h1:focus { outline: none; }
.kc-lede { margin: 20px 0 0; max-width: 50ch; font-size: 1.125rem; line-height: 1.42; color: var(--t-ink-2); text-wrap: pretty; }
.kc-lede strong { color: var(--t-ink); font-weight: 600; }
@media (min-width: 1000px) { .kc-lede { margin: 0; } }
@keyframes kc-rise { from { transform: translateY(28px) scale(.97); } }
@media (min-width: 380px) { .kc-mast h1 { font-size: 2.75rem; } }
@media (min-width: 600px) { .kc-mast h1 { font-size: 4.25rem; } .kc-lede { font-size: 1.25rem; } }
@media (min-width: 1100px) { .kc-mast h1 { font-size: 5rem; } }

/* ---------- The stage: whose day, the tablet, Start ---------- */
.kc-stage { display: grid; gap: 16px; margin-bottom: 64px; }
.kc-stage-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.kc-h2 { margin: 0 0 8px; font-size: 1.75rem; line-height: 1.05; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.kc-stage-head .kc-h2 { margin: 0; font-size: 1.375rem; }
@media (min-width: 900px) { .kc-h2 { font-size: 2.25rem; } .kc-stage-head .kc-h2 { font-size: 1.5rem; } }
.kc-show { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--t-surface-2); box-shadow: inset 0 0 0 1.5px var(--t-line); }
.kc-seg {
  min-height: 44px; padding: 8px 14px; border: 0; border-radius: var(--t-r-btn, 10px); cursor: pointer;
  background: transparent; color: var(--t-ink); font: 600 .9375rem/1.2 var(--t-display);
}
.kc-seg[aria-pressed="true"] { background: var(--t-card); box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -3px 0 rgba(0,0,0,.08); }
.kc-seg:focus-visible { outline: 3px solid var(--t-ink); outline-offset: 2px; }

/* The tablet, drawn: an ink bezel with a camera dot, the board as its glass. */
.kc-frame {
  position: relative; padding: clamp(10px, 1.7vw, 20px); border-radius: clamp(26px, 3.2vw, 44px);
  background: #0b0b0a;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.08), inset 0 -8px 0 rgba(255,255,255,.04), 0 34px 60px -34px rgba(0,0,0,.6);
  animation: kc-rise .8s var(--t-spring) .06s both;
}
.kc-frame::before {
  content: ""; position: absolute; top: calc(clamp(10px, 1.7vw, 20px) / 2 - 3px); left: 50%; width: 6px; height: 6px; margin-left: -3px;
  border-radius: 50%; background: #2c2c2a;
}
.kc-screen { position: relative; overflow: hidden; border-radius: clamp(14px, 1.8vw, 24px); background: #121211; }
.kc-screen:focus { outline: none; }
.kc-screen:focus-visible { outline: 3px solid var(--t-lemon); outline-offset: 3px; }
@media (min-width: 900px) { .kc-board .kc-b { min-height: min(62vh, 640px); } }
.kc-stage-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; }
.kc-note { margin: 0; max-width: 60ch; color: var(--t-ink-2); }
@media (max-width: 599px) { .kc-stage-foot > .kc-key { flex: 1 1 100%; } }

/* ---------- Keys ---------- */
body.kc .kc-key {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 20px; border: 0; border-radius: var(--t-r-btn, 10px); cursor: pointer;
  background: var(--t-card); color: var(--t-ink); text-decoration: none; text-align: center;
  font: 600 1rem/1.2 var(--t-display);
  box-shadow: inset 0 0 0 1.5px var(--t-line), inset 0 -4px 0 rgba(0,0,0,.08);
  transition: transform var(--t-base) var(--t-spring);
}
body.kc .kc-key:active { transform: translateY(2px) scale(.97); }
body.kc .kc-key:disabled { cursor: default; opacity: .6; }
body.kc .kc-key-ink { background: var(--t-ink); color: var(--t-surface); box-shadow: inset 0 -4px 0 rgba(255,255,255,.14); font-weight: 700; }
body.kc .kc-key-lemon { min-height: 56px; padding: 14px 26px; background: var(--t-lemon); color: var(--kc-dark); font-weight: 800; font-size: 1.0625rem; box-shadow: inset 0 -5px 0 rgba(0,0,0,.18); }
body.kc .kc-key:focus-visible { outline: 3px solid var(--t-ink); outline-offset: 3px; }

/* ---------- Full screen ---------- */
/* The board leaves the bezel and fills the viewport; the rest of the page is inert under it. */
body.kc-on { overflow: hidden; }
.kc-screen.is-on {
  position: fixed; inset: 0; z-index: 2000; border-radius: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  background: #121211;
}
.kc-screen.is-on .kc-board { height: 100%; }
.kc-screen.is-on .kc-b {
  height: 100%; min-height: 0; overflow: hidden; padding-bottom: 76px;
  transform: translate(var(--kc-shift-x, 0), var(--kc-shift-y, 0));
}
/* Full screen has a height as well as a width: every size also answers to the viewport's height, so a
   landscape laptop keeps the clock and the cards in view instead of trimming them away. */
.kc-screen.is-on .kc-b { --kc-gap: min(1.8cqi, 2vh); padding-top: min(3.2cqi, 4vh); padding-left: min(3.2cqi, 4vh); padding-right: min(3.2cqi, 4vh); }
.kc-screen.is-on .kc-clock { font-size: max(3rem, min(15cqi, 19vh)); }
.kc-screen.is-on .kc-clock-night { font-size: max(4rem, min(20cqi, 30vh)); }
.kc-screen.is-on .kc-date { font-size: max(1.125rem, min(2.9cqi, 4vh)); }
.kc-screen.is-on .kc-next { padding: min(2.4cqi, 2.6vh) min(2.8cqi, 3.4vh); }
.kc-screen.is-on .kc-next-t { font-size: max(1.375rem, min(4.4cqi, 5.4vh)); }
.kc-screen.is-on .kc-next-m { font-size: max(.9375rem, min(1.8cqi, 2.4vh)); }
.kc-screen.is-on .kc-row { min-height: max(48px, min(6.2cqi, 6.6vh)); }
.kc-screen.is-on .kc-row-t { font-size: max(1.0625rem, min(2.3cqi, 3vh)); }
.kc-screen.is-on .kc-row-time { font-size: max(.9375rem, min(1.9cqi, 2.6vh)); }
.kc-screen.is-on .kc-card { padding: min(2.2cqi, 2.6vh); }
.kc-screen.is-on .kc-card-t { font-size: max(1.25rem, min(2.9cqi, 3.6vh)); }
.kc-screen.is-on .kc-card-m, .kc-screen.is-on .kc-chip { font-size: max(.9375rem, min(1.75cqi, 2.3vh)); }
.kc-screen.is-on .kc-q { font-size: max(1.125rem, min(2.45cqi, 3vh)); }
.kc-screen.is-on .kc-h { font-size: max(1.125rem, min(2.4cqi, 3.2vh)); }
.kc-bar {
  position: absolute; right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); left: max(12px, env(safe-area-inset-left));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px 16px;
}
.kc-bar[hidden] { display: none; }
.kc-bar-note { margin: 0; font: 500 .8125rem/1.3 var(--t-mono); color: #a9a59c; text-align: right; }
.kc-leave {
  min-height: 44px; padding: 8px 16px; border: 0; border-radius: var(--t-r-btn, 10px); cursor: pointer;
  background: #2a2a27; color: #f2f0ea; font: 600 .9375rem/1.2 var(--t-display);
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.12);
}
.kc-leave:focus-visible { outline: 3px solid var(--t-lemon); outline-offset: 2px; }
.kc-screen.is-on.is-night-on .kc-bar-note, .kc-screen.is-on.is-night-on .kc-leave { color: #8c887f; background: #121211; }

/* ---------- Below the stage ---------- */
.kc-app { display: grid; grid-template-columns: minmax(0, 1fr); gap: 48px; }
@media (min-width: 1000px) { .kc-app { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px 48px; } .kc-real { grid-column: 1 / -1; } }
.kc-sub { margin: 0 0 18px; max-width: 64ch; color: var(--t-ink-2); }
.kc-steps { display: grid; gap: 14px; margin: 12px 0 0; padding: 0; list-style: none; counter-reset: kc; }
.kc-steps li {
  position: relative; padding: 16px 18px 16px 62px; border-radius: var(--t-r-m); background: var(--t-card);
  box-shadow: inset 0 0 0 1.5px var(--t-line); line-height: 1.45; counter-increment: kc;
}
.kc-steps li::before {
  content: counter(kc); position: absolute; left: 16px; top: 14px; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%;
  background: var(--t-lemon); color: var(--kc-dark); font: 700 1rem/1 var(--t-mono);
}
.kc-steps strong { display: block; margin-bottom: 2px; }
.kc-steps a, .kc-src a, .kc-real p a { color: var(--t-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.kc-src { display: grid; gap: 8px; margin: 12px 0 0; padding: 0; list-style: none; }
.kc-src li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 4px 16px;
  min-height: 56px; padding: 10px 16px; border-radius: var(--t-r-m); background: var(--t-card); box-shadow: inset 0 0 0 1.5px var(--t-line);
}
.kc-src-name { font-weight: 700; }
.kc-src-what { grid-column: 1; color: var(--t-ink-2); font-size: .9375rem; }
.kc-src-state { grid-row: 1 / span 2; grid-column: 2; font: 600 .8125rem/1.3 var(--t-mono); text-align: right; }
.kc-src-state a { display: inline-flex; align-items: center; min-height: 44px; }
.kc-src li.is-kept .kc-src-state { color: var(--t-ink); }
.kc-field { display: inline-grid; gap: 6px; font-weight: 600; }
.kc-field select {
  min-height: 48px; min-width: 160px; padding: 8px 12px; border: 0; border-radius: var(--t-r-s); background: var(--t-card); color: var(--t-ink);
  font: 600 1rem/1.2 var(--t-mono); box-shadow: inset 0 0 0 1.5px var(--t-line);
}
.kc-field select:focus-visible { outline: 3px solid var(--t-ink); outline-offset: 2px; }
.kc-real { padding: 28px 22px; border-radius: var(--t-r-l); background: var(--t-ink); color: var(--t-surface); }
.kc-real .t-label { color: inherit; opacity: .8; }
.kc-real h2 { margin: 6px 0 10px; font-size: 1.75rem; line-height: 1.05; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.kc-real p:not(.t-label) { margin: 0 0 18px; max-width: 66ch; }
body.kc .kc-real .kc-key-ink { background: var(--t-surface); color: var(--t-ink); }
body.kc .kc-real .kc-key:focus-visible { outline-color: var(--t-surface); }
@media (min-width: 600px) { .kc-real { padding: 36px 40px; } .kc-real h2 { font-size: 2.25rem; } }

@media (prefers-reduced-motion: reduce) {
  .kc-mast h1, .kc-frame { animation: none; }
  body.kc .kc-key { transition: none; }
  body.kc .kc-key:active { transform: none; }
}

@media print { .kc-stage-foot, .kc-show { display: none; } }

/* A transformed ancestor would hold a fixed child; the bezel's rise is over long before Start, but make sure. */
body.kc-on .kc-frame { animation: none; transform: none; }
