/* Pronota marketing site.
 *
 * Tokens are lifted verbatim from design-language.html :root. Two brand rules
 * bind hardest here:
 *
 *  - Coral (#E05338) is reserved for the active-speaker bar and PRIMARY CALLS
 *    TO ACTION. It is never a background, never decoration. On this page that
 *    means exactly one coral element: the download button.
 *  - The wordmark is Inter Light 300 with ".ai" in Medium 500, rendered as live
 *    text so it cannot drift into another face. It takes currentColor.
 *
 * Dark mode deviates from the design doc deliberately, matching the app: the
 * doc names near-black as the page, but an indigo rail against a black page
 * reads as two unrelated surfaces, so the page is indigo.
 */

:root {
  --indigo: #1e1b4b;
  --indigo-80: #2d2966;
  --indigo-20: #eeedf8;
  --coral: #e05338;
  --coral-700: #c2451f;
  --coral-20: #fae9e5;
  --white: #ffffff;
  --off-white: #f7f7f5;
  --gray-200: #e8e8e4;
  --gray-400: #aeaaa0;
  --gray-500: #78746b;
  --gray-600: #6b6760;
  --near-black: #0f0e1a;
  --green: #15803d;

  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --page-max: 960px;

  --page-bg: var(--off-white);
  --surface: var(--white);
  --text: var(--indigo);
  --text-muted: var(--gray-600);
  --rule: var(--gray-200);
  --tint: var(--indigo-20);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --page-bg: var(--indigo);
    --surface: var(--indigo-80);
    --text: var(--off-white);
    --text-muted: var(--gray-400);
    --rule: rgba(255, 255, 255, 0.14);
    --tint: rgba(255, 255, 255, 0.06);
  }
}

:root[data-theme='dark'] {
  --page-bg: var(--indigo);
  --surface: var(--indigo-80);
  --text: var(--off-white);
  --text-muted: var(--gray-400);
  --rule: rgba(255, 255, 255, 0.14);
  --tint: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 16px;
}

/* ---------------------------------------------------------------- header --- */

header {
  border-bottom: 1px solid var(--rule);
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  /* Vertical only, for the same reason as .hero: keep the .wrap gutter. */
  padding-top: 20px;
  padding-bottom: 20px;
}

.lockup {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

/* Wordmark: 0.72 x the mark height, per the design doc's 44px mark / 32px
   wordmark pairing. Matching 1:1 overflows. */
.wordmark {
  font-weight: 300;
  font-size: 23px;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.wordmark .tld {
  font-weight: 500;
}

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

/* Top and bottom only: a padding shorthand here would zero the .wrap gutter
   and put the hero text against the screen edge on phones. */
.hero {
  padding-top: 88px;
  padding-bottom: 72px;
}

h1 {
  font-weight: 300;
  font-size: clamp(2rem, 5.2vw, 3.25rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 24px;
  max-width: 22ch;
}

h1 strong {
  font-weight: 500;
}

.lede {
  font-size: clamp(1.0625rem, 2.2vw, 1.25rem);
  color: var(--text-muted);
  max-width: 58ch;
  margin: 0 0 36px;
}

/* --------------------------------------------------------------- actions --- */

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

.btn {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 12px 22px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

/* The one coral element on the page. Reserved for exactly this. */
.btn-primary {
  background: var(--coral);
  color: var(--white);
}

.btn-primary:hover {
  background: var(--coral-700);
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--rule);
}

.btn-secondary:hover {
  border-color: var(--gray-400);
}

.btn:focus-visible {
  outline: 2px solid var(--indigo);
  outline-offset: 2px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) .btn:focus-visible {
    outline-color: var(--off-white);
  }
}

.btn svg {
  flex: none;
}

.hint {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 14px 0 0;
}

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

section {
  padding: 56px 0;
  border-top: 1px solid var(--rule);
}

h2 {
  font-weight: 500;
  font-size: 1.375rem;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
}

h3 {
  font-weight: 500;
  font-size: 1rem;
  margin: 0 0 6px;
}

p {
  margin: 0 0 16px;
}

.section-lede {
  color: var(--text-muted);
  max-width: 62ch;
  margin-bottom: 32px;
}

.grid {
  display: grid;
  gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 22px;
}

.card p {
  color: var(--text-muted);
  font-size: 0.9375rem;
  margin: 0;
}

.card .mono {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gray-500);
  display: block;
  margin-bottom: 10px;
}

/* A plain list of who this is for — no cards, it is not a feature grid. */
.who {
  margin: 0;
  padding: 0;
  list-style: none;
  max-width: 62ch;
}

.who li {
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  color: var(--text-muted);
}

.who li:last-child {
  border-bottom: 0;
}

.who strong {
  color: var(--text);
  font-weight: 500;
}

/* The licence-vs-meetings promise. Tinted, not coral — it is reassurance, not
   a call to action. */
.promise {
  background: var(--tint);
  border-radius: 12px;
  padding: 24px 26px;
  max-width: 62ch;
}

.promise p:last-child {
  margin-bottom: 0;
}

.promise .headline {
  font-weight: 500;
  color: var(--text);
}

/* ----------------------------------------------------------------- auth --- */

.signed-in {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.who-am-i {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--text);
}

.linkish {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--text-muted);
  text-decoration: underline;
  cursor: pointer;
}

