/* Hangar — editorial take on "Bold grid".
   Cream ground, ink, one accent used sparingly; thin rules, square corners,
   no shadows or gradients. All colours are tokens so the dark scheme only
   swaps variables. The accent is decorative on the light ground (2.96:1);
   it is a text colour only in the always-dark footer. */

@font-face {
  font-family: "Archivo";
  src: url("/fonts/archivo-variable.woff2") format("woff2");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "DM Mono";
  src: url("/fonts/dm-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

:root {
  --ground: #f4f3ef;
  --ground-muted: #e4e2db;
  --ink: #0e0e10;
  --ink-soft: #3a3a40;
  --muted: #5b5a55;           /* supporting text: 6.3:1 on the ground */
  --accent: #ff4f12;
  --accent-ink: #0e0e10;      /* text on the accent */
  --link-hover: #c2380a;
  --focus: #c2380a;           /* focus ring: 4.9:1 on the ground (the accent is only 2.96:1) */
  --live: #1f9d55;
  --down: #c2380a;
  --rule: #0e0e10;            /* 1.5 px: frames and section openings */
  --hairline: #cfccc3;        /* 1 px: separators inside a section */
  --line: #85837b;            /* 1 px: form-cell edges, 3.4:1 on the ground */
  --font: "Archivo", system-ui, sans-serif;
  --mono: "DM Mono", ui-monospace, monospace;
  --max: 1240px;
  --gutter: clamp(16px, 4vw, 32px);
  --section: 96px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0e0e10;
    --ground-muted: #1b1b1f;
    --ink: #f4f3ef;
    --ink-soft: #c9c7bf;
    --muted: #a3a19a;
    --link-hover: #ff7a47;
    --focus: var(--accent);
    --live: #3ddc84;
    --down: #ff6a3d;
    --rule: #f4f3ef;
    --hairline: #2e2e33;
    --line: #6b6a64;            /* 3.6:1 on the ground */
  }
}
@media (max-width: 639px) { :root { --section: 64px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  /* Sticky footer: short pages (404) still end at the bottom of the window. */
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}
body > .topbar, body > main, body > .footer { width: 100%; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1.5px; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
[id] { scroll-margin-top: 24px; }

.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.mono-label { font-family: var(--mono); font-size: 13px; font-weight: 400; line-height: 1.4; text-transform: uppercase; letter-spacing: 0.08em; }
.accent { color: var(--accent); }
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--ink); color: var(--ground); padding: 8px 12px; }
.skip:focus { left: 8px; z-index: 10; }
.arrow { display: inline-block; width: 0.9em; height: 0.9em; vertical-align: -0.08em; flex: none; }
.icon { width: 20px; height: 20px; flex: none; }

/* ── Header: name left; Work / About / Contact + profile icons right ── */
.topbar { border-bottom: 1px solid var(--hairline); }
.topbar-inner { display: flex; align-items: center; gap: 8px 24px; min-height: 64px; }
.topbar a { text-decoration: none; }
.brand { margin-right: auto; font-size: 18px; font-weight: 800; letter-spacing: -0.01em; text-transform: uppercase; white-space: nowrap; }
.brand:hover { color: inherit; }
.nav { display: flex; gap: 4px 24px; }
/* 44 px tall targets without making the bar taller. */
.nav a { display: inline-flex; align-items: center; min-height: 44px; }
.nav a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--accent); text-decoration-thickness: 2px; }
.profile { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; }
.topbar-profile { gap: 0; padding-left: 16px; border-left: 1px solid var(--hairline); }
.profile-icon { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; color: var(--ink-soft); }
.profile-icon:hover { color: var(--link-hover); }
@media (max-width: 719px) {
  /* GitHub / LinkedIn stay in About and the footer. */
  .topbar-profile { display: none; }
}
/* Four nav links don't fit beside the name on narrow phones: the nav takes
   its own row under it. */
