/* The landing page, over style.css. One wide element, the annotated
   schema; everything else is a left-aligned column of prose and code. */

.home-main { max-width: 72rem; margin: 0 auto; padding: 0 1.5rem; }
.home-main > section { margin: 0 0 6.5rem; }
.home-main h2 { font-size: 1.2rem; font-weight: 500; margin: 0 0 .75rem; }
.home-main h3 { font-size: .95rem; font-weight: 600; margin: 0 0 .5rem; }
.home-main p { margin: 0 0 1rem; max-width: 64ch; }
.home-main .intro { max-width: 64ch; margin-bottom: 1.75rem; }
.home-main .intro p { color: var(--muted); }

/* hero */
.hero { padding: 6.5rem 0 0; }
.hero h1 {
  max-width: 19ch;
  margin: 0 0 1.75rem;
  font-size: clamp(2rem, 1.2rem + 3.3vw, 3.4rem);
  font-weight: 300;
  line-height: 1.1;
  letter-spacing: -.035em;
}
.hero .lede { max-width: 62ch; font-size: 1.04rem; line-height: 1.7; }
.cta { display: flex; flex-wrap: wrap; gap: .75rem 1.75rem; align-items: center; margin: 2rem 0 1.5rem; }
.cta a.button {
  padding: .6rem 1.1rem;
  font-weight: 500;
  color: var(--bg);
  background: var(--accent);
  border-radius: 4px;
  text-decoration: none;
}
.cta a.button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--fg)); }
.hero .banner { max-width: 64ch; }

/* the annotated schema */
.annotated { margin: 0; }
.annotated figcaption {
  display: grid;
  grid-template-columns: minmax(0, 44rem) minmax(16rem, 1fr);
  column-gap: 2.5rem;
}
.annotated .file {
  display: block;
  padding: .55rem 1.15rem;
  font-size: .76rem;
  color: var(--muted);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  border-radius: 4px 4px 0 0;
}
.annotated .row {
  display: grid;
  grid-template-columns: minmax(0, 44rem) minmax(16rem, 1fr);
  column-gap: 2.5rem;
}
.annotated .seg {
  margin: 0;
  padding: 0 1.15rem;
  border-radius: 0;
  transition: background-color .15s;
}
.annotated .row:first-of-type .seg { padding-top: 1rem; }
.annotated .row:last-of-type .seg { padding-bottom: 1.1rem; border-radius: 0 0 4px 4px; }
.annotated .note {
  /* size containment: a note never makes its row taller than its code,
     so the code reads as one unbroken file */
  contain: size;
  position: relative;
  margin: 0;
  padding: .1rem 0 0 1rem;
  max-width: 46ch;
  font-size: .8rem;
  line-height: 1.6;
  color: var(--muted);
  transition: color .15s;
}
.annotated .note::before {
  content: "";
  position: absolute;
  left: 0;
  top: .3rem;
  bottom: .3rem;
  border-left: 1px solid var(--line);
  transition: border-color .15s;
}
.annotated .note code { white-space: nowrap; overflow-wrap: normal; }
.annotated .row:first-of-type .note { padding-top: 1.1rem; }
.annotated .row:first-of-type .note::before { top: 1.2rem; }
/* rows whose code opens with a blank line: start the note on the code */
.annotated .row.gap .note { padding-top: calc(.84rem * 1.6 + .1rem); }
.annotated .row.gap .note::before { top: calc(.84rem * 1.6 + .2rem); }
.annotated .row:last-of-type .note::before { bottom: 1.2rem; }
.annotated .row:hover .seg { background: color-mix(in srgb, var(--panel) 94%, var(--fg)); }
.annotated .row:hover .note { color: var(--fg); }
.annotated .row:hover .note::before { border-left-color: var(--accent); }

/* what it makes */
.gets dl { display: grid; grid-template-columns: 15rem minmax(0, 54ch); margin: 1.5rem 0 0; }
.gets dt, .gets dd { padding: 1rem 0; border-top: 1px solid var(--line); }
.gets dt { font-weight: 500; padding-right: 2rem; }
.gets dd { margin: 0; color: var(--muted); }
.gets dd a code { color: var(--accent); }

