/* Public page. The product's own palette and type; the page itself is a quiet sheet of paper,
   and the only moving thing on it is the demo slide. Slide marks come from slide.css. */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 18px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--cobalt); outline-offset: 3px; }

.top, main, .foot {
  width: min(100% - 32px, 1040px);
  margin-inline: auto;
}

/* Header */

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 0;
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.wordmark img { display: block; }

/* One button style for every call to action on the page */

.cta {
  display: inline-block;
  padding: 12px 22px;
  border: 1px solid var(--cobalt);
  border-radius: 6px;
  background: var(--cobalt);
  color: #fff;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.cta:hover { background: color-mix(in srgb, var(--cobalt) 86%, black); }
.cta:disabled { opacity: 0.6; cursor: default; }
.cta-small { padding: 8px 14px; font-size: 15px; }
/* The header's copy of the button stays quiet: one loud thing in the first screen. */
.cta-ghost { background: transparent; color: var(--cobalt); }
.cta-ghost:hover { background: color-mix(in srgb, var(--cobalt) 10%, transparent); }

.more { color: var(--mute); text-underline-offset: 3px; }
.more:hover { color: var(--ink); }

/* Hero: the claim and the author's own 53 seconds side by side, the demo under both */

.hero {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  grid-template-areas: "text text" "circle demo";
  align-items: start;
  column-gap: 40px;
  padding-top: 28px;
}

.hero-text { grid-area: text; }

h1 {
  max-width: 24ch;
  margin: 0 0 18px;
  font-family: var(--display);
  font-size: clamp(34px, 4.4vw, 56px);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.03em;
  text-wrap: balance;
}

.lead {
  max-width: 56ch;
  margin: 0 0 22px;
  font-size: clamp(17px, 1.4vw, 20px);
  line-height: 1.45;
}

.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin: 0; }

/* The circle: a Telegram-style video note; plays silently, a tap turns the sound on */

.circle {
  grid-area: circle;
  margin: 40px 0 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  width: 250px;
}

.circle-button {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  padding: 0;
  border: 4px solid var(--paper);
  border-radius: 50%;
  background: var(--line);
  /* A cobalt ring, as Telegram marks a fresh circle, and a soft shadow that lifts it off the page */
  box-shadow: 0 0 0 3px var(--cobalt), 0 18px 36px -14px rgba(14, 26, 58, 0.45);
  overflow: hidden;
  cursor: pointer;
}

.circle-button:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--cobalt), 0 0 0 7px color-mix(in srgb, var(--cobalt) 30%, transparent); }

.circle-button video { display: block; width: 100%; height: 100%; object-fit: cover; }

.circle-sound {
  position: absolute;
  left: 50%;
  bottom: 10%;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(14, 26, 58, 0.72);
  transform: translateX(-50%);
  transition: opacity 0.2s;
}