@media (max-width: 459px) {
  .topbar-inner { flex-wrap: wrap; padding-block: 6px; }
  .brand { width: 100%; min-height: 40px; display: flex; align-items: center; }
  .nav { width: 100%; justify-content: space-between; }
}
@media (max-width: 380px) {
  .topbar-inner { gap: 8px 12px; }
  .brand { font-size: 16px; }
  .nav { gap: 4px 12px; }
}

/* ── Section labels: thin rule, small mono label ── */
.section-label { margin: 0 0 24px; padding-top: 14px; border-top: 1.5px solid var(--rule); }

/* ── Introduction ── */
.intro { padding-block: clamp(40px, 7vw, 72px) clamp(48px, 6vw, 64px); }
.intro-label { margin: 0 0 20px; color: var(--muted); }
.intro-h {
  margin: 0; max-width: 14ch;
  font-size: clamp(44px, 6.5vw, 96px); line-height: 0.95; font-weight: 800; letter-spacing: -0.035em;
  text-wrap: balance;
}
.intro-h .line { display: block; }
.intro-foot { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px 24px; align-items: end; margin-top: clamp(24px, 3vw, 36px); }
.intro-text { grid-column: 1 / span 7; margin: 0; max-width: 46ch; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.45; color: var(--ink-soft); }
.intro-cta { grid-column: 9 / -1; justify-self: end; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; font-size: 17px; }
@media (max-width: 860px) {
  .intro-text, .intro-cta { grid-column: 1 / -1; justify-self: start; }
}

/* ── Selected work ── */
.work { padding-bottom: var(--section); }

/* Featured project: framed, text 5 / screenshot 7 on desktop. */
.feature { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); border: 1.5px solid var(--rule); }
.feature-text { display: flex; flex-direction: column; gap: 16px; padding: clamp(24px, 3vw, 40px); }
.feature-k { display: flex; align-items: center; gap: 10px; margin: 0; }
.feature-mark { width: 8px; height: 8px; background: var(--accent); flex: none; }
.feature-name { margin: 8px 0 0; font-size: clamp(40px, 5vw, 72px); line-height: 1; font-weight: 800; letter-spacing: -0.035em; }
.feature-name a { text-decoration: none; }
.feature-purpose { margin: 0; max-width: 30ch; text-wrap: pretty; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.35; font-weight: 500; }
.feature-live { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--hairline); }
.feature-link { margin-top: auto; padding-top: 8px; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; align-self: flex-start; font-weight: 700; }
.feature-shot { display: block; border-left: 1.5px solid var(--rule); background: var(--ground-muted); overflow: hidden; }
.feature-shot img { width: 100%; height: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top left; }
.feature-noshot { grid-template-columns: 1fr; }
@media (max-width: 1023px) {
  .feature { grid-template-columns: 1fr; }
  /* Name, purpose and tags on the left; status and the link on the right. */
  .feature-text {
    display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px 32px; align-items: start;
    grid-template-areas: "k ." "name live" "purpose live" "tags link";
  }
  .feature-k { grid-area: k; }
  .feature-name { grid-area: name; }
  .feature-purpose { grid-area: purpose; }
  .feature-text > .tags { grid-area: tags; }
  .feature-live { grid-area: live; margin-top: 8px; }
  .feature-link { grid-area: link; align-self: end; margin-top: 0; padding-top: 0; }
  .feature-shot { border-left: 0; border-top: 1.5px solid var(--rule); }
}
@media (max-width: 639px) {
  .feature-text { display: flex; }
  .feature-link { align-self: flex-start; }
  .feature-shot img { aspect-ratio: 4 / 3; }
}

/* Tags: square, thin, mono; wrap freely. */
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.tags li { font-family: var(--mono); font-size: 12px; line-height: 1.5; letter-spacing: 0.02em; padding: 2px 8px; border: 1px solid var(--ink-soft); }

