/* Public site. Direction: shop floor, not showroom.
 * Near-black ground, a blueprint layer sampled from the client's own banner,
 * chrome type, one orange accent, and the drawing title block as the repeating unit.
 */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--step-0);          /* >= 17px, and it respects the OS setting */
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;                /* belt; the real fix is never overflowing */
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent-hover); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }
.section { padding-block: var(--section-y); }
.measure { max-width: var(--measure); }

/* Centring a block that has a max-width needs BOTH: text-align centres the text
   INSIDE the box, and auto margins centre the box itself. Without the margins a
   max-width'd <p> hangs flush left with its text centred inside it, which reads
   as a broken column. Any centred section uses this. */
.center { text-align: center; }
.center > * { margin-inline: auto; }

.skip {
  position: absolute; left: -9999px; top: 0;
  background: var(--accent); color: var(--on-accent);
  padding: 0.6rem 1rem; z-index: 100; font-weight: 600;
}
.skip:focus { left: 0; }

/* ── Type ───────────────────────────────────────────────────────────────── */
h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 0.98;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  margin: 0 0 var(--space-s);
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); letter-spacing: 0; }
p  { margin: 0 0 var(--space-s); max-width: var(--measure); }
.lead { font-size: var(--step-1); color: var(--text-2); }

.mono {
  font-family: var(--font-mono);
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.accent { color: var(--accent); }

/* ── Header ─────────────────────────────────────────────────────────────── */
.site-head {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.site-head__in {
  display: flex; align-items: center; gap: var(--space-m);
  height: 68px;                       /* <= 80px, one line at desktop */
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--text); }
.brand img { width: 46px; height: 46px; }
.admin .brand img { width: 30px; height: 30px; }
.brand__name {
  font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
  text-transform: uppercase; letter-spacing: 0.01em; line-height: 1;
}
.brand__name span { color: var(--accent); }

.nav { margin-left: auto; display: flex; align-items: center; gap: var(--space-m); }
.nav a {
  color: var(--text-2); text-decoration: none;
  font-size: 0.95rem; font-weight: 500; white-space: nowrap;
  position: relative; padding-block: 0.4rem;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.nav a[aria-current="page"]::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
}

.btn {
  display: inline-block; padding: 0.75rem 1.4rem;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--font-display); font-weight: 800; font-size: 1rem;
  text-transform: uppercase; letter-spacing: 0.03em;
  text-decoration: none; border: 2px solid var(--accent); border-radius: var(--radius);
  cursor: pointer; white-space: nowrap;
  transition: transform 0.15s var(--ease), background 0.15s var(--ease);
}
.btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--on-accent); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line-control); }
.btn--ghost:hover { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 0.5rem 0.9rem; font-size: 0.85rem; }

.nav-toggle { display: none; background: none; border: 1px solid var(--line-control);
  color: var(--text); width: 42px; height: 38px; border-radius: var(--radius); cursor: pointer; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: currentColor; margin: 3px auto; }

@media (max-width: 900px) {
  .nav-toggle { display: block; margin-left: auto; }
  .nav {
    position: fixed; inset: 68px 0 auto 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--bg-raised); border-bottom: 1px solid var(--line);
    padding: var(--space-s); display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: 0.85rem 0.25rem; border-bottom: 1px solid var(--line); }
  .nav .btn { margin-top: var(--space-xs); text-align: center; }
}

