/*
 * Canvas AI website — white page, liquid glass, one cool accent.
 * Tokens follow the app (src/renderer/src/ui/tokens.css), copied because this site has no build step.
 * One screen: the promise, the download and the commands on the left; the app itself on the right, with its mic
 * pill hearing a scripted speaker. Motion respects prefers-reduced-motion.
 */

:root {
  color-scheme: light;

  --bg: #ffffff;
  --ink: #12161c;
  --ink-2: rgb(18 22 28 / 0.64);
  --ink-3: rgb(18 22 28 / 0.44);
  --ink-4: rgb(18 22 28 / 0.2);

  /* one cool accent */
  --accent: #2f6fd6;
  --accent-hi: #4b8bef;
  --accent-ink: #ffffff;
  --accent-soft: rgb(47 111 214 / 0.1);

  /* liquid glass on white: a bright rim, a soft lens shadow, a faint cool refraction at the lower edge */
  --lg-fill: linear-gradient(180deg, rgb(255 255 255 / 0.86), rgb(255 255 255 / 0.56));
  --lg-rim: rgb(255 255 255 / 0.95);
  --lg-line: rgb(18 22 28 / 0.08);
  --lg-shadow:
    0 1px 1px rgb(15 23 42 / 0.04),
    0 6px 18px rgb(15 23 42 / 0.07),
    0 22px 48px rgb(30 60 120 / 0.07);

  /* type */
  --font-ui: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', system-ui, sans-serif;

  /* motion */
  --ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --ease-surface: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-control: 150ms;

  /* layout */
  --gutter: max(clamp(20px, 5vw, 96px), calc((100vw - 1480px) / 2));
  --space: clamp(14px, 3.2vh, 34px);
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --dur-control: 0ms;
  }
}

/* ── base ─────────────────────────────────────────────────────────────── */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 8px;
}

kbd {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 5px;
  border-radius: 6px;
  background: rgb(18 22 28 / 0.05);
  box-shadow: inset 0 -1px 0 rgb(18 22 28 / 0.08);
  color: var(--ink-2);
  font-family: var(--font-ui);
  font-size: 11.5px;
  font-weight: 500;
  line-height: 1;
}

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

.skip {
  position: absolute;
  left: 12px;
  top: -100px;
  z-index: 30;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 15px;
}

.skip:focus {
  top: 12px;
}

/* ── liquid glass ─────────────────────────────────────────────────────── */

.glass {
  position: relative;
  background: var(--lg-fill);
  box-shadow:
    inset 0 1px 0 var(--lg-rim),
    inset 0 0 0 1px rgb(255 255 255 / 0.6),
    inset 0 -10px 18px -14px rgb(47 111 214 / 0.18),
    0 0 0 0.5px var(--lg-line),
    var(--lg-shadow);
  -webkit-backdrop-filter: blur(18px) saturate(190%);
  backdrop-filter: blur(18px) saturate(190%);
}

/* The specular highlight across the top of every glass surface. */
.glass::before {
  content: '';
  position: absolute;
  inset: 1px 1px auto;
  height: 50%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.7), rgb(255 255 255 / 0));
  pointer-events: none;
}

/* ── one screen ───────────────────────────────────────────────────────── */

.page {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
}

.site-header,
.hero,
.site-footer {
  padding-inline: var(--gutter);
}

.site-header {
  padding-top: clamp(18px, 3.4vh, 32px);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.wordmark-mark {
  display: block;
  border-radius: 7px;
  box-shadow: 0 1px 3px rgb(15 23 42 / 0.12);
}

/* The copy on the left, the app on the right, both centred on the same line. */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center;
  column-gap: clamp(40px, 5vw, 96px);
  padding-block: var(--space);
}

.hero-copy {
  max-width: 580px;
}

/* Select · Ask · Learn · Resume */
.steps {
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 500;
  color: var(--ink-2);
}

.steps li {
  position: relative;
}

