/* ==========================================================================
   TKCH v2 — base: reset, layout primitives, header + menu, language switch,
   "how we work" console, capabilities, contact form, footer, 404, a11y helpers.
   Owner: Claude 2. Colours come only from the semantic tokens in tokens.css
   (--bg, --fg, --fg-muted, --line, --accent …), so every block follows its [data-theme].
   ========================================================================== */

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--c-ink);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--c-ink);
  color: var(--c-text-on-ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; }
h1, h2, h3, h4 { font-weight: 700; line-height: 1.05; letter-spacing: var(--track-head); text-wrap: balance; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
[hidden] { display: none !important; }
img, svg, video, picture { display: block; max-width: 100%; }
img { height: auto; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-underline-offset: 0.22em; }
p { text-wrap: pretty; }

:focus-visible {
  outline: 2px solid var(--accent, var(--c-signal));
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- A11y helpers ---------- */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: 10px; left: 10px;
  z-index: 200;
  padding: 0.7em 1em;
  border-radius: var(--radius-s);
  background: var(--c-text-on-ink);
  color: var(--c-ink);
  font-weight: 650;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--dur-s) var(--ease-out);
}
.skip-link:focus-visible { transform: none; }

.scroll-sentinel { position: absolute; top: 0; left: 0; width: 1px; height: 48px; pointer-events: none; }

/* Legacy Polish anchors (#projekty, #zespol …) kept as empty markers so old links still land. */
.anchor-alias { position: absolute; top: 0; left: 0; width: 1px; height: 1px; pointer-events: none; }

/* ---------- Layout primitives ---------- */
.container {
  width: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.section-y { padding-block: var(--section-y); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 100;
  height: var(--header-h);
  color: var(--c-text-on-ink);
  transition: border-color 0.3s;
  border-bottom: 1px solid transparent;
}
/* The bar's background and blur live on ::before. A backdrop-filter on the header itself would make it
   the containing block for its position:fixed children, shrinking the full-screen phone menu to 68 px. */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: transparent;
  transition: background-color 0.3s;
}
.site-header[data-scrolled="true"] { border-bottom-color: rgb(244 241 234 / 0.08); }
.site-header[data-scrolled="true"]::before {
  background: rgb(8 9 13 / 0.78);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  backdrop-filter: saturate(150%) blur(16px);
}
.site-header__inner {
  height: 100%;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.brand__mark { width: 24px; height: 24px; }
.brand__node { fill: var(--c-signal); }

.site-menu { display: flex; align-items: center; gap: clamp(1rem, 2.4vw, 2.25rem); }
.site-nav ul { display: flex; gap: clamp(1rem, 2.4vw, 2.25rem); list-style: none; margin: 0; padding: 0; }
.site-nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.4rem;
  font-size: 0.95rem;
  font-weight: 550;
  text-decoration: none;
  color: rgb(244 241 234 / 0.78);
  transition: color var(--dur-s);
}
.site-nav a:hover, .site-nav a[aria-current="true"] { color: var(--c-text-on-ink); }
.site-nav a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--c-signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover::after, .site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.site-menu__cta.btn { min-height: 42px; padding: 0.5em 1.1em; font-size: 0.95rem; }

/* PL / EN */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid rgb(244 241 234 / 0.18);
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
}
.lang-switch a {
  display: inline-grid;
  place-items: center;
  min-width: 2.6em;
  min-height: 32px;
  padding: 0 0.6em;
  border-radius: 999px;
  text-decoration: none;
  letter-spacing: 0.04em;
  color: inherit;
  opacity: 0.72;
  transition: background-color var(--dur-s), color var(--dur-s), opacity var(--dur-s);
}
.lang-switch a:hover { opacity: 1; }
.lang-switch a[aria-current="page"] { background: var(--c-text-on-ink); color: var(--c-ink); opacity: 1; }