/* Other projects: a quieter ruled row, three columns, no boxes. */
.others { list-style: none; margin: 48px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1.5px solid var(--rule); }
.other { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 24px 24px 28px; }
.other + .other { border-left: 1px solid var(--hairline); }
.other:first-child { padding-left: 0; }
.other:last-child { padding-right: 0; }
.other-k { margin: 0; display: flex; gap: 12px; color: var(--muted); }
.other-n { color: var(--ink); }
.other-name { margin: 4px 0 0; font-size: clamp(26px, 2.6vw, 32px); line-height: 1.05; font-weight: 800; letter-spacing: -0.025em; }
.other-name a { text-decoration: none; }
.other-tagline { margin: 0; max-width: 34ch; color: var(--ink-soft); text-wrap: pretty; }
.other-updated { margin: 0; color: var(--muted); font-size: 12px; }
.other-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.other-more { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 15px; }
.stretched::after { content: ""; position: absolute; inset: 0; } /* the whole row is the link */
.other:hover .other-name a, .other:hover .other-more { color: var(--link-hover); }
.other:has(.stretched:focus-visible) { outline: 3px solid var(--focus); outline-offset: 4px; }
.other:has(.stretched:focus-visible) .stretched { outline: none; }
@media (max-width: 719px) {
  .others { grid-template-columns: 1fr; }
  .other, .other:first-child, .other:last-child { padding: 20px 0 24px; }
  .other + .other { border-left: 0; border-top: 1px solid var(--hairline); }
}

/* ── Status: maintenance (plain) · availability (square dot) ── */
.status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; font-size: 12px; }
.avail { display: inline-flex; align-items: center; gap: 6px; }
.avail::before { content: "·"; color: var(--muted); margin-right: 4px; }
.avail[hidden] { display: none; }
.avail-dot { width: 8px; height: 8px; background: var(--muted); }
.avail[data-state="live"] .avail-dot { background: var(--live); }
.avail[data-state="down"] { color: var(--down); }
.avail[data-state="down"] .avail-dot { background: var(--down); }
.avail[data-state="unknown"], .avail[data-state="off"] { color: var(--muted); }
.avail[data-state="unknown"] .avail-dot { background: transparent; border: 1px solid var(--muted); }

/* ── In progress: a hatched accent band ("under construction") and a
   dashed chip (a draft). Hard-stop stripes — a pattern, not a gradient. ── */
.work-wip::before, .wip-note::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 8px; background: repeating-linear-gradient(-45deg, var(--accent) 0 3px, transparent 3px 8px); }
.status-wip { padding: 2px 8px; border: 1px dashed var(--ink); color: var(--ink); }
.wip-note { position: relative; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 16px; margin: 0 0 28px; padding-top: 22px; color: var(--ink-soft); }
.wip-note-k { color: var(--ink); }

/* Live figure: the number, then when it was checked. The slot keeps the
   height of both lines while loading or unavailable, so nothing moves. */
.figure { margin: 0; min-height: 41px; font-size: 15px; line-height: 1.5; color: var(--ink-soft); }
.figure-value { font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.figure-age, .figure-none { font-family: var(--mono); font-size: 12px; letter-spacing: 0.04em; color: var(--muted); }
.figure-age { display: block; }

/* Homepage pointer to /builds/: one quiet ruled row under the projects. */
.work-more { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 20px; min-height: 64px; padding-block: 12px; border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); text-decoration: none; }
.work-more-k { color: var(--muted); }
.work-more-name { font-size: 20px; font-weight: 800; letter-spacing: -0.015em; }
.work-more-text { color: var(--ink-soft); }
.work-more .arrow { margin-left: auto; }
.work-more:hover .work-more-name, .work-more:hover .arrow { color: var(--link-hover); }
.work-more + .work-more { border-top: 0; }
/* In-progress projects: the same quiet row, kept apart from the finished
   ones, under the hatched band instead of a hairline. */
.work-wip { position: relative; padding-top: 20px; border-top: 0; }
.work-wip .work-more-k { color: var(--ink); }
/* Coming soon: the same, under a grey band — planned, not started yet. */
.work-soon::before, .wip-soon::before { background: repeating-linear-gradient(-45deg, var(--line) 0 3px, transparent 3px 8px); }

