/* Xylotect website styles.
   Visual language taken from the logo: shield diagonals (chamfered corners at 45°),
   circuit traces (the page "spine" and the project wire), silver strokes on black,
   a restrained cold blue sampled from the hero footage. */

/* ---------- Tokens ---------- */
:root {
  --c-void: #000000;
  --c-panel: #0b0e12;
  --c-raised: #12161b;
  --c-line: #232a32;
  --c-line-soft: rgba(255, 255, 255, 0.09);
  --c-steel: #8e98a5;      /* secondary text, 7:1 on black */
  --c-silver: #d3d9e0;     /* body text */
  --c-white: #f3f5f7;      /* headings */
  --c-signal: #7fb2e5;     /* accent, sampled from the hero footage */
  --c-signal-soft: rgba(127, 178, 229, 0.14);
  --c-danger: #ff9d8a;

  --f-display: "Unbounded", "Onest", system-ui, sans-serif;
  --f-text: "Onest", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  --fs-hero: clamp(2.15rem, 1.05rem + 4.4vw, 5rem);
  --fs-h2: clamp(1.7rem, 1.1rem + 2.3vw, 3.1rem);
  --fs-statement: clamp(1.35rem, 0.85rem + 2.1vw, 2.75rem);
  --fs-h3: clamp(1.15rem, 1rem + 0.55vw, 1.45rem);
  --fs-lead: clamp(1.05rem, 0.98rem + 0.3vw, 1.2rem);
  --fs-body: 1rem;
  --fs-small: 0.875rem;
  --fs-micro: 0.8125rem;

  --gutter: clamp(16px, 4vw, 56px);
  --shell: 1320px;
  --spine-gap: 0px;
  --header-h: 72px;
  --cut: 12px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: dark;
}

@media (max-width: 720px) {
  :root { --header-h: 60px; --cut: 10px; }
}
@media (min-width: 1100px) {
  :root { --spine-gap: 64px; }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: #000; /* literal (not a token) so static analyzers see the real page colour */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + 16px);
}
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
body {
  margin: 0;
  min-height: 100vh;
  background: #000;
  color: var(--c-silver);
  font-family: var(--f-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "kern" 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
p { text-wrap: pretty; }
ul, ol { padding: 0; list-style: none; }
[hidden] { display: none !important; }
::selection { background: rgba(127, 178, 229, 0.35); color: #fff; }

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-signal);
  outline-offset: 3px;
  border-radius: 2px;
}
main:focus-visible { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed;
  left: 12px; top: 12px;
  z-index: 100;
  padding: 12px 16px;
  background: var(--c-white);
  color: #000;
  font-weight: 600;
  transform: translateY(-160%);
  transition: transform 0.2s var(--ease);
}
.skip-link:focus-visible { transform: none; }

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

/* ---------- Buttons and links ---------- */
.btn {
  --btn-bg: transparent;
  --btn-ink: var(--c-white);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px;
  color: var(--btn-ink);
  font-family: var(--f-text);
  font-size: 0.95rem;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.01em;
  white-space: nowrap;
  transition: color 0.25s var(--ease);
}
.btn::before,
.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  clip-path: polygon(0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)));
  transition: opacity 0.3s var(--ease), transform 0.5s var(--ease-out), background 0.3s var(--ease);
}
.btn::before { background: var(--btn-bg); }
.btn--small { min-height: 40px; padding: 0 16px; font-size: 0.875rem; --cut: 9px; }

