/* ZIMS Development · the six chapters
   Two layouts share one markup:
   - flow: every block in normal document order (phones, short windows, reduced motion, no script)
   - pin:  tall tracks with a sticky stage, used when there is room for the scroll story
   The pin query below must match PIN_QUERY in js/core/capabilities.js character for character. */

/* ================= 01 · Hero ================= */

.hero {
  position: relative;
  display: flex; flex-direction: column;
  min-height: 100vh; min-height: 100svh;
  padding-top: var(--nav-h);
}
.hero__inner { position: relative; flex: 1; display: flex; align-items: center; }
.hero__copy { position: relative; z-index: 1; width: min(100%, 52rem); padding-block: clamp(16px, 3vh, 40px); }
.hero__copy .display { margin-top: 26px; max-width: 13.5em; }
.hero__lede { margin-top: 28px; }
.hero__copy .actions { margin-top: 38px; }

/* A still of the 3D instrument. As a background it only downloads where it is shown. */
.hero__art {
  position: absolute; right: -2%; top: 50%;
  width: min(48vw, 620px); aspect-ratio: 1;
  background: url("../img/instrument.webp") center / contain no-repeat;
  transform: translateY(-50%);
  pointer-events: none;
}
[data-scene="on"] .hero__art, [data-scene="pending"] .hero__art { display: none; }

.hero__foot {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 24px;
  padding-bottom: clamp(20px, 3.5vh, 36px);
}
.cue {
  display: inline-flex; align-items: center; gap: 14px;
  min-height: 44px;
  color: var(--text-3);
  font: 400 .6875rem/1 var(--font-mono);
  letter-spacing: .16em; text-transform: uppercase;
  transition: color .3s var(--ease);
}
.cue:hover { color: var(--text); }
.cue__line { position: relative; width: 1px; height: 40px; background: var(--line-strong); overflow: hidden; }
.cue__line i {
  position: absolute; left: 0; top: 0; width: 1px; height: 14px; background: var(--accent);
  animation: cue 2.6s var(--ease-inout) -1s infinite;
}
@keyframes cue { 0% { transform: translateY(-16px); } 100% { transform: translateY(42px); } }

.hero__index { display: flex; gap: clamp(18px, 2.6vw, 40px); color: var(--text-2); font-size: .875rem; }
.hero__index li { display: flex; align-items: baseline; gap: 10px; }
.hero__index b { color: var(--text-3); font: 400 .6875rem/1 var(--font-mono); letter-spacing: .12em; }

@media (max-width: 959px) {
  /* The instrument sits in the upper half, the words below it. */
  .hero__inner { align-items: flex-end; }
  .hero__copy { padding-block: 0 20px; }
  .hero__copy .display { margin-top: 18px; }
  .hero__lede { margin-top: 18px; }
  .hero__copy .actions { margin-top: 26px; }
  [data-scene="on"] .hero__copy, [data-scene="pending"] .hero__copy { padding-top: calc(36vh - var(--nav-h)); padding-top: calc(36svh - var(--nav-h)); }
  .hero__art { position: relative; right: auto; top: auto; transform: none; width: min(84vw, 380px); margin: 0 auto -8px; order: -1; background-image: url("../img/instrument-640.webp"); }
  [data-scene="off"] .hero__inner { flex-direction: column; align-items: stretch; justify-content: flex-end; gap: 12px; }
  .hero__index { display: none; }
}
@media (max-height: 560px) { .cue { display: none; } }

/* Phones: no 3D and no still image. The hero is the words alone, centred in the first screen.
   This query matches PHONE_QUERY in js/core/capabilities.js. */
@media (pointer: coarse) and (max-width: 720px), (pointer: coarse) and (max-height: 560px) {
  .hero__art { display: none; }
  [data-scene] .hero__inner { flex-direction: column; align-items: stretch; justify-content: center; }
  [data-scene] .hero__copy { padding-block: 24px; }
}

/* ================= 02 · What is ZIMS ================= */

.what { position: relative; padding-block: clamp(96px, 14vw, 180px); }
.what__copy { position: relative; width: min(100%, 40rem); }
.what__copy .headline { margin-top: 24px; }