.steps li + li {
  margin-left: 22px;
}

.steps li + li::before {
  content: '';
  position: absolute;
  left: -13px;
  top: 50%;
  width: 4px;
  height: 4px;
  margin-top: -2px;
  border-radius: 50%;
  background: var(--accent);
  opacity: 0.55;
}

h1 {
  margin-top: var(--space);
  font-family: var(--font-display);
  font-size: clamp(34px, min(3.8vw, 6.4vh), 60px);
  font-weight: 650;
  line-height: 1.04;
  letter-spacing: -0.045em;
  text-wrap: balance;
}

.h1-second {
  display: block;
  margin-top: 0.1em;
  color: var(--ink-3);
}

.cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 18px;
  margin-top: calc(var(--space) * 1.2);
}

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 11px 24px 11px 18px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--accent-ink);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.45),
    inset 0 -2px 6px rgb(10 40 110 / 0.25),
    0 0 0 0.5px rgb(20 60 140 / 0.4),
    0 10px 26px rgb(47 111 214 / 0.32),
    0 2px 4px rgb(15 23 42 / 0.1);
  transition:
    transform var(--dur-control) var(--ease-standard),
    box-shadow var(--dur-control) var(--ease-standard);
}

/* Liquid highlight inside the button. */
.btn::before {
  content: '';
  position: absolute;
  inset: 1px 8px auto;
  height: 45%;
  border-radius: 999px;
  background: linear-gradient(180deg, rgb(255 255 255 / 0.32), rgb(255 255 255 / 0));
  pointer-events: none;
}

.btn:hover {
  transform: translateY(-1px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.45),
    inset 0 -2px 6px rgb(10 40 110 / 0.25),
    0 0 0 0.5px rgb(20 60 140 / 0.4),
    0 14px 32px rgb(47 111 214 / 0.4),
    0 2px 4px rgb(15 23 42 / 0.1);
}

.btn-icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.btn-text {
  display: flex;
  flex-direction: column;
}

.btn-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.25;
}

.btn-meta {
  font-size: 12px;
  line-height: 1.3;
  opacity: 0.85;
}

/* Shown only while <html data-release="pending">: honest about the empty Releases page. */
.release-note {
  display: none;
  max-width: 24ch;
  font-size: 12.5px;
  line-height: 1.4;
  color: var(--ink-3);
}

[data-release='pending'] .release-note {
  display: block;
}

/* ── the three commands ───────────────────────────────────────────────── */

.commands {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: calc(var(--space) * 1.3);
}

.command {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 8px 0 14px;
  border-radius: 999px;
  transition:
    box-shadow 300ms var(--ease-standard),
    transform 400ms var(--ease-surface);
}

.say {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.02em;
  transition: color 300ms var(--ease-standard);
}

.keys {
  display: inline-flex;
  gap: 3px;
}

/* The command the pill just heard lights up. */
[data-phase='heard'][data-cmd='annotate'] .command[data-cmd='annotate'],
[data-phase='heard'][data-cmd='open'] .command[data-cmd='open'],
[data-phase='heard'][data-cmd='close'] .command[data-cmd='close'] {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 var(--lg-rim),
    inset 0 0 0 1px rgb(255 255 255 / 0.6),
    inset 0 -10px 18px -12px rgb(47 111 214 / 0.35),
    0 0 0 1.5px rgb(47 111 214 / 0.55),
    0 10px 28px rgb(47 111 214 / 0.22);
}

[data-phase='heard'][data-cmd='annotate'] .command[data-cmd='annotate'] .say,
[data-phase='heard'][data-cmd='open'] .command[data-cmd='open'] .say,
[data-phase='heard'][data-cmd='close'] .command[data-cmd='close'] .say {
  color: var(--accent);
}

/* ── the app, on the right ────────────────────────────────────────────── */