.btn--primary {
  --btn-bg: linear-gradient(180deg, #f5f7f9 0%, #cfd6de 100%);
  --btn-ink: #05070a;
}
/* metallic sheen that crosses the button on hover */
.btn--primary::after {
  background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.85) 48%, transparent 66%);
  background-size: 250% 100%;
  background-position: 120% 0;
  opacity: 0;
  transition: background-position 0.7s var(--ease-out), opacity 0.2s;
  z-index: -1;
}
.btn--primary:hover::after { opacity: 1; background-position: -30% 0; }
.btn--primary:active::before { background: #c3cbd4; }

.btn--glass {
  --btn-bg: rgba(10, 13, 17, 0.5);
}
.btn--glass::before { -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* 1px chamfered border, diagonals included (evenodd ring) */
.btn--glass::after {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.14) 45%, rgba(127, 178, 229, 0.45));
  clip-path: polygon(evenodd,
    0 0, calc(100% - var(--cut)) 0, 100% var(--cut), 100% 100%, var(--cut) 100%, 0 calc(100% - var(--cut)), 0 0,
    1px 1px, calc(100% - var(--cut) - 0.41px) 1px, calc(100% - 1px) calc(var(--cut) + 0.41px), calc(100% - 1px) calc(100% - 1px), calc(var(--cut) + 0.41px) calc(100% - 1px), 1px calc(100% - var(--cut) - 0.41px), 1px 1px);
}
.btn--glass:hover { --btn-bg: rgba(20, 26, 33, 0.72); }

.text-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  color: var(--c-white);
  font-weight: 500;
}
.text-link::after {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
  transition: width 0.3s var(--ease-out), background 0.3s;
}
.text-link:hover { color: var(--c-signal); }
.text-link:hover::after { width: 36px; }
.text-link--up::after {
  width: 7px;
  height: 7px;
  margin-top: 4px;
  background: none;
  border-top: 1.5px solid currentColor;
  border-left: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.3s var(--ease-out);
}
.text-link--up:hover::after { width: 7px; transform: translateY(-3px) rotate(45deg); }

.copy-btn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--c-line);
  color: var(--c-steel);
  font-size: var(--fs-micro);
  font-weight: 500;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.copy-btn:hover { color: var(--c-white); border-color: #3a434e; }
.copy-btn.is-done { color: var(--c-signal); border-color: rgba(127, 178, 229, 0.5); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease);
  border-bottom: 1px solid transparent;
}
.site-header.is-solid {
  background: rgba(0, 0, 0, 0.74);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom-color: var(--c-line-soft);
}
.site-header__inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 100%;
  width: min(100% - 2 * var(--gutter), 1440px);
  margin-inline: auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  padding: 4px 0;
}
.brand__mark { width: auto; height: 34px; }
.brand__word { width: auto; height: 12px; opacity: 0.94; }

.site-nav { margin-left: auto; }
.site-nav__list { display: flex; gap: 6px; }
.site-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  color: var(--c-silver);
  font-size: 0.9375rem;
  font-weight: 500;
  transition: color 0.2s;
}
.site-nav a::after {
  content: "";
  position: absolute;
  left: 12px; right: 12px; bottom: 6px;
  height: 1px;
  background: var(--c-signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--ease-out);
}
.site-nav a:hover { color: var(--c-white); }
.site-nav a:hover::after,
.site-nav a[aria-current="true"]::after { transform: scaleX(1); }
.site-nav a[aria-current="true"] { color: var(--c-white); }