/* ── About ── */
.about { padding-bottom: var(--section); }
.about-body { max-width: 62ch; }
.about-body p { margin: 0 0 16px; color: var(--ink-soft); text-wrap: pretty; }
.about-body .about-lead { font-size: clamp(19px, 1.8vw, 22px); line-height: 1.45; font-weight: 500; color: var(--ink); }
.about-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 24px; margin-top: 24px; }
.about-links .profile { gap: 4px 24px; }
.about-links a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }
@media (min-width: 1024px) {
  .about { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; }
  .about .section-label { grid-column: 1 / -1; }
  .about-body { grid-column: 4 / span 7; }
}

/* ── Project page ── */
.project { padding-block: 24px var(--section); }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin-bottom: 16px; text-decoration: none; }
.project-head { padding-bottom: 28px; }
.project-k { margin: 0 0 12px; color: var(--muted); }
.project-title { display: flex; gap: 20px; align-items: center; }
.project-title h1 { margin: 0; min-width: 0; overflow-wrap: anywhere; font-size: clamp(44px, 7vw, 96px); line-height: 0.95; font-weight: 800; letter-spacing: -0.035em; }
.project-tagline { margin: 16px 0 0; max-width: 40ch; font-size: clamp(19px, 2vw, 23px); line-height: 1.35; font-weight: 500; color: var(--ink-soft); }
.logo { width: 56px; height: 56px; object-fit: contain; flex: none; }
.logo-lg { width: 72px; height: 72px; }
.logo-dark-tile { background: #0e0e10; padding: 8px; }
@media (prefers-color-scheme: dark) { .logo-dark-tile { background: #1b1b1f; } }
@media (max-width: 520px) {
  .project-title { gap: 14px; }
  .logo-lg { width: 52px; height: 52px; }
}

/* Facts strip: ruled above and below; each fact a label over its value. */
.facts { display: flex; flex-wrap: wrap; gap: 20px 40px; margin: 0; padding-block: 18px; border-top: 1.5px solid var(--rule); border-bottom: 1px solid var(--hairline); }
.fact { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fact dt { color: var(--muted); font-size: 12px; }
.fact dd { margin: 0; font-weight: 500; }
.fact-stack { flex: 1 1 260px; }
.fact-source a { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
@media (max-width: 639px) {
  .facts { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px 24px; }
  .fact:first-child, .fact-live, .fact-stack, .fact-source { grid-column: 1 / -1; }
}

.main-shot { margin: 32px 0 0; }
.main-shot a { display: block; border: 1.5px solid var(--rule); background: var(--ground-muted); }
.main-shot img { width: 100%; }
.main-shot a:hover { border-color: var(--link-hover); }
.main-shot figcaption, .shot figcaption { margin-top: 12px; max-width: 80ch; font-family: var(--mono); font-size: 13px; line-height: 1.5; color: var(--muted); }

.prose { max-width: 66ch; padding-top: 48px; }
.prose .lead { font-size: clamp(19px, 2vw, 22px); line-height: 1.45; font-weight: 500; margin-top: 0; }
.prose h2 { margin: 48px 0 14px; padding-top: 12px; border-top: 1px solid var(--hairline); font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: 10px; }
.prose li::marker { color: var(--accent); }
/* Numbered steps (Protek's "How it works"): ruled rows, mono numbers. */
.prose ol { list-style: none; margin: 0; padding: 0; counter-reset: step; border-top: 1px solid var(--hairline); }
.prose ol li { counter-increment: step; position: relative; margin: 0; padding: 14px 0 14px 3rem; border-bottom: 1px solid var(--hairline); }
.prose ol li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 14px; font-family: var(--mono); font-size: 13px; line-height: 2; color: var(--muted); }

/* Section headings below the prose: "More screenshots", "Recent updates" */
.section-h { margin: 0 0 16px; padding-top: 12px; border-top: 1.5px solid var(--rule); font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }

/* Screenshot gallery — framed images, 2-up (1-up on phones) */
.gallery { margin-top: 72px; }
.gallery-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 24px; }
.shot { margin: 0; display: flex; flex-direction: column; }
/* Even frames so mixed aspect ratios line up across a row. */
.shot a { display: flex; align-items: center; justify-content: center; aspect-ratio: 16 / 10; background: var(--ground-muted); border: 1.5px solid var(--rule); overflow: hidden; }
.shot a:hover { border-color: var(--link-hover); }
.shot img { width: 100%; height: 100%; object-fit: contain; }
/* An odd last shot spans the row with its caption beside it. */
@media (min-width: 861px) {
  .shot:last-child:nth-child(odd) { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; align-items: center; }
  .shot:last-child:nth-child(odd) figcaption { margin-top: 0; }
}
@media (max-width: 860px) { .gallery-grid { grid-template-columns: 1fr; } }

/* Recent updates — ruled rows: mono date, then the change */
.shipped { margin-top: 72px; }
.shipped .section-h { margin-bottom: 0; }
.shipped-list { list-style: none; margin: 0; padding: 0; max-width: 820px; }
.shipped-list li { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 4px 20px; align-items: baseline; padding: 12px 0; border-bottom: 1px solid var(--hairline); font-size: 16px; }
.shipped-list time { white-space: nowrap; color: var(--muted); font-size: 12px; }
.shipped-list a { text-decoration-thickness: 1px; }
.shipped-list a:hover { text-decoration-thickness: 2px; }
@media (max-width: 520px) { .shipped-list li { grid-template-columns: 1fr; } }

/* Another project to explore */
.next { margin-top: 72px; border-top: 1.5px solid var(--rule); }
.next-link { display: flex; flex-direction: column; gap: 6px; padding-block: 20px 8px; text-decoration: none; }
.next-k, .next-cat { color: var(--muted); }
.next-name { display: inline-flex; align-items: center; gap: 12px; font-size: clamp(32px, 4vw, 48px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.next-link:hover .next-name { color: var(--link-hover); }

/* ── Contact pages, 404 ── */
.page { padding-block: clamp(40px, 6vw, 64px) var(--section); }
.page-head { padding-bottom: 28px; border-bottom: 1px solid var(--hairline); }
.page-k { margin: 0 0 16px; color: var(--muted); }
.page-title { margin: 0; font-size: clamp(44px, 6.5vw, 88px); line-height: 0.95; font-weight: 800; letter-spacing: -0.035em; }
.page-lede { margin: 18px 0 0; max-width: 46ch; font-size: clamp(18px, 1.8vw, 21px); line-height: 1.45; color: var(--ink-soft); }
.page-lede code { font-family: var(--mono); font-size: 0.85em; }
.page-links { margin: 32px 0 0; font-size: 19px; font-weight: 500; }
.page-links a { display: inline-block; padding-block: 10px; }
.page-hint { margin: 32px 0 0; max-width: 60ch; color: var(--muted); }
.page-hint + .page-links { margin-top: 12px; }

/* Contact family (form, sent, error): the header and one frame share a
   7 / 5 split, so the lede starts where the side panel's text starts.
   The frame is the homepage feature block: 1.5 px rule, main panel on the
   ground, side panel on --ground-muted. */
.contact, .contact-result { --pad: clamp(16px, 3vw, 40px); --split: minmax(0, 7fr) minmax(0, 5fr); }
.cf-head { display: grid; grid-template-columns: minmax(0, 1fr); padding-bottom: clamp(32px, 4vw, 48px); border-bottom: 0; }
@media (min-width: 1024px) {
  .cf-head { grid-template-columns: var(--split); grid-template-rows: 1fr auto; }
  .cf-head .page-k { grid-column: 1; grid-row: 1; align-self: end; }
  .cf-head .page-title { grid-column: 1; grid-row: 2; }
  .cf-head .page-lede { grid-column: 2; grid-row: 1 / 3; align-self: end; margin: 0 0 0.2em; padding-left: var(--pad); }
}
.cf-frame { display: grid; grid-template-columns: minmax(0, 1fr); border: 1.5px solid var(--rule); }
.cf-panel { display: flex; flex-direction: column; min-width: 0; }
/* Panel kickers: same height left and right, so the first rules line up. */
.cf-k, .cf-side-k { display: flex; align-items: center; gap: 10px; margin: 0; min-height: 52px; padding: 14px var(--pad); }
.cf-side-k { color: var(--muted); }

/* The form: ruled cells, not boxes. Cell edges are --line (3:1 on the
   ground) so each field's area stays visible; focus rings the whole cell. */
.form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); min-width: 0; }
.cf-k { grid-column: 1 / -1; }
.field { position: relative; display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 14px var(--pad) 8px; border-top: 1px solid var(--line); }
.field + .field:not(.field-wide) { border-left: 1px solid var(--line); }
.field-wide { grid-column: 1 / -1; padding-bottom: 14px; }
.field input, .field textarea {
  width: 100%; min-height: 44px; margin: 0; padding: 6px 0;
  border: 0; border-radius: 0; background: transparent; color: var(--ink);
  font: inherit; font-size: 18px; line-height: 1.4; caret-color: var(--focus);
  -webkit-appearance: none; appearance: none;
}
.field textarea { min-height: 200px; resize: vertical; flex: 1 0 auto; }
.field input:focus, .field textarea:focus { outline: none; }
.field:focus-within { outline: 3px solid var(--focus); outline-offset: -3px; }
/* After the visitor has interacted: a red edge and label on a field that won't pass. */
.field:has(:user-invalid) label { color: var(--down); }
.field:has(:user-invalid) label::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 8px; border: 4px solid var(--down); vertical-align: 0.05em; }
.field-hint { margin: 6px 0 0; text-wrap: balance; font-family: var(--mono); font-size: 12px; line-height: 1.45; letter-spacing: 0.02em; color: var(--muted); }
/* Honeypot: off-screen, not display:none, so form-filling bots still see it */
.hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.form-foot { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; font-weight: 700; font-size: 15px; text-decoration: none; }
.btn-solid { background: var(--ink); color: var(--ground); }
.btn-solid:hover { background: var(--accent); color: var(--accent-ink); }
.form-submit { min-height: 64px; padding: 0 clamp(24px, 3vw, 36px); border: 1.5px solid transparent; border-radius: 0; font-family: inherit; font-size: 17px; cursor: pointer; }
/* The flush button and the sent page's rows sit against the side panel, which
   is painted later: lift them while focused so the whole ring shows. */
.form-submit:focus-visible, .cf-projects a:focus-visible { position: relative; z-index: 1; }
.form-note { align-self: center; margin: 0; padding: 12px var(--pad); max-width: 44ch; font-size: 14px; line-height: 1.45; color: var(--muted); }
@media (max-width: 639px) {
  .form, .form-foot { grid-template-columns: minmax(0, 1fr); }
  .field + .field:not(.field-wide) { border-left: 0; }
  .form-note { padding-block: 14px; }
  .form-submit { width: 100%; min-height: 56px; }
}

/* Side panel: what happens next, then the other channels. */
.cf-side { display: flex; flex-direction: column; min-width: 0; border-top: 1.5px solid var(--rule); background: var(--ground-muted); }
.cf-steps { list-style: none; margin: 0; padding: 16px var(--pad) 24px; border-top: 1px solid var(--line); counter-reset: step; display: flex; flex-direction: column; gap: 14px; }
.cf-steps li { counter-increment: step; display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); max-width: 52ch; font-size: 16px; line-height: 1.45; color: var(--ink-soft); text-wrap: pretty; }
.cf-steps li::before { content: counter(step, decimal-leading-zero); font-family: var(--mono); font-size: 13px; line-height: 1.8; color: var(--muted); }
.cf-side-text { margin: 0; padding: 16px var(--pad) 0; border-top: 1px solid var(--line); color: var(--ink-soft); }
.cf-side-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 0 24px; min-height: 65px; margin-top: 24px; padding: 4px var(--pad); border-top: 1px solid var(--line); }
.cf-side-foot .cf-side-k { min-height: 44px; padding: 0; }
.cf-profile { gap: 0 24px; }
.cf-profile a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; }