.showcase {
  position: relative;
  isolation: isolate;
  justify-self: center;
  width: 100%;
  /* Never taller than the screen leaves room for (the window is 16:10.5). */
  max-width: min(880px, calc((100svh - 250px) * 16 / 10.5));
  padding-bottom: 26px;
}

/* A soft light behind the window, so its glass has something to refract. */
.showcase::before {
  content: '';
  position: absolute;
  inset: 2% -6% 4% -5%;
  z-index: -1;
  background:
    radial-gradient(45% 55% at 20% 35%, rgb(47 111 214 / 0.3), transparent 70%),
    radial-gradient(42% 50% at 84% 74%, rgb(56 178 196 / 0.26), transparent 70%),
    radial-gradient(38% 45% at 80% 16%, rgb(139 108 232 / 0.24), transparent 70%);
  filter: blur(40px);
  opacity: 0.8;
  transition: opacity 600ms var(--ease-standard);
}

[data-phase='hearing'] .showcase::before {
  opacity: 1;
}

.app-window {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 10.5;
  container-type: inline-size;
  border-radius: 22px;
  background:
    radial-gradient(70% 60% at 85% 90%, rgb(140 200 205 / 0.16), transparent 70%),
    linear-gradient(160deg, rgb(236 240 247 / 0.58), rgb(246 248 251 / 0.5));
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.95),
    inset 0 0 0 1px rgb(255 255 255 / 0.55),
    0 0 0 1px rgb(18 22 28 / 0.06),
    0 32px 80px rgb(30 60 120 / 0.18),
    0 6px 18px rgb(15 23 42 / 0.06);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  backdrop-filter: blur(30px) saturate(180%);
  transition:
    transform 800ms var(--ease-surface),
    opacity 800ms var(--ease-standard),
    box-shadow 800ms var(--ease-standard);
}

/* "open canvas": the window lifts. "close canvas": it steps back. */
[data-phase='heard'][data-cmd='open'] .app-window {
  transform: translateY(-8px);
  box-shadow:
    inset 0 1px 0 rgb(255 255 255 / 0.95),
    inset 0 0 0 1px rgb(255 255 255 / 0.55),
    0 0 0 1px rgb(18 22 28 / 0.06),
    0 44px 100px rgb(30 60 120 / 0.24),
    0 8px 22px rgb(15 23 42 / 0.07);
}

[data-phase='heard'][data-cmd='close'] .app-window {
  transform: scale(0.97);
  opacity: 0.55;
}

/* Everything inside the window is sized in em off its width, so it scales as one picture. */
.app {
  display: grid;
  grid-template-columns: 13.5em minmax(0, 1fr);
  height: 100%;
  padding: 0.6em;
  font-size: 1.95cqw;
  line-height: 1.35;
  color: var(--ink);
}

.i {
  display: block;
  width: 1.15em;
  height: 1.15em;
  flex: none;
}

.app-side {
  display: flex;
  flex-direction: column;
  padding: 0.85em 0.75em 0.75em;
  border-radius: 1.3em;
  background: rgb(255 255 255 / 0.8);
  box-shadow:
    inset 0 1px 0 #fff,
    0 0 0 0.5px rgb(18 22 28 / 0.06),
    0 0.5em 1.6em rgb(15 23 42 / 0.06);
}

.app-side-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.35em;
  color: var(--ink-2);
}

.app-side-actions {
  display: flex;
  gap: 0.9em;
}

.app-nav {
  display: grid;
  gap: 0.15em;
  margin-top: 1.1em;
}

.app-nav li {
  display: flex;
  align-items: center;
  gap: 0.7em;
  padding: 0.45em 0.6em;
  border-radius: 0.8em;
  font-size: 1.08em;
  color: var(--ink-2);
}

.app-nav .app-nav-on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 0.1em 0.4em rgb(15 23 42 / 0.05);
}

.app-label {
  margin: 1.2em 0.6em 0.4em;
  font-size: 0.92em;
  color: var(--ink-3);
}