.header-tools { display: flex; align-items: center; gap: 10px; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--c-line);
  background: rgba(0, 0, 0, 0.35);
}
.lang-switch__btn {
  min-width: 40px;
  min-height: 36px;
  padding: 0 8px;
  color: var(--c-steel);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: color 0.2s, background 0.2s;
}
.lang-switch__btn:hover { color: var(--c-white); }
.lang-switch__btn[aria-pressed="true"] { color: #05070a; background: var(--c-silver); }

.sound-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 0 12px 0 10px;
  border: 1px solid var(--c-line);
  background: rgba(0, 0, 0, 0.35);
  color: var(--c-silver);
  font-size: var(--fs-micro);
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s;
}
.sound-toggle:hover { border-color: #3a434e; color: var(--c-white); }
.sound-toggle__icon { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.sound-toggle__speaker { fill: currentColor; stroke: none; }
.sound-toggle__waves { display: none; }
.sound-toggle[aria-pressed="true"] .sound-toggle__waves { display: block; }
.sound-toggle[aria-pressed="true"] .sound-toggle__mute { display: none; }
.sound-toggle__state {
  min-width: 2.6em;
  padding: 3px 6px;
  border: 1px solid var(--c-line);
  color: var(--c-steel);
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
}
.sound-toggle[aria-pressed="true"] { border-color: rgba(127, 178, 229, 0.55); color: var(--c-white); }
.sound-toggle[aria-pressed="true"] .sound-toggle__state { color: #05070a; background: var(--c-signal); border-color: var(--c-signal); }

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--c-line);
  background: rgba(0, 0, 0, 0.35);
}
.menu-toggle__bars { display: grid; gap: 6px; width: 18px; }
.menu-toggle__bars span { height: 1.5px; background: var(--c-white); transition: transform 0.3s var(--ease); }
.menu-toggle__bars span:last-child { width: 12px; justify-self: end; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:first-child { transform: translateY(3.75px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars span:last-child { width: 18px; transform: translateY(-3.75px) rotate(-45deg); }

.mobile-menu {
  position: fixed;
  inset: var(--header-h) 0 0 0;
  z-index: 49;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 32px;
  padding: 32px var(--gutter) calc(32px + env(safe-area-inset-bottom));
  background: rgba(0, 0, 0, 0.96);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  overflow-y: auto;
}
.mobile-menu__list { display: grid; gap: 4px; }
.mobile-menu__list a {
  display: flex;
  align-items: center;
  min-height: 56px;
  border-bottom: 1px solid var(--c-line);
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: 1.5rem;
  font-weight: 300;
}
.mobile-menu__tools { display: flex; flex-wrap: wrap; gap: 12px; }
.sound-toggle--wide { min-height: 44px; }

@media (max-width: 1099px) {
  .site-nav, .header-cta { display: none; }
  .menu-toggle { display: inline-flex; }
  .header-tools { margin-left: auto; }
}
@media (max-width: 720px) {
  .brand__mark { height: 30px; }
  .brand__word { height: 10px; }
  .site-header__inner { gap: 12px; }
  .header-tools { gap: 6px; }
  .header-tools .sound-toggle .sound-toggle__label { display: none; }
  .header-tools .sound-toggle { padding: 0 8px; min-height: 40px; }
  .lang-switch__btn { min-width: 36px; min-height: 38px; }
}
@media (max-width: 380px) {
  .brand__word { display: none; }
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 210vh;
}
.hero__sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
}
.hero__media { position: absolute; inset: 0; }
.hero__poster,
.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero__poster { object-fit: cover; }
.hero__canvas { opacity: 0; transition: opacity 0.6s var(--ease); }
.hero.is-live .hero__canvas { opacity: 1; }

.hero__shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  will-change: transform; /* own layer: the gradients are rastered once, not every scroll frame */
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.84) 0%, rgba(0, 0, 0, 0.66) 30%, rgba(0, 0, 0, 0.22) 60%, rgba(0, 0, 0, 0) 78%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.66) 0, rgba(0, 0, 0, 0) 180px),
    linear-gradient(0deg, rgba(0, 0, 0, 0.72) 0, rgba(0, 0, 0, 0) 32%);
}
/* darkens the footage at the end of the intro; opacity is written by hero.js */
.hero__fade {
  position: absolute;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.hero__content {
  position: absolute;
  left: 0; right: 0;
  bottom: clamp(56px, 12vh, 132px);
  display: grid;
  gap: 24px;
  justify-items: start;
  will-change: transform; /* composited; hero.js writes the transform directly */
}
.hero__title {
  max-width: 13.5ch;
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: var(--fs-hero);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.035em;
  text-wrap: balance;
}
.hero__lead {
  max-width: 46ch;
  color: var(--c-silver);
  font-size: var(--fs-lead);
  line-height: 1.55;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

.hero__hint {
  position: absolute;
  right: var(--gutter);
  bottom: clamp(32px, 6vh, 56px);
  display: flex;
  align-items: center;
  gap: 14px;
  color: var(--c-steel);
  font-size: var(--fs-micro);
  letter-spacing: 0.02em;
}
.hero__hint-track {
  position: relative;
  width: 96px;
  height: 1px;
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
}
.hero__hint-fill {
  position: absolute;
  inset: 0;
  background: var(--c-white);
  transform-origin: left;
  transform: scaleX(0);
  will-change: transform;
}

@media (orientation: portrait), (max-width: 720px) {
  .hero__shade {
    background:
      linear-gradient(0deg, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.8) 34%, rgba(0, 0, 0, 0.3) 62%, rgba(0, 0, 0, 0.05) 100%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.7) 0, rgba(0, 0, 0, 0) 140px);
  }
  .hero__content { bottom: clamp(72px, 11vh, 120px); gap: 18px; }
  .hero__hint { left: var(--gutter); right: auto; bottom: 28px; }
}
@media (max-width: 720px) {
  .hero { height: 190vh; }
  .hero__actions { width: 100%; }
  .hero__actions .btn { flex: 1 1 140px; }
}