.error {
  color: var(--coral-700);
  font-size: 0.875rem;
  margin: 14px 0 0;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------- footer --- */

footer {
  border-top: 1px solid var(--rule);
  padding: 32px 0 56px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a {
  color: inherit;
}

/* ========================================================= illustrations ===
 *
 * Everything below is illustration: made-up meetings and people, drawn in CSS
 * and inline SVG so it follows the theme tokens in light and dark mode.
 *
 * Coral appears in exactly one place — the transcript row being written in
 * the hero panel, i.e. the person speaking now (the active speaker). That is the brand's own reserved
 * use, so it does not compete with the coral download button. "On" and
 * "selected" states are indigo (off-white in dark mode).
 *
 * Motion uses the design doc's tokens and stops entirely under
 * prefers-reduced-motion; illustrations.js draws a still frame instead.
 */

:root {
  --ease-out: cubic-bezier(0, 0, 0.2, 1);
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --duration-fast: 150ms;
  --duration-base: 250ms;
  --duration-slow: 400ms;
  --ink: var(--indigo);
  --switch-off: var(--gray-200);
  --switch-on: var(--indigo);
  --switch-knob-on: var(--white);
  --sent: var(--green);
  --shadow: 0 1px 2px rgba(30, 27, 75, 0.06), 0 12px 32px -12px rgba(30, 27, 75, 0.18);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --ink: var(--off-white);
    --switch-off: rgba(255, 255, 255, 0.18);
    --switch-on: var(--off-white);
    --switch-knob-on: var(--indigo);
    --sent: #4ade80;
    --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
  }
}

:root[data-theme='dark'] {
  --ink: var(--off-white);
  --switch-off: rgba(255, 255, 255, 0.18);
  --switch-on: var(--off-white);
  --switch-knob-on: var(--indigo);
  --sent: #4ade80;
  --shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.45);
}

figure {
  margin: 0;
}

/* The site defaults to dark (data-theme on <html>); the light tokens above
   remain for anything that removes the attribute. */

/* Scroll reveal. Hidden only when the inline head script ran, so a page
   without JavaScript still shows everything. */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity var(--duration-slow) var(--ease-out),
    transform var(--duration-slow) var(--ease-out);
}

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

/* -------------------------------------------------------- hero art --- */

.hero-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 48px;
  align-items: center;
}

/* closest-side keeps the glow inside the box, so no edge ever shows. */
.hero-art {
  position: relative;
  height: 360px;
  background: radial-gradient(closest-side at 55% 55%, var(--tint), transparent);
  overflow: hidden;
}

/* Newest row at the bottom; older rows drift up and fade out. */
.hero-art .scroll {
  position: absolute;
  inset: 0 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 45%);
  mask-image: linear-gradient(to bottom, transparent, #000 45%);
}

.hero-art .row {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 10px;
  animation: row-in var(--duration-base) var(--ease-out);
}

/* A new speaker opens a small gap, like a paragraph break. */
.hero-art .row.turn {
  margin-top: 12px;
}

.hero-art .who {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ink);
}

.hero-art .row:not(.turn) .who {
  visibility: hidden;
}