.app-session {
  padding: 0.3em 0.6em;
  color: var(--ink-2);
}

.app-status {
  display: flex;
  align-items: center;
  gap: 0.55em;
  margin-top: auto;
  padding: 0.6em 0.75em;
  border-radius: 0.9em;
  background: #fff;
  box-shadow:
    0 0 0 0.5px rgb(18 22 28 / 0.06),
    0 0.2em 0.6em rgb(15 23 42 / 0.05);
  color: var(--ink-2);
  font-size: 0.95em;
}

.app-status-text {
  flex: 1;
}

.app-dot {
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--accent);
}

[data-phase='hearing'] .app-dot {
  animation: blink 0.9s var(--ease-standard) infinite;
}

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

.app-main {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 0.75em 1.1em 0 1.6em;
}

.app-bar {
  display: flex;
  align-items: baseline;
  gap: 0.5em;
}

.app-bar-title {
  font-size: 1.15em;
  font-weight: 600;
}

.app-bar-date {
  color: var(--ink-3);
}

.app-bar-icons {
  margin-left: auto;
  align-self: center;
  color: var(--ink-2);
}

.app-empty {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto 0;
  padding-bottom: 3.5em;
  text-align: center;
}

.app-title {
  font-family: var(--font-display);
  font-size: 2.2em;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.app-sub {
  margin-top: 0.6em;
  color: var(--ink-2);
}

.app-composer {
  display: flex;
  align-items: center;
  gap: 0.8em;
  width: min(100%, 30em);
  margin-top: 1.4em;
  padding: 0.45em 0.45em 0.45em 1.2em;
  border-radius: 999px;
  background: #fff;
  box-shadow:
    0 0 0 0.5px rgb(18 22 28 / 0.08),
    0 0.4em 1.4em rgb(15 23 42 / 0.07);
  color: var(--ink-2);
}

.app-placeholder {
  flex: 1;
  overflow: hidden;
  color: var(--ink-3);
  text-align: left;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.app-send {
  display: grid;
  place-items: center;
  width: 2.3em;
  height: 2.3em;
  border-radius: 50%;
  background: rgb(18 22 28 / 0.18);
  color: #fff;
}

.app-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5em;
  margin-top: 1em;
}

.app-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.4em 0.9em;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.85);
  box-shadow: 0 0 0 0.5px rgb(18 22 28 / 0.08);
  font-size: 0.95em;
  color: var(--ink-2);
}

/* "annotate": the macOS selection drags out across the heading. */
.app-marquee {
  position: absolute;
  left: -0.8em;
  top: -0.9em;
  width: calc(100% + 1.6em);
  height: 6em;
  border: 1.5px dashed var(--accent);
  border-radius: 0.3em;
  background: var(--accent-soft);
  transform: scale(0);
  transform-origin: 0 0;
  opacity: 0;
  transition:
    transform 0ms linear 400ms,
    opacity 400ms var(--ease-standard);
}

[data-phase='heard'][data-cmd='annotate'] .app-marquee {
  transform: scale(1);
  opacity: 1;
  transition:
    transform 900ms var(--ease-surface),
    opacity 120ms linear;
}

/* ── the mic pill, floating over the window's lower edge ──────────────── */

.voice {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.pill {
  grid-column: 2;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 20px 0 12px;
  border-radius: 999px;
}

.pill-grip {
  width: 16px;
  height: 16px;
  fill: var(--ink-4);
}

.pill-mic {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 26px;
}

.bar {
  width: 4px;
  min-height: 4px;
  height: 14%;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.55;
  transition:
    height 90ms linear,
    opacity 200ms var(--ease-standard);
}

/* No-JS / reduced-motion: a still meter mid-word. main.js sets live heights. */
.bar:nth-child(3n + 1) {
  height: 45%;
}

.bar:nth-child(3n + 2) {
  height: 80%;
}

.bar:nth-child(4n) {
  height: 60%;
}

[data-phase='hearing'] .bar {
  opacity: 1;
}

.heard {
  grid-column: 3;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 40px;
  padding: 0 16px 0 12px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--ink-3);
  white-space: nowrap;
  opacity: 0;
  transform: translateX(-8px) scale(0.96);
  transition:
    opacity 260ms var(--ease-standard),
    transform 420ms var(--ease-surface);
}

