/* Machine Soul: shared styles for the design previews.
   Sizes are tuned so a 1440px-wide viewport matches references/V1.png & V2.png. */

:root {
  --font: "Commissioner", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --ink: #111;
  --muted: #4a4a4a;
  --paper: #fff;
  --line: #111;

  --accent: #d4f24c;
  --accent-ink: #111;
  --btn-bg: var(--accent);
  --btn-ink: var(--accent-ink);
  --tag-bg: #eef0e8;
  --card-bg: #f4f5f0;

  --gutter: clamp(20px, 6.1vw, 88px);
  --wrap: 1162px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  --fs-hero: clamp(30px, 3.55vw, 54px);
  --fs-btn: clamp(16px, 1.6vw, 22px);
  --fs-h2: clamp(34px, 4vw, 58px);
  --fs-h3: clamp(24px, 2.4vw, 36px);
  --fs-statement: clamp(22px, 2.65vw, 40px);
  --fs-pill: clamp(15px, 1.8vw, 26px);
  --fs-service: clamp(20px, 2.7vw, 40px);
  --fs-body: clamp(16px, 1.3vw, 19px);
  --fs-small: clamp(14px, 1.3vw, 19px);

  --tile: clamp(60px, 6.9vw, 100px);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, p, figure, dl, dd { margin: 0; }
button, input, textarea { font: inherit; color: inherit; }

/* Commissioner has no italic; it has a slant axis instead. */
em { font-style: oblique 12deg; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 6px; }

.wrap {
  width: min(100% - 2 * var(--gutter), var(--wrap));
  margin-inline: auto;
}

.logo { display: block; aspect-ratio: 834 / 264; height: auto; }

/* ---------- Buttons, pills, tags ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  height: 2.6em;
  padding: 0 1em;
  border: 0;
  border-radius: 999px;
  font-size: var(--fs-btn);
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
  background: var(--btn-bg);
  color: var(--btn-ink);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out), background-color 0.3s, opacity 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -12px rgb(0 0 0 / 0.45); }
.btn:active { transform: translateY(0); }
.btn[disabled] { opacity: 0.6; cursor: progress; transform: none; }
.btn .arrow { transition: transform 0.4s var(--ease-out); }
.btn:hover .arrow { transform: translateX(3px); }

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 1.1vw, 16px) clamp(8px, 0.9vw, 14px);
}
.pill {
  display: inline-flex;
  align-items: center;
  height: 2.65em;
  padding: 0 0.72em;
  border-radius: 999px;
  font-size: var(--fs-pill);
  line-height: 1;
  white-space: nowrap;
  transition: transform 0.4s var(--ease-out), background-color 0.3s;
}
.pill:hover { transform: translateY(-2px); }

.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  padding: 0.4em 0.8em;
  border-radius: 999px;
  font-size: 14px;
  line-height: 1.1;
  background: var(--tag-bg);
}

/* ---------- Nav: floating capsule (desktop) / bottom tab bar (phone) ---------- */

.nav {
  position: fixed;
  top: 18px;
  left: 50%;
  z-index: 60;
  display: flex;
  align-items: center;
  padding: 6px 6px 6px 22px;
  border-radius: 999px;
  color: var(--nav-ink);
  background: var(--nav-bg);
  border: 1px solid var(--nav-border);
  box-shadow: var(--nav-shadow);
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
  translate: -50% 0;
  transition: translate 0.6s var(--ease-out), background-color 0.4s;
}
.nav.is-hidden { translate: -50% calc(-100% - 64px); }
.nav__brand {
  display: block;
  margin-right: 26px;
  color: var(--nav-brand-ink, currentColor);
  transition: opacity 0.3s;
}
.nav__brand:hover { opacity: 0.75; }
.nav__brand .logo { width: 116px; }
.nav__links {
  position: relative;
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav__links a {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  font-size: 16px;
  white-space: nowrap;
}
.nav__indicator {
  position: absolute;
  z-index: 0;
  top: 0;
  left: 0;
  height: 44px;
  width: 0;
  border-radius: 999px;
  background: var(--nav-indicator);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.55s var(--ease-out), width 0.55s var(--ease-out), opacity 0.3s;
}
.nav__icon { display: none; width: 22px; height: 22px; }
.nav__links .nav__cta {
  margin-left: 10px;
  background: var(--btn-bg);
  color: var(--btn-ink);
  transition: transform 0.4s var(--ease-out), box-shadow 0.4s var(--ease-out);
}
.nav__links .nav__cta:hover { transform: translateY(-1px); box-shadow: 0 8px 24px -10px rgb(0 0 0 / 0.5); }
.nav__short { display: none; }

/* ---------- Hero ---------- */

.hero {
  position: relative;
  isolation: isolate;
  overflow: clip;
}
.hero__brand { display: none; }
.hero__inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 40px;
  min-height: clamp(600px, 58vw, 900px);
}
.hero__title {
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin-bottom: 0.62em;
}
.flair {
  display: inline-block;
  animation: flair 3.2s 1.1s var(--ease-out) both;
  transition: font-variation-settings 0.6s var(--ease-out);
}
.flair:hover { font-variation-settings: "FLAR" 100; }
@keyframes flair {
  0%, 100% { font-variation-settings: "FLAR" 0; }
  45% { font-variation-settings: "FLAR" 100; }
}

/* ---------- WebGL containers ----------
   Canvases fade in over a gradient that matches the scene, so there's no
   image flash. Fallback images only appear when WebGL is unavailable
   (html.gl-off, set by the head script) or a scene fails (.gl-failed). */

.gl { position: relative; }
.gl__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.4s var(--ease-out);
}
.gl-ready > .gl__canvas { opacity: 1; }
.gl__fallback,
.knot-visual__fallback { opacity: 0; transition: opacity 0.8s var(--ease-out); }
.gl-off .gl__fallback,
.gl-off .knot-visual__fallback,
.gl-failed > .gl__fallback { opacity: 1; }
.gl--bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
}