.statement {
  margin-top: clamp(24px, 3.4vh, 40px);
  color: var(--text);
  font: 300 clamp(1.1875rem, 1.75vw, 1.625rem)/1.42 var(--font-display);
  letter-spacing: -.02em;
}
.js-live .sw { opacity: .2; }

.triad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px;
  margin-top: clamp(28px, 4.4vh, 48px); padding-top: 24px;
  border-top: 1px solid var(--line);
}
.triad h3 {
  color: var(--text);
  font: 400 .75rem/1.4 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
}
.triad p { margin-top: 10px; font-size: .9375rem; line-height: 1.55; }

.js-live .triad li { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .9s var(--ease); }
.js-live .triad.is-in li { opacity: 1; transform: none; }
.js-live .triad.is-in li:nth-child(2) { transition-delay: .09s; }
.js-live .triad.is-in li:nth-child(3) { transition-delay: .18s; }

/* In flow each service card arrives on its own. */
@media (max-width: 959px), (max-height: 639px) {
  .js-live .svc { opacity: 0; transform: translateY(26px); transition: opacity .8s var(--ease), transform 1s var(--ease); }
  .js-live .svc.in { opacity: 1; transform: none; }
}

@media (max-width: 720px) {
  .triad { grid-template-columns: 1fr; gap: 20px; }
}

/* ================= 03 · Services ================= */

.services { position: relative; padding-block: clamp(96px, 14vw, 180px); }
.services__head .headline { margin-top: 24px; }
.services__head .lede { margin-top: 22px; }

.tabs { display: none; }

.panels { display: grid; gap: 18px; margin-top: 48px; }
.svc {
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(19, 27, 40, .82), rgba(10, 15, 24, .82));
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.svc__top { display: flex; align-items: center; gap: 20px; }
.svc__num {
  color: var(--text-3);
  font: 400 .6875rem/1.4 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
}
.svc__title {
  margin-top: 6px;
  color: var(--text);
  font: 300 clamp(1.375rem, 2.2vw, 1.875rem)/1.15 var(--font-display);
  letter-spacing: -.03em;
  text-wrap: balance;
}
.svc__lead { max-width: 38rem; margin-top: 20px; color: var(--text); font-size: 1.0625rem; }
.svc__grid { display: grid; gap: 18px; margin-top: 24px; padding-top: 22px; border-top: 1px solid var(--line); }
.svc__grid dt {
  color: var(--accent);
  font: 400 .6875rem/1.4 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
}
.svc__grid dd { margin-top: 8px; font-size: .9375rem; line-height: 1.55; }

@media (min-width: 720px) {
  .svc__grid { grid-template-columns: repeat(3, 1fr); gap: 24px; }
}

/* Ring glyphs: each service's ring from the 3D instrument, drawn flat. */
.glyph { flex: none; width: 56px; height: 56px; overflow: visible; }
.glyph__ring { fill: none; stroke: var(--text); stroke-width: 2; }
.glyph__ring--thin { stroke: var(--text-3); stroke-width: 1.2; }
.glyph__ring--dash { stroke-width: 3; stroke-dasharray: 6.6 2.82; }
.glyph__ring--ticks { stroke-width: 5; stroke-dasharray: 1 3.19; }
.glyph__spin { transform-origin: 32px 32px; }
.glyph__spin path { fill: none; stroke: var(--text); stroke-width: 2; stroke-linecap: round; }
.glyph__core { fill: var(--accent); }
.js-live .svc.is-active .glyph__spin, .js-live .svc.in .glyph__spin { animation: spin 28s linear -6s infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ================= 04 · Process ================= */

.process { position: relative; }
.process__pin { padding-block: clamp(96px, 14vw, 180px) 0; }
.process__head .headline { margin-top: 24px; }
.process__head .lede { margin-top: 22px; }

.steps { position: relative; display: grid; gap: 0; margin-top: 56px; }
.step { position: relative; padding: 0 0 34px 44px; transition: opacity .5s var(--ease); }
.js-live .step { opacity: .42; }
.js-live .step.is-active, .js-live .step.is-done { opacity: 1; }
.step__btn {
  position: absolute; left: -15px; top: -12px; z-index: 1;
  width: 44px; height: 44px;
  display: grid; place-items: center;
}
.step__btn i {
  width: 11px; height: 11px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--canvas);
  transition: background-color .4s var(--ease), border-color .4s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease);
}
.step.is-done .step__btn i { background: var(--text); border-color: var(--text); }
.step.is-active .step__btn i {
  background: var(--accent); border-color: var(--accent);
  transform: scale(1.35);
  box-shadow: 0 0 0 6px var(--accent-muted);
}
.step__num { color: var(--text-3); font: 400 .6875rem/1 var(--font-mono); letter-spacing: .14em; }
.step h3 {
  margin-top: 10px;
  color: var(--text);
  font: 300 1.5rem/1.1 var(--font-display);
  letter-spacing: -.03em;
}
.step__text { margin-top: 10px; max-width: 30rem; font-size: .9375rem; line-height: 1.55; }