/* query and answer */
.pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 1.5rem; }
.pair pre { margin-bottom: 1rem; }
.label { margin: 0 0 .4rem; font-size: .78rem; color: var(--muted); }
.ask .aside { margin: 1.5rem 0 .75rem; }

.live pre { max-width: 52rem; }

/* the CLI: a real sequence */
.steps { margin: 0; padding: 0 0 0 1.75rem; max-width: 52rem; }
.steps li { padding: 0 0 .25rem .5rem; }
.steps li::marker { color: var(--muted); font-size: .85rem; }
.steps li p { margin: 0 0 .4rem; }
.steps pre { margin-bottom: 1.4rem; }

.agents p { max-width: 64ch; }

.fit .columns { display: grid; grid-template-columns: repeat(2, minmax(0, 30rem)); gap: 2rem 3rem; margin-top: 1.5rem; }
.fit .columns > div { padding-top: 1rem; border-top: 1px solid var(--line); }
.fit p { color: var(--muted); }
.fit ul { margin: 0; padding-left: 1.2rem; }
.fit li { margin: .2rem 0; }
.fit li::marker { color: var(--muted); }

.site-foot {
  max-width: 72rem;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  border-top: 0;
}
.site-foot nav {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem 1.5rem;
  padding-top: 1.25rem;
  font-size: .85rem;
  border-top: 1px solid var(--line);
}
.site-foot p { margin: 1rem 0 0; }

