/* ============================================================
   product.css — Tentanote's and Tentabase's pages, on top of tokens.css,
   page.css and family.css. A short scroll: a bar with the product's name,
   a hero that shows the thing working, a few sections, and the way in.
   Each page's colour is family.css's --accent, set on <html>, with
   --accent-fill and --on-accent where a filled control needs a deeper
   shade, or dark words, to be read.
   ============================================================ */

/* page.css centres one column in the window; these pages scroll instead.
   place-items too: browsers now apply justify-items to block layout, so the
   centring left behind shrank the footer to its words. */
.product body {
  display: block;
  place-items: normal;
  min-height: 0;
  padding: 0;
}

.product main,
.product .bar,
.product .foot { position: relative; z-index: 1; }

/* The field fades as the page scrolls (product.js sets --fade): full behind
   the hero, a trace behind the sections. The far copy keeps its own dimness. */
.product .field { opacity: var(--fade, 1); }
.product .field.far { opacity: calc(0.75 * var(--fade, 1)); }
.product .depth { opacity: calc(0.4 + 0.6 * var(--fade, 1)); }

/* page.css's main is a 34rem centred column; here it is the whole page. */
.product main { max-width: none; text-align: left; }

.wrap { width: min(72rem, 100% - 48px); margin-inline: auto; }

/* ---- the bar ------------------------------------------------------- */

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 76px;
}

/* The bar's links drop page.css's underline — but not the button's padding. */
.bar a { border: 0; }
.bar a:not(.pill) { padding: 0; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-default);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.brand:hover { color: var(--text-default); }
.brand img { width: 30px; height: 30px; border-radius: 22.37%; }

.nav { display: flex; align-items: center; gap: 22px; font-size: 0.875rem; }
.nav a { color: var(--text-muted); }
.nav a:hover { color: var(--text-default); }

/* The one filled control in the bar. */
.pill {
  display: inline-flex;
  align-items: center;
  height: 34px;
  padding: 0 16px;
  border-radius: var(--radius-full);
  white-space: nowrap;
  background: rgb(var(--accent-fill, var(--accent)));
  color: rgb(var(--on-accent, 255 255 255)) !important;
  font-weight: 600;
  font-size: 0.875rem;
  transition: filter 160ms ease, transform 160ms ease;
}

.pill:hover { filter: brightness(1.12); }

/* ---- the hero ------------------------------------------------------ */

.hero {
  padding: clamp(40px, 9vh, 96px) 0 0;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin: 0 0 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgb(var(--accent));
}

.hero h1 {
  margin: 0 auto;
  max-width: 19ch;
  font-size: clamp(2.6rem, 6.4vw, 4.75rem);
  line-height: 1.02;
  letter-spacing: -0.035em;
  font-weight: 650;
  text-wrap: balance;
}

.hero .lede {
  margin: 24px auto 0;
  max-width: 36rem;
  font-size: clamp(1.0625rem, 1.9vw, 1.25rem);
}

.hero .waitlist { margin-top: 30px; }
.hero .note { margin: 14px 0 0; font-size: 0.8125rem; color: var(--text-faint); }

/* The app itself, in a window: the film, or its poster where there is no
   film. A light in the page's colour spills out from behind it. */
.stage {
  position: relative;
  margin: clamp(48px, 8vh, 80px) auto 0;
  max-width: 64rem;
}

.stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 8% 6% -4%;
  background: radial-gradient(closest-side, rgb(var(--accent) / 0.28), transparent);
  filter: blur(40px);
}

.window {
  overflow: hidden;
  padding: 0;
  border-radius: 16px;
}

.window video,
.window img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0b0b0b;
}

/* Tentabase's live catalogue (catalogue.js): the canvas fills the window,
   the tally runs along its foot. */
.catalogue { position: relative; }
.catalogue canvas { display: block; width: 100%; aspect-ratio: 16 / 10; }

.tally {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 12px;
  margin: 0;
  font-size: 0.75rem;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
  text-align: left;
}

@media (max-width: 760px) {
  .catalogue canvas { aspect-ratio: 4 / 5; }
}