/* Chrome orb card (V1 hero, index) */
.orb-card {
  width: clamp(220px, 19.8vw, 300px);
  aspect-ratio: 602 / 1018;
  overflow: hidden;
  background:
    radial-gradient(70% 45% at 50% 50%, #6d8c34 0%, transparent 70%),
    linear-gradient(160deg, #cfd9b0 0%, #34491b 35%, #121a0a 70%, #52703a 100%);
  box-shadow: 0 40px 80px -30px rgb(0 0 0 / 0.55);
}
.orb-card .gl__fallback { width: 100%; height: 100%; object-fit: cover; scale: 1.1; }

/* Sky card + chrome knot (V2 hero, index) */
.knot-visual {
  position: relative;
  width: clamp(250px, 27vw, 390px);
  aspect-ratio: 782 / 1020;
}
.knot-visual__fallback {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  mix-blend-mode: multiply; /* the JPG's white margin melts into the page */
}
.knot-visual__card {
  position: absolute;
  inset: 0 26.5% 0 0;
  overflow: hidden;
  background: linear-gradient(180deg, #3c8bcc 0%, #6aaade 70%, #b9d8ef 100%);
}
.gl-off .knot-visual__card { background: none; }
.knot-visual__knot {
  position: absolute;
  inset: -8% -12% -10% -10%;
  pointer-events: none;
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(64px, 7vw, 104px); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px 48px;
  flex-wrap: wrap;
  margin-bottom: clamp(40px, 5vw, 72px);
}
.section-title {
  font-size: var(--fs-h2);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -0.015em;
}
.section-intro {
  max-width: 34ch;
  font-size: var(--fs-small);
  color: var(--muted);
}
.section-head__aside { display: grid; gap: 14px; justify-items: start; }
.section-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  border-bottom: 1px solid currentColor;
  padding-bottom: 2px;
}
.section-link span { transition: transform 0.4s var(--ease-out); }
.section-link:hover span { transform: translateX(4px); }

/* ---------- About ---------- */

.about__statement {
  max-width: 22.5em;
  font-size: var(--fs-statement);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin-bottom: clamp(28px, 3.4vw, 50px);
}

/* ---------- Origin: The Soul of a New Machine ---------- */

.origin__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  align-items: center;
  gap: clamp(40px, 7vw, 110px);
}
.origin__stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: clamp(360px, 36vw, 520px);
  perspective: 1400px;
}
.origin__stage::after {
  /* floor shadow */
  content: "";
  position: absolute;
  bottom: 6%;
  left: 20%;
  right: 20%;
  height: 34px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.28), transparent);
  filter: blur(4px);
  animation: shadow-breathe 7s ease-in-out infinite;
}
.book-float { animation: book-float 7s ease-in-out infinite; transform-style: preserve-3d; }
@keyframes book-float { 50% { transform: translateY(-14px); } }
@keyframes shadow-breathe { 50% { transform: scaleX(0.85); opacity: 0.7; } }

