/* ==========================================================================
   XVALIO — main stylesheet
   Visual language derived from the official logo:
   · navy night background of the lockup, white wordmark
   · the X diagonal (≈35°) as the base module of a proprietary "diagonal field"
   · mint → blue gradient of the X, used only on thin strokes and accents
   · "leaf" radius: two opposite corners rounded, two sharp, like the X strokes
   · construction guides of the brand board, wide-tracked tagline capitals
   ========================================================================== */

@font-face {
  font-family: "Geist";
  src: url("../fonts/geist-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@property --sweep {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 130%;
}

:root {
  /* Brand palette (sampled from the official brand board) */
  --mint: #55FBC8;
  --blue: #139DF5;
  --navy: #0B1F31;
  --ink: #13191D;
  --mist: #E4E4E6;

  /* Surfaces & text */
  --bg: #050A13;
  --panel-top: #0C1A2A;
  --panel-bottom: #08111D;
  --text: #E8EAEE;
  --text-2: #A3AEBF;
  --text-3: #7C889B;
  --line: rgba(228, 232, 240, 0.09);
  --line-strong: rgba(228, 232, 240, 0.18);
  --guide: rgba(228, 232, 240, 0.06);

  --grad: linear-gradient(90deg, var(--mint), var(--blue));
  --grad-diag: linear-gradient(135deg, var(--mint), var(--blue));

  /* Shape */
  --angle: 35deg; /* diagonal of the X strokes */
  --leaf-sm: 0 12px 0 12px;
  --leaf-r: clamp(28px, 5vw, 80px);

  /* Layout */
  --gutter: clamp(20px, 5vw, 72px);
  --inset: clamp(8px, 1.4vw, 24px); /* approach panel inset from the viewport edges */
  --max: 1360px;
  --col-gap: clamp(16px, 2vw, 32px);
  --header-h: 76px;
  --header-h-compact: 62px;
  --section-y: clamp(88px, 9.5vw, 148px);

  /* Motion */
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);

  color-scheme: dark;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h-compact);
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: clip;
  background: var(--bg);
  color: var(--text);
  font-family: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, p, ol { margin: 0; }
ol { padding: 0; list-style: none; }
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
em { font-style: normal; }

::selection { background: rgba(85, 251, 200, 0.28); color: #fff; }

:focus-visible {
  outline: 2px solid var(--mint);
  outline-offset: 4px;
  border-radius: 0 8px 0 8px;
}

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

.skip-link {
  position: fixed;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--text);
  color: var(--bg);
  border-radius: var(--leaf-sm);
  font-size: 14px;
  transform: translateY(-160%);
  transition: transform 0.3s var(--ease);
}
.skip-link:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--max) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
}

/* --------------------------------------------------------------------------
   Shared components
   -------------------------------------------------------------------------- */

/* Section label: leaf marker · index · rule · name */
.label {
  grid-column: 1 / span 3;
  display: flex;
  align-items: center;
  gap: 12px;
  align-self: start;
  padding-top: 0.9em;
  font-size: 12px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.label::before {
  content: "";
  flex: none;
  width: 8px; height: 8px;
  border-radius: 0 5px 0 5px;
  background: var(--grad-diag);
}
.label__index {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.12em;
}
.label__index::after {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.35;
}

.heading {
  font-size: clamp(1.75rem, 1.1rem + 2.4vw, 3rem);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.032em;
  max-width: 19ch;
  text-wrap: balance;
}
.heading--xl {
  font-size: clamp(2.1rem, 1.1rem + 4vw, 4.4rem);
  line-height: 1.04;
  letter-spacing: -0.04em;
  max-width: 15ch;
}

/* Ghost button with a gradient border revealed on hover */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 18px;
  border-radius: var(--leaf-sm);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s var(--ease), background-color 0.4s var(--ease), border-color 0.4s var(--ease);
}
.btn--ghost {
  border: 1px solid var(--line-strong);
  background: rgba(5, 10, 19, 0.35);
  color: var(--text);
}
.btn--ghost::before {
  content: "";
  position: absolute;
  inset: -1px;
  padding: 1px;
  border-radius: inherit;
  background: var(--grad-diag);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0;
  transition: opacity 0.4s var(--ease);
  pointer-events: none;
}
.btn--ghost.is-current::before { opacity: 0.6; }
@media (hover: hover) {
  .btn--ghost:hover { background-color: rgba(228, 232, 240, 0.05); }
  .btn--ghost:hover::before { opacity: 1; }
}