/* ---------- Content wrapper and the spine ---------- */
.content { position: relative; }
.content > .section > .shell,
.content .section > .shell { padding-left: var(--spine-gap); }

.spine {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  z-index: 0;
}
.spine__base { fill: none; stroke: rgba(255, 255, 255, 0.11); stroke-width: 1; }
.spine__live { fill: none; stroke-width: 1.5; stroke-linecap: square; }
.spine__tip { fill: var(--c-white); filter: drop-shadow(0 0 4px rgba(127, 178, 229, 0.9)); }
.spine .pad { fill: var(--c-void); stroke: rgba(255, 255, 255, 0.28); stroke-width: 1; transition: fill 0.4s var(--ease), stroke 0.4s var(--ease); }
.spine .pad.is-lit { fill: var(--c-signal); stroke: var(--c-white); }
.spine .branch { fill: none; stroke: rgba(255, 255, 255, 0.16); stroke-width: 1; transition: stroke 0.4s var(--ease); }
.spine .branch.is-lit { stroke: rgba(217, 224, 232, 0.75); }
@media (max-width: 1099px) {
  .spine { display: none; }
}

/* ---------- Sections ---------- */
.section {
  position: relative;
  z-index: 1;
  padding-block: clamp(96px, 13vh, 168px);
}
@media (max-width: 720px) {
  .section { padding-block: 72px; }
  .about { padding-top: 96px; }
}
.section-title {
  position: relative;
  max-width: 20ch;
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: var(--fs-h2);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
}
/* On small screens the spine is hidden; each heading keeps its pad. */
@media (max-width: 1099px) {
  .section-title { padding-top: 28px; }
  .section-title::before {
    content: "";
    position: absolute;
    left: 1px; top: 0;
    width: 9px; height: 9px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    background: var(--c-signal);
    transform: rotate(45deg);
  }
  .section-title::after {
    content: "";
    position: absolute;
    left: 14px; top: 5px;
    width: 40px; height: 1px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.45), transparent);
  }
}

/* About */
.about { padding-top: clamp(120px, 18vh, 200px); padding-bottom: clamp(56px, 8vh, 104px); }
.statement {
  max-width: 30ch;
  margin-top: clamp(32px, 5vh, 56px);
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: var(--fs-statement);
  font-weight: 300;
  line-height: 1.3;
  letter-spacing: -0.02em;
}
.statement .w {
  /* words not yet "read" stay at 50%: still 4.9:1 on black, so never unreadable */
  opacity: clamp(0.5, calc((var(--k, 1) - var(--i, 0)) * 4 + 0.5), 1);
  transition: opacity 0.12s linear;
}
.about__note {
  margin-top: clamp(28px, 4vh, 44px);
  max-width: 52ch;
  color: var(--c-steel);
  font-size: var(--fs-lead);
}