.menu-toggle {
  display: none;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  padding: 0 0.95rem;
  border: 1px solid rgb(244 241 234 / 0.2);
  border-radius: 999px;
  background: transparent;
  font-size: 0.9rem;
  font-weight: 600;
}
.menu-toggle__bars { position: relative; width: 16px; height: 10px; }
.menu-toggle__bars::before, .menu-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.3s var(--ease-out), top 0.3s var(--ease-out);
}
.menu-toggle__bars::before { top: 1px; }
.menu-toggle__bars::after { top: 7.5px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { top: 4.25px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { top: 4.25px; transform: rotate(-45deg); }

@media (max-width: 899px) {
  .menu-toggle { display: inline-flex; position: relative; z-index: 2; }
  .site-menu {
    position: fixed;
    inset: 0;
    z-index: 1;
    flex-direction: column;
    align-items: stretch;
    justify-content: center;
    gap: 2.5rem;
    padding: calc(var(--header-h) + 2rem) var(--gutter) 2.5rem;
    background: var(--c-ink);
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s var(--ease-out), visibility 0s linear 0.3s;
  }
  .site-menu[data-open="true"] { visibility: visible; opacity: 1; transition: opacity 0.3s var(--ease-out); }
  .site-nav ul { flex-direction: column; gap: 0.25rem; }
  .site-nav a { font-size: clamp(2rem, 9vw, 3rem); font-weight: 750; letter-spacing: -0.03em; color: var(--c-text-on-ink); }
  .site-nav a::after { display: none; }
  .site-menu .lang-switch { align-self: flex-start; font-size: 0.95rem; }
  .site-menu .lang-switch a { min-height: 44px; min-width: 3.4em; }
  .site-menu__cta.btn { min-height: 54px; font-size: 1.05rem; }
  body[data-menu-open="true"] { overflow: hidden; }
}

/* Language suggestion (first visit only, never a redirect) */
.lang-suggest {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 150;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  padding: 0.85rem 1rem 0.85rem 1.2rem;
  border-radius: 16px;
  background: var(--c-text-on-ink);
  color: var(--c-ink);
  box-shadow: 0 20px 50px -20px rgb(0 0 0 / 0.6);
  font-size: var(--fs-sm);
}
.lang-suggest p { flex: 1 1 14rem; }
@media (min-width: 900px) {
  /* Desktop: a small corner note, not a bar over the content */
  .lang-suggest { left: auto; right: 24px; bottom: 24px; width: 360px; }
}
.lang-suggest a { font-weight: 700; }
.lang-suggest button {
  min-height: 40px;
  padding: 0 0.9rem;
  border: 1px solid rgb(11 12 16 / 0.2);
  border-radius: 999px;
  background: transparent;
  font-size: var(--fs-sm);
}

/* ---------- How we work (signal block + console) ---------- */
.work { padding-block: var(--section-y); }
.work__inner {
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 5vw, 6rem);
  align-items: center;
}
.work__copy { display: grid; gap: 1.5rem; align-content: start; }
.work__title { max-width: 16ch; font-size: var(--fs-xl); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; }
.work__lead { font-size: var(--fs-md); max-width: 44ch; }
.work .eyebrow { color: var(--fg); }
.work .eyebrow::before { background: var(--fg); }
@media (max-width: 1023px) {
  .work__inner { grid-template-columns: 1fr; }
}

.console {
  --console-bg: #0b0d14;
  --console-fg: #eef0f6;
  --console-muted: rgb(238 240 246 / 0.62);
  --console-line: rgb(238 240 246 / 0.1);
  display: grid;
  border-radius: var(--radius-window);
  background: var(--console-bg);
  color: var(--console-fg);
  box-shadow: 0 50px 90px -40px rgb(70 20 0 / 0.65), 0 20px 40px -24px rgb(70 20 0 / 0.5);
  overflow: hidden;
  font-size: var(--fs-sm);
}
.console__bar {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  min-height: 44px;
  padding: 0 1rem;
  border-bottom: 1px solid var(--console-line);
}
.console__dots { display: flex; gap: 6px; }
.console__dots i { width: 10px; height: 10px; border-radius: 50%; background: rgb(238 240 246 / 0.16); }
.console__title { flex: 1; font-family: var(--mono); font-size: var(--fs-xs); color: var(--console-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.console__replay {
  min-height: 32px;
  padding: 0 0.8rem;
  border: 1px solid var(--console-line);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: var(--fs-xs);
}
.console__replay:hover { border-color: var(--console-fg); }
.console__body { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); min-height: 30rem; }
.console__roster {
  list-style: none;
  margin: 0;
  padding: 1rem 0.75rem;
  display: grid;
  align-content: start;
  gap: 0.25rem;
  border-right: 1px solid var(--console-line);
}
.console__roster li {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 0.6rem;
  padding: 0.55rem 0.6rem;
  border-radius: 8px;
}
.console__roster .dot { grid-row: span 3; width: 8px; height: 8px; margin-top: 0.5em; border-radius: 50%; background: var(--st-received); }
.console__roster b { font-weight: 650; }
.console__roster span { font-family: var(--mono); font-size: 0.72rem; color: var(--console-muted); }
.console__roster em { font-style: normal; font-family: var(--mono); font-size: 0.72rem; color: var(--st-sending); min-height: 1em; }
.console__roster li[data-state="working"] { background: rgb(238 240 246 / 0.05); }

.console__feed {
  /* messages fill from the top while replaying; final state is identical */
  list-style: none;
  margin: 0;
  padding: 1.25rem 1.25rem 1.5rem;
  display: grid;
  align-content: end;
  gap: 1.25rem;
}
.msg { display: grid; gap: 0.4rem; }
.msg__head { display: flex; align-items: baseline; gap: 0.6rem; }
.msg__head b { font-weight: 700; }
.msg__head b[data-kind="human"] { color: var(--c-cobalt-soft); }
.msg__id, .msg__kind { font-family: var(--mono); font-size: 0.7rem; color: var(--console-muted); }
.msg__kind { padding: 0.05rem 0.4rem; border-radius: 4px; background: rgb(63 201 138 / 0.14); color: var(--st-received); text-transform: uppercase; letter-spacing: 0.06em; }
.msg__text { max-width: 62ch; line-height: 1.5; }
.msg__text code { padding: 0.05em 0.35em; border-radius: 4px; background: rgb(238 240 246 / 0.08); }

.deliveries { list-style: none; margin: 0.15rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.console .state {
  --st: var(--st-received);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.2rem 0.55rem 0.2rem 0.45rem;
  border: 1px solid var(--console-line);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  white-space: nowrap;
}
.console .state::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--st); }
.console .state span { color: var(--console-muted); font-weight: 400; }
.console .state[data-state="queued"] { --st: var(--st-queued); }
.console .state[data-state="sending"] { --st: var(--st-sending); }
.console .state[data-state="accepted"] { --st: var(--st-accepted); }
.console .state[data-state="received"] { --st: var(--st-received); }
.console__caption {
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--console-line);
  font-size: var(--fs-xs);
  color: var(--console-muted);
}
/* Replay: messages not yet "sent" are hidden only while JS drives the replay. */
.console[data-replaying="true"] .msg[data-pending] { visibility: hidden; } /* keeps its space: no layout shift */
@media (prefers-reduced-motion: no-preference) {
  .msg[data-entering] { animation: msg-in 0.5s var(--ease-out) both; }
  @keyframes msg-in { from { opacity: 0; transform: translateY(10px); } }
}
@media (max-width: 719px) {
  .console__body { grid-template-columns: 1fr; min-height: 0; }
  .console__roster { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--console-line); scrollbar-width: none; }
  .console__roster span { display: none; }
  .console__feed { padding: 1rem; }
}

