/* SANS design tokens and primitives.
 *
 * Every other stylesheet on this site reads its colour, rhythm and type from
 * here and declares none of its own. The names in the first block are fixed by
 * .autopilot/.../interfaces.md - change a value, never a name. The second block
 * is derived from the first so the whole page follows one palette.
 *
 * A look is declared once. Section elements whose markup cannot carry a
 * primitive's class join that primitive's selector list below and keep only
 * what differs in sections.css.
 *
 * Fonts are a system stack on purpose: the site has to open from a disc with no
 * network, so nothing is fetched from a font host.
 */

:root {
  /* --- fixed contract ---------------------------------------------------- */
  --bg: #08080a;                      /* page ground */
  --bg-1: #0e0e11;                    /* panel */
  --bg-2: #16161a;                    /* card */
  --line: rgba(255, 255, 255, .08);   /* hairline between surfaces */
  --ink: #f2f2f4;                     /* body text */
  --ink-2: rgba(242, 242, 244, .62);  /* secondary text - the palest any text may be */
  --ink-3: rgba(242, 242, 244, .38);  /* non-text detail only: ticks, dividers, rims */
  --red: #dd1825;                     /* accent */
  --red-2: #b50914;                   /* accent, pressed and shadowed */
  --red-glow: rgba(221, 24, 37, .45); /* light the accent throws */
  --green: #16803f;                   /* inside the mark only */
  --gold: #b89355;                    /* inside the mark only */
  --r-cut: 18px;                      /* length of a chamfered corner */
  --gap: clamp(56px, 8vw, 128px);     /* vertical rhythm between sections */
  --shell: min(1280px, 92vw);         /* content width */
  --f-display: 'Oswald', 'Arial Narrow', 'Haettenschweiler', 'Impact', system-ui, sans-serif;
  --f-text: 'Inter', -apple-system, 'Segoe UI', Roboto, system-ui, sans-serif;

  /* --- derived ----------------------------------------------------------- */
  --sheen: rgba(255, 255, 255, .07);  /* light catching the top of a panel */
  --screw: rgba(242, 242, 244, .26);  /* the machined dots in a panel corner */
  --tick: rgba(242, 242, 244, .34);   /* every fifth mark on the rule */
  --tick-2: rgba(242, 242, 244, .14); /* the marks between */
  --shadow: rgba(0, 0, 0, .72);       /* what a panel drops on the ground */
  --on-red: #ffffff;                  /* text sitting on the accent - nothing else */
  --white: #ffffff;                   /* white as a material: the mark's disc, plates, glints, sparks */

  --rule-step: 14px;                  /* distance between two marks */
  --rule-minor: 7px;                  /* short mark */
  --rule-major: 20px;                 /* every fifth mark, and the rule height */
  --r-btn: 4px;
  --pill: 999px;
  --tap: 44px;                        /* smallest comfortable touch target */
  --gutter: 16px;                     /* side air of .shell on the narrowest phone */

  /* Motion, shortest first: --fast, --dur-short, --slow, --dur-long,
   * --dur-drift, --dur-pulse. --ease changes a state; --ease-out arrives. */
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --fast: 140ms;
  --dur-short: 160ms;                 /* something small leaves or answers */
  --slow: 320ms;
  --dur-long: 480ms;                  /* something travels its full distance */
  --dur-drift: 900ms;                 /* slow photographic drift */
  --dur-pulse: 1.9s;                  /* one beat of a looping pulse */

  color-scheme: dark;
  scrollbar-color: var(--ink-3) var(--bg-1);
  scrollbar-width: thin;
}

/* --- reset ------------------------------------------------------------- */

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

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

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ul, ol {
  margin: 0;
}

ul[class],
ol[class] {
  padding: 0;
  list-style: none;
}

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
}

/* The attribute beats whatever display a class gives (.btn is inline-flex). */

[hidden] {
  display: none !important;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-text);
  font-size: clamp(15px, .35vw + 14px, 17px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Browser chrome the page did not draw still belongs to the design. */

::selection {
  background: var(--red);
  color: var(--on-red);
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-1);
}

::-webkit-scrollbar-thumb {
  background: var(--ink-3);
  border: 3px solid var(--bg-1);
  border-radius: var(--pill);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--red);
}

a {
  color: inherit;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}

input,
textarea {
  caret-color: var(--red);
}

/* Keyboard travel has to be visible at every stop. */

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

:focus:not(:focus-visible) {
  outline: none;
}

/* --- type --------------------------------------------------------------- */