/* ── Hero ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  padding-block: clamp(3rem, 7vw, 6rem) clamp(3rem, 6vw, 5rem);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("../img/tex-blueprint.jpg") center/cover no-repeat;
  opacity: 0.65;
}
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(180deg, transparent 30%, var(--bg) 100%);
}
.hero > * { position: relative; z-index: 2; }
.hero__grid { display: grid; gap: var(--space-xl); align-items: center; }
@media (min-width: 900px) { .hero__grid { grid-template-columns: 1.05fr 0.95fr; } }
.hero h1 { margin-bottom: var(--space-s); }
.hero__sub { font-size: var(--step-1); color: var(--text-2); max-width: 34ch; }
.hero__cta { display: flex; flex-wrap: wrap; gap: var(--space-xs); margin-top: var(--space-m); }
.hero__media { border: 1px solid var(--line-strong); border-radius: var(--radius); overflow: hidden; }
.hero__media img { width: 100%; aspect-ratio: 3/2; object-fit: cover; }

/* ── The signature element: the drawing title block ─────────────────────── */
.spec {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-panel);
  margin: 0;
}
.spec__row { display: grid; grid-template-columns: 5.5rem 1fr; gap: 0.75rem; padding: 0.5rem 0.85rem; }
/* One edge only, used sparsely - never border-top AND border-bottom on every row. */
.spec__row + .spec__row { border-top: 1px solid var(--line); }
.spec dt { color: var(--text-muted); letter-spacing: 0.08em; margin: 0; }
.spec dd { margin: 0; color: var(--text-2); }
.spec__row:first-child dd { color: var(--accent); font-weight: 600; }

/* ── Cards / grids ──────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--space-m); }
.grid--3 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 22rem), 1fr)); }

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-raised);
  overflow: hidden;
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
a.card:hover { border-color: var(--accent); transform: translateY(-2px); }
/* Portrait-first: his photography is 9:16 and a landscape frame would letterbox
   the entire portfolio. */
.card__media { aspect-ratio: 4/5; overflow: hidden; background: var(--bg-panel); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding: var(--space-s); display: flex; flex-direction: column; gap: 0.35rem; flex: 1; }
.card__title { font-family: var(--font-display); font-weight: 800; text-transform: uppercase;
  font-size: 1.15rem; line-height: 1.05; margin: 0; }
.card__meta { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.07em;
  text-transform: uppercase; color: var(--text-muted); }
.card__text { color: var(--text-2); font-size: 0.95rem; margin: 0; }

/* ── Problem list: a ruled label list, not a three-card grid ────────────── */
.rules { list-style: none; margin: 0; padding: 0; }
.rules li { padding: var(--space-s) 0; border-bottom: 1px solid var(--line); display: grid;
  grid-template-columns: auto 1fr; gap: var(--space-s); align-items: baseline; }
.rules li:last-child { border-bottom: 0; }
.rules b { font-family: var(--font-mono); color: var(--accent); font-size: 0.8rem; font-weight: 600; }

/* ── Process ────────────────────────────────────────────────────────────── */
.steps { display: grid; gap: var(--space-m); counter-reset: none; }
@media (min-width: 800px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { border-top: 2px solid var(--accent); padding-top: var(--space-s); }
.step h3 { margin-bottom: 0.35rem; }
.step p { color: var(--text-2); font-size: 0.95rem; }

/* ── Band / split ───────────────────────────────────────────────────────── */
.band { background: var(--bg-panel); border-block: 1px solid var(--line); }

/* The closing CTA band gets the machined-steel plate under it. Very low opacity:
   it is a surface, not a picture, and text sits on top of it. */
.band--steel { position: relative; overflow: hidden; }
.band--steel::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background: url("../img/tex-steel.jpg") center/cover no-repeat;
  opacity: 0.5;
}
.band--steel > * { position: relative; z-index: 1; }

/* Side-by-side media stretches to the TEXT column's height. A portrait source
   left to set its own height next to a short text block opens exactly the void
   the two-column layout exists to remove - measured at 706px on the home page
   before this. The media is therefore a fixed window that the image covers, and
   the window is capped so a 9:16 phone photo cannot dominate the band. */
.split { display: grid; gap: var(--space-xl); align-items: center; }
@media (min-width: 860px) { .split { grid-template-columns: 1fr 1fr; } }
.split__media {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  max-height: 30rem;
}
.split__media img { width: 100%; height: 100%; object-fit: cover; }
/* On a portrait source, bias the crop upward - the subject is rarely at the bottom. */
.split__media img.is-portrait { object-position: 50% 32%; }