[data-phase='hearing'] .heard,
[data-phase='transcribing'] .heard,
[data-phase='heard'] .heard {
  opacity: 1;
  transform: none;
}

.heard-check {
  display: none;
  width: 16px;
  height: 16px;
  color: var(--accent);
}

[data-phase='heard'] .heard-check {
  display: block;
}

.heard-text {
  color: var(--ink);
  font-weight: 500;
}

[data-phase='transcribing'] .heard-label {
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  50% {
    opacity: 0.4;
  }
}

/* ── footer ───────────────────────────────────────────────────────────── */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-bottom: clamp(16px, 3vh, 28px);
  font-size: 12.5px;
  color: var(--ink-3);
}

.motion-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 8px;
  border: 0;
  border-radius: 999px;
  background: rgb(18 22 28 / 0.05);
  color: var(--ink-2);
  font: 500 12px/1.3 var(--font-ui);
  cursor: pointer;
  transition: background-color var(--dur-control) var(--ease-standard);
}

.motion-toggle[hidden] {
  display: none;
}

.motion-toggle:hover {
  background: rgb(18 22 28 / 0.09);
}

/* Pause glyph (two bars) while playing; play glyph (triangle) while paused. */
.toggle-icon {
  width: 7px;
  height: 8px;
  border-inline: 2px solid currentColor;
}

.motion-toggle[data-state='paused'] .toggle-icon {
  width: 0;
  height: 0;
  border-inline-end: 0;
  border-block: 4px solid transparent;
  border-inline-start: 7px solid currentColor;
}

/* ── entrance ─────────────────────────────────────────────────────────── */

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@keyframes arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .hero-copy > * {
    animation: rise 900ms var(--ease-surface) backwards;
  }

  .hero-copy > :nth-child(2) {
    animation-delay: 60ms;
  }

  .hero-copy > :nth-child(3) {
    animation-delay: 120ms;
  }

  .hero-copy > :nth-child(4) {
    animation-delay: 180ms;
  }

  .showcase {
    animation: arrive 1100ms var(--ease-surface) 160ms backwards;
  }
}

/* ── smaller screens: the copy, then the app below it ─────────────────── */

@media (max-width: 1023px) {
  .hero {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
    row-gap: calc(var(--space) * 2);
    padding-top: calc(var(--space) * 1.4);
  }

  .hero-copy {
    max-width: 640px;
  }

  h1 {
    font-size: clamp(34px, 7vw, 60px);
  }

  .showcase {
    max-width: 680px;
  }
}

@media (max-width: 560px) {
  .steps {
    padding-inline: 13px;
    font-size: 12.5px;
  }

  .steps li + li {
    margin-left: 18px;
  }

  .steps li + li::before {
    left: -11px;
  }

  .commands {
    gap: 8px;
  }

  /* Too narrow to keep the pill centred with the bubble beside it: they share the row instead. */
  .voice {
    grid-template-columns: auto auto;
    justify-content: center;
    gap: 8px;
  }

  .pill,
  .heard {
    grid-column: auto;
  }

  .pill {
    gap: 8px;
    height: 42px;
    padding: 0 14px 0 12px;
  }

  .pill-grip {
    display: none;
  }

  .wave {
    gap: 3px;
  }

  .bar {
    width: 3px;
  }

  .heard {
    height: 36px;
    padding-inline: 10px 12px;
    font-size: 12.5px;
  }
}

@media print {
  .showcase,
  .motion-toggle,
  .skip {
    display: none;
  }
}
