/*
 * The public page (welcome.html) and the sign-in pages (server/pages.ts): same
 * colors as the app. Fonts are the system's: the CSP allows only our own files,
 * and the brand (and with it a typeface) isn't chosen yet.
 */
:root {
  --bg: #f6f5f2;
  --panel: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a66;
  --line: #e2e0da;
  --accent: #b5522b;
  --accent-text: #ffffff;
  /* The accent for small text on the soft tint: 6:1 there (the accent itself is 4.1:1). */
  --accent-ink: #8f3d1c;
  --soft: #f3e6df;
  /* The guide's phone frames, and its trophy. */
  --bezel: #1d1d1b;
  --gold: #c99a2e;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161614;
    --panel: #1f1f1d;
    --text: #ecebe7;
    --muted: #a3a29c;
    --line: #34332f;
    --accent: #e08356;
    --accent-text: #1d1d1b;
    --accent-ink: #e08356;
    --soft: #2c241f;
    --bezel: #4a4944;
    --gold: #d9b04a;
  }
}

/*
 * One language at a time. Until the script picks one (welcome.ts), Brazilian
 * Portuguese; then it hides the other versions of each text itself.
 */
html:not([data-lang]) body [lang]:not([lang="pt-BR"]) {
  display: none;
}
/*
 * At a language's own address (server/public-page.ts) the server sets
 * data-lang, so the page is in that language even without the script. pt-PT
 * shows pt-BR where it has no text of its own (its text comes right after).
 * One rule per language of platform/langs.ts (test/langs.test.ts).
 */
html[data-lang="de"] body [lang]:not([lang="de"]),
html[data-lang="en"] body [lang]:not([lang="en"]),
html[data-lang="es"] body [lang]:not([lang="es"]),
html[data-lang="fr"] body [lang]:not([lang="fr"]),
html[data-lang="it"] body [lang]:not([lang="it"]),
html[data-lang="pl"] body [lang]:not([lang="pl"]),
html[data-lang="pt-BR"] body [lang]:not([lang="pt-BR"]),
html[data-lang="ja"] body [lang]:not([lang="ja"]),
html[data-lang="zh-CN"] body [lang]:not([lang="zh-CN"]),
html[data-lang="pt-PT"] body [lang]:not([lang="pt-PT"], [lang="pt-BR"]),
html[data-lang="pt-PT"] body [lang="pt-BR"]:has(+ [lang="pt-PT"]) {
  display: none;
}
[hidden] { display: none !important; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}
.mark { font-size: 22px; color: var(--accent); line-height: 1; }
.top-title { font-weight: 600; font-size: 15px; flex: 1; min-width: 0; }
.top-title a { color: inherit; text-decoration: none; }
.langs { display: flex; }
.langs select {
  font: inherit;
  font-size: 13px;
  padding: 3px 6px;
  max-width: 46vw;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}
.langs select:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

main { max-width: 1040px; margin: 0 auto; padding: 0 16px 32px; }
section { margin: 56px 0; }
h1 { font-size: clamp(30px, 4.4vw, 44px); line-height: 1.15; margin: 14px 0 16px; letter-spacing: -0.015em; text-wrap: balance; }
h2 { font-size: 24px; margin: 0 0 16px; text-wrap: balance; }
h3 { font-size: 18px; margin: 0 0 6px; }
p { margin: 0 0 12px; }
section > p, .needs, .facts { max-width: 46em; }

.button {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-text);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  padding: 10px 20px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.button:hover { filter: brightness(1.08); }
.button.plain { background: transparent; color: var(--accent); border: 1px solid var(--accent); padding: 9px 19px; }

/* The opening: what it is, and beside it, what it looks like. */
.hero { display: grid; gap: 32px; align-items: center; margin-top: 48px; }
.badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent-ink);
  background: var(--soft);
  border-radius: 999px;
  padding: 3px 12px;
  margin: 0;
}
.lead { font-size: 19px; color: var(--muted); max-width: 34em; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.cta-note { flex: 1 1 16em; margin: 0; font-size: 14px; color: var(--muted); }

.demo {
  margin: 0;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 18px 40px -28px rgb(0 0 0 / 0.45);
}
.demo-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 15px; }
.demo-tag { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; }
.clock { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.demo-plan { list-style: none; margin: 0 0 14px; padding: 0; font-size: 15px; }
.demo-plan li { display: flex; gap: 0.6em; padding: 5px 6px; border-bottom: 1px solid var(--line); }
.demo-plan .when { flex: none; min-width: 4.4em; color: var(--muted); font-variant-numeric: tabular-nums; }
.demo-plan .done { color: var(--muted); }
/* The step the coach is on: the same band the app gives it. */
.demo-plan .next { background: var(--soft); border-bottom-color: transparent; border-radius: 6px; padding: 8px 6px; font-size: 17px; font-weight: 600; }
.demo-plan .next .when { color: var(--accent-ink); }
.demo-talk { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 15px; }
.demo-talk li { display: flex; gap: 10px; align-items: baseline; }
.demo-talk .who {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 5.2em;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--accent-ink);
}
.demo-talk .you, .demo-talk .you .who { color: var(--muted); }
/* The coach speaking: three bars, still when motion is reduced. */
.voice { display: inline-flex; align-items: flex-end; gap: 2px; height: 10px; }
.voice i { width: 2px; height: 4px; background: currentColor; transform-origin: bottom; animation: talk 0.9s ease-in-out infinite; }
.voice i:nth-child(2) { height: 8px; animation-delay: 0.15s; }
.voice i:nth-child(3) { animation-delay: 0.3s; }
@keyframes talk { 50% { transform: scaleY(1.7); } }
.demo figcaption { margin-top: 12px; font-size: 13px; color: var(--muted); }