@media (min-width: 1024px) {
  .cf-frame { grid-template-columns: var(--split); }
  .cf-side { border-top: 0; border-left: 1.5px solid var(--rule); }
  .cf-side-foot { margin-top: auto; }
  /* Form page: four shared rows (kicker · name+email · message · send), so
     the side panel's rules sit exactly on the form's. */
  .contact .cf-frame { grid-template-rows: auto auto 1fr auto; }
  .contact .cf-frame > .form, .contact .cf-frame > .cf-side { grid-row: 1 / -1; }
  @supports (grid-template-rows: subgrid) {
    .contact .cf-frame > .form, .contact .cf-frame > .cf-side { display: grid; grid-template-rows: subgrid; }
    .contact .cf-side > .cf-side-k { grid-row: 1; }
    .contact .cf-side > .cf-steps { grid-row: 2 / 4; }
    .contact .cf-side > .cf-side-foot { grid-row: 4; margin-top: 0; }
  }
}

/* Sent: the projects as ruled rows; the whole row is the link. */
.cf-projects { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.cf-projects li + li { border-top: 1px solid var(--hairline); }
.cf-projects a { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr) auto; align-items: baseline; gap: 2px 16px; padding: 14px var(--pad); text-decoration: none; }
.cf-projects-n { grid-row: 1 / 3; color: var(--muted); }
.cf-projects-name { font-size: 22px; line-height: 1.2; font-weight: 800; letter-spacing: -0.015em; }
.cf-projects-tag { grid-column: 2; color: var(--ink-soft); font-size: 15px; line-height: 1.4; }
.cf-projects .arrow { grid-column: 3; grid-row: 1 / 3; align-self: center; }
.cf-projects a:hover .cf-projects-name, .cf-projects a:hover .arrow { color: var(--link-hover); }
.cf-panel-foot { display: flex; align-items: center; min-height: 65px; margin: auto 0 0; padding: 4px var(--pad); border-top: 1px solid var(--line); font-weight: 700; }
.cf-panel-foot a { display: inline-block; padding-block: 10px; }