.book {
  --t: 36px;
  position: relative;
  width: clamp(190px, 19vw, 270px);
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transform: rotateY(calc(26deg + var(--ry, 0deg))) rotateX(calc(3deg + var(--rx, 0deg)));
  transition: transform 0.9s var(--ease-out);
}
.book__face { position: absolute; inset: 0; backface-visibility: hidden; }
.book__cover {
  display: flex;
  flex-direction: column;
  padding: 26px 22px 22px 28px;
  border-radius: 2px 7px 7px 2px;
  overflow: hidden;
  color: var(--cover-ink);
  background: var(--cover-bg);
  transform: translateZ(calc(var(--t) / 2));
  box-shadow: inset 5px 0 6px -2px rgb(0 0 0 / 0.35), inset 7px 0 0 -5px rgb(255 255 255 / 0.25);
}
.book__cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, rgb(255 255 255 / 0.22), transparent 38%, transparent 70%, rgb(255 255 255 / 0.08));
  pointer-events: none;
}
.book__author { font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase; opacity: 0.85; }
.book__title {
  margin-top: 18px;
  font-size: clamp(26px, 2.6vw, 38px);
  font-weight: 600;
  line-height: 0.98;
  letter-spacing: -0.02em;
}
.book__title em { font-weight: 400; color: var(--cover-accent, inherit); }
.book__note { margin-top: auto; font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; opacity: 0.75; }
.book__spine {
  width: var(--t);
  display: grid;
  place-items: center;
  color: var(--cover-ink);
  background: var(--spine-bg);
  transform: translateX(calc(var(--t) / -2)) rotateY(-90deg);
  transform-origin: center;
}
.book__spine span {
  writing-mode: vertical-rl;
  rotate: 180deg;
  font-size: 10px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}
.book__pages {
  inset: 4px auto 4px calc(100% - var(--t) + 4px);
  width: calc(var(--t) - 4px);
  background: repeating-linear-gradient(90deg, #f4f1e8 0 1px, #dcd6c6 1px 2px);
  transform: translateX(calc(var(--t) / 2 - 2px)) rotateY(90deg);
}
.book__back {
  border-radius: 7px 2px 2px 7px;
  background: var(--spine-bg);
  transform: translateZ(calc(var(--t) / -2)) rotateY(180deg);
}

.origin__title {
  font-size: clamp(32px, 3.9vw, 56px);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 18px 0 28px;
}
.origin__copy p + p { margin-top: 1em; }
.origin__copy p { max-width: 36em; color: var(--origin-muted, var(--muted)); }
.origin__copy p strong { color: var(--ink); font-weight: 500; }
.origin__facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--origin-line, rgb(0 0 0 / 0.14));
}
.origin__facts dt { font-size: clamp(22px, 2vw, 30px); font-weight: 500; letter-spacing: -0.01em; }
.origin__facts dd { margin-top: 4px; font-size: 14px; line-height: 1.35; color: var(--origin-muted, var(--muted)); }