.circle-sound svg { width: 24px; height: 24px; fill: #fff; }
.circle-sound .sound-on, .circle.sound .circle-sound .sound-off { display: none; }
.circle.sound .circle-sound .sound-on { display: block; }
.circle.sound .circle-sound { opacity: 0; }
.circle.sound .circle-button:hover .circle-sound { opacity: 1; }

.circle figcaption { color: var(--mute); font-size: 14px; text-align: center; max-width: 26ch; }

/* The demo: a 16:9 sheet with the real slide inside, and the speech tape under it */

.demo { grid-area: demo; margin: 40px 0 0; }

.sheet {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: 8px;
  background: #fff;
  /* A sheet lying on the paper: a hairline edge and a shadow that falls down and away */
  box-shadow: 0 1px 2px rgba(14, 26, 58, 0.06), 0 24px 48px -24px rgba(14, 26, 58, 0.35);
  container-type: inline-size;
  overflow: hidden;
}

:root[data-theme="dark"] .sheet { background: color-mix(in srgb, var(--paper) 70%, black); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 24px 48px -24px rgba(0, 0, 0, 0.7); }

.slide[hidden] { display: none; }

.demo .slide-foot .slide-legend { color: var(--mute); }

/* The author's mark signs the demo slide the way a source line does on a real one */
.slide-brand { display: inline-block; margin-right: 1cqw; vertical-align: -0.9cqw; }
.slide-brand img { display: inline-block; height: 3.2cqw; width: auto; }
.slide-brand .brand-dark, :root[data-theme="dark"] .slide-brand .brand-light { display: none; }
:root[data-theme="dark"] .slide-brand .brand-dark { display: inline-block; }

.tape {
  display: flex;
  justify-content: flex-end;
  min-height: 1.5em;
  margin: 12px 4px 0;
  overflow: hidden;
  color: var(--mute);
  font-size: clamp(15px, 1.4vw, 19px);
  white-space: pre;
  /* The start of the tape runs off to the left on purpose; fade it so it does not look cut. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 18%);
  mask-image: linear-gradient(90deg, transparent, #000 18%);
}

#demo-partial { color: var(--ink); }

.demo.live #demo-partial::after {
  content: "";
  display: inline-block;
  width: 0.45em;
  height: 0.95em;
  margin-left: 0.25em;
  background: var(--cobalt);
  vertical-align: -0.12em;
  animation: blink 1s steps(2) infinite;
}

/* How it works: three short columns, marked the way a slide marks its points */

.how {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
  margin-top: 96px;
}

.how h2 {
  position: relative;
  margin: 0 0 12px;
  padding-top: 16px;
  font-family: var(--display);
  font-size: 23px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.how h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 28px;
  height: 4px;
  background: var(--cobalt);
}

.how p { margin: 0; font-size: 17px; }

/* Early access */

.access {
  max-width: 62ch;
  margin-top: 110px;
  padding-top: 44px;
  border-top: 1px solid var(--line);
}

.access h2 {
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: clamp(30px, 3.6vw, 40px);
  font-weight: 800;
  letter-spacing: -0.02em;
}

.access > p { margin: 0 0 30px; }

form { display: grid; gap: 18px; }

.fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

label { display: grid; gap: 7px; }
label > span { font-size: 15px; color: var(--mute); }

input, textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

:root[data-theme="dark"] input, :root[data-theme="dark"] textarea { background: color-mix(in srgb, var(--paper) 80%, black); }

textarea { resize: vertical; }
input:focus, textarea:focus { outline: none; border-color: var(--cobalt); box-shadow: 0 0 0 3px color-mix(in srgb, var(--cobalt) 25%, transparent); }

.trap { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; }

.hint { margin: 0; color: var(--mute); font-size: 15px; }
.hint.error { color: var(--alarm); }

.done {
  margin: 0;
  padding: 14px 18px;
  border-left: 4px solid var(--marker);
  background: color-mix(in srgb, var(--marker) 28%, var(--paper));
}

.done[hidden] { display: none; }

/* Footer */

.foot {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 120px;
  padding: 26px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--mute);
  font-size: 15px;
}

@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 760px) {
  .hero { grid-template-columns: 1fr; grid-template-areas: "text" "circle" "demo"; padding-top: 16px; row-gap: 20px; }
  /* Small enough that the circle, its caption and the sheet share one phone screen. */
  .circle { grid-template-columns: 150px minmax(0, 1fr); align-items: center; width: 100%; margin-top: 0; gap: 16px; }
  .circle figcaption { font-size: 14px; text-align: left; max-width: none; }
  .circle-sound { width: 36px; height: 36px; }
  .circle-sound svg { width: 20px; height: 20px; }
  .demo { margin-top: 0; }
  /* The sheet is narrow here: the slide's own units would make its text unreadable. */
  .sheet { aspect-ratio: 4 / 3; }
  .sheet .slide { padding: 7cqw 7cqw 9cqw; }
  .sheet .slide-topic { font-size: 3.2cqw; margin-bottom: 2cqw; }
  .sheet .slide-title { font-size: 5.6cqw; margin-bottom: 3cqw; }
  .sheet .slide-list li { font-size: 3.9cqw; padding-left: 5cqw; margin-bottom: 1.8cqw; }
  .sheet .slide-list li::before { width: 2.8cqw; height: 0.6cqw; top: 0.5em; }
  .sheet .slide-foot { left: 7cqw; right: 7cqw; bottom: 3cqw; font-size: 2.6cqw; }
  .sheet .slide-legend { display: none; }
  /* Only the phrase being spoken fits on a phone. */
  .tape { justify-content: flex-start; white-space: normal; mask-image: none; -webkit-mask-image: none; }
  #demo-final { display: none; }
  .how { grid-template-columns: 1fr; gap: 30px; margin-top: 72px; }
  .fields { grid-template-columns: 1fr; }
  .access { margin-top: 80px; }
  .foot { flex-direction: column; margin-top: 80px; }
  .tape { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .demo.live #demo-partial::after { animation: none; }
}
#circle[hidden] { display: none; }