/* Display type: one face, weight, case and tracking; each heading sets its
 * own size. */

.display,
.section-title,
.hero__word,
.hero__sub,
.scene__title,
.journey__title,
.tech-card__title,
.tile__brand,
.svc__title,
.fears__title,
.fear__q,
.svc-dialog__title,
.contact__title {
  font-family: var(--f-display);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.display {
  font-size: clamp(2.2rem, 6vw, 5.5rem);
  line-height: .95;
  text-wrap: balance;
}

/* Small caps: labels, tabs, buttons. */

.eyebrow,
.btn,
.skip-link,
.site-nav a,
.scene__eyebrow,
.hotspot__label,
.journey__eyebrow,
.hud__label,
.tab,
html:not(.ui-ready) .tabpanel__title,
.tile__meta,
.specs dt,
.svc-notes__official,
.contact__person,
.site-footer__descriptor,
.site-footer__title {
  font-family: var(--f-display);
  letter-spacing: .28em;
  text-transform: uppercase;
}

.eyebrow {
  font-size: .72rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink-2);
}

.lead {
  font-size: clamp(1rem, .5vw + .9rem, 1.2rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 66ch;
  text-wrap: pretty;
}

/* Figures that sit in a column have to line up under each other. */

.tabular {
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

/* --- chamfer ------------------------------------------------------------ */

/* Bare .cut takes the reference corners - top left and bottom right. Naming any
 * corner takes over completely, so .cut.cut--tr chamfers that corner alone.
 * --cut-path is published so a panel can clip its own inner layers to the same
 * outline; .glass uses it to keep its hairline running around the bevel. */

.cut,
.journey--static .scene__media,
.svc__media {
  --cut-tl: var(--r-cut);
  --cut-tr: 0px;
  --cut-br: var(--r-cut);
  --cut-bl: 0px;
  --cut-path: polygon(
    var(--cut-tl) 0,
    calc(100% - var(--cut-tr)) 0,
    100% var(--cut-tr),
    100% calc(100% - var(--cut-br)),
    calc(100% - var(--cut-br)) 100%,
    var(--cut-bl) 100%,
    0 calc(100% - var(--cut-bl)),
    0 var(--cut-tl)
  );
  clip-path: var(--cut-path);
}

.cut--tl,
.cut--tr,
.cut--br,
.cut--bl {
  --cut-tl: 0px;
  --cut-tr: 0px;
  --cut-br: 0px;
  --cut-bl: 0px;
}

.cut--tl { --cut-tl: var(--r-cut); }
.cut--tr { --cut-tr: var(--r-cut); }
.cut--br { --cut-br: var(--r-cut); }
.cut--bl { --cut-bl: var(--r-cut); }

/* The chamfer clips everything outside the box, a focus ring included, so a
 * chamfered element draws its ring on the inside of its own edge. A panel does
 * the same whether cut or not, so its ring lands on its red hairline. */

.cut:focus-visible,
.glass:focus-visible {
  outline-offset: -2px;
  border-radius: 0;
}

/* A square outline would open at the bevels, so a bare .cut draws its ring as
 * a 2px band: the box minus the same outline inset by 2px (.83px = 2px x
 * (sqrt2 - 1) keeps the band 2px wide across a 45-degree bevel). */

.cut:not(.glass):focus-visible {
  outline: none;
}

:where(.cut:not(.glass, dialog):focus-visible) {
  position: relative;
  isolation: isolate;
}

.cut:not(.glass):focus-visible::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  background: var(--red);
  clip-path: polygon(
    evenodd,
    0 0, 100% 0, 100% 100%, 0 100%, 0 0,
    max(2px, var(--cut-tl) + .83px) 2px,
    calc(100% - max(2px, var(--cut-tr) + .83px)) 2px,
    calc(100% - 2px) max(2px, var(--cut-tr) + .83px),
    calc(100% - 2px) calc(100% - max(2px, var(--cut-br) + .83px)),
    calc(100% - max(2px, var(--cut-br) + .83px)) calc(100% - 2px),
    max(2px, var(--cut-bl) + .83px) calc(100% - 2px),
    2px calc(100% - max(2px, var(--cut-bl) + .83px)),
    2px max(2px, var(--cut-tl) + .83px),
    max(2px, var(--cut-tl) + .83px) 2px
  );
}

/* --- surfaces ----------------------------------------------------------- */

/* The hairline is the element's own background and the surface is a layer inset
 * by one pixel, both clipped to the same outline. A plain border would be sliced
 * off by the chamfer and the panel would lose its edge exactly at the corner
 * that makes it interesting. */

.glass {
  position: relative;
  isolation: isolate;
  background: var(--line);
}

/* Depth has one source: wrap the panel in .lift. Its drop-shadow follows the
 * outline the panel was cut to; a box-shadow would be clipped away with it. */

.lift {
  filter: drop-shadow(0 18px 22px var(--shadow));
}

/* Focus turns the hairline red and two pixels wide, bevel included. */

.glass:focus-visible {
  background: var(--red);
}

.glass:focus-visible::before {
  inset: 2px;
}

.glass::before {
  content: '';
  position: absolute;
  inset: 1px;
  z-index: -1;
  clip-path: var(--cut-path, none);
  background:
    linear-gradient(180deg, var(--sheen), transparent 96px),
    linear-gradient(180deg, var(--bg-2), var(--bg-1));
}

/* Four machined dots, one per corner, for panels that should read as hardware. */

.screws {
  position: relative;
}

.screws::after {
  --dot: radial-gradient(circle at center, var(--screw) 0 1.4px, transparent 1.5px);
  content: '';
  position: absolute;
  inset: 14px;
  pointer-events: none;
  background-image: var(--dot), var(--dot), var(--dot), var(--dot);
  background-size: 4px 4px;
  background-repeat: no-repeat;
  background-position: 0 0, 100% 0, 0 100%, 100% 100%;
}

/* A measuring rule across the page: short marks every step, a long one every
 * fifth, hanging off a hairline. */

.rule {
  height: var(--rule-major);
  border: 0;
  margin: 0;
  background-image:
    linear-gradient(90deg, var(--tick) 0 1px, transparent 1px),
    linear-gradient(90deg, var(--tick-2) 0 1px, transparent 1px),
    linear-gradient(90deg, var(--line), var(--line));
  background-size:
    calc(var(--rule-step) * 5) var(--rule-major),
    var(--rule-step) var(--rule-minor),
    100% 1px;
  background-repeat: repeat-x, repeat-x, no-repeat;
  background-position: 0 0, 0 0, 0 0;
}

/* --- controls ----------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .6em;
  min-height: var(--tap);
  padding: 0 1.6em;
  border: 1px solid var(--line);
  border-radius: var(--r-btn);
  background: transparent;
  color: var(--ink);
  font-size: .78rem;
  font-weight: 500;
  letter-spacing: .18em;
  text-decoration: none;
  cursor: pointer;
  transition:
    border-color var(--fast) var(--ease),
    color var(--fast) var(--ease),
    box-shadow var(--slow) var(--ease);
}

.btn:hover {
  border-color: var(--red);
  box-shadow: 0 10px 30px -14px var(--red-glow);
}

.btn:active {
  border-color: var(--red-2);
}

/* Disabled text stays at --ink-2; the dashed edge is what says "not now". */

.btn[disabled],
.btn[aria-disabled='true'] {
  color: var(--ink-2);
  border-color: var(--line);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}

.btn--solid {
  border-color: var(--red);
  border-radius: var(--pill);
  background: var(--red);
  color: var(--on-red);
}

.btn--solid:hover {
  border-color: var(--red);
  background: var(--red-2);
}

.btn--solid[disabled],
.btn--solid[aria-disabled='true'] {
  background: var(--bg-2);
  border-color: var(--line);
  color: var(--ink-2);
}

/* Outline: a rim in the control's own text colour, --rim strong. */

.btn--ghost,
.svc__more,
.contact__btn,
.icon-btn {
  --rim: 55%;
  border-color: color-mix(in srgb, currentColor var(--rim), transparent);
  border-radius: var(--pill);
}

/* On the red arch or the dark ground. Hover darkens: lightening the red would
 * take white text under 4.5:1. */

.btn--ghost {
  color: var(--on-red);
}

.btn--ghost:hover {
  border-color: currentColor;
  background: color-mix(in srgb, var(--bg) 18%, transparent);
  box-shadow: none;
}

.btn--round,
.icon-btn,
.social__link,
.teaser__play {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  min-width: var(--tap);
  height: var(--tap);
  padding: 0;
  border-radius: var(--pill);
}

/* --- layout ------------------------------------------------------------- */

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

.stack {
  display: flex;
  flex-direction: column;
  gap: var(--space, 16px);
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space, 16px);
}

.sr-only,
.tabpanel__title,
.journey:not(.journey--static) .journey__head,
.journey:not(.journey--static) .scene__copy {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* --- motion ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