.steps__line { position: absolute; left: 6.5px; top: 10px; bottom: 44px; width: 1px; background: var(--line-strong); }
.steps__line i {
  position: absolute; inset: 0;
  background: var(--accent);
  transform: scaleY(var(--fill, 0)); transform-origin: top;
}

/* ---------- The alignment moment ---------- */

.align { padding-block: clamp(88px, 12vw, 170px); }
.align__head { display: grid; gap: 20px 64px; align-items: end; }
.align__head .lede { max-width: 30rem; }

.align__panel {
  margin-top: 40px; padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(19, 27, 40, .88), rgba(8, 12, 20, .9));
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
}
.align__figure { position: relative; }
.align__svg { width: 100%; height: clamp(170px, 24vw, 260px); overflow: visible; }
.align__svg path { vector-effect: non-scaling-stroke; }
.align__tag {
  position: absolute; top: 0; z-index: 1;
  color: var(--text-3);
  font: 400 .6875rem/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
  transition: color .4s var(--ease);
}
.align__tag--a { left: 0; }
.align__tag--b { right: 0; }
.align__panel[data-state="aligned"] .align__tag--b { color: var(--accent); }

.align__control { position: relative; display: block; margin-top: 18px; }
.align__hint {
  display: block; margin-bottom: 12px;
  color: var(--text-2);
  font: 400 .6875rem/1 var(--font-mono);
  letter-spacing: .14em; text-transform: uppercase;
}
.align__control input {
  --p: 0%;
  -webkit-appearance: none; appearance: none;
  display: block; width: 100%; height: 44px; margin: 0;
  background: transparent; cursor: grab;
}
.align__control input:active { cursor: grabbing; }
.align__control input::-webkit-slider-runnable-track {
  height: 2px; border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) var(--p), var(--line-strong) var(--p));
}
.align__control input::-moz-range-track { height: 2px; border-radius: 2px; background: var(--line-strong); }
.align__control input::-moz-range-progress { height: 2px; background: var(--accent); }
.align__control input::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 30px; height: 30px; margin-top: -14px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--canvas) radial-gradient(circle, var(--accent) 0 4px, transparent 5px);
  box-shadow: 0 0 0 6px var(--accent-muted);
  transition: transform .3s var(--ease);
}
.align__control input::-moz-range-thumb {
  width: 28px; height: 28px; border-radius: 50%;
  border: 1px solid var(--accent);
  background: var(--canvas) radial-gradient(circle, var(--accent) 0 4px, transparent 5px);
  box-shadow: 0 0 0 6px var(--accent-muted);
}
.align__control input:hover::-webkit-slider-thumb { transform: scale(1.12); }
.align__control input:focus-visible { outline: none; }
.align__control input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 4px; }
.align__control input:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 4px; }

.benefits { display: grid; gap: 28px 32px; margin-top: 44px; }
.benefit { position: relative; padding-top: 22px; border-top: 1px solid var(--line); }
.benefit::before {
  content: ""; position: absolute; left: 0; top: -1px; width: 100%; height: 1px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .9s var(--ease);
}
.benefit.is-lit::before { transform: scaleX(1); }
.benefit__mark {
  display: block; width: 12px; height: 12px; margin-bottom: 18px; border-radius: 50%;
  border: 1px solid var(--line-strong);
  transition: background-color .5s var(--ease), border-color .5s var(--ease), box-shadow .5s var(--ease);
}
.benefit.is-lit .benefit__mark { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-muted); }
.benefit h4 {
  color: var(--text);
  font: 300 1.25rem/1.2 var(--font-display);
  letter-spacing: -.025em;
}
.benefit p { margin-top: 10px; font-size: .9375rem; line-height: 1.55; }

