/* ── The older sections, brought up to the new look ──────────────────────
   Loaded last on the home page. The "at a glance" figures take the hero's
   Sora numbers, section titles take the hero's gradient accent, the films
   get a lit frame on hover, and FAQ answers open smoothly with an orange
   edge. Nothing here changes layout. */

/* Section titles: the accent half in the hero's gradient. */
main .section-title .thin {
  background-image: linear-gradient(100deg, #f97316 10%, #ea580c 45%, #c2410c 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}

/* ── At a glance ── */
.glance-item strong {
  font-family: "Sora", var(--font-display);
  font-weight: 600;
  letter-spacing: -0.035em;
  font-variant-numeric: tabular-nums;
}

.glance-item {
  border-radius: 16px;
  transition: background-color 0.2s ease;
}

@media (hover: hover) {
  .glance-item:hover {
    background-color: color-mix(in srgb, var(--accent) 6%, transparent);
  }
}

/* ── What's new: the films ── */
.film-frame {
  transition: box-shadow 0.3s ease, translate 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (hover: hover) {
  .film:hover .film-frame {
    translate: 0 -4px;
    box-shadow: 0 0 0 1.5px rgba(234, 88, 12, 0.55), 0 34px 60px -30px rgba(234, 88, 12, 0.55);
  }
}

.film-num {
  font-family: "Sora", var(--font-display);
  font-weight: 600;
  color: var(--accent);
}

/* ── FAQ ── */
.faq details {
  position: relative;
  overflow: hidden;
}

/* The orange edge an open answer carries. */
.faq details::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(#fb923c, #ea580c);
  scale: 1 0;
  transform-origin: top;
  transition: scale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.faq details[open]::before {
  scale: 1 1;
}

.faq details[open] {
  border-color: rgba(234, 88, 12, 0.35);
}

.faq summary {
  transition: color 0.15s ease;
}

.faq summary:hover,
.faq details[open] summary {
  color: var(--accent-deep);
}

html[data-theme="dark"] .faq summary:hover,
html[data-theme="dark"] .faq details[open] summary {
  color: #fdba74;
}

/* Answers slide open where the browser can animate to auto height;
   elsewhere they simply open. */
@supports (interpolate-size: allow-keywords) {
  .faq details {
    interpolate-size: allow-keywords;
  }

  .faq details::details-content {
    block-size: 0;
    overflow: hidden;
    transition: block-size 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), content-visibility 0.35s allow-discrete;
  }

  .faq details[open]::details-content {
    block-size: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .film-frame,
  .faq details::before,
  .faq details::details-content {
    transition: none;
  }
}

/* ── No grids: the closing banner keeps its glow, without the lined grid
   clean.css draws behind it. ── */
.closer::before {
  background-image: none;
}

/* ── Header (nav-evolve.js) ──────────────────────────────────────────────
   Desktop only. At the top of the page: a wide bare bar. Scrolled: the
   floating pill clean.css draws. The pill's width comes from --nav-pill,
   measured by the script, so the change can animate. */
@media (min-width: 721px) {
  /* .is-scrolled too: clean.css names it, and would otherwise win. */
  .nav.has-menu,
  .nav.has-menu.is-scrolled {
    width: 100%;
    max-width: min(var(--nav-pill, 640px), calc(100% - 24px));
    transition:
      max-width 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      padding 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      inset 0.5s cubic-bezier(0.2, 0.8, 0.2, 1),
      background-color 0.3s ease,
      border-color 0.3s ease,
      box-shadow 0.3s ease,
      opacity 0.4s ease; /* intro.css fades the header in after the cover */
  }

  /* While the script measures the pill it must be its natural width, at once. */
  .nav.has-menu.is-measuring,
  .nav.has-menu.is-scrolled.is-measuring {
    width: fit-content;
    max-width: calc(100% - 24px);
    transition: none;
  }

  .nav.has-menu.is-wide,
  .nav.has-menu.is-scrolled.is-wide,
  html[data-theme="dark"] .nav.has-menu.is-wide,
  html[data-theme="dark"] .nav.has-menu.is-scrolled.is-wide {
    inset: 20px 0 auto;
    max-width: min(1180px, calc(100% - 40px));
    padding: 8px 8px 8px 12px;
    background: transparent;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    border-color: transparent;
    box-shadow: none;
  }

  /* ── The sliding highlight under the link for the section on screen ── */
  .nav-links {
    position: relative;
  }

  .nav-glider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    border-radius: 999px;
    background: var(--accent-soft);
    box-shadow: inset 0 0 0 1px rgba(234, 88, 12, 0.22);
    opacity: 0;
    pointer-events: none;
    transition:
      transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      width 0.4s cubic-bezier(0.2, 0.8, 0.2, 1),
      opacity 0.25s ease;
  }

  .nav-links a {
    position: relative;
  }

  .nav-links a.is-active,
  .nav-links a.is-active:hover {
    background: none;
    color: var(--accent-deep);
  }
}

@media (max-width: 720px) {
  .nav-glider {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nav.has-menu,
  .nav-glider {
    transition: none;
  }
}

/* Room between the wide header and the hero's badge. */
@media (min-width: 721px) {
  .hero-badge {
    margin-top: 26px;
  }
}

/* The wide header keeps its links dead centre: they take the free space on
   both sides, and the brand is given the same width as the right-hand group
   (--nav-side, measured by nav-evolve.js). Only where there is room for it:
   on a tablet that extra width pushed the buttons off the right edge. */
@media (min-width: 1024px) {
  .nav.has-menu.is-wide .nav-links {
    margin-inline: auto;
  }

  .nav.has-menu.is-wide .nav-left {
    min-width: var(--nav-side, 0px);
  }
}

/* ── Providers belt: the makers' real logos (assets/logos/), smaller ──
   Each card is the company's own mark and wordmark: the colour marks as
   images, the black-and-white ones (and every wordmark) drawn in ink so they
   turn white in dark mode. Hovering stops the belt, steps the others back,
   and grows the card under the pointer. The flagship model is in its title. */
.belt {
  padding-block: 22px 26px;
}

.belt-set,
.models .belt-set {
  gap: 12px;
  padding-right: 12px;
}

.provider,
.models .provider {
  width: auto;
  gap: 10px;
  padding: 11px 18px;
  border-radius: 12px;
  transition:
    transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1),
    box-shadow 0.35s ease,
    border-color 0.35s ease,
    opacity 0.3s ease,
    filter 0.3s ease;
}

.provider-mark {
  display: block;
  flex: none;
  width: 24px;
  height: 24px;
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.provider-mark.is-mono,
.provider-word {
  background: var(--ink);
  -webkit-mask: var(--logo) center / contain no-repeat;
  mask: var(--logo) center / contain no-repeat;
}

/* The wordmark at 16px tall, as wide as its own drawing (--w of 24 units). */
.provider-word {
  display: block;
  flex: none;
  height: 16px;
  width: calc(var(--w) / 24 * 16px);
}

.provider .provider-name {
  font-size: 15px;
  line-height: 1;
}

@media (hover: hover) {
  .belt:hover .provider {
    opacity: 0.45;
    filter: grayscale(0.6);
  }

  .belt .provider:hover {
    z-index: 1;
    opacity: 1;
    filter: none;
    transform: translateY(-3px) scale(1.1);
    border-color: rgba(234, 88, 12, 0.45);
    box-shadow: 0 16px 34px -16px rgba(234, 88, 12, 0.6);
  }

  .belt .provider:hover .provider-mark {
    transform: rotate(-6deg) scale(1.08);
  }
}

@media (max-width: 720px) {
  .provider,
  .models .provider {
    padding: 9px 14px;
  }

  .provider-mark {
    width: 20px;
    height: 20px;
  }

  .provider-word {
    height: 14px;
    width: calc(var(--w) / 24 * 14px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .provider,
  .provider-mark {
    transition: none;
  }

  .belt .provider:hover,
  .belt .provider:hover .provider-mark {
    transform: none;
  }
}

/* ── Closing banner: a typing chat box and the live count (closer-ask.js) ──
   The banner is dark in both themes, so these colours are fixed. */
.closer-ask {
  display: flex;
  align-items: center;
  gap: 12px;
  width: min(100%, 520px);
  margin: 28px 0 20px;
  padding: 10px 10px 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: 0 20px 50px -24px rgba(249, 115, 22, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-align: left;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.closer-ask.is-sent {
  border-color: rgba(251, 146, 60, 0.6);
  box-shadow: 0 24px 60px -22px rgba(249, 115, 22, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.closer-ask-spark svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: #fb923c;
}

.closer-ask-text {
  flex: 1;
  min-width: 0;
  min-height: 1.4em;
  font: 500 15.5px/1.4 var(--font-body);
  color: #f4f4f5;
  white-space: nowrap;
  overflow: hidden;
}

.closer-ask-caret {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: -0.15em;
  background: #fb923c;
  animation: closer-caret 1s steps(2, jump-none) infinite;
}

@keyframes closer-caret {
  50% { opacity: 0; }
}

.closer-ask-send {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.1);
  transition: background-color 0.3s ease, scale 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.closer-ask.is-sent .closer-ask-send {
  background: linear-gradient(180deg, #f97316, #ea580c);
  scale: 1.08;
}

.closer-ask-send svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: #fff;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.closer .closer-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0 0;
  font: 500 14px/1.3 var(--font-body);
  color: #a1a1aa;
}

.closer-count b {
  font: 600 14.5px/1 "Sora", var(--font-display);
  color: #fafafa;
  font-variant-numeric: tabular-nums;
}

.closer-count i {
  position: relative;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
}

.closer-count i::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: #22c55e;
  animation: builders-ping 1.8s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@media (max-width: 560px) {
  .closer-ask-text {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .closer-ask-caret,
  .closer-count i::after {
    animation: none;
  }
}

/* The chat box's one-line text must not widen the banner's column past a
   phone's screen. */
.closer {
  grid-template-columns: minmax(0, 1fr);
}