/* Services */
.services__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 48px;
  margin-top: clamp(40px, 6vh, 72px);
}
.service {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  padding-top: 24px;
  border-top: 1px solid var(--c-line);
}
.service::before {
  content: "";
  position: absolute;
  top: -1px; left: 0;
  width: 56px; height: 1px;
  background: var(--c-white);
}
.service__title {
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.service__text { max-width: 54ch; color: var(--c-silver); }
.service .text-link { justify-self: start; margin-top: 4px; }

.features { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.feature {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--c-line);
  background: var(--c-panel);
  color: var(--c-silver);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.feature::after {
  content: "";
  width: 7px; height: 7px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  opacity: 0.6;
  transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
.feature:hover { color: var(--c-white); border-color: rgba(127, 178, 229, 0.6); background: var(--c-signal-soft); }
.feature:hover::after { opacity: 1; transform: translateX(3px) rotate(45deg); }

@media (min-width: 900px) {
  .services__grid { grid-template-columns: 7fr 5fr; column-gap: clamp(40px, 6vw, 96px); row-gap: 56px; }
  .service--main { grid-row: span 2; }
}

/* ---------- Work ---------- */
.work__head {
  display: grid;
  gap: 20px;
  align-items: end;
}
.work__lead { max-width: 48ch; color: var(--c-steel); font-size: var(--fs-lead); }
@media (min-width: 1100px) {
  .work__head { grid-template-columns: 1fr minmax(0, 44ch); }
}

.work__layout {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
  margin-top: clamp(36px, 6vh, 64px);
}
@media (min-width: 1100px) {
  .work__layout { grid-template-columns: minmax(0, 1fr) 300px; gap: 56px; align-items: start; }
}

.stage, .project-index { min-width: 0; }
.stage, .player { scroll-margin-top: calc(var(--header-h) + 16px); }
.player { position: relative; }
.player__frame {
  --pcut: 22px;
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  clip-path: polygon(0 0, calc(100% - var(--pcut)) 0, 100% var(--pcut), 100% 100%, var(--pcut) 100%, 0 calc(100% - var(--pcut)));
}
/* chamfered hairline frame, diagonals included */
.player__frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.45), rgba(255, 255, 255, 0.08) 40%, rgba(127, 178, 229, 0.45));
  clip-path: polygon(evenodd,
    0 0, calc(100% - var(--pcut)) 0, 100% var(--pcut), 100% 100%, var(--pcut) 100%, 0 calc(100% - var(--pcut)), 0 0,
    1px 1px, calc(100% - var(--pcut) - 0.41px) 1px, calc(100% - 1px) calc(var(--pcut) + 0.41px), calc(100% - 1px) calc(100% - 1px), calc(var(--pcut) + 0.41px) calc(100% - 1px), 1px calc(100% - var(--pcut) - 0.41px), 1px 1px);
}
.player__poster,
.player__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}
.player__video { opacity: 0; transition: opacity 0.35s var(--ease); }
.player.is-started .player__video { opacity: 1; }
.player.is-switching .player__poster { animation: wipe 0.6s var(--ease-out); }
@keyframes wipe {
  from { clip-path: polygon(0 0, 0 0, -30% 100%, -30% 100%); }
  to { clip-path: polygon(0 0, 130% 0, 100% 100%, -30% 100%); }
}

.player__big {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 84px; height: 84px;
  margin: -42px 0 0 -42px;
  color: #05070a;
  transition: transform 0.3s var(--ease-out), opacity 0.25s;
}
.player__big::before {
  content: "";
  position: absolute;
  inset: 10px;
  background: linear-gradient(180deg, #f5f7f9, #c9d1da);
  transform: rotate(45deg);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.55);
  transition: background 0.25s;
}
.player__big svg { position: relative; width: 26px; height: 26px; fill: currentColor; margin-left: 3px; }
.player__big:hover { transform: scale(1.06); }
.player.is-started .player__big { opacity: 0; pointer-events: none; transform: scale(0.85); }
.player.is-started.is-paused .player__big { opacity: 1; pointer-events: auto; transform: none; }