.hero-art .pill {
  height: 10px;
  border-radius: 5px;
  background: var(--ink);
  opacity: 0.35;
  width: 0;
  transition: width 1.1s linear, background-color var(--duration-slow) var(--ease-standard),
    opacity var(--duration-slow) var(--ease-standard);
}

.hero-art .row.live .pill {
  background: var(--coral);
  opacity: 1;
}

@keyframes row-in {
  from { opacity: 0; transform: translateY(8px); }
}

@media (max-width: 860px) {
  .hero-top {
    grid-template-columns: 1fr;
  }

  .hero-art {
    display: none;
  }
}

/* --------------------------------------------------------------- pipeline --- */

.pipeline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: stretch;
}

.device {
  position: relative;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  padding: 30px 20px 20px;
}

.device-label,
.outside-label {
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.device-label {
  position: absolute;
  top: -9px;
  left: 16px;
  padding: 0 8px;
  background: var(--page-bg);
  line-height: 18px;
}

.stages {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.stage {
  position: relative;
}

.stage p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0;
}

/* Connector between stages, with a packet running along it. */
.stage:not(:last-child)::before {
  content: '';
  position: absolute;
  top: 20px;
  left: 52px;
  right: -22px;
  height: 1.5px;
  background: var(--rule);
}

.stage:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 17.75px;
  left: 52px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink);
  animation: packet 2.4s var(--ease-standard) infinite;
}

.stage:nth-child(2)::after { animation-delay: 0.6s; }
.stage:nth-child(3)::after { animation-delay: 1.2s; }

.ico {
  display: block;
  margin-bottom: 14px;
  fill: var(--ink);
}

.ico-wave rect {
  transform-box: fill-box;
  transform-origin: center;
  animation: wave 1.2s var(--ease-standard) infinite alternate;
}

.ico-wave rect:nth-child(2) { animation-delay: -0.3s; }
.ico-wave rect:nth-child(3) { animation-delay: -0.6s; }
.ico-wave rect:nth-child(4) { animation-delay: -0.9s; }
.ico-wave rect:nth-child(5) { animation-delay: -0.15s; }

.ico .trk,
.ico-check .ln {
  fill: var(--rule);
}

.ico-lanes .seg,
.ico-text .ln {
  transform-box: fill-box;
  transform-origin: left;
  animation: grow 3.6s var(--ease-out) infinite;
}

.ico-lanes .s2,
.ico-text .l2 { animation-delay: 0.5s; }
.ico-lanes .s3,
.ico-text .l3 { animation-delay: 1s; }

.ico-text .caret {
  animation: blink 0.9s steps(1) infinite;
}

.ico-check .tick {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 12;
  animation: tick 3.6s var(--ease-out) infinite;
}

.ico-check .t2 { animation-delay: 0.5s; }
.ico-check .t3 { animation-delay: 1s; }

.outside {
  width: 156px;
  border: 1.5px dashed var(--rule);
  border-radius: 12px;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  color: var(--gray-500);
}

.outside-state {
  font-size: 0.8125rem;
  line-height: 1.4;
}

@media (max-width: 760px) {
  .pipeline {
    grid-template-columns: 1fr;
  }

  .stages {
    grid-template-columns: 1fr 1fr;
  }

  .stage::before,
  .stage::after {
    display: none;
  }

  .outside {
    width: auto;
    flex-direction: row;
    flex-wrap: wrap;
    text-align: left;
    justify-content: flex-start;
    gap: 4px 12px;
  }
}

@media (max-width: 420px) {
  .stages {
    grid-template-columns: 1fr;
  }
}

/* -------------------------------------------------------------------- hub --- */

.hub {
  display: grid;
  grid-template-columns: 1fr 160px minmax(0, 1.3fr);
  align-items: center;
  margin-bottom: 32px;
}

.hub-source {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 16px 18px;
}

.hub-source svg {
  flex: none;
}

.hub-source strong {
  display: block;
  font-weight: 500;
}

.mono-sm {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
}

.wires {
  display: block;
  overflow: visible;
}

.wire path {
  stroke: var(--ink);
  stroke-width: 1.5;
  opacity: 0.5;
  transition: opacity var(--duration-base) var(--ease-standard);
}

.wire circle {
  fill: var(--ink);
}