/* ---------- Capabilities ---------- */
.caps { padding-block: var(--section-y); }
.caps__inner { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); }
.caps__head { display: grid; gap: 1.25rem; max-width: 60rem; margin-bottom: clamp(2.5rem, 5vw, 4rem); }
.caps__head h2 { font-size: var(--fs-2xl); font-weight: 800; line-height: 0.95; letter-spacing: -0.045em; }
.caps__head > p:not(.eyebrow) { font-size: var(--fs-md); color: var(--fg-muted); max-width: 46ch; }
.caps__list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2rem, 3vw, 3rem) clamp(1.5rem, 3vw, 3rem);
}
.cap { display: grid; gap: 0.8rem; align-content: start; }
.cap__title { font-size: var(--fs-lg); font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.cap__text { color: var(--fg-muted); max-width: 38ch; }
.cap__proof { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cap__proof a {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 0.8rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 0.75rem;
  text-decoration: none;
  transition: border-color var(--dur-s), background-color var(--dur-s);
}
.cap__proof a:hover { border-color: var(--fg); background: var(--surface); }
@media (max-width: 1023px) { .caps__list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 599px) { .caps__list { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */
.contact { padding-block: var(--section-y); }
.contact__inner {
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(2.5rem, 6vw, 7rem);
}
.contact__head { display: grid; gap: 1.5rem; align-content: start; }
.contact__title { font-size: var(--fs-2xl); font-weight: 800; line-height: 0.86; letter-spacing: var(--track-display); }
.contact__lead { font-size: var(--fs-md); max-width: 38ch; }
@media (max-width: 1023px) { .contact__inner { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.5rem; }
.topics { border: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.75rem; }
.topics legend { margin-bottom: 0.75rem; padding: 0; font-weight: 650; }
.topic { position: relative; display: grid; }
.topic input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.topic__card {
  display: grid;
  gap: 0.35rem;
  align-content: start;
  min-height: 100%;
  padding: 1rem 1.1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  transition: border-color var(--dur-s), background-color var(--dur-s), transform var(--dur-s) var(--ease-out);
}
.topic__card b { font-size: 1.05rem; }
.topic__card span { font-size: var(--fs-sm); color: var(--fg-muted); line-height: 1.4; }
.topic:hover .topic__card { border-color: var(--fg-muted); }
.topic input:checked + .topic__card { border-color: var(--fg); background: var(--bg); box-shadow: inset 0 0 0 1px var(--fg); }
.topic input:focus-visible + .topic__card { outline: 2px solid var(--accent); outline-offset: 3px; }
@media (max-width: 599px) {
  /* Three compact tiles in one row; the short descriptions stay available to screen readers. */
  .topic__card { min-height: 0; padding: 0.75rem 0.6rem; text-align: center; }
  .topic__card b { font-size: 0.95rem; }
  .topic__card span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}

.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
@media (max-width: 599px) { .form__row { grid-template-columns: 1fr; } }

.field { display: grid; gap: 0.45rem; }
.field label { font-weight: 600; }
.field__opt { font-weight: 400; color: var(--fg-muted); }
.field__meta { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.field__counter { font-family: var(--mono); font-size: var(--fs-xs); color: var(--fg-muted); }
.field__counter[data-over="true"] { color: var(--accent); }
.field input, .field textarea {
  width: 100%;
  min-height: 52px;
  padding: 0.8rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 1rem;
  transition: border-color var(--dur-s), box-shadow var(--dur-s);
}
.field textarea { min-height: 10rem; resize: vertical; line-height: 1.5; }
.field input:hover, .field textarea:hover { border-color: var(--fg-muted); }
.field input:focus-visible, .field textarea:focus-visible { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px var(--glow); }
.field[data-invalid="true"] input, .field[data-invalid="true"] textarea { border-color: var(--accent); }
.field__error { min-height: 0; font-size: var(--fs-sm); font-weight: 600; color: var(--accent); }
.field__error:empty { display: none; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.turnstile-slot:empty { display: none; }

.form-status:empty { display: none; }
.form-status {
  display: grid;
  gap: 0.2rem;
  padding: 0.9rem 1.1rem;
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  background: var(--surface);
  font-size: var(--fs-sm);
}
.form-status[data-tone="info"] { border-left-color: var(--fg-muted); }

.form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; }
.form__foot small { color: var(--fg-muted); max-width: 34ch; }
.btn .spinner { display: none; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; }
.btn[data-loading="true"] .spinner { display: inline-block; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.form-success { display: grid; gap: 1rem; justify-items: start; padding: 2rem 0; }
.form-success h3 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -0.04em; }
.form-success .state {
  display: inline-flex; align-items: center; gap: 0.45rem;
  padding: 0.3rem 0.75rem 0.3rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500;
}
.form-success .state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--st-received); }
.form-success .state span { color: var(--fg-muted); }

/* ---------- Footer ---------- */
.site-footer { padding-block: clamp(3rem, 6vw, 5rem) 2rem; overflow: hidden; }
.site-footer__inner { max-width: calc(var(--maxw) + 2 * var(--gutter)); margin-inline: auto; padding-inline: var(--gutter); display: grid; gap: clamp(2.5rem, 5vw, 4rem); }
/* Decorative wordmark drawn by CSS (no text node), so it is not read or contrast-checked as content. */
.site-footer__wordmark::before { content: "TKCH"; }
.site-footer__wordmark {
  font-size: clamp(5rem, 1rem + 16vw, 16rem);
  font-weight: 800;
  line-height: 0.78;
  letter-spacing: -0.06em;
  color: var(--surface-2);
  user-select: none;
}
.site-footer__cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.site-footer__label { margin-bottom: 0.9rem; font-family: var(--mono); font-size: var(--fs-xs); font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--fg-muted); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.35rem; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; text-decoration-color: var(--accent); }
.site-footer__bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; padding-top: 1.5rem; border-top: 1px solid var(--line); font-size: var(--fs-sm); color: var(--fg-muted); }
@media (max-width: 599px) { .site-footer__cols { grid-template-columns: 1fr 1fr; } .site-footer__cols > :last-child { grid-column: 1 / -1; } }

/* ---------- 404 ---------- */
.page-404 { background: var(--c-ink); }
.site-header--minimal { position: absolute; }
.notfound {
  min-height: 100svh;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 1.5rem;
  max-width: calc(var(--maxw) + 2 * var(--gutter));
  margin-inline: auto;
  padding: calc(var(--header-h) + 3rem) var(--gutter) 4rem;
}
.notfound__code { font-size: clamp(8rem, 3rem + 22vw, 22rem); font-weight: 800; line-height: 0.8; letter-spacing: -0.06em; margin-left: -0.03em; }
.notfound__text { font-size: var(--fs-md); max-width: 42ch; color: var(--fg-muted); }
.notfound__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------- Reduced motion: no transitions that move things ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Compact phone layout for my sections (length budget) ---------- */
@media (max-width: 599px) {
  .caps__list { gap: 1.75rem; }
  .cap { gap: 0.55rem; }
  .cap__text { font-size: var(--fs-sm); }
  .work__inner { gap: 2rem; }
  .work__copy { gap: 1rem; }
  .console { font-size: 0.8rem; }
  .console__feed { gap: 0.9rem; }
  .contact__head { gap: 1rem; }
  .form { gap: 1.15rem; }
}

/* ---------- Header orientation (state set by assets/js/motion, owner Claude 1) ----------
   [data-header][data-theme-under="<theme>"] — theme of the section currently under the header.
   .section-indicator — "02 / 05 · LOLSKINSFORUS"; empty (hidden) until motion fills it. */
.section-indicator {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6em;
  margin-right: auto;
  margin-left: clamp(1rem, 3vw, 2.5rem);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.8;
  transition: opacity var(--dur-s);
}
.section-indicator:has(> [data-si-label]:empty) { opacity: 0; }
.section-indicator__index { font-variant-numeric: tabular-nums; }
@media (max-width: 1099px) { .section-indicator { display: none; } }

/* Light/orange sections: tint the bar. Desktop only — the phone menu is a full-screen ink sheet. */
@media (min-width: 900px) {
  .site-header[data-scrolled="true"][data-theme-under="paper"]::before,
  .site-header[data-scrolled="true"][data-theme-under="archive"]::before { background: rgb(243 239 231 / 0.86); }
  .site-header[data-scrolled="true"][data-theme-under="signal"]::before { background: rgb(255 91 31 / 0.9); }
  .site-header[data-scrolled="true"][data-theme-under="paper"],
  .site-header[data-scrolled="true"][data-theme-under="archive"] {
    border-bottom-color: rgb(11 12 16 / 0.1);
    color: var(--c-text-on-paper);
  }
  .site-header[data-scrolled="true"][data-theme-under="signal"] {
    border-bottom-color: rgb(18 6 0 / 0.14);
    color: #120600;
  }
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .site-nav a { color: inherit; opacity: 0.78; }
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .site-nav a:hover,
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .site-nav a[aria-current="true"],
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .site-nav a[aria-current="location"] { opacity: 1; }
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .lang-switch { border-color: rgb(11 12 16 / 0.22); }
  .site-header[data-scrolled="true"]:is([data-theme-under="paper"], [data-theme-under="archive"], [data-theme-under="signal"]) .lang-switch a[aria-current="page"] { background: var(--c-text-on-paper); color: var(--c-paper); }
  .site-header[data-scrolled="true"][data-theme-under="signal"] .site-nav a::after { background: #120600; }
  .site-header[data-scrolled="true"][data-theme-under="signal"] .site-menu__cta.btn { --b-bg: #120600; --b-fg: var(--c-signal); --b-bd: #120600; }
}
/* aria-current="location" (motion navState) gets the same visual as the current IO-based "true" */
.site-nav a[aria-current="location"] { color: var(--c-text-on-ink); }
.site-nav a[aria-current="location"]::after { transform: scaleX(1); }

/* Skip-link target: focusable for the jump, no ring on the whole page region */
main[tabindex="-1"]:focus { outline: none; }

/* Contact CTA while #contact is the current chapter: a quiet ring instead of the nav underline */
.site-menu__cta[aria-current="location"] { box-shadow: 0 0 0 2px var(--c-ink), 0 0 0 4px var(--c-signal); }