/* ---------- Services ---------- */

.service {
  display: grid;
  grid-template-columns: var(--tile) minmax(0, 1fr) minmax(0, 523px);
  align-items: center;
  column-gap: clamp(20px, 4.6vw, 66px);
  padding-block: clamp(22px, 2.9vw, 42px);
  border-bottom: 1.5px solid var(--line);
}
.service__title {
  font-size: var(--fs-service);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  transition: transform 0.5s var(--ease-out);
}
.service__desc { font-size: var(--fs-small); line-height: 1.3; }
.service { position: relative; }
.service__title a::after { content: ""; position: absolute; inset: 0; }
.service__title a:focus-visible { outline: none; }
.service:has(a:focus-visible) { outline: 2px solid currentColor; outline-offset: 4px; border-radius: 8px; }
.service:hover .service__title { transform: translateX(6px); }

.tile {
  position: relative;
  display: grid;
  place-items: center;
  width: var(--tile);
  aspect-ratio: 1;
  border-radius: calc(var(--tile) * 0.09);
  overflow: hidden;
  color: #1c1c1c;
  background:
    radial-gradient(120% 90% at 20% 10%, rgb(255 255 255 / 0.95), transparent 55%),
    linear-gradient(145deg, #f2f2f2 0%, #c9c9c9 38%, #ececec 58%, #a9a9a9 100%);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.9),
    inset 0 -1px 0 rgb(0 0 0 / 0.12),
    0 1px 2px rgb(0 0 0 / 0.12);
}
.tile::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(105deg, transparent 38%, rgb(255 255 255 / 0.85) 50%, transparent 62%);
  transform: translateX(-110%);
  transition: transform 0.9s var(--ease-out);
}
.service:hover .tile::after { transform: translateX(110%); }
.tile svg {
  position: relative;
  z-index: 1;
  width: 54%;
  height: auto;
  filter: drop-shadow(0 1px 0 rgb(255 255 255 / 0.7));
}
.service:hover .led { animation: blink 0.9s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

/* ---------- Work (with client logos) ---------- */

.work__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 1.7vw, 24px);
}
.case {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: clamp(24px, 3vw, 44px);
  border-radius: 24px;
  background: var(--card-bg);
  overflow: hidden;
}
.case--featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
}
.case__body { display: flex; flex-direction: column; gap: 22px; }
.case__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 48px;
}
.case__logo { height: 44px; width: auto; }
.case__logo--mira { height: 28px; mix-blend-mode: multiply; }
.logo-chip {
  display: inline-grid;
  place-items: center;
  height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: #0f1419;
  color: #fff;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.05em;
}
/* Techpaladin: boxless mark + name, on the left of the KDE card */
.client-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 17px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.client-mark img { height: 44px; width: auto; }
.client-mark .on-dark { display: none; }
.case--featured .client-mark .on-light,
.v1 .dark-surface .client-mark .on-light { display: none; }
.case--featured .client-mark .on-dark,
.v1 .dark-surface .client-mark .on-dark { display: block; }
.case__client { font-size: 15px; font-weight: 500; color: var(--case-muted, var(--muted)); margin-bottom: -10px; }
.case__more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 500;
  border: 0 !important;
}
.case__more span { transition: transform 0.4s var(--ease-out); }
.case__more:hover span { transform: translateX(4px); }
.case__title {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
.case__summary { color: var(--case-muted, var(--muted)); max-width: 46ch; }
.case__points { display: grid; align-content: start; }
.case__points li {
  display: grid;
  grid-template-columns: 2.4em 1fr;
  gap: 8px;
  padding-block: 14px;
  border-top: 1px solid var(--case-line, rgb(0 0 0 / 0.14));
  line-height: 1.35;
}
.case__points li:last-child { border-bottom: 1px solid var(--case-line, rgb(0 0 0 / 0.14)); }
.case__points .n { font-size: 13px; padding-top: 0.25em; font-variant-numeric: tabular-nums; opacity: 0.6; }
.case__links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: auto; font-size: 15px; }
.case__links a {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
  transition: opacity 0.3s;
}
.case__links a:hover { opacity: 0.6; }