/* Status: pulsing dot + caption */
.status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-2);
}
.status__dot {
  position: relative;
  flex: none;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--mint);
}
.status__dot::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--mint);
  opacity: 0;
}

/* Split rule: a stroke interrupted like the split diagonal of the X */
.split-rule {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 76px;
  height: 2px;
}
.split-rule i {
  display: block;
  height: 1.5px;
  border-radius: 1px;
  background: var(--grad);
  transform-origin: left;
}
.split-rule i:first-child { flex: 1; background: linear-gradient(90deg, var(--mint), #34CBDC); }
.split-rule i:last-child { width: 14px; background: var(--blue); }

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: height 0.6s var(--ease), background-color 0.6s var(--ease), border-color 0.6s var(--ease);
}
.site-header.is-scrolled {
  height: var(--header-h-compact);
  background-color: rgba(5, 10, 19, 0.74);
  border-bottom-color: var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
  backdrop-filter: blur(16px) saturate(150%);
}
.site-header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.site-header__logo {
  display: block;
  padding: 6px 0;
  transition: opacity 0.5s var(--ease), transform 0.6s var(--ease), visibility 0.5s;
}
.site-header__logo img { width: 108px; height: auto; }

.site-header__progress {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 1px;
  background: var(--grad);
  transform: scaleX(var(--progress, 0));
  transform-origin: left;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}
.site-header.is-scrolled .site-header__progress { opacity: 0.65; }

.site-nav {
  display: flex;
  align-items: center;
  gap: clamp(24px, 2.8vw, 40px);
}
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 450;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
/* current-section marker (leaf) */
.site-nav__link::before {
  content: "";
  position: absolute;
  left: -13px; top: 50%;
  width: 5px; height: 5px;
  margin-top: -2.5px;
  border-radius: 0 3px 0 3px;
  background: var(--grad-diag);
  transform: scale(0);
  transition: transform 0.5s var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 3px;
  height: 1px;
  background: var(--line-strong);
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.5s var(--ease);
}
.site-nav__link.is-current { color: var(--text); }
.site-nav__link.is-current::before { transform: scale(1); }
@media (hover: hover) {
  .site-nav__link:hover { color: var(--text); }
  .site-nav__link:hover::after { transform: scaleX(1); transform-origin: left; }
}

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

.hero {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding-top: var(--header-h);
  overflow: hidden;
  background:
    radial-gradient(48% 60% at 78% 38%, rgba(19, 110, 210, 0.12), transparent 70%),
    radial-gradient(60% 45% at 40% -12%, rgba(19, 95, 190, 0.16), transparent 70%),
    var(--bg);
}

/* The diagonal field (canvas, drawn by main.js) */
.hero__field {
  position: absolute;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  -webkit-mask-image: linear-gradient(90deg, transparent 24%, #000 64%), linear-gradient(180deg, #000 78%, transparent 100%);
  -webkit-mask-composite: source-in;
  mask-image: linear-gradient(90deg, transparent 24%, #000 64%), linear-gradient(180deg, #000 78%, transparent 100%);
  mask-composite: intersect;
}

.hero__inner {
  flex: 1;
  display: flex;
  align-items: center;
  padding-block: clamp(40px, 7vh, 88px);
}
.hero__content { width: 100%; max-width: 620px; }

.hero__status { margin-bottom: clamp(28px, 4.6vh, 48px); }

.hero__title {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-weight: 400;
  font-size: inherit;
}

.hero__lockup {
  position: relative;
  display: block;
  width: clamp(260px, 37vw, 548px);
}
.hero__logo { width: 100%; height: auto; }

/* Construction guides, echoing the brand board */
.guides { position: absolute; inset: 0; pointer-events: none; }
.guides__h,
.guides__v { position: absolute; display: block; }
.guides__h {
  left: -40vw; width: 200vw;
  height: 1px;
  background: linear-gradient(90deg, transparent 5%, var(--guide) 22%, var(--guide) 60%, transparent 80%);
}
.guides__h--top { top: -1px; }
.guides__h--bottom { bottom: -1px; }
.guides__v {
  top: -100vh; bottom: -100vh;
  width: 1px;
  background: linear-gradient(180deg, transparent 30%, var(--guide) 45%, var(--guide) 55%, transparent 70%);
}
.guides__v--left { left: -1px; }
.guides__v--right { right: -1px; }

.hero__tagline {
  display: flex;
  flex-direction: column;
  margin-top: clamp(26px, 3.6vh, 38px);
  font-size: clamp(0.76rem, 0.64rem + 0.32vw, 0.94rem);
  line-height: 2.05;
  font-weight: 400;
  letter-spacing: 0.42em;
  text-transform: uppercase;
  color: #CDD3DD;
}

.hero__rule { margin-top: clamp(26px, 3.6vh, 36px); }

.hero__intro {
  max-width: 35ch;
  margin-top: clamp(22px, 3vh, 30px);
  font-size: clamp(1rem, 0.92rem + 0.32vw, 1.18rem);
  line-height: 1.65;
  color: var(--text-2);
  text-wrap: pretty;
}

.hero__foot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 20px clamp(20px, 3.4vh, 30px);
}
.hero__foot::before {
  content: "";
  position: absolute;
  top: 0; left: var(--gutter); right: var(--gutter);
  height: 1px;
  background: var(--line);
  transform-origin: left;
}

.hero__index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px clamp(24px, 3.4vw, 56px);
}
.hero__index a {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  padding-block: 6px;
  font-size: 14px;
  color: var(--text-2);
  transition: color 0.3s var(--ease);
}
.hero__index a span {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.3s var(--ease);
}
@media (hover: hover) {
  .hero__index a:hover { color: var(--text); }
  .hero__index a:hover span { color: var(--mint); }
}

.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-3);
  transition: color 0.3s var(--ease);
}
.scroll-cue__line {
  position: relative;
  width: 1px; height: 32px;
  overflow: hidden;
  background: var(--line-strong);
}
.scroll-cue__line::after {
  content: "";
  position: absolute;
  left: 0; top: 0;
  width: 1px; height: 12px;
  background: linear-gradient(180deg, transparent, var(--mint));
  transform: translateY(-100%);
}
@media (hover: hover) {
  .scroll-cue:hover { color: var(--text); }
}

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