@media (min-width: 620px) { .benefits { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 960px) {
  .align__head { grid-template-columns: 1.2fr 1fr; }
  .benefits { grid-template-columns: repeat(4, 1fr); }
}

/* ================= 05 · About ================= */

.about { position: relative; padding-block: clamp(96px, 13vw, 190px); }
.about__copy { width: min(100%, 43rem); }
.about__copy .headline { margin-top: 24px; }
.about__copy > .lede { margin-top: 26px; max-width: 36rem; }

.pillars { margin-top: clamp(40px, 6vw, 72px); border-top: 1px solid var(--line); }
.pillars li {
  display: grid; grid-template-columns: 34px 1fr; gap: 6px 14px;
  padding-block: 24px;
  border-bottom: 1px solid var(--line);
}
.pillars__num { grid-row: span 2; color: var(--accent); font: 400 .75rem/1.9 var(--font-mono); letter-spacing: .1em; }
.pillars h3 { color: var(--text); font: 300 1.375rem/1.2 var(--font-display); letter-spacing: -.025em; }
.pillars p { font-size: .9875rem; line-height: 1.6; }

.values { margin-top: clamp(40px, 6vw, 72px); color: var(--text); font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.15; }
.values em { margin-right: .18em; }
.values span { display: block; margin-top: 14px; color: var(--text-2); font: 400 .9875rem/1.6 var(--font-body); }

.facts { display: grid; gap: 18px 32px; margin-top: clamp(36px, 5vw, 56px); padding-top: 24px; border-top: 1px solid var(--line); }
.facts dt { color: var(--text-3); font: 400 .6875rem/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.facts dd { margin-top: 8px; color: var(--text); font-size: .9375rem; line-height: 1.5; }

@media (min-width: 720px) {
  .pillars li { grid-template-columns: 34px 11rem 1fr; gap: 0 20px; align-items: baseline; }
  .pillars__num { grid-row: auto; }
  .facts { grid-template-columns: 1fr 1.5fr .9fr; }
}

/* ================= 06 · Contact ================= */

.contact { position: relative; }
.contact__lead {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 100vh; min-height: 100svh;
  padding-block: calc(var(--nav-h) + 40px) 32vh;      /* the lower third is left open for the 3D horizon */
  text-align: center;
}
.contact__lead .kicker { justify-content: center; }
.contact__lead .display { margin-top: 26px; max-width: 12.5em; }
.contact__lead .lede { margin-top: 28px; max-width: 36rem; }
.contact__lead .actions { margin-top: 38px; }

.contact__grid {
  display: grid; gap: 40px clamp(32px, 6vw, 88px);
  margin-bottom: clamp(72px, 10vw, 130px);
  padding: clamp(24px, 4.5vw, 56px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(160deg, rgba(19, 27, 40, .86), rgba(8, 12, 20, .9));
  -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
  scroll-margin-top: calc(var(--nav-h) + 16px);
}
@media (min-width: 900px) { .contact__grid { grid-template-columns: .8fr 1.2fr; } }

.channels { margin-top: 26px; }
.channels li { display: grid; gap: 6px; justify-items: start; padding-block: 20px; border-top: 1px solid var(--line); }
.channels li > span { color: var(--text-3); font: 400 .6875rem/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; }
.channels li > a:not(.link) {
  color: var(--text);
  font: 300 clamp(1.25rem, 2vw, 1.5rem)/1.2 var(--font-display);
  letter-spacing: -.02em;
  transition: color .3s var(--ease);
}
.channels li > a:not(.link):hover { color: var(--accent-hover); }
.channels address { color: var(--text); line-height: 1.55; }
.channels .link { margin-top: 6px; font-size: .9375rem; }

/* Form fields live in shop.css: the checkout uses them too. */

/* ================= Pin layout ================= */

@media (min-width: 960px) and (min-height: 640px) {
  .hero__copy { width: min(58%, 52rem); }

  /* 02: the statement lights up word by word while the instrument opens beside it. */
  .js-live .what { height: 240vh; padding-block: 0; }
  .js-live .what__pin {
    position: sticky; top: 0;
    display: flex; align-items: center;
    height: 100vh;
    padding-top: var(--nav-h);
  }
  .js-live .what__inner { display: flex; justify-content: flex-end; }
  .js-live .what__copy { width: min(48%, 39rem); margin-right: clamp(0px, 3vw, 56px); }

  /* 03: four services share one stage, one ring at a time. */
  .js-live .services { padding-block: 0; }
  .js-live .services__track { height: 470vh; }
  .js-live .services__pin {
    position: sticky; top: 0;
    display: flex; align-items: center;
    height: 100vh;
    padding-top: var(--nav-h);
  }
  .js-live .services__inner > * { width: min(58%, 47rem); }
  .js-live .services__head .lede { display: none; }

  .js-live .tabs {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
    margin-top: clamp(22px, 3.6vh, 40px);
  }
  .tab {
    position: relative;
    display: flex; align-items: baseline; gap: 10px;
    min-height: 44px; padding: 14px 0 12px;
    color: var(--text-3);
    font-size: .9375rem;
    text-align: left;
    transition: color .4s var(--ease);
  }
  .tab b { font: 400 .6875rem/1 var(--font-mono); letter-spacing: .12em; }
  .tab::before, .tab i { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 1px; }
  .tab::before { background: var(--line-strong); }
  .tab i { background: var(--accent); transform: scaleX(var(--fill, 0)); transform-origin: left; }
  .tab:hover, .tab[aria-selected="true"] { color: var(--text); }
  .tab[aria-selected="true"] b { color: var(--accent); }

  .js-live .panels { gap: 0; margin-top: clamp(20px, 3.4vh, 36px); }
  .js-live .svc {
    grid-area: 1 / 1;
    padding: 0; border: 0; border-radius: 0; background: none;
    -webkit-backdrop-filter: none; backdrop-filter: none;
    opacity: 0; visibility: hidden;
    transform: translateY(18px);
    transition: opacity .45s var(--ease), transform .7s var(--ease), visibility 0s linear .45s;
  }
  .js-live .svc.is-active {
    opacity: 1; visibility: visible; transform: none;
    transition: opacity .6s var(--ease) .12s, transform .8s var(--ease) .12s, visibility 0s;
  }
  .js-live .svc__lead { margin-top: clamp(14px, 2.2vh, 20px); }
  .js-live .svc__grid { margin-top: clamp(16px, 2.6vh, 24px); padding-top: clamp(14px, 2.2vh, 22px); }

  /* 04: the path across the top, the pipeline in the middle, five steps along the bottom. */
  .js-live .process__track { height: 460vh; }
  .js-live .process__pin {
    position: sticky; top: 0;
    display: flex;
    height: 100vh;
    padding-block: calc(var(--nav-h) + clamp(12px, 3.5vh, 44px)) clamp(22px, 4.5vh, 48px);
  }
  .js-live .process__inner { display: flex; flex-direction: column; justify-content: space-between; }
  .js-live .process__head { width: min(52%, 40rem); }
  .js-live .process__head .lede { margin-top: 18px; }

  .js-live .steps { grid-template-columns: repeat(5, 1fr); gap: 28px; margin-top: 0; padding-top: 30px; }
  .js-live .step { padding: 0; }
  .js-live .step__btn { left: -16px; top: -52px; }
  .js-live .step h3 { font-size: clamp(1.25rem, 1.7vw, 1.5rem); }
  .js-live .step__text { font-size: .875rem; }
  .js-live .steps__line { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 1px; }
  .js-live .steps__line i { transform: scaleX(var(--fill, 0)); transform-origin: left; }

  .contact__lead { padding-bottom: 34vh; }
}

/* Short desktop windows: keep the story, drop the secondary lines. */
@media (min-width: 960px) and (min-height: 640px) and (max-height: 760px) {
  .js-live .process__head .lede { display: none; }
  .js-live .svc__lead { font-size: 1rem; }
}

@media (pointer: coarse) {
  .channels li > a, .channels .link { display: inline-flex; align-items: center; min-height: 44px; }
}