.wire[data-on='false'] path {
  stroke-dasharray: 3 5;
  opacity: 0.3;
}

.wire[data-on='false'] circle {
  display: none;
}

.hub-targets {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-rows: repeat(3, 72px);
  gap: 12px;
}

.target {
  display: grid;
  grid-template-columns: 1fr auto;
  align-content: center;
  column-gap: 12px;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0 18px;
}

.target-name {
  font-weight: 500;
  transition: color var(--duration-base) var(--ease-standard);
}

.target-state {
  grid-row: 2;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--gray-500);
}

.target[data-on='false'] .target-name {
  color: var(--text-muted);
}

.switch {
  grid-column: 2;
  grid-row: 1 / 3;
  align-self: center;
  position: relative;
  width: 40px;
  height: 22px;
  border-radius: 11px;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: var(--switch-off);
  transition: background-color var(--duration-fast) var(--ease-standard);
}

.switch::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  transition: transform var(--duration-fast) var(--ease-standard);
}

.switch[aria-checked='true'] {
  background: var(--switch-on);
}

.switch[aria-checked='true']::after {
  background: var(--switch-knob-on);
  transform: translateX(18px);
}

.switch:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hub figcaption {
  grid-column: 1 / -1;
  margin-top: 16px;
}

@media (max-width: 760px) {
  .hub {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .wires {
    display: none;
  }

  .hub-targets {
    grid-template-rows: none;
    gap: 8px;
  }

  .target {
    padding: 12px 16px;
  }
}

/* -------------------------------------------------------------- who icons --- */

.who li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.who-ico {
  flex: none;
  margin-top: 1px;
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ----------------------------------------------------------------- ledger --- */

.leaves {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  gap: 20px;
  align-items: start;
}

.leaves .promise {
  max-width: none;
}

.ledger {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  overflow: hidden;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

.ledger-head {
  padding: 12px 16px;
  border-bottom: 1px solid var(--rule);
  color: var(--gray-500);
}

.ledger ul {
  list-style: none;
  margin: 0;
  padding: 6px 0;
}

.ledger li {
  display: grid;
  grid-template-columns: 16px 1fr auto;
  gap: 10px;
  padding: 7px 16px;
}

.ledger .val {
  color: var(--gray-500);
}

.ledger .kept {
  color: var(--text-muted);
}

.ledger .kept span:nth-child(2) {
  text-decoration: line-through;
  text-decoration-color: var(--gray-400);
}

.ledger .out .dir {
  color: var(--sent);
}

.ledger .out + .kept {
  border-top: 1px dashed var(--rule);
  margin-top: 6px;
  padding-top: 13px;
}

/* Rows land one after another once the panel scrolls in. */
.js .ledger li {
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--duration-base) var(--ease-out),
    transform var(--duration-base) var(--ease-out);
}

.js .ledger.in li {
  opacity: 1;
  transform: none;
}

.ledger.in li:nth-child(2) { transition-delay: 120ms; }
.ledger.in li:nth-child(3) { transition-delay: 240ms; }
.ledger.in li:nth-child(4) { transition-delay: 480ms; }
.ledger.in li:nth-child(5) { transition-delay: 560ms; }
.ledger.in li:nth-child(6) { transition-delay: 640ms; }
.ledger.in li:nth-child(7) { transition-delay: 720ms; }

@media (max-width: 760px) {
  .leaves {
    grid-template-columns: 1fr;
  }
}

/* ------------------------------------------------------------- keyframes --- */

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

/* Travels the gap between two stage icons: the connector is ~ column width
   minus the icon, so run to just short of the next icon. */
@keyframes packet {
  0% { left: 52px; opacity: 0; }
  15%, 85% { opacity: 1; }
  100% { left: calc(100% + 16px); opacity: 0; }
}

@keyframes wave {
  from { transform: scaleY(0.35); }
  to { transform: scaleY(1); }
}

@keyframes grow {
  0% { transform: scaleX(0); opacity: 1; }
  30%, 85% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}

@keyframes tick {
  0% { stroke-dashoffset: 12; opacity: 1; }
  25%, 85% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: 0; opacity: 0; }
}

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

  .js .reveal,
  .js .ledger li {
    opacity: 1;
    transform: none;
  }

  .stage::after,
  .wire circle {
    display: none;
  }
}