.section { position: relative; padding-block: var(--section-y); }

/* Section top rule that draws in (see motion) */
[data-line]::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--line) 0%, var(--line) 100%);
  transform-origin: left;
}

/* Vision ------------------------------------------------------------------ */

.vision { padding-bottom: clamp(72px, 8vw, 120px); }
.vision__body { grid-column: 4 / -1; }

.statement {
  max-width: 16ch;
  font-size: clamp(2.1rem, 0.9rem + 4.6vw, 5rem);
  line-height: 1.03;
  font-weight: 440;
  letter-spacing: -0.045em;
  text-wrap: balance;
}
.statement .w { display: inline-block; }
.statement__light { font-weight: 200; letter-spacing: -0.035em; }

/* Complexity → clarity band */
.resolve { margin-top: clamp(56px, 6.5vw, 96px); }
.resolve__field {
  width: 100%;
  height: clamp(84px, 8.4vw, 128px);
}
.resolve__caps {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  line-height: 1;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}
.resolve__caps span:last-child {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-2);
}
.resolve__caps span:last-child::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 0 4px 0 4px;
  background: var(--grad-diag);
}

.vision__cols {
  grid-column: 4 / -1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 4vw, 64px);
  margin-top: clamp(44px, 5vw, 72px);
  max-width: 900px;
}
.vision__cols p {
  max-width: 40ch;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-2);
}

/* Approach — raised navy "leaf" panel ------------------------------------ */

