/* sayEmber's website. The colours are the app's dark theme (AmberTheme.kt), the bubble in the
   demo is the app's own (demo.js). */

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/fonts/bricolage-grotesque.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

:root {
  --ink: #0a0a0a;
  --coal: #161616;
  --raised: #1f1f1f;
  --rim: #262626;
  --ash: #ededed;
  --smoke: #8a8a8a;
  --flame: #ffb020;
  --leaf: #6ccb8f;
  --slate: #8fa3bf;
  --wide: 70rem;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  background: var(--ink);
  color: var(--ash);
  font: 400 1.0625rem/1.6 "Bricolage Grotesque", system-ui, sans-serif;
  font-optical-sizing: auto;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body { margin: 0; }
img, canvas { display: block; }

a { color: var(--flame); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--flame); outline-offset: 3px; border-radius: 6px; }

.wrap { max-width: calc(var(--wide) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }

/* Header */
.masthead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(10, 10, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.masthead .wrap { display: flex; align-items: center; gap: 2rem; height: 4.25rem; }
.wordmark {
  font-weight: 700;
  font-size: 1.375rem;
  letter-spacing: -0.02em;
  color: var(--ash);
  text-decoration: none;
  margin-right: auto;
}
.wordmark span { color: var(--flame); }
.masthead nav { display: flex; gap: 2rem; }
.masthead nav a { color: var(--smoke); text-decoration: none; font-size: 0.9688rem; }
.masthead nav a:hover { color: var(--ash); }

.button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  background: var(--flame);
  color: #1c1206;
  font-weight: 650;
  font-size: 1rem;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}
.button:hover { background: #ffc24d; }
.button.small { padding: 0.5rem 1rem; font-size: 0.9375rem; }
.button.quiet { background: var(--raised); color: var(--smoke); border: 1px solid var(--rim); cursor: default; }
.button svg { width: 1.1em; height: 1.1em; fill: currentColor; }

/* Hero: the promise, the buttons, then the phone with the app at work. */
.hero { text-align: center; padding: clamp(3.5rem, 9vh, 6rem) 0 0; }
.hero h1 {
  font-size: clamp(2.6rem, 7.2vw, 5.25rem);
  line-height: 1;
  font-weight: 750;
  letter-spacing: -0.04em;
  margin: 0 auto;
  max-width: 14ch;
  text-wrap: balance;
}
.lede {
  color: var(--smoke);
  font-size: clamp(1.125rem, 2vw, 1.3125rem);
  line-height: 1.55;
  margin: 1.5rem auto 0;
  max-width: 36rem;
  text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 2.25rem; }
.fine { color: var(--smoke); font-size: 0.875rem; margin: 1rem 0 0; }

/* The phone: a chat, its text field, the keyboard, and the bubble above the keys. */
.stage { display: flex; justify-content: center; padding: 4rem 0 0; }
.phone {
  position: relative;
  width: 19.5rem;
  border-radius: 2.75rem;
  padding: 0.6rem;
  background: #1b1b1b;
  border: 1px solid #2e2e2e;
  box-shadow: 0 2.5rem 6rem -2rem rgba(0, 0, 0, 0.9);
}
.screen {
  position: relative;
  border-radius: 2.2rem;
  overflow: hidden;
  background: #101010;
  height: 38rem;
  display: flex;
  flex-direction: column;
  text-align: left;
  font-size: 0.875rem;
  line-height: 1.4;
}
.status { display: flex; justify-content: space-between; padding: 0.7rem 1.4rem 0.4rem; color: #cfcfcf; font-size: 0.75rem; font-weight: 600; }
.chat-head { display: flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1rem 0.75rem; border-bottom: 1px solid #1e1e1e; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; background: #3a4a5c; display: grid; place-items: center; font-weight: 650; color: #dfe7f0; font-size: 0.875rem; }
.chat-head b { font-weight: 600; }
.chat { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 0.4rem; padding: 0.75rem; }
.msg { margin: 0; max-width: 78%; padding: 0.5rem 0.75rem; border-radius: 1rem; background: #222; }
.msg.mine { align-self: flex-end; background: #3d2c0c; color: #f3e6cc; }
.compose { display: flex; align-items: flex-end; gap: 0.5rem; padding: 0.5rem 0.6rem 0.6rem; }
.field {
  flex: 1;
  min-height: 2.5rem;
  padding: 0.55rem 0.9rem;
  background: #1c1c1c;
  border-radius: 1.25rem;
  color: var(--ash);
}
.field .placeholder { color: #777; }
.field .caret { display: inline-block; width: 2px; height: 1.1em; margin-left: 1px; vertical-align: text-bottom; background: var(--flame); animation: blink 1.1s steps(1) infinite; }
.field .word { opacity: 0; transition: opacity 180ms ease-out; }
.field .word.in { opacity: 1; }
.send { flex: none; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: #2a2a2a; display: grid; place-items: center; }
.send svg { width: 1.1rem; height: 1.1rem; fill: #9a9a9a; }
.keyboard { background: #1a1a1a; padding: 0.5rem 0.3rem 1.1rem; display: grid; gap: 0.45rem; }
.keys { display: flex; justify-content: center; gap: 0.3rem; }
.keys i { flex: 0 1 1.55rem; height: 2.3rem; border-radius: 0.4rem; background: #2c2c2c; }
.keys i.wide { flex-basis: 2.4rem; background: #242424; }
.keys i.space { flex-basis: 9rem; }

/* The bubble: the app's view, the disc in its middle, drawn by demo.js; it sits at the
   screen's edge just above the keyboard, as in the app. */
.bubble {
  position: absolute;
  right: 0.35rem;
  bottom: 18.5rem;
  width: 4rem;
  height: 4rem;
  border: 0;
  padding: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
}
.bubble canvas { position: absolute; left: 0; pointer-events: none; }
.bubble:focus-visible { outline-offset: -0.5rem; }
.stage-note { color: var(--smoke); font-size: 0.875rem; text-align: center; margin: 1.25rem auto 0; max-width: 24rem; }

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

/* Sections */
.section { padding: clamp(5rem, 12vh, 8rem) 0 0; }
.section h2 {
  font-size: clamp(1.9rem, 4vw, 2.75rem);
  line-height: 1.08;
  font-weight: 720;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 20ch;
  text-wrap: balance;
}
.intro { color: var(--smoke); font-size: 1.125rem; margin: 1rem 0 0; max-width: 36rem; }

/* How it works: three steps in order. */
.steps { list-style: none; margin: 3rem 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 1px solid var(--rim); padding-top: 1.25rem; }
.steps li::before { content: counter(step); display: block; color: var(--flame); font-weight: 700; font-size: 1.125rem; margin-bottom: 0.5rem; }
.steps h3 { font-size: 1.25rem; font-weight: 650; margin: 0 0 0.4rem; letter-spacing: -0.01em; }
.steps p { color: var(--smoke); margin: 0; }

/* Privacy: the text beside the four labels a dictation can carry. */
.split { display: grid; grid-template-columns: 5fr 6fr; gap: clamp(2rem, 6vw, 5rem); align-items: start; }
.split p { color: var(--smoke); margin: 1rem 0 0; max-width: 32rem; }
.routes { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rim); }
.routes li { padding: 1.1rem 0; border-bottom: 1px solid var(--rim); }
.routes b { display: flex; align-items: baseline; font-weight: 650; font-size: 1.0625rem; }
.routes b::before { content: ""; flex: none; width: 0.55rem; height: 0.55rem; margin-right: 0.65rem; border-radius: 50%; background: var(--slate); transform: translateY(-0.1em); }
.routes .on-phone b::before { background: var(--leaf); }
.routes .enclave b::before { background: var(--flame); }
.routes span { display: block; color: var(--smoke); margin: 0.25rem 0 0 1.2rem; }

/* What else: a quiet grid of facts. */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2.5rem; margin: 3rem 0 0; }
.facts div { border-top: 1px solid var(--rim); padding-top: 1.25rem; }
.facts h3 { font-size: 1.125rem; font-weight: 650; margin: 0 0 0.35rem; }
.facts p { color: var(--smoke); margin: 0; font-size: 1rem; }

/* FAQ */
.faq { margin: 0; border-top: 1px solid var(--rim); }
.faq details { border-bottom: 1px solid var(--rim); }
.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 2.5rem 1.15rem 0;
  font-weight: 600;
  font-size: 1.0625rem;
  position: relative;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0.25rem; top: 0.95rem; color: var(--flame); font-size: 1.4rem; font-weight: 400; line-height: 1.2; transition: transform 160ms ease-out; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { color: var(--smoke); margin: 0 0 1.25rem; max-width: 42rem; }

/* Closing call */
.closing { text-align: center; }
.closing h2 { margin: 0 auto; }

/* Long text: privacy policy and Impressum */
.doc { max-width: 42rem; padding: 3.5rem 0 0; }
.doc h1 { font-size: clamp(2.2rem, 6vw, 3.25rem); line-height: 1.05; font-weight: 750; letter-spacing: -0.03em; margin: 0 0 2rem; }
.doc h2 { font-size: 1.3rem; font-weight: 700; letter-spacing: -0.01em; margin: 2.75rem 0 0.75rem; }
.doc p { margin: 0 0 1rem; }
.doc ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.doc li { margin: 0 0 0.6rem; }
.doc li::marker { color: var(--flame); }
.doc .missing { color: #f07167; }
.doc address { font-style: normal; margin: 0 0 1rem; }
.doc .other { color: var(--smoke); }

/* Footer */
.footer { margin: clamp(5rem, 12vh, 8rem) 0 0; border-top: 1px solid var(--rim); padding: 3rem 0 2.5rem; font-size: 0.9375rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer h4 { font-size: 0.9375rem; font-weight: 600; margin: 0 0 0.75rem; color: var(--ash); }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.footer a { color: var(--smoke); text-decoration: none; }
.footer a:hover { color: var(--ash); }
.footer .about { color: var(--smoke); max-width: 18rem; margin: 0.75rem 0 0; }
.footer-base { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; margin-top: 3rem; color: var(--smoke); }
.language { display: inline-flex; align-items: center; gap: 0.75rem; }
.language svg { width: 1rem; height: 1rem; fill: none; stroke: var(--smoke); stroke-width: 1.6; }
.language a[aria-current] { color: var(--ash); }

@media (min-width: 64rem) {
  .hero { text-align: left; padding-top: clamp(3rem, 7vh, 5rem); }
  .hero .wrap { display: grid; grid-template-columns: 7fr 5fr; gap: 3rem; align-items: center; }
  .hero h1 { margin: 0; max-width: 11ch; }
  .lede { margin-left: 0; }
  .hero .actions { justify-content: flex-start; }
  .stage { padding: 0; }
}

@media (max-width: 52rem) {
  .faq { margin-top: 0.5rem; }
  .masthead nav { display: none; }
  .steps, .facts { grid-template-columns: 1fr; gap: 1.75rem; }
  .split { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
}
@media (min-width: 52rem) and (max-width: 64rem) {
  .facts { grid-template-columns: repeat(2, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  .field .caret { animation: none; }
  .field .word, .faq summary::after { transition: none; }
}

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