.caption {
  margin: 14px 0 0;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

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

.section { padding: clamp(80px, 14vh, 140px) 0 0; }

.section h2,
.closing h2 {
  margin: 0;
  max-width: 22ch;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 650;
  text-wrap: balance;
}

.section > .wrap > p,
.section .intro,
.closing .intro {
  margin: 18px 0 0;
  max-width: 38rem;
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Steps: numbered glass cards, a picture over each where there is one. */
.steps {
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 16px;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.steps img,
.steps canvas.art {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top left;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.steps .text { padding: 22px 22px 24px; }

.steps h3 {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.steps h3::before {
  content: counter(step, decimal-leading-zero);
  display: block;
  margin-bottom: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: rgb(var(--accent));
}

.steps p {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

/* Episodes: a glass card each, the video on top on its poster with one play
   button (product.js, playOnPress), its name, length and line below. */
.episodes {
  margin: 44px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.episodes li {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.episodes .screen {
  position: relative;
  border-bottom: 1px solid rgb(255 255 255 / 0.06);
}

.episodes video {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: #0b0b0b;
}

.episodes .play {
  position: absolute;
  inset: 0;
  width: 100%;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.episodes .play[hidden] { display: none; }

/* The button's face, in the corner so the poster stays seen: a pill in the
   page's colour with a triangle, "Play" and the length. The whole poster is
   the button. */
.episodes .face {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px 0 14px;
  border-radius: var(--radius-full);
  background: rgb(var(--accent-fill, var(--accent)) / 0.94);
  color: #fff;
  font-size: 0.9375rem;
  font-weight: 600;
  box-shadow: 0 0 0 1px rgb(255 255 255 / 0.25) inset, 0 10px 30px rgb(0 0 0 / 0.5), 0 0 40px rgb(var(--accent) / 0.35);
  transition: filter 160ms ease, transform 160ms ease;
}

.episodes .face::before {
  content: "";
  width: 14px;
  height: 16px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 16'%3E%3Cpath d='M1 1.7v12.6a1 1 0 0 0 1.5.9l10.4-6.3a1 1 0 0 0 0-1.8L2.5.8A1 1 0 0 0 1 1.7z' fill='white'/%3E%3C/svg%3E") center / contain no-repeat;
}

.episodes .face .t { font-weight: 500; opacity: 0.75; font-variant-numeric: tabular-nums; }

.episodes .play:hover .face,
.episodes .play:focus-visible .face { filter: brightness(1.12); transform: translateY(-1px); }
.episodes .play:focus-visible { outline: 2px solid rgb(var(--accent)); outline-offset: -2px; }

.episodes .text { padding: 20px 22px 24px; }

.episodes h3 {
  margin: 0;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
}

.episodes .length {
  margin-left: 8px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-faint);
  font-variant-numeric: tabular-nums;
}

.episodes .more { margin-top: 12px; font-size: 0.875rem; }

/* With the script, the length is on the button instead. */
.js .episodes h3 .length { display: none; }

.episodes p {
  margin: 8px 0 0;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
  text-wrap: pretty;
}

@media (prefers-reduced-motion: reduce) {
  .episodes .face { transition: none; }
}

/* A statement and its argument side by side; stacked on a phone. */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: start;
}

.split .argument {
  padding: clamp(24px, 3vw, 36px);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--text-muted);
}

.split .argument p { margin: 0; text-wrap: pretty; }
.split .argument p + p { margin-top: 14px; }
.split .argument strong { color: var(--text-default); font-weight: 600; }

.more {
  display: inline-flex;
  gap: 6px;
  margin-top: 20px;
  border: 0;
  padding: 0;
  font-weight: 600;
  font-size: 0.9375rem;
  color: rgb(var(--accent));
}

.more::after { content: "→"; transition: translate 160ms ease; }
.more:hover { color: rgb(var(--accent)); }
.more:hover::after { translate: 3px 0; }

/* Promises: a check in the page's colour beside each. */
.promises {
  margin: 36px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.promises li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  padding: 20px 22px;
  border-radius: 18px;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.promises li::before {
  content: "";
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-7' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")
      center / 100% no-repeat,
    rgb(var(--accent));
}

.promises strong { display: block; color: var(--text-default); font-weight: 600; }

/* The way in, again, at the foot. */
.closing {
  padding: clamp(96px, 16vh, 160px) 0 0;
  text-align: center;
}

.closing h2 { margin-inline: auto; }
.closing .intro { margin-inline: auto; }
.closing .pill { height: 44px; padding: 0 22px; margin-top: 28px; font-size: 1rem; }

/* ---- the foot ------------------------------------------------------ */

/* page.css centres every footer; this one is a full-width row. */
.foot {
  display: block;
  margin-top: clamp(96px, 14vh, 140px);
  padding: 28px 0 36px;
  border-top: 1px solid rgb(255 255 255 / 0.06);
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.8125rem;
  color: var(--text-faint);
}

.foot nav { display: flex; flex-wrap: wrap; gap: 20px; }
.foot a { border: 0; padding: 0; color: var(--text-muted); }
.foot a:hover { color: var(--text-default); }

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

.hero > * { animation: rise 800ms cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.hero > :nth-child(2) { animation-delay: 60ms; }
.hero > :nth-child(3) { animation-delay: 120ms; }
.hero > :nth-child(4) { animation-delay: 180ms; }
.hero > :nth-child(5) { animation-delay: 260ms; }

/* Sections come up as they scroll in (product.js adds .in). Without the
   script, or with reduced motion, they are simply there. */
.js .reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 700ms ease, transform 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .pill, .more::after { transition: none; }
}

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

/* On a phone the hero's words fill the first screen, so the field cannot sit
   behind them at full strength the way it can beside them on a wide window.
   datapoints.js drops its centre below the words (narrowAt); here it is
   dimmed, the front plane — the largest, blurriest dots, the ones that
   smudged the words — is left out, and a soft shade sits behind the copy. */
@media (max-width: 760px) {
  .product .field { opacity: calc(0.8 * var(--fade, 1)); }
  .product .field.far { opacity: calc(0.5 * var(--fade, 1)); }
  .product .field.glow { display: none; }
  .hero { position: relative; }
  .hero::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -40px -24px 0;
    pointer-events: none;
    background: radial-gradient(75% 60% at 50% 42%, rgb(17 17 17 / 0.72), rgb(17 17 17 / 0.4) 65%, transparent 100%);
  }
  .hero .lede { color: var(--text-default); }
}

@media (max-width: 760px) {
  .split,
  .promises,
  .episodes { grid-template-columns: 1fr; }
  .episodes .face { left: 12px; bottom: 12px; height: 34px; padding: 0 13px 0 12px; font-size: 0.875rem; }
  .episodes .face::before { width: 12px; height: 14px; }
  .nav .hide-narrow { display: none; }
  .window { border-radius: 12px; }
}
