/* ==========================================================================
   CIIL AI — the landing page's own additions to the release design system.

   Everything here reads a token from styles.css or theme-dark.css and none of it
   writes a hex value. The two doors keep the release pages' one blue
   (--bench-ours), because the blue marks an Anuvani model wherever it appears.
   Entrances are the release's: a card rises 10px as it fades, 500ms on one curve,
   each column 70ms after the last, and only once the card has been seen.
   ========================================================================== */

/* ---------- The opening: the name, one line of questions, the lede ---------- */

.release-hero__intro { max-inline-size: none; }
.release-hero__eyebrow { margin-top: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem); }
.release-hero__name { inline-size: fit-content; max-inline-size: 100%; margin-inline: auto; }
/* the two questions are one line where the column allows it, two balanced lines where not */
.release-hero__title { max-inline-size: none; margin-inline: auto; text-wrap: balance; }
.release-hero__lede { max-inline-size: var(--measure); margin-inline: auto; }

.release-hero__art {
  container-type: inline-size;
}

.release-hero__art .dg--tall {
  display: none;
}

/* drawn twice: across below 62rem the wide drawing would have to shrink its type, so the tall one takes over */
@container (width < 62rem) {
  .release-hero__art .dg--wide {
    display: none;
  }

  .release-hero__art .dg--tall {
    display: block;
    max-width: 26rem;
    margin-inline: auto;
  }
}

/* ---------- The opening drawing ---------- */

/* type is set for the drawing's own units: 1 unit is 1px where the column is full width */
.lh .dg-name { font: 600 16px var(--sans); }
.lh .dg-sub,
.lh .dg-note { font: 400 13.5px var(--mono); }
.lh .dg-tag { font: 500 13px var(--mono); letter-spacing: 0.02em; }
.lh .dg-zone-title { font: 600 13px var(--sans); letter-spacing: 0.12em; }
.lh .lh-fam,
.lh .lh-count { fill: var(--ink-soft); }
/* on the phone the family names are the narrower sans, so the longest still clears its dots */
.lh .lh-fam--sans { font: 500 13px var(--sans); letter-spacing: 0; }

/* the recording is neutral: colour only appears where a model has read it */
.lh-wavebar {
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 2.1;
  opacity: 0.88;
}

.lh-panel {
  fill: var(--paper-raised);
  stroke: var(--line-strong);
  stroke-width: 1;
}