/* ---------- Writing / mentions ---------- */

.mentions { border-top: 1.5px solid var(--line); }
.mention a {
  display: grid;
  grid-template-columns: minmax(140px, 0.9fr) minmax(0, 2.4fr) minmax(0, 1fr) 32px;
  align-items: center;
  gap: 24px;
  padding: 22px 8px;
  border-bottom: 1px solid rgb(0 0 0 / 0.16);
  transition: background-color 0.3s, padding 0.5s var(--ease-out);
}
.mention a:hover { background: var(--mention-hover); padding-inline: 20px; }
.mention__source { font-size: 15px; color: var(--muted); }
.mention__title { font-size: clamp(18px, 1.6vw, 24px); font-weight: 500; line-height: 1.2; }
.mention__topic { font-size: 15px; color: var(--muted); }
.mention__arrow { justify-self: end; transition: transform 0.4s var(--ease-out); }
.mention a:hover .mention__arrow { transform: translate(3px, -3px); }

/* ---------- Contact: form + live boot log ---------- */

.contact__panel {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: clamp(32px, 4.5vw, 64px);
  align-items: start;
  padding: clamp(24px, 5vw, 72px);
  border-radius: 32px;
  overflow: clip;
  color: var(--panel-ink);
  background: var(--panel-bg);
}
.contact__intro { grid-column: 1 / -1; max-width: 40em; }
.contact__title {
  font-size: clamp(38px, 5.2vw, 76px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.contact__title em { color: var(--panel-accent, inherit); }
.contact__intro p { color: var(--panel-muted); max-width: 34em; }

.form { display: grid; gap: 24px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.field { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { padding: 0; font-size: 14px; letter-spacing: 0.01em; color: var(--panel-muted); }
.field__label i { font-style: normal; opacity: 0.65; }
.field input,
.field textarea {
  width: 100%;
  font-size: 17px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  transition: border-color 0.3s, box-shadow 0.3s, background-color 0.3s;
}
.field textarea { min-height: 150px; line-height: 1.45; resize: vertical; }
.field input::placeholder,
.field textarea::placeholder { color: inherit; opacity: 0.38; }
.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--focus);
  box-shadow: 0 0 0 4px var(--focus-ring);
}
.field input:user-invalid,
.field textarea:user-invalid { border-color: #e5484d; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  height: 40px;
  padding: 0 15px;
  border-radius: 999px;
  border: 1px solid var(--field-border);
  background: var(--field-bg);
  font-size: 15px;
  white-space: nowrap;
  transition: background-color 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}
.chip span::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1.5px solid currentColor;
  transition: background-color 0.25s;
}
.chip:hover span { border-color: var(--focus); }
.chip input:checked + span {
  color: var(--chip-on-ink);
  background: var(--chip-on-bg);
  border-color: transparent;
}
.chip input:checked + span::before { background: currentColor; }
.chip input:focus-visible + span { box-shadow: 0 0 0 4px var(--focus-ring); }

.form__actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 22px; margin-top: 4px; }
.form__note { font-size: 14px; color: var(--panel-muted); }