/* The video: our poster with a play button; YouTube's player takes its place on play (welcome.ts). */
.video-play, .video-frame { display: block; width: 100%; max-width: 880px; aspect-ratio: 16 / 9; border-radius: 12px; background: #0e0e10; }
.video-play { position: relative; overflow: hidden; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18); }
.video-play img { display: block; width: 100%; height: 100%; object-fit: cover; }
.video-button {
  position: absolute; inset: 0; margin: auto; width: 84px; height: 84px; border-radius: 50%;
  background: rgba(14, 14, 16, 0.72); border: 3px solid #fff; transition: background 0.15s, transform 0.15s;
}
.video-button::after {
  content: ""; position: absolute; top: 50%; left: 54%; transform: translate(-50%, -50%);
  border-style: solid; border-width: 15px 0 15px 25px; border-color: transparent transparent transparent #fff;
}
.video-play:hover .video-button, .video-play:focus-visible .video-button { background: var(--accent); transform: scale(1.06); }
.video-frame { border: 0; }
.video-note { margin-top: 12px; font-size: 14px; color: var(--muted); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Before, during, after: a real sequence, so numbered and joined by a line. */
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 24px; counter-reset: step; }
.steps li { position: relative; counter-increment: step; padding-left: 48px; }
.steps li::before {
  content: counter(step);
  position: absolute;
  top: 0;
  left: 0;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 15px;
  font-weight: 700;
}
.steps li:not(:last-child)::after { content: ""; position: absolute; top: 40px; bottom: -16px; left: 15px; width: 2px; background: var(--line); }
.steps h3 { line-height: 32px; }
.steps p { font-size: 16px; }

.needs, .facts { margin: 0; padding-left: 22px; }
.needs li, .facts li { margin-bottom: 8px; }
.needs li::marker { content: "✓  "; color: var(--accent); font-weight: 700; }