.player__spinner {
  position: absolute;
  left: 50%; top: 50%;
  z-index: 2;
  width: 36px; height: 36px;
  margin: -18px 0 0 -18px;
  border: 1.5px solid rgba(255, 255, 255, 0.18);
  border-top-color: var(--c-white);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
}
.player.is-loading .player__spinner { opacity: 1; animation: spin 0.9s linear infinite; }
.player.is-loading .player__big { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.player__error {
  position: absolute;
  inset: auto 16px 16px 16px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  padding: 14px 16px;
  background: rgba(0, 0, 0, 0.82);
  border: 1px solid var(--c-line);
  color: var(--c-white);
  font-size: var(--fs-small);
}
.player__error p { flex: 1 1 260px; }

.player__controls {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
  min-height: 48px;
}
.player__btn {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border: 1px solid var(--c-line);
  color: var(--c-white);
  transition: border-color 0.2s, background 0.2s;
}
.player__btn:hover { border-color: #3a434e; background: var(--c-panel); }
.player__btn svg { width: 20px; height: 20px; fill: currentColor; }
.player__btn[data-player-fs] svg { fill: none; stroke: currentColor; stroke-width: 1.6; }
.player__btn .icon-pause { display: none; }
.player.is-playing .player__btn .icon-pause { display: block; }
.player.is-playing .player__btn .icon-play { display: none; }

.player__time {
  flex: none;
  color: var(--c-steel);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
}
.player__time-sep { margin: 0 6px; opacity: 0.6; }

.player__progress { position: relative; flex: 1; height: 44px; }
.player__seek {
  --p: 0%;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 44px;
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.player__seek::-webkit-slider-runnable-track {
  height: 2px;
  background: linear-gradient(90deg, var(--c-white) var(--p), rgba(255, 255, 255, 0.18) var(--p));
}
.player__seek::-moz-range-track { height: 2px; background: rgba(255, 255, 255, 0.18); }
.player__seek::-moz-range-progress { height: 2px; background: var(--c-white); }
.player__seek::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px; height: 12px;
  margin-top: -5px;
  background: var(--c-white);
  border: 0;
  transform: rotate(45deg);
}
.player__seek::-moz-range-thumb {
  width: 11px; height: 11px;
  background: var(--c-white);
  border: 0;
  border-radius: 0;
  transform: rotate(45deg);
}
.player__seek:focus-visible { outline-offset: 0; }
.player__ticks { position: absolute; left: 6px; right: 6px; top: 50%; height: 0; pointer-events: none; }
.player__ticks i {
  position: absolute;
  top: -8px;
  width: 1px; height: 6px;
  background: rgba(255, 255, 255, 0.4);
}

/* Fullscreen */
.player:fullscreen { display: grid; place-items: center; background: #000; padding: 24px; }
.player:fullscreen .player__frame { width: min(100%, calc((100vh - 120px) * 16 / 9)); }
.player:fullscreen .player__controls { width: min(100%, calc((100vh - 120px) * 16 / 9)); }

/* Chapters */
.chapters { margin-top: 28px; }
.chapters__title {
  color: var(--c-steel);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.02em;
}
.chapters__list {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(132px, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding-bottom: 6px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
  scrollbar-color: #2a313a transparent;
}
.chapter {
  display: grid;
  gap: 8px;
  width: 100%;
  padding: 0 0 6px;
  text-align: left;
  scroll-snap-align: start;
  color: var(--c-silver);
}
.chapter__img {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--c-panel);
  border: 1px solid var(--c-line);
  transition: border-color 0.2s;
}
.chapter__img img { width: 100%; height: 100%; object-fit: cover; opacity: 0.78; transition: opacity 0.25s, transform 0.5s var(--ease-out); }
.chapter__label { font-size: var(--fs-micro); font-weight: 500; line-height: 1.35; }
.chapter__time { color: var(--c-steel); font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.chapter:hover .chapter__img img { opacity: 1; transform: scale(1.04); }
.chapter:hover .chapter__img { border-color: #3a434e; }
.chapter.is-current .chapter__img { border-color: var(--c-signal); }
.chapter.is-current .chapter__img img { opacity: 1; }
.chapter.is-current .chapter__label { color: var(--c-white); }

/* Project info */
.project-info { margin-top: 28px; display: grid; gap: 14px; }
.project-info__meta { display: flex; flex-wrap: wrap; gap: 8px; }
.project-info__meta span {
  padding: 5px 10px;
  border: 1px solid var(--c-line);
  color: var(--c-steel);
  font-size: var(--fs-micro);
  line-height: 1.3;
}
.project-info__meta span:first-child { color: #05070a; background: var(--c-silver); border-color: var(--c-silver); font-weight: 500; }
.project-info__title {
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: clamp(1.4rem, 1.1rem + 1vw, 2rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.15;
}
.project-info__desc { max-width: 58ch; color: var(--c-silver); }

/* Project index */
.project-index { position: relative; }
.project-index__title {
  color: var(--c-steel);
  font-size: var(--fs-micro);
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.project-index__list { display: grid; gap: 2px; }
.pi {
  position: relative;
  display: grid;
  grid-template-columns: 76px 1fr;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 10px 12px 10px 10px;
  text-align: left;
  border: 1px solid transparent;
  transition: background 0.25s, border-color 0.25s;
}
.pi__thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--c-panel); border: 1px solid var(--c-line); }
.pi__thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.7; transition: opacity 0.25s; }
.pi__text { display: grid; gap: 2px; min-width: 0; }
.pi__title { color: var(--c-silver); font-weight: 500; line-height: 1.3; transition: color 0.2s; }
.pi__cat { color: var(--c-steel); font-size: var(--fs-micro); }
.pi:hover { background: var(--c-panel); }
.pi:hover .pi__thumb img { opacity: 1; }
.pi[aria-pressed="true"] { background: var(--c-raised); border-color: var(--c-line); }
.pi[aria-pressed="true"] .pi__title { color: var(--c-white); }
.pi[aria-pressed="true"] .pi__thumb img { opacity: 1; }
.pi[aria-pressed="true"]::before {
  content: "";
  position: absolute;
  left: -1px; top: 10px; bottom: 10px;
  width: 2px;
  background: var(--c-signal);
}

/* The wire: a circuit trace from the selected project to the screen */
.wire {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
  display: none;
}
.wire path { fill: none; stroke: var(--c-signal); stroke-width: 1.25; }
.wire.is-drawing path { animation: wire-draw 0.55s var(--ease-out) both; }
@keyframes wire-draw { from { stroke-dashoffset: var(--len); } to { stroke-dashoffset: 0; } }
@media (min-width: 1100px) {
  .wire { display: block; }
}

@media (max-width: 1099px) {
  .project-index__list { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 720px) {
  .work__layout { gap: 32px; }
  .player__frame { --pcut: 14px; }
  .player__big { width: 68px; height: 68px; margin: -34px 0 0 -34px; }
  .player__controls { gap: 10px; }
  .chapters__list { grid-auto-columns: 136px; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); }
  .project-index__list { grid-template-columns: 1fr; }
}

.noscript-work { display: grid; gap: 32px; margin-top: 32px; }
.noscript-work video { width: 100%; aspect-ratio: 16 / 9; background: #000; }
.noscript-work p { margin-top: 8px; }

/* ---------- Contact ---------- */
.contact { padding-bottom: clamp(96px, 14vh, 160px); }
.contact__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 56px; }
@media (min-width: 1000px) {
  .contact__grid { grid-template-columns: 5fr 6fr; gap: clamp(48px, 7vw, 112px); align-items: start; }
}
.contact__lead { margin-top: 24px; max-width: 44ch; color: var(--c-silver); font-size: var(--fs-lead); }
.contact__list { display: grid; gap: 0; margin-top: 40px; border-top: 1px solid var(--c-line); }
.contact__item { display: grid; gap: 6px; padding: 20px 0; border-bottom: 1px solid var(--c-line); }
.contact__item dt { color: var(--c-steel); font-size: var(--fs-micro); }
.contact__item dd { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.contact__value {
  color: var(--c-white);
  font-size: clamp(1.1rem, 0.95rem + 0.7vw, 1.45rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
}
a.contact__value { background: linear-gradient(var(--c-signal), var(--c-signal)) 0 100% / 0 1px no-repeat; transition: background-size 0.35s var(--ease-out), color 0.2s; }
a.contact__value:hover { color: var(--c-signal); background-size: 100% 1px; }
.contact__social { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 24px; }

.request {
  position: relative;
  display: grid;
  gap: 22px;
  padding: clamp(24px, 3vw, 40px);
  background: var(--c-panel);
  clip-path: polygon(0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px));
}
.request::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0.05) 45%, rgba(127, 178, 229, 0.3));
  clip-path: polygon(evenodd,
    0 0, calc(100% - 28px) 0, 100% 28px, 100% 100%, 28px 100%, 0 calc(100% - 28px), 0 0,
    1px 1px, calc(100% - 28.41px) 1px, calc(100% - 1px) 28.41px, calc(100% - 1px) calc(100% - 1px), 28.41px calc(100% - 1px), 1px calc(100% - 28.41px), 1px 1px);
}
.request__title {
  color: var(--c-white);
  font-family: var(--f-display);
  font-size: var(--fs-h3);
  font-weight: 400;
  letter-spacing: -0.015em;
}
.request__note { margin-top: -8px; color: var(--c-steel); font-size: var(--fs-small); max-width: 56ch; }

.field { display: grid; gap: 8px; min-width: 0; margin: 0; padding: 0; border: 0; }
.field__label { color: var(--c-silver); font-size: var(--fs-small); font-weight: 500; padding: 0; }
.field__input {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: #06080b;
  border: 1px solid #5a6573; /* 3:1 against the panel (WCAG 1.4.11) */
  border-radius: 0;
  color: var(--c-white);
  font-size: 1rem;
  line-height: 1.4;
  transition: border-color 0.2s, background 0.2s;
}
.field__input:hover { border-color: #75818f; }
.field__input:focus-visible { outline: 2px solid var(--c-signal); outline-offset: 0; border-color: var(--c-signal); }
.field__input--area { min-height: 132px; resize: vertical; }
.field__hint { color: var(--c-steel); font-size: var(--fs-micro); }
.field__error { color: var(--c-danger); font-size: var(--fs-micro); }
.field.is-invalid .field__input { border-color: var(--c-danger); }

.choice { display: flex; flex-wrap: wrap; gap: 8px; }
.choice__item { position: relative; }
.choice__item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.choice__item span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #2b333d;
  color: var(--c-silver);
  font-size: var(--fs-small);
  font-weight: 500;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.choice__item input:hover + span { border-color: #3a4450; color: var(--c-white); }
.choice__item input:checked + span { background: var(--c-silver); border-color: var(--c-silver); color: #05070a; }
.choice__item input:focus-visible + span { outline: 2px solid var(--c-signal); outline-offset: 3px; }

.request__submit { justify-self: start; }
.request__submit[disabled] { opacity: 0.6; cursor: progress; }
.request__status { color: var(--c-silver); font-size: var(--fs-small); max-width: 60ch; }
.request__status:empty { display: none; }
.request__status.is-error { color: var(--c-danger); }
.request__fallback { display: grid; gap: 10px; }
.request__fallback .copy-btn { justify-self: start; }

/* ---------- Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  padding: clamp(72px, 10vh, 120px) 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--c-line-soft);
  background: radial-gradient(60% 50% at 50% 0%, rgba(127, 178, 229, 0.06), transparent 70%), var(--c-void);
}
.site-footer__inner { display: grid; justify-items: center; gap: 40px; }
.site-footer__logo { width: min(420px, 78vw); height: auto; }
.site-footer__nav ul { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.site-footer__nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--c-silver);
  font-weight: 500;
  transition: color 0.2s;
}
.site-footer__nav a:hover { color: var(--c-white); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  width: 100%;
  padding-top: 24px;
  border-top: 1px solid var(--c-line-soft);
  color: var(--c-steel);
  font-size: var(--fs-micro);
}

/* ---------- Reveal on scroll (one gentle entrance, no bounce) ---------- */
/* Hidden only once the reveal script is running, so a script failure never hides text. */
.reveal-on [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 18px, 0);
  transition: opacity 0.8s var(--ease), transform 0.9s var(--ease-out);
}
.reveal-on [data-reveal].is-in { opacity: 1; transform: none; }

/* ---------- Reduced motion: static hero frame, no scrubbing, no entrances ---------- */
@media (prefers-reduced-motion: reduce) {
  .hero { height: auto; }
  .hero__sticky { position: relative; height: 100vh; height: 100svh; }
  .hero__canvas { display: none; }
  .hero__content { transform: none; }
  .hero__hint { display: none; }
  .reveal-on [data-reveal] { opacity: 1; transform: none; transition: none; }
  .statement .w { opacity: 1; }
  .player.is-switching .player__poster { animation: none; }
  .wire.is-drawing path { animation: none; }
  *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
/* Static mode is also used when the frames cannot load (slow connection, Save-Data, errors). */
.hero.is-static { height: auto; }
.hero.is-static .hero__sticky { position: relative; }
.hero.is-static .hero__hint { display: none; }
.hero.is-static .hero__content { transform: none; }

@media print {
  .site-header, .hero__media, .hero__shade, .spine, .player, .chapters, .request, .mobile-menu { display: none !important; }
  body { background: #fff; color: #000; }
}