/* Error codes on /contact/error/: ruled rows, mono code then the meaning */
.codes { margin: 0; border-top: 1px solid var(--line); }
.code-row { display: grid; grid-template-columns: 7rem minmax(0, 1fr); gap: 4px 20px; align-items: baseline; padding: 14px var(--pad); }
.code-row + .code-row { border-top: 1px solid var(--hairline); }
.code-row dt { font-family: var(--mono); font-size: 15px; font-weight: 500; }
.code-row dd { margin: 0; max-width: 60ch; }
/* contact.js: the code from ?r= — its row in the accent, its meaning on top */
.code-row.is-match { background: var(--accent); color: var(--accent-ink); }
.code-reason { padding-bottom: 22px; border-bottom: 1.5px solid var(--rule); }
.code-reason-k { display: flex; align-items: center; gap: 10px; min-height: 44px; margin: 0; padding: 14px var(--pad) 6px; }
.code-reason-text { margin: 0; padding-inline: var(--pad); max-width: 40ch; font-size: clamp(19px, 1.8vw, 22px); line-height: 1.4; font-weight: 500; }
@media (max-width: 520px) { .code-row { grid-template-columns: 1fr; } }

/* ── PC builds: one framed block per build, main photo beside the specs ── */
.build { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); margin-top: 40px; border: 1.5px solid var(--rule); }
.build + .build { margin-top: 32px; }
.build-shot { display: block; border-right: 1.5px solid var(--rule); background: var(--ground-muted); overflow: hidden; }
.build-shot img { width: 100%; height: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.build-text { display: flex; flex-direction: column; gap: 14px; min-width: 0; padding: clamp(24px, 3vw, 40px); }
.build-k { margin: 0; display: flex; gap: 12px; color: var(--muted); }
.build-n { color: var(--ink); }
.build-name { margin: 0; font-size: clamp(28px, 3.2vw, 44px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.build-note { margin: 0; max-width: 52ch; color: var(--ink-soft); }
.build-specs { margin: 8px 0 0; border-top: 1px solid var(--hairline); }
.build-specs div { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: 2px 16px; align-items: baseline; padding: 10px 0; border-bottom: 1px solid var(--hairline); }
.build-specs dt { font-size: 12px; color: var(--muted); }
.build-specs dd { margin: 0; font-weight: 500; }
/* Frame rates the owner measured: game · settings · fps on one ruled line. */
.build-games { margin-top: 8px; }
.build-games-k { margin: 0 0 6px; font-size: 12px; color: var(--muted); }
.build-games ul { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hairline); }
.build-games li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--hairline); }
.build-game { font-weight: 500; }
.build-game-set { grid-row: 2; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.build-fps { grid-column: 2; grid-row: 1 / 3; align-self: center; font-weight: 800; font-variant-numeric: tabular-nums; }
.build-games-note { margin: 6px 0 0; font-family: var(--mono); font-size: 12px; color: var(--muted); }
.build-more { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; margin: auto 0 0; padding: 12px 0 0; }
.build-thumb { display: block; width: 120px; border: 1px solid var(--line); }
.build-thumb img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; }
/* A landscape photo (wide: true) as a strip across the whole block. */
.build-wide { grid-column: 1 / -1; display: block; border-top: 1.5px solid var(--rule); background: var(--ground-muted); }
.build-wide img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.build-shot:hover img, .build-thumb:hover img, .build-wide:hover img { opacity: 0.9; }