@media (max-width: 62rem) {
  .annotated figcaption { display: block; }
  .annotated .row { display: block; }
  .annotated .note,
  .annotated .row:first-of-type .note,
  .annotated .row.gap .note {
    contain: none;
    max-width: none;
    padding: .7rem 1.15rem .8rem;
    font-size: .8rem;
    background: var(--bg);
    border-left: 2px solid var(--line);
  }
  .annotated .note::before { display: none; }
  .annotated .row:last-of-type .seg { border-radius: 0; }
  .annotated .row:last-of-type .note { padding-bottom: 0; }
  .annotated .row .seg + .note { margin: 0; }
  .annotated .row.gap .seg { padding-top: 0; }
  .annotated .seg { padding-bottom: .8rem; }
  .annotated .row:first-of-type .seg { padding-top: 1rem; }
  .annotated .row:not(.gap):not(:first-of-type) .seg { padding-top: .8rem; }
  .gets dl { grid-template-columns: minmax(0, 1fr); }
  .gets dt { padding-bottom: .25rem; }
  .gets dd { padding-top: 0; border-top: 0; }
  .pair { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 40rem) {
  .home-main > section { margin-bottom: 4.5rem; }
  .hero { padding-top: 3.5rem; }
  .fit .columns { grid-template-columns: minmax(0, 1fr); }
  .steps { padding-left: 1.4rem; }
}
@media (max-width: 30rem) {
  .home-main { padding: 0 1rem; }
  .site-foot { padding-left: 1rem; padding-right: 1rem; }
  .annotated { margin: 0 -1rem; }
  .annotated .file { border-radius: 0; }
  .annotated .seg { margin: 0; border-radius: 0; }
  .annotated .note { padding-left: 1rem; padding-right: 1rem; }
  .steps pre { margin-left: -2.4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .annotated .seg, .annotated .note { transition: none; }
}

/* ---------------------------------------------------------------------
   The homepage (/): centred hero, one tabbed code panel, feature cards
   whose illustrations are drawn as small pieces of product UI. */
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.front {
  --ok: #4f6b47;
  --no: #8e3b36;
  --card: color-mix(in srgb, var(--panel) 55%, var(--bg));
}
@media (prefers-color-scheme: dark) {
  .front { --ok: #a8ba93; --no: #e0a29b; }
}
.front .home-main > section { margin-bottom: 8rem; }
.centred { text-align: center; }
.centred > p, .centred > h1, .centred > h2 { margin-left: auto; margin-right: auto; }
.front .hero { padding-top: 7.5rem; }
.front .hero h1 {
  max-width: none;
  font-size: clamp(2.2rem, 1rem + 4.6vw, 4.4rem);
  letter-spacing: -.045em;
  margin-bottom: 1.5rem;
}
.front .hero .lede { max-width: 54ch; color: var(--muted); font-size: 1.05rem; }
.front .hero .cta { justify-content: center; margin-top: 2.5rem; }
.front .hero .banner { margin: 2rem auto 0; text-align: left; }
.cta a.button.quiet { color: var(--fg); background: transparent; box-shadow: inset 0 0 0 1px var(--line); }
.cta a.button.quiet:hover { background: var(--panel); }

.front h2 { font-size: clamp(1.4rem, 1rem + 1.4vw, 2rem); font-weight: 400; letter-spacing: -.03em; margin-bottom: .75rem; }
.front .sub { color: var(--muted); max-width: 60ch; }

/* the tabbed examples */
.tabs {
  max-width: 60rem;
  margin: 2.75rem auto 0;
  text-align: left;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}
.tabbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .6rem .7rem;
  border-bottom: 1px solid var(--line);
}
.tabs:not(.js) .tabbar { display: none; }
[role=tablist] { display: flex; flex-wrap: wrap; gap: .25rem; }
[role=tablist][hidden] { display: none; }
[role=tab], .copy {
  padding: .35rem .75rem;
  font-size: .82rem;
  font-weight: 400;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
}
[role=tab]:hover, .copy:hover { color: var(--fg); background: color-mix(in srgb, var(--bg) 60%, transparent); }
[role=tab][aria-selected=true] { color: var(--fg); background: var(--bg); border-color: var(--line); }
.copy { border-color: var(--line); }
.panel { padding: 1.25rem 0 1.5rem; }
.panel:focus-visible { outline-offset: -2px; }
.tabs:not(.js) .panel + .panel { border-top: 1px solid var(--line); }
.tabs .panel-name { margin: 0 0 .75rem 1.25rem; font-size: .78rem; color: var(--muted); }
.tabs.js .panel-name { display: none; }
.listing { display: grid; grid-template-columns: auto minmax(0, 1fr); min-height: 17.5rem; }
.tabs:not(.js) .listing { min-height: 0; }
.listing pre { margin: 0; padding: 0; background: none; border-radius: 0; font-size: .84rem; line-height: 1.65; }
.listing .gutter { padding: 0 1rem 0 1.25rem; text-align: right; color: color-mix(in srgb, var(--muted) 65%, transparent); user-select: none; }
.listing .code { padding-right: 1.25rem; }

/* feature cards */
.features > h2 { max-width: none; }
.features > .sub { max-width: 62ch; }
.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 3.5rem 2rem; margin-top: 3rem; }
.feature .illo {
  position: relative;
  height: 17rem;
  padding: 2rem 2rem 0;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: .82rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 78%, transparent);
  mask-image: linear-gradient(to bottom, #000 78%, transparent);
}
.feature .text { padding: 1.5rem 1.5rem 0; }
.feature .icon { width: 1.25rem; height: 1.25rem; fill: none; stroke: var(--fg); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.feature h3 { margin: .9rem 0 .5rem; font-size: 1.05rem; font-weight: 500; }
.feature .text p { margin: 0 0 1rem; color: var(--muted); max-width: 46ch; }
.feature .text a { color: var(--fg); text-decoration: none; font-size: .9rem; }
.feature .text a:hover { text-decoration: underline; }

.illo p { margin: 0; }
.chip {
  display: inline-block;
  padding: .05rem .45rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 5px;
  white-space: nowrap;
}
.chip.code { color: var(--no); }
.state {
  display: inline-block;
  padding: .05rem .5rem;
  font-size: .76rem;
  color: var(--muted);
  background: color-mix(in srgb, var(--muted) 12%, transparent);
  border-radius: 5px;
}
.state.ok { color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent); }
.state.no { color: var(--no); background: color-mix(in srgb, var(--no) 12%, transparent); }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { position: relative; display: grid; grid-template-columns: 2.1rem minmax(0, 1fr); gap: 0 1rem; padding-bottom: 1.6rem; }
.timeline li:not(:last-child)::before { content: ""; position: absolute; left: 1.05rem; top: 2.3rem; bottom: .3rem; border-left: 1px solid var(--line); }
.timeline .node { display: grid; place-items: center; width: 2.1rem; height: 2.1rem; background: var(--bg); border: 1px solid var(--line); border-radius: 7px; }
.timeline .node svg { width: 1rem; height: 1rem; fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.timeline .meta { display: flex; gap: 1rem; align-items: center; margin-bottom: .45rem; }
.timeline .when { color: var(--muted); font-size: .76rem; }
.timeline .what { color: var(--muted); line-height: 2; }

.rule-line { padding: .55rem .75rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; }
.asked { margin: 1rem 0 1.1rem !important; color: var(--muted); font-size: .76rem; }
.viewers { list-style: none; margin: 0; padding: 0; }
.viewers li { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) auto; align-items: center; gap: 1rem; padding: .55rem 0; border-top: 1px solid var(--line); }
.viewers .chip { justify-self: start; }
.viewers .rows { display: flex; gap: .3rem; }
.viewers .rows i { width: 2.4rem; height: .5rem; background: color-mix(in srgb, var(--accent) 45%, transparent); border-radius: 2px; }
.viewers .count { color: var(--muted); }

.mini-app { max-width: 22rem; margin: 0 auto; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; }
.mini-head { display: flex; justify-content: space-between; align-items: center; padding: .7rem .9rem; font-weight: 500; border-bottom: 1px solid var(--line); }
.live-pill { display: inline-flex; align-items: center; gap: .4rem; font-size: .74rem; font-weight: 400; color: var(--ok); }
.live-pill i { width: .45rem; height: .45rem; background: var(--ok); border-radius: 50%; }
.mini-list { list-style: none; margin: 0; padding: .3rem 0; }
.mini-list li { padding: .55rem .9rem; }
.mini-list li + li { border-top: 1px solid var(--line); }
.mini-list li.new { background: var(--accent-soft); }
.mini-list .by { display: block; font-size: .74rem; color: var(--muted); }

.one-file { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.one-file .tiny { margin: 0; padding: .9rem 1rem; font-size: .76rem; background: var(--bg); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.made { list-style: none; margin: 0; padding: 0; }
.made li { padding: .22rem 0; color: var(--fg); }
.made li::before { content: "\2713"; display: inline-block; width: 1.4rem; color: var(--ok); }

/* the waitlist form (landing.js) */
.wl-box { max-width: 34rem; margin: 2rem auto 0; text-align: left; }
.wl-box form { margin-bottom: 1rem; }
.wl-box form[hidden], .wl-box [hidden] { display: none; }
.wl-entry { flex-direction: column; align-items: stretch; }
.wl-entry label { font-size: .87rem; color: var(--muted); margin-top: .4rem; }
.wl-entry button { align-self: flex-start; margin-top: .75rem; }

.fit-line { padding-top: 2rem; border-top: 1px solid var(--line); }
.fit-line p { max-width: 70ch; color: var(--muted); }
.fit-line .lead { color: var(--fg); font-weight: 500; margin-right: .6ch; }

@media (max-width: 52rem) {
  .pairs { grid-template-columns: minmax(0, 1fr); }
  .front .home-main > section { margin-bottom: 5.5rem; }
}
@media (max-width: 30rem) {
  .front .hero { padding-top: 4rem; }
  .front .hero .cta { flex-direction: column; align-items: stretch; }
  .front .hero .cta a.button { text-align: center; }
  .tabs { margin-left: -1rem; margin-right: -1rem; border-radius: 0; border-left: 0; border-right: 0; }
  .listing pre { font-size: .76rem; }
  .listing .gutter { padding-left: .75rem; padding-right: .75rem; }
  .feature .illo { padding: 1.4rem 1.1rem 0; font-size: .78rem; }
  .feature .text { padding: 1.25rem .25rem 0; }
  .viewers li { grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: .6rem; }
  .viewers .rows i { width: 1.4rem; }
  .one-file { grid-template-columns: minmax(0, 1fr); }
  .one-file .made { display: none; }
}

/* the example: code on the left, what it means on the right (Instant's layout) */
.example {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 4fr);
  gap: 3.5rem;
  align-items: center;
}
.example .tabs { margin: 0; max-width: none; }
.example .listing { min-height: 31rem; }
.example-text h2 { margin-top: 0; }
.example-text p { color: var(--muted); max-width: 46ch; }
.example-text code { color: var(--fg); }
@media (max-width: 62rem) {
  .example { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .example-text { order: -1; }
  .example .listing { min-height: 0; }
}