/* ── Prose ──────────────────────────────────────────────────────────────── */
.prose { max-width: var(--measure); }
.prose h2 { margin-top: var(--space-l); font-size: var(--step-2); }
.prose h3 { margin-top: var(--space-m); }
.prose ul { padding-left: 1.1rem; color: var(--text-2); }
.prose li { margin-bottom: 0.35rem; }
.prose code { font-family: var(--font-mono); font-size: 0.85em; background: var(--bg-panel);
  padding: 0.1em 0.35em; border-radius: 2px; }

/* ── Forms ──────────────────────────────────────────────────────────────── */
.field { margin-bottom: var(--space-s); }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; }
.field .hint { display: block; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 0.4rem; }
.field input, .field textarea, .field select {
  width: 100%; padding: 0.7rem 0.85rem;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--line-control);  /* 3.55:1 - WCAG 2.2 component contrast */
  border-radius: var(--radius);
  font-family: inherit; font-size: 1rem;
}
.field input:focus, .field textarea:focus, .field select:focus {
  border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 1px;
}
.field textarea { min-height: 8rem; resize: vertical; }
.field--error input, .field--error textarea, .field--error select { border-color: var(--tw-error); }
.error-text { color: var(--tw-error); font-size: 0.9rem; margin: 0.3rem 0 0; }
.field-row { display: grid; gap: var(--space-s); }
@media (min-width: 700px) { .field-row--2 { grid-template-columns: 1fr 1fr; } }

/* Honeypot. Named nothing form-like and pushed off-screen - never display:none,
   which some bots detect. */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.stepbar { display: flex; gap: 0.5rem; margin-bottom: var(--space-m); font-family: var(--font-mono);
  font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; }
.stepbar span { padding: 0.3rem 0.6rem; border: 1px solid var(--line-control); color: var(--text-2);
  border-radius: var(--radius); }
.stepbar span[aria-current="step"] { border-color: var(--accent); color: var(--accent); }

.callout { border-left: 3px solid var(--accent); background: var(--bg-panel);
  padding: var(--space-s) var(--space-m); margin-block: var(--space-m); border-radius: 0 var(--radius) var(--radius) 0; }
.callout p:last-child { margin-bottom: 0; }

.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 90;
  background: var(--bg-panel); border: 1px solid var(--line-strong); border-left: 3px solid var(--accent);
  padding: 0.75rem 1rem; border-radius: var(--radius); max-width: 22rem; }
.toast--error { border-left-color: var(--tw-error); }

/* ── Empty state: a fragment, never a reassurance ───────────────────────── */
.empty { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.85rem;
  padding: var(--space-l) 0; }

/* ── Footer ─────────────────────────────────────────────────────────────── */
.site-foot { border-top: 1px solid var(--line); background: var(--bg-panel); margin-top: var(--space-2xl); }
.site-foot__grid { display: grid; gap: var(--space-l); padding-block: var(--space-xl); }
@media (min-width: 760px) { .site-foot__grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-foot h2 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 0.6rem; font-weight: 600; }
.site-foot ul { list-style: none; margin: 0; padding: 0; }
.site-foot li { margin-bottom: 0.4rem; }
.site-foot a { color: var(--text-2); text-decoration: none; }
.site-foot a:hover { color: var(--accent); }
.site-foot__legal { border-top: 1px solid var(--line); padding-block: var(--space-s);
  font-size: 0.85rem; color: var(--text-muted); display: flex; flex-wrap: wrap; gap: var(--space-s); }

/* Short facts are a ruled label/value list, not a grid. */
.dl { margin: 0; font-size: 0.92rem; }
.dl div { display: grid; grid-template-columns: 1fr; gap: 0.15rem; padding-block: 0.35rem; }
@media (min-width: 601px) { .dl div { grid-template-columns: 8rem 1fr; gap: 0.75rem; } }
.dl dt { color: var(--text-muted); font-family: var(--font-mono); font-size: 0.75rem;
  letter-spacing: 0.06em; text-transform: uppercase; }
