/* BABEL ON landing page. Black and white. The chromatic glow is the only color. */

:root {
  --bg: #000000;
  --fg: #ffffff;
  --dim: #8a8a8a;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.28);
  --rainbow: conic-gradient(from 0deg, #ff2e54, #ff9400, #ffd60a, #30d159, #63d1ff, #0a85ff, #bf59f2, #ff2e54);
  --head: "Barlow Condensed", "Oswald", "Arial Narrow", sans-serif;
  --body: "Inter", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --gutter: clamp(16px, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  font-size: clamp(16px, 0.5vw + 9.5px, 21px);
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

main { overflow-x: clip; }

h1, h2, h3, p, ul, dl, dd, figure, pre { margin: 0; }
ul { padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }

.wrap {
  width: 100%;
  max-width: calc(70rem + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: 16px; top: -4rem; z-index: 10;
  padding: 0.5rem 0.9rem; background: var(--fg); color: var(--bg);
  font: 600 0.9rem/1 var(--head); letter-spacing: 0.14em; text-transform: uppercase; text-decoration: none;
}
.skip:focus { top: 16px; }

/* ---------- type ---------- */

h1, h2, h3, .hero__tag, .btn, .idx, .top__link, .ctl {
  font-family: var(--head);
  text-transform: uppercase;
}

h1 {
  font-weight: 700;
  font-size: clamp(3.4rem, 14vw, 9rem);
  line-height: 0.92;
  letter-spacing: 0.16em;
  margin-right: -0.16em;
}

h2 {
  font-weight: 600;
  font-size: clamp(2rem, 5.4vw, 3.5rem);
  line-height: 1.02;
  letter-spacing: 0.07em;
}

h3 {
  font-weight: 600;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: 0.14em;
}

/* ---------- top bar ---------- */

.top { position: absolute; inset: 0 0 auto 0; z-index: 5; }
.top__in { display: flex; align-items: center; justify-content: flex-end; gap: 2.25rem; height: 4.25rem; }
.top__link {
  font-weight: 600; font-size: 0.95rem; letter-spacing: 0.22em; text-decoration: none;
  padding: 0.6rem 0; border-bottom: 1px solid transparent;
}
.top__link:hover { border-bottom-color: var(--fg); }

/* ---------- buttons and links ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 3.25rem; padding: 0 2rem;
  background: var(--fg); color: var(--bg);
  border: 1px solid var(--fg); border-radius: 999px;
  position: relative; isolation: isolate;
  font-weight: 700; font-size: 1.05rem; letter-spacing: 0.2em; text-decoration: none;
  transition: background-color 0.18s, color 0.18s;
}
.btn:hover { background: var(--bg); color: var(--fg); }

/* the buy button: a white pill with the chromatic glow behind it */
.btn--buy { min-height: 3.5rem; padding: 0; border: 0; background: transparent; color: var(--bg); font-size: 1.12rem; transition: transform 0.18s; }
.btn--buy::before, .btn--buy::after {
  content: ""; position: absolute; z-index: 0; border-radius: inherit;
  background: conic-gradient(from 40deg, #ff2e54, #ff9400, #ffd60a, #30d159, #63d1ff, #0a85ff, #bf59f2, #ff2e54);
}
.btn--buy::before { inset: 0; }
.btn--buy::after { inset: -3px; filter: blur(13px); opacity: 0.6; transition: opacity 0.18s, inset 0.18s; }
.btn__in { position: relative; z-index: 1; display: inline-flex; align-items: center; margin: 2px; min-height: calc(3.5rem - 4px); padding: 0 2.3rem; border-radius: inherit; background: var(--fg); color: var(--bg); }
.btn--buy:hover { background: transparent; color: var(--bg); transform: translateY(-1px); }
.btn--buy:hover::after { opacity: 1; inset: -7px; }
@media (prefers-reduced-motion: reduce) { .btn--buy, .btn--buy::after { transition: none; } .btn--buy:hover { transform: none; } }
.btn--ghost { background: transparent; color: var(--fg); border-color: var(--line-strong); }
.btn--ghost:hover { border-color: var(--fg); }
.btn--off { background: transparent; color: var(--dim); border-color: var(--line-strong); border-style: dashed; cursor: default; }
.btn--off:hover { background: transparent; color: var(--dim); }
.btn__price { margin-left: 0.7em; padding-left: 0.7em; border-left: 1px solid currentColor; letter-spacing: 0.06em; }

/* the buy block in "Get it" */
.buy__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.5rem 1.25rem; }
.buy__num { font-family: var(--head); font-weight: 700; font-size: clamp(4rem, 9vw, 6.5rem); line-height: 0.9; letter-spacing: 0.04em; }
.buy__was { color: var(--dim); font-family: var(--head); font-weight: 600; font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: 0.04em; text-decoration-thickness: 2px; }
.buy__note { color: var(--dim); flex-basis: 100%; }
.buy__note strong { color: var(--fg); font-weight: 500; }
.hero__price { margin-top: 1.1rem; color: var(--dim); font-size: 0.9rem; }
.buy__list { margin: 1.75rem 0 2rem; }
.buy__list li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 0.98rem; }
.buy__list li:first-child { border-top: 1px solid var(--line); }

/* the GitHub star count inside a link or a button (main.js fills it) */
.stars { margin-left: 0.7em; letter-spacing: 0.08em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stars__icon { color: #e3b341; } /* GitHub star gold: the one colour outside the glow */
.stars__n:not(:empty) { margin-left: 0.45em; }

.quiet {
  color: var(--dim); font-size: 0.95rem; text-decoration: none;
  padding: 0.6rem 0.2rem; border-bottom: 1px solid transparent;
  transition: color 0.18s;
}
.quiet:hover { color: var(--fg); border-bottom-color: var(--line-strong); }

.ctl {
  appearance: none; background: none; color: var(--fg); cursor: pointer;
  min-width: 5.2rem; min-height: 2.1rem; padding: 0 0.9rem;
  border: 1px solid var(--line-strong); border-radius: 2px;
  font-weight: 600; font-size: 0.85rem; letter-spacing: 0.2em;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s;
}
.ctl:hover:not(:disabled) { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.ctl:disabled { color: var(--dim); cursor: default; }

/* ---------- the chromatic glow ---------- */
/* A black panel sits on three rainbow layers: a sharp 2 px core, a soft band and a wide band.
   Only transform and opacity change. main.js turns the <b> elements and grows the wide band. */

.glowbox { position: relative; --r: 1.5rem; }
.glowbox__panel { position: relative; z-index: 1; display: block; background: var(--bg); border-radius: var(--r); }

.glow { position: absolute; inset: 0; z-index: 0; display: block; pointer-events: none; transition: opacity 0.7s ease; }
.glow.is-off { opacity: 0; }

.glow__l {
  position: absolute; display: block;
  inset: calc(var(--s) * -1);
  border-radius: calc(var(--r) + var(--s));
  overflow: hidden; isolation: isolate;
  container-type: size;
}
.glow__l b {
  position: absolute; left: 50%; top: 50%; display: block;
  width: 150cqmax; height: 150cqmax; margin: -75cqmax 0 0 -75cqmax;
  background: var(--rainbow);
  will-change: transform;
}
.glow__l--core { --s: 2px; }
.glow__l--soft { --s: 5px; filter: blur(7px); }
.glow__l--wide { --s: 12px; filter: blur(22px); opacity: 0.5; will-change: transform, opacity; }

.glow--mini .glow__l--core { --s: 1.5px; }
.glow--mini .glow__l--soft { --s: 2px; filter: blur(3px); }
.glow--mini .glow__l--wide { --s: 4px; filter: blur(7px); }

/* ---------- 1. hero ---------- */

.hero { position: relative; isolation: isolate; min-height: 100svh; display: grid; align-items: center; padding: 6.5rem 0 4rem; }
.hero__in { display: flex; flex-direction: column; align-items: center; text-align: center; }

.hero__mark {
  /* a square plate with the corner radius of an iOS app icon */
  --w: min(clamp(11rem, 26vw, 17rem), 32svh);
  --r: calc(var(--w) * 0.2237);
  width: var(--w);
  margin-bottom: clamp(2.75rem, 7svh, 4.5rem);
}
.hero__mark .glowbox__panel { aspect-ratio: 1; }
.hero__mark img { position: absolute; inset: 13%; width: 74%; height: 74%; max-width: none; object-fit: contain; }

.hero__tag { margin-top: 1.1rem; font-weight: 500; font-size: clamp(1.05rem, 2.1vw, 1.5rem); line-height: 1.5; letter-spacing: 0.26em; margin-right: -0.26em; }
.hero__tag span { white-space: nowrap; }
.hero__sub { max-width: 34rem; margin-top: 1.4rem; color: var(--dim); font-size: 1.125rem; }
.hero__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.75rem 1rem; margin-top: 2.25rem; }
.hero__spec {
  margin-top: 3rem; color: var(--dim);
  font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase;
}
.hero__spec span { margin: 0 0.6em; opacity: 0.5; }

/* ---------- sections ---------- */

.section {
  padding: clamp(4.5rem, 11vw, 9rem) 0; border-top: 1px solid var(--line);
  background: linear-gradient(180deg, #0b0b0b, #000 30rem);
}

.head { max-width: 46rem; margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.head p { margin-top: 1.1rem; color: var(--dim); max-width: 36rem; }
.idx { display: block; margin-bottom: 1.1rem; color: var(--dim); font: 500 0.78rem/1 var(--mono); letter-spacing: 0.2em; }

/* ---------- 2. demo ---------- */

.demo { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.demo__win { --r: 0.75rem; }

.win { border: 1px solid var(--line-strong); background: linear-gradient(180deg, #121212, #050505 45%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.1); }
.win__bar { display: flex; align-items: center; height: 2.6rem; padding: 0 1rem; border-bottom: 1px solid var(--line); }
.win__dots { display: flex; gap: 0.45rem; }
.win__dots i { width: 0.62rem; height: 0.62rem; border: 1px solid var(--line-strong); border-radius: 50%; }
.win__title { flex: 1; margin-right: 2.9rem; text-align: center; color: var(--dim); font-size: 0.8rem; }

.field {
  display: grid; align-content: start;
  min-height: 11.5rem; padding: 1.5rem 1.4rem;
  font-family: var(--mono); font-size: clamp(0.95rem, 2.3vw, 1.2rem); line-height: 1.7;
}
.field > p { grid-area: 1 / 1; }
.field__raw { color: var(--dim); }
.field__raw .w { transition: opacity 0.35s, color 0.25s; }
.field__raw .w.del { text-decoration: line-through; text-decoration-thickness: 1.5px; text-decoration-color: var(--fg); }
.field__raw .w.gone { opacity: 0; }
.field__raw.is-out { opacity: 0; transition: opacity 0.3s; }
.field__clean { color: var(--fg); opacity: 0; transition: opacity 0.45s; }
.field__clean.is-in { opacity: 1; }

.caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 3px; vertical-align: -0.2em; background: var(--fg); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

.win__foot { display: flex; align-items: center; justify-content: space-between; min-height: 3.4rem; padding: 0 1rem 0 1.4rem; border-top: 1px solid var(--line); }
.status { color: var(--dim); font: 500 0.72rem/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.status::before { content: ""; display: inline-block; width: 0.45rem; height: 0.45rem; margin-right: 0.7rem; border: 1px solid var(--dim); border-radius: 50%; }
.status.is-live { color: var(--fg); }
.status.is-live::before { background: var(--fg); border-color: var(--fg); }

.facts li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 0.98rem; }
.facts li:first-child { border-top: 1px solid var(--line); }

/* ---------- 3. shapes ---------- */

.spoken { margin-bottom: 2rem; padding-left: 1.25rem; border-left: 1px solid var(--line-strong); max-width: 52rem; }
.spoken figcaption { margin-bottom: 0.5rem; color: var(--dim); font: 500 0.72rem/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
.spoken p { color: var(--dim); font-family: var(--mono); font-size: 0.95rem; }

.shapes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.shape { display: flex; flex-direction: column; min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); background: linear-gradient(180deg, #0e0e0e, #040404); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.shape__for { margin-top: 0.25rem; color: var(--dim); font-size: 0.85rem; }
.shape__said { margin-top: 0.6rem; color: var(--dim); font-family: var(--mono); font-size: 0.9rem; }
.shape__out { flex: 1; margin: 1.25rem 0; padding: 1.1rem 1.2rem; background: #000; box-shadow: inset 0 0.4rem 1rem rgba(0, 0, 0, 0.8); border: 1px solid var(--line); border-radius: 2px; font-size: 0.98rem; }
.shape__out p + p { margin-top: 1em; }
.shape__out--tight p + p { margin-top: 0; }
.shape__out--term { flex: 0 1 auto; overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; }
.shape__out--term p { white-space: nowrap; }
.shape__out--term .sign { color: var(--dim); margin-right: 0.4em; }
.shape__rule { color: var(--dim); font-size: 0.9rem; }

/* ---------- 4. private ---------- */

.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(2rem, 5vw, 4rem); }
.ico { width: 3rem; height: 3rem; margin-bottom: 1.4rem; fill: none; stroke: var(--fg); stroke-width: 1.25; stroke-linecap: round; stroke-linejoin: round; }
.trio__item p { margin-top: 0.7rem; color: var(--dim); font-size: 0.98rem; }

/* ---------- 5. inside ---------- */

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); }
.cell { min-width: 0; padding: clamp(1.25rem, 3vw, 2rem); background: linear-gradient(180deg, #0e0e0e, #040404); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06); }
.cell--wide { grid-column: 1 / -1; }
.cell > p { margin-top: 0.7rem; color: var(--dim); font-size: 0.98rem; max-width: 36rem; }

.inds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(1rem, 3vw, 2.5rem); margin-top: 2rem; }
.inds li { color: var(--dim); font: 500 0.72rem/1.4 var(--mono); letter-spacing: 0.14em; text-transform: uppercase; }
.inds li > span { display: block; margin-top: 1rem; }

/* a small drawing of a Mac screen */
.scr { background: #000; position: relative; aspect-ratio: 16 / 10; border: 1px solid var(--line-strong); border-radius: 0.4rem; overflow: hidden; }

.pill { position: absolute; left: 50%; bottom: 14%; display: flex; align-items: center; gap: 3px; height: 1.3rem; padding: 0 0.5rem; margin-left: -1.9rem; width: 3.8rem; justify-content: center; border: 1px solid var(--fg); border-radius: 1rem; }
.pill i, .wave i { display: block; width: 2px; background: var(--fg); border-radius: 1px; transform-origin: center; animation: bar 1.1s ease-in-out infinite; }
.pill i { height: 0.7rem; }
.wave i { height: 0.7rem; }
.pill i:nth-child(2n), .wave i:nth-child(2n) { animation-delay: -0.35s; }
.pill i:nth-child(3n), .wave i:nth-child(3n) { animation-delay: -0.7s; }
.wave i:nth-child(5n) { animation-delay: -0.5s; }
@keyframes bar { 0%, 100% { transform: scaleY(0.3); } 50% { transform: scaleY(1); } }

.mbar { position: absolute; inset: 0 0 auto 0; height: 19%; min-height: 1.1rem; display: flex; align-items: center; justify-content: flex-end; padding-right: 12%; border-bottom: 1px solid var(--line-strong); }
.wave { display: flex; align-items: center; gap: 3px; }

.dock { position: absolute; left: 22%; right: 22%; bottom: 13%; height: 20%; --r: 0.3rem; }
.dock__in { height: 100%; display: flex; align-items: center; justify-content: center; gap: 8%; border: 1px solid var(--line); }
.dock__in i { width: 11%; aspect-ratio: 1; border: 1px solid var(--line-strong); border-radius: 22%; }

.scr--edge { overflow: visible; border-color: transparent; --r: 0.4rem; }
.scr__in { position: absolute; inset: 0; }

/* ---------- 6. models ---------- */

.credits { border-top: 1px solid var(--line); }
.credit { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 1.5rem; padding: 2rem 0; border-bottom: 1px solid var(--line); }
.credit dt { font: 600 1.25rem/1.4 var(--head); letter-spacing: 0.14em; text-transform: uppercase; }
.credit dd p:first-child { font-size: 1.125rem; }
.links { display: flex; flex-wrap: wrap; gap: 0.4rem 2rem; margin-top: 0.8rem; }
.links a { color: var(--dim); font-size: 0.95rem; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 0.3em; transition: color 0.18s; }
.links a:hover { color: var(--fg); text-decoration-color: var(--fg); }

/* ---------- 7. get it ---------- */

.get { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(2.5rem, 6vw, 5rem); }
.needs ul { margin-top: 1.1rem; }
.needs li { padding: 0.85rem 0; border-bottom: 1px solid var(--line); color: var(--dim); font-size: 0.98rem; }
.needs li:first-child { border-top: 1px solid var(--line); }

.code { border: 1px solid var(--line-strong); border-radius: 2px; background: linear-gradient(180deg, #101010, #030303 4rem); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 2rem 3rem rgba(0, 0, 0, 0.8); }
.code__bar { display: flex; align-items: center; justify-content: space-between; min-height: 3rem; padding: 0 0.6rem 0 1.2rem; border-bottom: 1px solid var(--line); color: var(--dim); font: 500 0.72rem/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; }
pre { padding: 1.3rem 1.2rem; overflow-x: auto; font-family: var(--mono); font-size: 0.88rem; line-height: 1.9; }
code { font-family: inherit; }
.build__note { margin: 1.5rem 0 2rem; color: var(--dim); }

/* ---------- 8. footer ---------- */

.foot { border-top: 1px solid var(--line); padding: 2.25rem 0; color: var(--dim); font-size: 0.9rem; }
.foot__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 2rem; }
.foot a { text-underline-offset: 0.3em; }
.foot a:hover { color: var(--fg); }

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  .demo, .get { grid-template-columns: minmax(0, 1fr); }
  .trio { grid-template-columns: minmax(0, 1fr); }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .credit { grid-template-columns: minmax(0, 1fr); gap: 0.6rem; }
}
@media (max-width: 680px) {
  .shapes { grid-template-columns: minmax(0, 1fr); }
  .inds { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 1.75rem; }
  .field { min-height: 13.5rem; padding: 1.2rem 1rem; }
  .win__foot { padding-left: 1rem; }
  .hero__spec span { margin: 0 0.3em; }
}

/* ---------- reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