/* Photo pop-up: shown while its id is the URL's #fragment (no JS needed). */
.lightbox { display: none; position: fixed; inset: 0; z-index: 20; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: clamp(12px, 3vw, 40px); background: #0e0e10; color: #f4f3ef; }
.lightbox:target { display: flex; }
html:has(.lightbox:target) { overflow: hidden; }
.lightbox-backdrop { position: absolute; inset: 0; }
.lightbox-close { position: relative; align-self: flex-end; display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 4px; color: #f4f3ef; text-decoration: none; }
.lightbox-close:hover { color: var(--accent); }
.lightbox-close:focus-visible { outline-color: var(--accent); }
.lightbox img { position: relative; width: auto; height: auto; max-width: 100%; max-height: calc(100dvh - 120px); object-fit: contain; }
@media (max-width: 860px) {
  .build { grid-template-columns: minmax(0, 1fr); }
  .build-shot { border-right: 0; border-bottom: 1.5px solid var(--rule); }
  .build-shot img { aspect-ratio: 1; }
}
@media (max-width: 520px) { .build-specs div { grid-template-columns: minmax(0, 1fr); } }

/* ── Footer — always ink-on-dark so the orange link keeps its contrast ── */
.footer { --focus: var(--accent); background: #0e0e10; color: #f4f3ef; }
@media (prefers-color-scheme: dark) { .footer { border-top: 1px solid #2e2e33; } }
.footer a:hover { color: var(--accent); }
.footer-inner { display: flex; flex-direction: column; gap: 40px; padding-block: 64px 32px; }
.footer-cta { margin: 0; display: flex; flex-direction: column; gap: 4px; font-size: clamp(26px, 3vw, 40px); line-height: 1.05; font-weight: 800; letter-spacing: -0.03em; }
.footer-q { color: #c9c7bf; }
.footer-cta a { align-self: flex-start; display: inline-flex; align-items: center; gap: 12px; color: var(--accent); text-decoration-thickness: 2px; }
.footer-cta a:hover { color: #ff7a47; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 24px; padding-top: 16px; border-top: 1px solid #3a3a40; color: #c9c7bf; }
.footer-profile { gap: 0 24px; }
.footer-profile a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; text-decoration: none; }
.footer-copy { margin: 0; }
/* Contact pages (and a site without the form): no "Let's talk", so just the quiet row. */
.footer-inner-quiet { padding-block: 24px; }
.footer-inner-quiet .footer-row { padding-top: 0; border-top: 0; }

/* ── Motion: restrained, and none at all when reduced motion is asked for ── */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
  a, .btn, .shot a, .main-shot a { transition: color 120ms, background-color 120ms, border-color 120ms; }
  .arrow { transition: transform 120ms; }
  .feature-link:hover .arrow, .other:hover .other-more .arrow, .next-link:hover .arrow, .intro-cta:hover .arrow { transform: translateX(2px); }
  .intro-cta:hover .arrow-down { transform: translate(1px, 2px); }
}