.dl dd { margin: 0; color: var(--text-2); }

/* ── Motion: one orchestrated page-load, not scattered micro-animations ─── */
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise 0.6s var(--ease) both; }
  .rise:nth-child(2) { animation-delay: 0.06s; }
  .rise:nth-child(3) { animation-delay: 0.12s; }
  .rise:nth-child(4) { animation-delay: 0.18s; }
}
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ── Video ──────────────────────────────────────────────────────────────────
   Aspect-ratio box so the page does not reflow when the poster or the player
   loads. 16/9 for both sources; a vertical Shorts clip letterboxes inside it
   rather than pushing the column around, which is the lesser of the two evils
   on a two-column layout. */
.vid__frame {
  position: relative;
  aspect-ratio: 16 / 9;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #000;
}
.vid__frame > video,
.vid__frame > iframe,
.vid__facade > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  display: block;
}
.vid__frame > video { object-fit: contain; }

.vid__facade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: #000;
  cursor: pointer;
  display: block;
}
.vid__facade:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.vid__play {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 66px;
  height: 46px;
  border-radius: 10px;
  background: rgba(10, 11, 13, .82);
  border: 1px solid var(--line-strong);
  transition: background 160ms var(--ease), transform 160ms var(--ease);
}
/* The triangle, drawn with a border so no image or icon font is needed. */
.vid__play::after {
  content: "";
  position: absolute;
  left: 52%;
  top: 50%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 9px 0 9px 15px;
  border-color: transparent transparent transparent var(--text);
}
.vid__facade:hover .vid__play,
.vid__facade:focus-visible .vid__play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.06);
}
.vid__facade:hover .vid__play::after { border-left-color: var(--on-accent); }

@media (prefers-reduced-motion: reduce) {
  .vid__play { transition: none; }
  .vid__facade:hover .vid__play { transform: translate(-50%, -50%); }
}

/* ── /links : the link-in-bio page ──────────────────────────────────────────
   Its own layout, no site header. Opens on a phone from a social app, so it is
   a single centred column with tap targets that clear 44px. */
.links {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: clamp(2rem, 8vw, 4.5rem) 1rem 3rem;
  background:
    radial-gradient(120% 70% at 50% 0%, rgba(252, 108, 12, .10), transparent 62%),
    var(--bg);
}
.links__in { width: 100%; max-width: 30rem; text-align: center; }
.links__logo {
  width: 88px; height: 88px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
}
.links__name {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 6vw, 2rem);
  margin: .8rem 0 .2rem;
  letter-spacing: .01em;
}
.links__tag { color: var(--text-muted); margin: 0 0 1.6rem; }

.links__cta {
  display: block;
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 700;
  padding: .95rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1.4rem;
  transition: transform 140ms var(--ease), background 140ms var(--ease);
}
.links__cta:hover { background: var(--accent-hover); transform: translateY(-1px); }
.links__cta-sub {
  display: block;
  font-weight: 400;
  font-size: .82rem;
  opacity: .85;
  margin-top: .15rem;
}

.links__list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.links__item {
  display: block;
  min-height: 44px;
  padding: .8rem 1rem;
  background: var(--bg-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color 140ms var(--ease), transform 140ms var(--ease);
}
.links__item:hover { border-color: var(--accent); transform: translateY(-1px); }
.links__label { display: block; font-weight: 600; }
.links__note {
  display: block;
  font-family: var(--font-mono);
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .15rem;
}

.links__more {
  margin-top: 1.8rem;
  display: flex;
  gap: 1.1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.links__more a {
  font-family: var(--font-mono);
  font-size: .82rem;
  color: var(--text-muted);
  text-decoration: none;
}
.links__more a:hover { color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .links__cta, .links__item { transition: none; }
  .links__cta:hover, .links__item:hover { transform: none; }
}