.approach { padding-block: 0; padding-inline: var(--inset); }
.panel {
  --enter: 1;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding-block: var(--section-y) clamp(56px, 6vw, 96px);
  border-radius: 0 var(--leaf-r) 0 var(--leaf-r);
  background:
    radial-gradient(50% 60% at 88% 0%, rgba(19, 157, 245, 0.09), transparent 70%),
    radial-gradient(40% 50% at 0% 100%, rgba(85, 251, 200, 0.045), transparent 70%),
    linear-gradient(180deg, var(--panel-top), var(--panel-bottom));
  box-shadow: inset 0 1px 0 rgba(228, 232, 240, 0.07), inset 0 0 0 1px rgba(228, 232, 240, 0.035);
}
/* Keep the panel content on the same column grid as the other sections */
.panel .wrap {
  max-width: calc(var(--max) + var(--gutter) * 2 - var(--inset) * 2);
  padding-inline: calc(var(--gutter) - var(--inset));
}

.approach__head { grid-column: 4 / -1; }

.principles {
  margin-top: clamp(48px, 5.5vw, 80px);
  border-bottom: 1px solid var(--line);
}
.principle {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--col-gap);
  align-items: center;
  padding-block: clamp(28px, 3vw, 44px);
  border-top: 1px solid var(--line);
}
.principle::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1.1s var(--ease);
}
.principle.is-active::before { transform: scaleX(1); }

.principle__num {
  grid-column: 1 / span 3;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--text-3);
  font-variant-numeric: tabular-nums;
  transition: color 0.6s var(--ease);
}
.principle__num::after {
  content: "";
  width: 24px; height: 1px;
  background: currentColor;
  opacity: 0.4;
  transform-origin: left;
  transition: transform 0.8s var(--ease), opacity 0.6s var(--ease);
}
.principle__title {
  grid-column: 4 / span 4;
  font-size: clamp(2.1rem, 0.9rem + 3.6vw, 4.4rem);
  line-height: 1;
  font-weight: 450;
  letter-spacing: -0.045em;
  transition: color 0.7s var(--ease), transform 0.9s var(--ease);
}
.principle__text {
  grid-column: 8 / span 3;
  max-width: 30ch;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--text-2);
  transition: color 0.7s var(--ease);
}
.principle__glyph {
  grid-column: 11 / span 2;
  justify-self: end;
  width: 100%;
  max-width: 176px;
  aspect-ratio: 176 / 104;
}

/* Interactive state — only once main.js drives the list */
.principles.is-live .principle__title { color: rgba(232, 234, 238, 0.32); }
.principles.is-live .principle__text { color: var(--text-3); }
.principles.is-live .principle.is-active .principle__title { color: var(--text); transform: translateX(6px); }
.principles.is-live .principle.is-active .principle__text { color: var(--text-2); }
.principles.is-live .principle.is-active .principle__num { color: var(--mint); }
.principles.is-live .principle.is-active .principle__num::after { transform: scaleX(1.6); opacity: 0.8; }

/* Development / contact -------------------------------------------------- */

.develop { padding-bottom: clamp(80px, 8vw, 128px); }
.develop__body { grid-column: 4 / -1; }
.develop__text {
  max-width: 44ch;
  margin-top: 24px;
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--text-2);
}

.status-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 20px clamp(24px, 3vw, 48px);
  margin-top: clamp(44px, 5vw, 72px);
  padding-block: 26px;
  border-block: 1px solid var(--line);
}
.status-bar__label {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: clamp(0.8rem, 0.72rem + 0.3vw, 0.98rem);
  line-height: 1.4;
  font-weight: 450;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text);
}

/* Module track: a band of aligned strokes travels continuously (no fake %) */
.track {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 18px;
  overflow: hidden;
}
.track i {
  flex: none;
  display: block;
  width: 10px;
  height: 1.4px;
  border-radius: 1px;
  background: var(--blue);
  background: color-mix(in oklab, var(--mint), var(--blue) calc(var(--t, 0.5) * 100%));
  opacity: 0.22;
  transform: rotate(calc(var(--angle) * -1));
}

.develop__contact {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 20px;
  margin-top: 26px;
  font-size: 0.95rem;
  color: var(--text-2);
}
.develop__contact-label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--text-3);
}

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