.bootlog {
  position: sticky;
  top: 100px;
  border-radius: 18px;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
  color: #d9ded2;
  background: var(--term-bg);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / 0.6), inset 0 0 0 1px rgb(255 255 255 / 0.06);
}
.bootlog__bar {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 12px 16px;
  border-bottom: 1px solid rgb(255 255 255 / 0.07);
  font-size: 12px;
}
.bootlog__bar i { width: 10px; height: 10px; border-radius: 50%; background: rgb(255 255 255 / 0.16); }
.bootlog__bar span { margin-left: 8px; opacity: 0.5; }
.bootlog__body {
  margin: 0;
  min-height: 300px;
  padding: 18px 18px 24px;
  font: inherit;
  line-height: 1.8;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.log-ok { color: var(--term-ok); }
.log-wait { color: #8a9185; }
.log-fail { color: #ff7a7a; }
.log-dim { color: #8a9185; }
.cursor {
  display: inline-block;
  width: 0.6em;
  height: 1.1em;
  vertical-align: -0.2em;
  background: var(--term-ok);
  animation: blink 1s steps(2, jump-none) infinite;
}

/* ---------- Footer ---------- */

.footer { padding-block: 56px 40px; }
.footer__top {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  flex-wrap: wrap;
  padding-bottom: 48px;
}
.footer__brand .logo { width: clamp(180px, 18vw, 240px); }
.footer__tagline { margin-top: 16px; font-size: 14px; opacity: 0.7; }
.theme-switch {
  display: inline-flex;
  gap: 4px;
  margin-top: 22px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid var(--footer-line);
  font-size: 14px;
}
.theme-switch a { padding: 6px 14px; border-radius: 999px; transition: background-color 0.3s; }
.theme-switch a:hover { background: rgb(128 128 128 / 0.14); }
.theme-switch a[aria-current] { background: var(--btn-bg); color: var(--btn-ink); }
.footer__bottom a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__cols { display: flex; gap: clamp(40px, 6vw, 96px); flex-wrap: wrap; }
.footer__col h4 { font-size: 13px; font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; opacity: 0.6; }
.footer__col li + li { margin-top: 8px; }
.footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid var(--footer-line);
  font-size: 14px;
  opacity: 0.75;
}

/* ---------- Reveal on scroll ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 1s var(--ease-out), transform 1s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
[data-reveal].is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
  [data-reveal] { opacity: 1; transform: none; }
}

/* ---------- Tablet ---------- */

@media (max-width: 1000px) {
  .hero__inner { grid-template-columns: 1fr; align-content: start; gap: 48px; padding-top: 120px; }
  .hero .orb-card { justify-self: center; }
  .service { grid-template-columns: var(--tile) minmax(0, 1fr); row-gap: 10px; }
  .service__desc { grid-column: 2; }
  .work__grid,
  .case--featured,
  .origin__grid,
  .contact__panel { grid-template-columns: 1fr; }
  .bootlog { position: relative; top: 0; }
  .mention a { grid-template-columns: 1fr 24px; gap: 4px 16px; }
  .mention__source, .mention__title, .mention__topic { grid-column: 1; }
  .mention__arrow { grid-column: 2; grid-row: 1 / span 3; }
}

/* ---------- Phone: app-style bottom tab bar, logo lives in the hero ---------- */

@media (max-width: 760px) {
  body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
  html { scroll-padding-top: 24px; }

  .nav {
    top: auto;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 10px;
    right: 10px;
    padding: 6px;
    border-radius: 28px;
    translate: none;
  }
  .nav.is-hidden { translate: none; }
  .nav__brand { display: none; }
  .nav__links {
    flex: 1;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
  }
  .nav__links a {
    flex-direction: column;
    justify-content: center;
    gap: 3px;
    height: 58px;
    padding: 0;
    border-radius: 22px;
    font-size: 11px;
    letter-spacing: 0.01em;
  }
  .nav__indicator { height: 58px; border-radius: 22px; }
  .nav__icon { display: block; }
  .nav__links .nav__cta { margin-left: 4px; }
  .nav__long { display: none; }
  .nav__short { display: inline; }

  .hero__brand {
    display: block;
    position: absolute;
    top: 26px;
    left: var(--gutter);
    z-index: 2;
    color: var(--hero-brand-ink, currentColor);
  }
  .hero__brand .logo { width: 116px; }
  .hero__inner { padding-top: 104px !important; }

  .form__row { grid-template-columns: 1fr; }
  .origin__facts { grid-template-columns: 1fr; gap: 14px; }
  .contact__panel { border-radius: 24px; }
}

.knot-visual:has(.gl-failed) .knot-visual__fallback { opacity: 1; }