/* What leaves the computer: a table, one per language. */
.scroll { overflow-x: auto; margin: 16px 0 20px; }
.sent { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.sent th, .sent td { text-align: left; vertical-align: top; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.sent thead th { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }
.sent tbody th { font-weight: 600; width: 32%; }
.sent td:nth-of-type(2) { min-width: 10.5em; }
.sent td:nth-of-type(3) { min-width: 8.5em; }
.sent tbody tr:last-child > * { border-bottom: 0; }
.sent td { color: var(--muted); }

/*
 * How to use it (#como-usar): five quests, like a campaign tutorial. Each one
 * has its shield on a dashed trail, what to do, what the coach would say about
 * it, and the app's own screens (tools/guide-shots.ts) in a browser window or
 * a phone.
 */
.guide-lead { font-size: 19px; color: var(--muted); }
.quests { position: relative; list-style: none; margin: 36px 0 0; padding: 0; display: grid; gap: 56px; }
.quests::before { content: ""; position: absolute; top: 40px; bottom: 40px; left: 22px; border-left: 3px dashed var(--line); }
.quest { position: relative; display: grid; gap: 24px; padding-left: 72px; }
.quest-badge {
  position: absolute;
  top: 0;
  left: 0;
  width: 48px;
  height: 56px;
  display: grid;
  place-items: center;
  padding-bottom: 8px;
  background: var(--accent);
  color: var(--accent-text);
  font: 700 18px/1 Georgia, "Times New Roman", serif;
  clip-path: polygon(0 0, 100% 0, 100% 62%, 50% 100%, 0 62%);
  transform: rotate(-5deg);
  transition: transform 0.25s;
}
.quest:nth-child(even) .quest-badge { transform: rotate(5deg); }
.quest:hover .quest-badge { transform: rotate(0) scale(1.1); }
.quest.final .quest-badge { background: var(--gold); font-size: 24px; }
.kicker { margin: 0 0 2px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent-ink); }
.quest.final .kicker { color: var(--gold); }
.quest h3 { font-size: 22px; margin-bottom: 10px; }
.quest-text p { font-size: 16px; }
/* The app's own words, as its buttons say them. */
.quest-text b { font-weight: 600; background: var(--soft); padding: 1px 5px; border-radius: 4px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.tips { list-style: none; margin: 0 0 12px; padding: 0; font-size: 15px; color: var(--muted); }
.tips li { position: relative; padding-left: 1.7em; margin-bottom: 6px; }
.tips li::before { content: "💡"; position: absolute; left: 0; }

/* What the coach would say about it. */
.bubble { display: flex; align-items: flex-start; gap: 12px; margin: 18px 0 0; max-width: 34em; }
.bubble .face {
  flex: none;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-text);
  font-size: 21px;
}
.bubble [lang] {
  position: relative;
  padding: 8px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  font-style: italic;
  box-shadow: 0 10px 24px -20px rgb(0 0 0 / 0.5);
}
.bubble [lang]::before {
  content: "";
  position: absolute;
  top: 13px;
  left: -7px;
  width: 12px;
  height: 12px;
  background: var(--panel);
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  transform: rotate(45deg);
}

/*
 * The screens: tilted a little, straight when pointed at. Each one sets only
 * its tilt (and drop); the transform is set in one place, so the hover beats
 * every tilt whatever its selector.
 */
.quest-shots { display: flex; justify-content: center; align-items: flex-start; gap: 18px; }
.shot { margin: 0; text-align: center; transform: rotate(var(--tilt, 0deg)) translateY(var(--drop, 0px)); transition: transform 0.25s; }
.shot:hover { transform: translateY(var(--drop, 0px)); }
.shot img { display: block; width: 100%; height: auto; }
.shot.pc {
  width: 100%;
  max-width: 600px;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 22px 44px -28px rgb(0 0 0 / 0.55);
  --tilt: -1deg;
}
/* A browser window's bar, with its three lights. */
.shot.pc::before {
  content: "";
  display: block;
  height: 22px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle, #e0605a 4px, transparent 4.5px) 6px 50% / 14px 14px no-repeat,
    radial-gradient(circle, #e8b34b 4px, transparent 4.5px) 22px 50% / 14px 14px no-repeat,
    radial-gradient(circle, #5fb35d 4px, transparent 4.5px) 38px 50% / 14px 14px no-repeat,
    var(--bg);
}
.quest:nth-child(even) .shot.pc { --tilt: 1deg; }
.shot.phone { flex: 0 1 240px; --tilt: -3deg; }
.shot.phone + .shot.phone { --tilt: 3deg; --drop: 18px; }
.shot.phone img { border: solid var(--bezel); border-width: 14px 7px 18px; border-radius: 28px; box-shadow: 0 22px 44px -26px rgb(0 0 0 / 0.6); }
.shot figcaption {
  display: inline-block;
  margin-top: 12px;
  padding: 2px 12px;
  background: var(--soft);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent-ink);
}

.invite { padding: 24px; background: var(--panel); border: 1px solid var(--accent); border-radius: 10px; }
.invite p:last-child { margin: 0; }

footer {
  border-top: 1px solid var(--line);
  padding: 16px;
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
footer p { max-width: 860px; margin: 0 auto; }
footer .legal { margin-top: 8px; font-size: 12px; }
footer a { color: inherit; }

/* The sign-in pages: not invited (with the invitation request), or failed. */
.notice { max-width: 560px; margin: 64px auto; }
.notice .actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.notice .detail { font-size: 14px; color: var(--muted); }
.request { display: grid; gap: 12px; margin: 24px 0 0; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; }
.request h2 { font-size: 19px; margin: 0; }
.request p { margin: 0; font-size: 15px; }
.request .field { display: grid; gap: 4px; width: 100%; }
.request label { font-size: 14px; color: var(--muted); }
.request input { font: inherit; color: var(--text); background: var(--bg); padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; max-width: 20rem; }
.request .note { font-size: 13px; color: var(--muted); }
.request form { display: grid; gap: 12px; justify-items: start; }

@media (min-width: 760px) {
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .steps li { padding-left: 0; padding-top: 48px; }
  .steps li:not(:last-child)::after { top: 15px; bottom: auto; left: 44px; right: -20px; width: auto; height: 2px; }
}
@media (min-width: 900px) {
  .hero { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: 48px; }
  .quest { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: start; gap: 40px; }
  /* The whole screen of the computer: under the text, as wide as the page. */
  .quest.wide { grid-template-columns: minmax(0, 1fr); }
  .quest.wide .quest-text { max-width: 46em; }
  .quest.wide .shot.pc { max-width: 920px; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  section { margin: 40px 0; }
  .hero { margin-top: 28px; }
  .top-title .wide { display: none; }
  /* The table as one block per row, each value with its label. */
  .sent, .sent tbody, .sent tr, .sent tbody th, .sent td { display: block; }
  .sent thead { display: none; }
  .sent tbody tr { padding: 12px; border-bottom: 1px solid var(--line); }
  .sent tbody tr:last-child { border-bottom: 0; }
  .sent tbody th, .sent td { padding: 0; border: 0; width: auto; }
  .sent tbody th { margin-bottom: 4px; }
  .sent td { font-size: 14px; }
  .sent td::before { content: attr(data-label) ": "; font-weight: 600; color: var(--text); }
  /* The guide: the screens take the whole width, under the text. */
  .quests { gap: 44px; }
  .quests::before { left: 18px; }
  .quest { padding-left: 56px; }
  .quest-badge { width: 40px; height: 48px; font-size: 16px; }
  .quest-shots { margin-left: -56px; gap: 12px; }
  .shot.phone img { border-width: 10px 5px 13px; border-radius: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .voice i { animation: none; }
  .quest-badge, .shot { transition: none; }
}
