/* HexaCrewTools landing: white space, large calm headlines, the 3D models
   alternating left and right of the copy, one contact form. */
@font-face {
  font-family: "Inter";
  src: url("fonts/inter-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}

:root {
  --ink: #0b1220;
  --ink-2: #2b3445;
  --muted: #566070;
  --line: #e4e8ef;
  --soft: #f5f7fa;
  --bg: #ffffff;
  --blue: #0a66a8;
  --focus: #1f6bff;
  --bad: #b42318;
  --radius: 14px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(16px, 4vw, 48px);
  --max: 1200px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 17px/1.6 "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: -0.035em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 11px 22px; border: 0; border-radius: 999px; cursor: pointer;
  font: 550 15px/1.2 "Inter", system-ui, sans-serif;
  transition: transform .25s var(--ease), background .2s, box-shadow .25s;
}
.btn:hover { transform: translateY(-1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn:focus-visible { border-radius: 999px; }
.btn-lg { padding: 15px 30px; font-size: 17px; }
.btn-dark { background: var(--ink); color: #fff; box-shadow: 0 6px 20px -8px rgba(11,18,32,.45); }
.btn-dark:hover { background: #1b2740; }

/* ── header: the logo and one button, fixed while the page scrolls ──── */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background .3s, box-shadow .3s, backdrop-filter .3s;
}
.nav.scrolled { background: rgba(255,255,255,.86); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); box-shadow: 0 1px 0 var(--line); }
.nav-inner {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px var(--pad);
}
/* 600 × 235 source; 120 px tall on desktop (306 × 120), smaller on phones */
.nav-logo { height: var(--logo); width: auto; aspect-ratio: 600 / 235; flex: none; }
.nav .btn { flex: none; }
:root { --logo: clamp(56px, 19vw, 120px); --nav-h: calc(var(--logo) + 28px); }
main { padding-top: var(--nav-h); }
[id] { scroll-margin-top: var(--nav-h); }

/* ── rows: copy beside a model, alternating ──────────────────────────── */
.row {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  padding: clamp(56px, 9vw, 120px) var(--pad);
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(24px, 5vw, 72px); align-items: center;
}
.row-rev .row-visual { order: -1; }
.row-wide { grid-template-columns: .8fr 1.2fr; }
.row-wide.row-rev { grid-template-columns: 1.2fr .8fr; }
.row-copy { max-width: 520px; }
.row h2 { font-size: clamp(34px, 4.4vw, 58px); line-height: 1.05; }
.row-copy p { margin-top: 20px; font-size: clamp(17px, 1.5vw, 20px); color: var(--muted); }
.row-visual { position: relative; }
.model { display: block; width: 100%; height: clamp(320px, 38vw, 480px); }
.row-wide .model { height: clamp(320px, 44vw, 560px); }
.row-visual.is-off { display: none; }
.row:has(.row-visual.is-off) { grid-template-columns: 1fr; }

.hero { padding: 8px var(--pad) 0; text-align: center; }
/* the robot first, its lower body behind the copy below it, exactly as it
   once stood behind the top edge of the product window */
.hero-visual { position: relative; z-index: 1; width: min(600px, 92vw); margin: calc(-1 * min(70px, 9vw)) auto calc(-1 * min(120px, 20vw)); }
.hero-robot { display: block; width: 100%; height: min(470px, 78vw); }
.hero-copy { position: relative; z-index: 2; background: var(--bg); padding-top: clamp(14px, 2vw, 24px); }
.hero h1 { font-size: clamp(34px, 5vw, 72px); line-height: 1.04; letter-spacing: -0.045em; max-width: 1200px; margin: 0 auto; }
.hero-copy > p { max-width: 640px; margin: 18px auto 0; color: var(--muted); font-size: clamp(17px, 1.6vw, 21px); }

/* ── contact: a dialog over the page ────────────────────────────────── */
dialog.contact {
  width: min(560px, calc(100vw - 2 * var(--pad))); max-height: calc(100dvh - 32px);
  padding: 0; border: 0; border-radius: 22px; background: #fff; color: var(--ink);
  box-shadow: 0 30px 80px -30px rgba(11,18,32,.55); overflow: auto;
}
dialog.contact::backdrop { background: rgba(11,18,32,.42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
dialog.contact:target:not([open]) {            /* without JavaScript */
  display: block; position: fixed; inset: 0; margin: auto; z-index: 100; height: fit-content;
}
.contact-card { position: relative; padding: clamp(24px, 5vw, 40px); }
.contact-close {
  position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center; color: var(--muted); transition: background .2s, color .2s;
}
.contact-close:hover { background: var(--soft); color: var(--ink); }
.contact-close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.contact h2 { font-size: clamp(28px, 4vw, 40px); line-height: 1.05; padding-right: 36px; }
.contact-lead { margin-top: 12px; color: var(--muted); font-size: 16.5px; }
.contact-form { display: grid; gap: 16px; margin-top: 24px; }
.field { display: grid; gap: 7px; }
.field label { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.field input, .field textarea {
  width: 100%; padding: 13px 15px; border: 1px solid #cfd5df; border-radius: var(--radius);
  background: #fff; color: var(--ink); font: 400 16px/1.5 "Inter", system-ui, sans-serif;
  transition: border-color .2s, box-shadow .2s;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #8a93a3; }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px rgba(31,107,255,.22); }
.field [aria-invalid="true"] { border-color: var(--bad); }
.contact-form .btn { justify-self: start; }
.form-status { min-height: 1.4em; font-size: 15px; color: var(--muted); }
.form-status.error { color: var(--bad); }
.contact-sent { display: grid; gap: 14px; justify-items: center; text-align: center; padding: 12px 0 4px; }
.contact-sent[hidden] { display: none; }
.contact-sent p { color: var(--muted); overflow-wrap: anywhere; }
.contact-sent h2:focus { outline: none; }
.sent-icon { width: 44px; height: 44px; fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* ── footer ──────────────────────────────────────────────────────────── */
.footer {
  max-width: calc(var(--max) + 2 * var(--pad)); margin: 0 auto;
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px 24px;
  padding: 26px var(--pad) 32px; border-top: 1px solid var(--line);
  font-size: 14px; color: var(--muted);
}
.footer nav { margin-left: auto; display: flex; gap: 22px; }
.footer a { padding: 4px 0; }
.footer a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

/* reveal start states (only once landing.js has confirmed it can run them) */
.js .reveal { opacity: 0; transform: translateY(14px); filter: blur(4px); }
.js .reveal-words .w { display: inline-block; opacity: 0; transform: translateY(0.35em); filter: blur(6px); }

/* ── tablet and phone: copy first, then the model ────────────────────── */
@media (max-width: 860px) {
  .row, .row-wide, .row-wide.row-rev { grid-template-columns: 1fr; }
  .row .row-visual, .row-rev .row-visual { order: -1; }   /* phones: the model above its text */
  .row-copy { max-width: 640px; }
  .model, .row-wide .model { height: clamp(240px, 68vw, 360px); }
  .row { gap: 4px; padding-top: clamp(40px, 8vw, 72px); padding-bottom: clamp(24px, 5vw, 48px); }
  .footer nav { margin-left: 0; }
}
@media (max-width: 380px) {
  .nav .btn { padding: 10px 16px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .btn:hover { transition: none; transform: none; }
  .js .reveal, .js .reveal-words .w { opacity: 1; transform: none; filter: none; }
}

/* ── legal pages: the same type and palette, a readable column ────────── */
.legal { max-width: 760px; margin: 0 auto; padding: clamp(32px, 6vw, 72px) var(--pad) clamp(56px, 8vw, 96px); }
.legal-version { font-size: 14px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--blue); }
.legal h1 { margin-top: 10px; font-size: clamp(34px, 4.6vw, 56px); line-height: 1.05; letter-spacing: -0.04em; }
.legal .lead { margin-top: 18px; font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); }
.legal h2 { margin-top: 48px; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; letter-spacing: -0.025em; }
.legal h3 { margin-top: 28px; font-size: 18px; letter-spacing: -0.015em; }
.legal p, .legal li { color: var(--ink-2); font-size: 16.5px; line-height: 1.7; }
.legal p { margin-top: 14px; }
.legal ul { margin: 12px 0 0; padding-left: 22px; }
.legal li { margin-top: 6px; }
.legal a:not(.btn) { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.legal table { width: 100%; margin-top: 16px; border-collapse: collapse; font-size: 15px; }
.legal th, .legal td { text-align: left; vertical-align: top; padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); color: var(--ink-2); }
.legal th { font-weight: 600; color: var(--ink); }
.legal-toc { margin-top: 28px; padding: 18px 22px; border-radius: var(--radius); background: var(--soft); }
.legal-toc p { margin: 0 0 6px; font-weight: 600; color: var(--ink); }
.legal-toc ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 28px; }
.legal-toc li { font-size: 15px; margin: 0; padding: 4px 0; break-inside: avoid; }
@media (max-width: 640px) {
  .legal-toc ol { columns: 1; }
  .legal table, .legal thead, .legal tbody, .legal tr, .legal th, .legal td { display: block; }
  .legal thead { display: none; }
  .legal td { border: 0; padding: 2px 0; }
  .legal tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .legal td:first-child { font-weight: 600; color: var(--ink); }
}

/* ── page not found ───────────────────────────────────────────────────── */
.notfound { max-width: 760px; margin: 0 auto; min-height: 52vh; padding: clamp(56px, 10vw, 120px) var(--pad);
  display: grid; align-content: center; justify-items: start; gap: 16px; }
.notfound h1 { font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.045em; }
.notfound p:not(.legal-version) { font-size: clamp(17px, 1.5vw, 19px); color: var(--muted); max-width: 520px; }
.notfound .btn { margin-top: 12px; }
