@charset "UTF-8";

/* ==========================================================================
   tech.html — the engineering page: Blade Engine, auto-wash, cold chain, spec.
   ========================================================================== */

@layer sections {
  .page-hero {
    position: relative;
    padding-top: clamp(7rem, 16vh, 11rem);
    padding-bottom: var(--s-8);
    background-color: var(--bg-void);
    background-image: var(--grain-ink);
  }
  .page-hero::before {
    content: '';
    position: absolute;
    inset: 0 0 auto;
    height: 640px;
    pointer-events: none;
    background: radial-gradient(ellipse 60% 70% at 30% 0%, rgb(121 230 255 / 9%), transparent 70%);
  }
  .page-hero__inner {
    position: relative;
    display: grid;
    gap: var(--s-5);
    justify-items: start;
  }
  .page-hero__inner > :not(.jump) {
    max-width: 52rem;
  }
  /* the sticky knife starts right under the chapter title */
  #engine .section__head {
    margin-bottom: 0;
  }
  .page-hero h1 {
    font-size: clamp(1.875rem, 7.4vw, 4.5rem);
  }
  .page-hero p {
    font-size: var(--fs-lead);
    color: var(--frost-500);
  }

  /* quick jumps across the four chapters */
  .jump {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
  }
  .jump a {
    display: inline-flex;
    align-items: center;
    gap: var(--s-2);
    min-height: 2.5rem;
    padding: 0 var(--s-4);
    border: 1px solid var(--line-hi);
    border-radius: 99px;
    font-size: var(--fs-xs);
    color: var(--frost-300);
    transition: background-color var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
      border-color var(--dur-fast) var(--ease-out);
  }
  .jump a span {
    font-family: var(--font-mono);
    font-size: var(--fs-micro);
    color: var(--ice);
  }
  .jump a:hover {
    background: var(--acid);
    border-color: var(--acid);
    color: var(--acid-ink);
  }
  .jump a:hover span {
    color: var(--acid-ink);
  }

  /* --- The Blade Engine --- */
  .engine {
    position: relative;
    display: grid;
    gap: var(--s-6);
  }
  @media (width >= 64rem) {
    .engine {
      grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
      gap: clamp(2rem, 5vw, 5rem);
    }
  }

  .engine__viewport {
    position: sticky;
    top: 0;
    z-index: 4;
    height: 100vh;
    display: grid;
    align-content: center;
    justify-items: center;
    gap: var(--s-5);
    pointer-events: none;
  }

  /*
    The cutaway of the knife assembly: drive plate on top, shaft, four wings, the cup in section.
    Desktop shows it in the sticky column; below 64rem it becomes the bar (see the media query).
    blade.js rebuilds the viewBox from the real size, so 1 unit ≈ 1px at the mill's height / 120.
  */
  .engine__mill {
    position: relative;
    width: 100%;
    height: clamp(17rem, 40vh, 23rem);
    overflow: visible;
  }
  .engine__blade-stage {
    display: block;
    width: 100%;
    height: 100%;
  }
  .engine__side {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    overflow: visible;
    filter: drop-shadow(0 0 48px rgb(121 230 255 / 14%));
  }
  .side__facet {
    stroke: rgb(234 244 255 / 38%);
    stroke-width: 0.6;
    stroke-linejoin: round;
  }

  .engine__hud {
    display: flex;
    gap: var(--s-5);
    padding: var(--s-3) var(--s-5);
    border: 1px solid var(--line);
    border-radius: var(--r-1);
    background: rgb(6 13 20 / 76%);
    backdrop-filter: blur(8px);
  }
  .engine__hud div {
    display: grid;
    gap: 2px;
    text-align: center;
  }
  .engine__hud dt {
    line-height: 1.2;
    font-family: var(--font-mono);
    font-size: 9px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--frost-700);
  }
  .engine__hud dd {
    line-height: 1.2;
    font-family: var(--font-mono);
    font-size: var(--fs-sm);
    color: var(--acid);
    font-variant-numeric: tabular-nums;
  }

  /* ice lives on two canvases: the far half of the swirl behind the knife, the near half in front */
  .engine__shards {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
  }
  .engine__shards--back {
    z-index: 0;
  }

  .engine__track {
    display: grid;
    padding-block: 30vh;
  }
  .engine__block {
    min-height: 56vh;
    display: grid;
    align-content: center;
    gap: var(--s-4);
    contain: layout;
    text-wrap: wrap;
  }
  .engine__block[data-crush] {
    transform-origin: 50% 50%;
    will-change: transform, opacity, filter;
  }
  .engine__block h3 {
    font-size: clamp(1.375rem, 2.4vw, 2rem);
  }
  .engine__block p {
    font-size: var(--fs-lead);
    color: var(--frost-500);
    max-width: 40ch;
    text-wrap: wrap;
  }
  .engine__block .kv {
    max-width: 26rem;
  }

  /*
    Phone / tablet: compact mill bar.
    Side section of the knife assembly under the HUD: the drive shaft hangs from
    the readout plate, the cup flares to a mouth on the bar's bottom edge
    (where the copy is clipped), and blade.js projects the wings from scroll.
  */
  @media (width < 64rem) {
    .engine {
      gap: 0;
    }
    .engine__viewport {
      --mill-top: 2px;
      top: var(--mill-top);
      height: auto;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: flex-start;
      gap: 0;
      /* edge to edge: the cup mouth spans the screen, so the copy goes under the knife */
      margin-inline: calc(var(--gutter) * -1);
      padding: 0.4rem 0 0;
      overflow: hidden;
      isolation: isolate;
      background: transparent;
      border-bottom: 1px solid var(--line);
      transition: top var(--dur-slow) var(--ease-out);
    }
    body:has(#site-header:not(.is-hidden)) .engine__viewport {
      --mill-top: var(--header-h, 4.5rem);
    }
    .engine__viewport::before {
      content: '';
      position: absolute;
      top: 0;
      bottom: 0;
      left: 50%;
      width: 100vw;
      translate: -50% 0;
      z-index: -1;
      background: var(--bg-void);
      box-shadow: 0 22px 36px 12px var(--bg-void);
    }
    .engine__hud {
      order: 1;
      position: relative;
      z-index: 3;
      width: auto;
      gap: var(--s-5);
      padding: 0.35rem 0.85rem;
      backdrop-filter: none;
    }
    .engine__mill {
      order: 2;
      z-index: 2;
      height: 7.5rem;
    }
    .engine__side {
      filter: none;
    }
    .engine__track {
      display: grid;
      gap: var(--s-8);
      padding: var(--s-6) 0 28vh;
    }
    .engine__block {
      min-height: 0;
      padding-block: 0;
    }
    .engine__block[data-crush] {
      clip-path: inset(var(--chew, 0px) 0 0 0);
      will-change: filter, opacity;
    }
    /* Landscape phones: the bar plus header would eat most of the screen */
    @media (height < 30rem) {
      .engine__mill {
        height: 4.75rem;
      }
    }
  }

  /* --- auto-wash: the diagram sits on an ink inset inside the paper chapter --- */
  .wash {
    display: grid;
    gap: var(--s-6);
    align-items: center;
  }
  @media (width >= 48rem) {
    .wash {
      grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
      gap: clamp(2rem, 5vw, 4rem);
    }
  }
  .wash__diagram {
    width: 100%;
    max-width: 30rem;
    margin-inline: auto;
  }
  .wash__flow {
    stroke: var(--ice);
    stroke-width: 2;
    fill: none;
    stroke-dasharray: 6 10;
    animation: wash-flow 1.6s linear infinite;
  }
  @keyframes wash-flow {
    to {
      stroke-dashoffset: -32;
    }
  }
  .wash__steps {
    display: grid;
    gap: var(--s-4);
    counter-reset: wash;
  }
  .wash__steps li {
    display: grid;
    grid-template-columns: 2.5rem 1fr;
    gap: var(--s-3);
    padding-bottom: var(--s-4);
    border-bottom: 1px solid var(--line-hi);
    font-size: var(--fs-sm);
    color: var(--frost-300);
  }
  .wash__steps li:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }
  .wash__steps li::before {
    counter-increment: wash;
    content: '0' counter(wash);
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.375rem;
    line-height: 1;
    letter-spacing: -0.05em;
    color: color-mix(in srgb, var(--frost-100) 28%, transparent);
  }

  /* --- cold chain: four links, the temperature is the headline --- */
  .chain {
    display: grid;
    gap: 0;
  }
  @media (width >= 56rem) {
    .chain {
      grid-template-columns: repeat(4, minmax(0, 1fr));
      border-top: 2px solid var(--frost-100);
    }
  }
  .chain__link {
    position: relative;
    display: grid;
    gap: var(--s-3);
    align-content: start;
    padding: 0 0 var(--s-6) var(--s-5);
    border-left: 1px solid var(--line-hi);
  }
  .chain__link:last-child {
    padding-bottom: 0;
  }
  @media (width >= 56rem) {
    .chain__link {
      grid-row: span 3;
      grid-template-rows: subgrid;
      row-gap: var(--s-3);
      padding: var(--s-6) var(--s-5);
      border-left: 0;
    }
    .chain__link:first-child {
      padding-left: 0;
    }
    .chain__link + .chain__link {
      border-left: 1px solid var(--line-hi);
    }
  }
  .chain__link::before {
    content: '';
    position: absolute;
    top: 0.2rem;
    left: -6px;
    width: 11px;
    height: 11px;
    background: var(--acid);
    transform: rotate(45deg);
  }
  @media (width >= 56rem) {
    .chain__link::before {
      top: -6px;
      left: 0;
    }
    .chain__link + .chain__link::before {
      left: calc(var(--s-5) - 5px);
    }
  }
  .chain__temp {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3.2vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.045em;
    line-height: 1;
    color: var(--ice);
    margin-top: 0;
  }
  @media (width >= 56rem) {
    .chain__temp {
      margin-top: var(--s-3);
    }
  }
  .chain__link h3 {
    font-size: 1.0625rem;
  }
  .chain__link p {
    font-size: var(--fs-xs);
    color: var(--frost-500);
  }

  /* --- passport: annotated front view + the numbers from the datasheet --- */
  .passport {
    display: grid;
    gap: var(--s-7);
  }
  @media (width >= 48rem) {
    .passport {
      grid-template-columns: minmax(0, 22rem) minmax(0, 1fr);
      gap: clamp(2rem, 5vw, 6rem);
      align-items: start;
    }
    .anatomy {
      position: sticky;
      top: 6.5rem;
    }
  }
  @media (width >= 64rem) {
    .passport {
      grid-template-columns: minmax(0, 25rem) minmax(0, 1fr);
    }
  }
  .anatomy {
    padding: var(--s-5);
    width: min(100%, 26rem);
    margin-inline: auto;
  }
  @media (width >= 48rem) {
    .anatomy {
      width: 100%;
      margin-inline: 0;
    }
  }
  .anatomy svg {
    width: 100%;
    height: auto;
  }
  .anatomy__dim {
    stroke: var(--ice);
    stroke-width: 1;
    fill: none;
  }
  .anatomy__dim-text {
    fill: var(--ice);
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.06em;
  }
  .anatomy__lead {
    stroke: var(--acid);
    stroke-width: 1;
    fill: none;
  }
  .anatomy__pin circle {
    fill: var(--acid);
  }
  .anatomy__pin text {
    fill: var(--acid-ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 13px;
    text-anchor: middle;
    dominant-baseline: central;
  }

  .parts {
    display: grid;
    counter-reset: part;
    border-top: 2px solid var(--frost-100);
  }
  .parts li {
    display: grid;
    grid-template-columns: 2.25rem minmax(0, 1fr);
    gap: var(--s-3);
    padding: var(--s-4) 0;
    border-bottom: 1px solid var(--line-hi);
  }
  .parts li::before {
    counter-increment: part;
    content: counter(part);
    display: grid;
    place-items: center;
    width: 1.5rem;
    height: 1.5rem;
    margin-top: 0.1rem;
    border-radius: 99px;
    background: var(--acid);
    color: var(--acid-ink);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 0.75rem;
  }
  .parts strong {
    display: block;
    font-family: var(--font-display);
    font-size: 1rem;
    letter-spacing: -0.015em;
  }
  .parts p {
    font-size: var(--fs-sm);
    color: var(--frost-500);
  }
  .passport__spec {
    margin-top: var(--s-7);
    display: grid;
    gap: var(--s-4);
  }
  .passport__spec .kv {
    border-top: 2px solid var(--frost-100);
  }

  /* --- closing band: lime, so the page ends on the one loud colour --- */
  .cta-band {
    --frost-100: #0a1400;
    --frost-300: #15260a;
    --frost-500: #2d4710;
    --line: rgb(10 20 0 / 26%);
    --accent: #0a1400;
    display: grid;
    gap: var(--s-5);
    justify-items: start;
    padding: clamp(1.5rem, 5vw, 4rem);
    background: var(--acid);
    border-color: var(--acid);
    color: #15260a;
  }
  .cta-band h2 {
    max-width: 24ch;
  }
  .cta-band p {
    max-width: 48ch;
    color: #15260a;
  }
  .cta-band .btn--primary {
    --btn-bg: #07111b;
    --btn-fg: var(--acid);
    --btn-bd: #07111b;
    box-shadow: none;
  }
  .cta-band .btn--ghost {
    --btn-fg: #0a1400;
    --btn-bd: #0a1400;
  }
  .cta-band .btn--ghost:hover {
    background: rgb(10 20 0 / 8%);
  }
}