.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 40px;
}
.site-footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 20px 40px;
}
.site-footer__logo { display: block; opacity: 0.9; transition: opacity 0.3s var(--ease); }
.site-footer__logo img { width: 100px; height: auto; }
.site-footer__tagline {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--text-3);
}
.site-footer__meta { font-size: 13px; color: var(--text-3); }
.site-footer__top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-3);
  transition: color 0.3s var(--ease);
}
.site-footer__top svg { transition: transform 0.5s var(--ease); }
@media (hover: hover) {
  .site-footer__logo:hover { opacity: 1; }
  .site-footer__top:hover { color: var(--text); }
  .site-footer__top:hover svg { transform: translateY(-3px); }
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1200px) {
  .principle__num { grid-column: 1 / span 2; }
  .principle__title { grid-column: 3 / span 4; }
  .principle__text { grid-column: 7 / span 4; }
}

/* Stacked hero: text first, the field becomes a horizon under it */
@media (max-width: 900px) {
  .hero__field {
    -webkit-mask-image: linear-gradient(180deg, transparent var(--field-start, 50%), #000 calc(var(--field-start, 50%) + 22%), #000 88%, transparent 100%);
    mask-image: linear-gradient(180deg, transparent var(--field-start, 50%), #000 calc(var(--field-start, 50%) + 22%), #000 88%, transparent 100%);
    -webkit-mask-composite: source-over;
    mask-composite: add;
  }
  .hero__inner { align-items: flex-start; padding-block: clamp(36px, 7vh, 72px) 0; }
  .hero__lockup { width: min(78vw, 460px); }
  .guides__v--right { display: none; }
}

@media (max-width: 960px) {
  .label { grid-column: 1 / -1; margin-bottom: 36px; padding-top: 0; }
  .vision__body,
  .approach__head,
  .develop__body,
  .vision__cols { grid-column: 1 / -1; }

  .principle {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 20px;
    row-gap: 14px;
    align-items: end;
  }
  .principle__num { grid-column: 1 / -1; }
  .principle__title { grid-column: 1; }
  .principle__glyph { grid-column: 2; grid-row: 2; width: 132px; }
  .principle__text { grid-column: 1 / -1; max-width: 46ch; }

  .site-footer__inner { grid-template-columns: auto 1fr auto; }
  .site-footer__tagline { display: none; }
}

@media (max-width: 720px) {
  :root { --header-h: 64px; --header-h-compact: 58px; --inset: 0px; }

  .site-nav__link { display: none; }
  .site-header__logo img { width: 96px; }

  .hero__status { margin-bottom: 26px; }
  .hero__lockup { width: min(84vw, 400px); }
  .hero__tagline { font-size: 0.78rem; letter-spacing: 0.34em; }
  .hero__intro { max-width: 32ch; }

  .hero__foot { padding-bottom: 22px; }
  .hero__index { gap: 6px 22px; }
  .hero__index a { font-size: 13px; gap: 7px; }
  .scroll-cue { display: none; }

  .status { font-size: 11px; letter-spacing: 0.18em; }

  .vision__cols { grid-template-columns: 1fr; gap: 20px; }
  .vision__cols p { font-size: 1rem; }
  .resolve__caps { font-size: 10px; letter-spacing: 0.2em; }

  .principle__glyph { width: 104px; }

  .status-bar { grid-template-columns: 1fr; padding-block: 22px; }
  .status-bar__label { font-size: 0.78rem; letter-spacing: 0.22em; }

  .site-footer { padding-block: 32px 36px; }
  .site-footer__inner { grid-template-columns: 1fr auto; gap: 18px; }
  .site-footer__meta { grid-column: 1; }
  .site-footer__top { grid-column: 2; grid-row: 1; }
}

@media (max-width: 360px) {
  .hero__index { gap: 6px 16px; }
  .principle__glyph { width: 88px; }
}

@media (min-width: 1680px) {
  :root { --max: 1480px; }
  .hero__lockup { width: 580px; }
}

/* --------------------------------------------------------------------------
   Motion — only when the user accepts motion (reveals also need scripting)
   -------------------------------------------------------------------------- */

/* Header logo appears once the hero lockup has scrolled away (needs main.js) */
@media (scripting: enabled) {
  .site-header__logo { opacity: 0; visibility: hidden; transform: translateY(-6px); }
  .site-header.has-logo .site-header__logo { opacity: 1; visibility: visible; transform: none; }
}

@media (prefers-reduced-motion: no-preference) {

  /* Hero entrance (pure CSS) */
  .guides__h { transform: scaleX(0); animation: guide-x 1.8s var(--ease-in-out) 0.1s forwards; }
  .guides__v { transform: scaleY(0); animation: guide-y 1.8s var(--ease-in-out) 0.25s forwards; }

  .hero__logo {
    clip-path: polygon(0 0, calc(var(--sweep) + 14%) 0, var(--sweep) 100%, 0 100%);
    animation: logo-sweep 1.5s var(--ease) 0.45s both;
  }
  .hero__status  { animation: fade-in 1s var(--ease) 0.9s both; }
  .hero__tagline { animation: tagline-in 1.6s var(--ease) 1.05s both; }
  .hero__rule i  { animation: draw-x 1.1s var(--ease) 1.3s both; }
  .hero__rule i:last-child { animation-delay: 1.55s; }
  .hero__intro   { animation: rise-in 1.2s var(--ease) 1.35s both; }
  .hero__foot    { animation: fade-in 1.2s var(--ease) 1.7s both; }
  .hero__foot::before { animation: draw-x 1.6s var(--ease-in-out) 1.6s both; }
  .site-header__inner { animation: fade-in 1.2s var(--ease) 1.5s both; }

  .status__dot::after { animation: pulse 3.2s var(--ease) 2s infinite; }
  .scroll-cue__line::after { animation: cue 2.6s var(--ease-in-out) 2.2s infinite; }

  .track i {
    animation: module 5.2s var(--ease-in-out) infinite;
    animation-delay: calc(var(--i, 0) / var(--n, 1) * 5.2s - 5.2s);
  }

  /* Approach panel opens up as it enters (value set by main.js on desktop) */
  @media (min-width: 721px) {
    .panel {
      clip-path: inset(0 calc((1 - var(--enter)) * 3.2vw) round 0 var(--leaf-r) 0 var(--leaf-r));
    }
  }

  @media (scripting: enabled) {
    /* Scroll reveals, driven by main.js */
    [data-reveal] {
      opacity: 0;
      transform: translate3d(0, 22px, 0);
      transition: opacity 1s var(--ease), transform 1.2s var(--ease);
      transition-delay: var(--delay, 0s);
    }
    [data-reveal].is-in { opacity: 1; transform: none; }

    [data-line]::before { transform: scaleX(0); transition: transform 1.6s var(--ease-in-out); }
    [data-line].is-in::before { transform: none; }

    .statement .w {
      opacity: 0.14;
      transition: opacity 0.9s var(--ease);
      transition-delay: calc(var(--i, 0) * 45ms);
    }
    .statement.is-in .w { opacity: 1; }
  }
}

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

@keyframes guide-x { to { transform: scaleX(1); } }
@keyframes guide-y { to { transform: scaleY(1); } }
@keyframes draw-x { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes logo-sweep {
  from { --sweep: -16%; opacity: 0.2; }
  30%  { opacity: 1; }
  to   { --sweep: 130%; opacity: 1; }
}
@keyframes tagline-in {
  from { opacity: 0; letter-spacing: 0.6em; }
  to   { opacity: 1; }
}
@keyframes rise-in {
  from { opacity: 0; transform: translate3d(0, 16px, 0); }
  to   { opacity: 1; transform: none; }
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse {
  0%   { transform: scale(1); opacity: 0.7; }
  70%  { transform: scale(3.2); opacity: 0; }
  100% { transform: scale(3.2); opacity: 0; }
}
@keyframes cue {
  0%   { transform: translateY(-100%); }
  60%, 100% { transform: translateY(260%); }
}
/* One stroke of the development track: flips onto the logo diagonal, then rests */
@keyframes module {
  0%, 62%, 100% { transform: rotate(calc(var(--angle) * -1)); opacity: 0.22; }
  70%, 84%      { transform: rotate(var(--angle)); opacity: 1; }
}

/* 404 page */
.error-page {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  min-height: 100vh;
  min-height: 100svh;
  gap: 28px;
  background: radial-gradient(60% 45% at 40% -12%, rgba(19, 95, 190, 0.16), transparent 70%), var(--bg);
}
.error-page__logo { width: min(78vw, 420px); }
.error-page__logo img { width: 100%; height: auto; }
.error-page h1 { font-size: 1.2rem; font-weight: 400; color: var(--text-2); }