.lh-rule {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.lh-lane {
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
}

.lh-arrow {
  fill: none;
  stroke: var(--ink-soft);
  stroke-width: 1.4;
}

.lh-arrowhead {
  fill: var(--ink-soft);
}

.lh-dot--ia { fill: var(--fam-ia); }
.lh-dot--dr { fill: var(--fam-dr); }
.lh-dot--tb { fill: var(--fam-tb); }
.lh-dot--aa { fill: var(--fam-aa); }
.lh-dot--en { fill: var(--fam-en); }

.lh-turn { opacity: 0.92; }
.lh-turn--1 { fill: var(--fam-ia); }
.lh-turn--2 { fill: var(--fam-dr); }
.lh-turn--3 { fill: var(--fam-tb); }
.lh-turn--4 { fill: var(--fam-aa); }

@media (prefers-reduced-motion: no-preference) {
  @keyframes lh-fade {
    from { opacity: 0; }
  }

  @keyframes lh-lift {
    from { opacity: 0; transform: translateY(8px); }
  }

  .lh-wavebar { animation: lh-fade 420ms ease-out var(--lh-d, 0ms) backwards; }
  .lh-tower { animation: lh-lift 520ms cubic-bezier(0.22, 0.68, 0.24, 1) calc(120ms + var(--lh-d, 0ms)) backwards; }
  .lh-dot,
  .lh-turn { animation: lh-fade 420ms ease-out var(--lh-d, 240ms) backwards; }
}

@media (prefers-reduced-motion: reduce) {
  .lh * {
    animation-duration: 0.01ms !important;
    animation-delay: 0ms !important;
  }
}

/* ---------- The models: the doors, then the widgets under them ---------- */

/* the doors follow the opening directly: no hairline, no title (its heading is for readers who listen) */
.release-section--lead {
  margin-top: clamp(2.5rem, 2rem + 2.2vw, 3.5rem);
  padding-top: 0;
  border-top: 0;
}

.doors {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0.75rem;
}

.door {
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 150ms ease-out, background-color 150ms ease-out;
}

.door:hover {
  border-color: var(--ink-soft);
  background: var(--bench-hover);
}

.door:focus-visible {
  outline: 2px solid var(--bench-ours);
  outline-offset: 2px;
}

.door__name {
  color: var(--bench-ours-ink);
  font: 400 clamp(2.25rem, 1.6rem + 2.2vw, 3rem)/1 var(--display);
  letter-spacing: -0.02em;
}

.door__desc {
  max-width: 32rem;
  margin-top: 0.875rem;
  color: var(--ink-soft);
  font-size: 1.0625rem;
  line-height: 1.55;
  text-wrap: pretty;
}

/* the one figure that leads, as on each release page's hero */
.door__lead {
  margin-top: 1.75rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.door__number {
  color: var(--bench-ours-ink);
  font: 400 3.75rem/0.9 var(--display);
  letter-spacing: -0.02em;
}

.door__what {
  margin-top: 0.75rem;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.4;
  text-wrap: pretty;
}

.door__next {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.4;
  text-wrap: pretty;
}

/* two supporting facts in a divided row, as the release hero sets three */
.door__facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 1.5rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.door__fact {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 0 1rem;
}

.door__fact:first-child {
  padding-left: 0;
  border-right: 1px solid var(--line);
}

.door__fact:last-child {
  padding-right: 0;
}

.door__fact dd {
  margin: 0;
  color: var(--ink);
  font: 400 1.5rem/1 var(--display);
  letter-spacing: -0.01em;
}

.door__fact dt {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.8125rem;
  line-height: 1.375;
  text-wrap: pretty;
}

/* where the card goes: the action, the address, the arrow */
.door__go {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 1.5rem 0 0;
  padding-top: 1.125rem;
  border-top: 1px solid var(--line);
}

.door__text {
  display: grid;
  flex: 1;
  min-width: 0;
  gap: 0.125rem;
}

.door__open {
  font: 600 0.9375rem/1.3 var(--sans);
}

/* the real address, as the widgets show theirs: never cut short, wrapping at a slash where it must */
.door__path {
  color: var(--muted);
  font: 400 0.8125rem/1.3 var(--mono);
  overflow-wrap: anywhere;
}

.door__arrow {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--ink);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  transition: transform 150ms ease-out;
}

.door:hover .door__arrow {
  transform: translate(2px, -2px);
}

/* side by side, the two cards' rows line up even where their sentences wrap differently */
@container release (min-width: 48rem) {
  .doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 1rem;
    row-gap: 0;
  }
}

@supports (grid-template-rows: subgrid) {
  @container release (min-width: 48rem) {
    .doors {
      grid-template-rows: repeat(5, auto);
    }

    .door {
      display: grid;
      grid-row: span 5;
      grid-template-rows: subgrid;
      row-gap: 0;
    }
  }
}

/* the widgets: two columns, so each model's card and paper stand under its own door */
.rlinks--grid {
  margin-top: 0.75rem;
}

@container release (min-width: 48rem) {
  .rlinks.rlinks--grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem 1rem;
  }
}

/* ---------- Entrances: the release's own ---------- */

@media (prefers-reduced-motion: no-preference) {
  .doors.is-inview .door,
  .rlinks--grid.is-inview .rlink {
    animation: bench-lift 500ms cubic-bezier(0.22, 0.68, 0.24, 1) var(--delay, 0ms) backwards;
  }

  /* each column 70ms after the last */
  .doors.is-inview .door:nth-child(2),
  .rlinks--grid.is-inview li:nth-child(even) .rlink { --delay: 70ms; }
}

/* ---------- The masthead: the two models are one press away ---------- */

@media (max-width: 36rem) {
  .btn__prefix {
    display: none;
  }
}
