/* Worst Gen AI, the online app.
   Same look as the website: white page, one red accent for actions.
   To change a colour or the font everywhere, edit the values in :root. */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("fonts/barlow-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("fonts/barlow-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("fonts/barlow-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("fonts/barlow-latin-700-normal.woff2") format("woff2"); }

:root {
  --ink: #16171a;
  --ink-2: #4a4b50;
  --muted: #63646a;
  --line: #e5e5e1;
  --band: #f7f7f5;
  --paper: #ffffff;
  --accent: #d90f17;
  --accent-dark: #b50c13;
  --ok: #1f7a3d;
  --warn: #9a5b00;
  --font: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --wrap: 920px;
  --fs: 26px;              /* size of the answer text, changed with A- and A+ */
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--band); color: var(--ink); font-family: var(--font); font-size: 17px; line-height: 1.55; }
h1, h2, p, ol, hr { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 36px); line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
h2 { font-size: 18px; line-height: 1.3; font-weight: 600; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding-left: 20px; padding-right: 20px; }

/* Top bar */
.bar { position: sticky; top: 0; z-index: 5; background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 20px; padding-top: 10px; padding-bottom: 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 18px; font-weight: 700; text-decoration: none; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand img { display: block; height: 24px; width: auto; }
.bar-right { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 20px; }
.bar-link { display: inline-flex; align-items: center; min-height: 44px; font-size: 15px; font-weight: 500; }

/* Status and sound meter */
.status { display: flex; align-items: center; gap: 8px; font-size: 15px; font-weight: 600; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #b9b9b4; }
.dot.listening { background: var(--ok); }
.dot.hearing { background: var(--ok); box-shadow: 0 0 0 4px rgba(31, 122, 61, 0.18); }
.dot.waiting { background: var(--warn); }
.dot.thinking { background: var(--warn); }
.dot.answering { background: var(--accent); }
.meter { display: flex; align-items: center; gap: 8px; }
.meter-track { width: 90px; height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.meter-fill { width: 0; height: 100%; background: #b9b9b4; }
.meter-fill.speech { background: var(--ok); }
.meter-label { min-width: 62px; font-size: 13px; color: var(--muted); }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border: 1px solid var(--accent); border-radius: 8px; background: var(--accent); color: #ffffff; font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; }
.btn:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #ffffff; }
.btn:disabled { opacity: 0.5; cursor: default; }
.btn.on { background: var(--ink); border-color: var(--ink); }
.btn-quiet { background: var(--paper); color: var(--ink); border-color: #c9c9c4; }
.btn-quiet:hover { background: var(--band); border-color: var(--ink); color: var(--ink); }
.small-btn { min-width: 44px; min-height: 44px; padding: 0 12px; border: 1px solid #c9c9c4; border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-weight: 600; cursor: pointer; }
.small-btn:hover { border-color: var(--ink); }
.small-btn:disabled { opacity: 0.4; cursor: default; }

/* Setup page */
.page { display: flex; flex-direction: column; gap: 14px; padding-top: 40px; padding-bottom: 64px; }
.lead { max-width: 40em; color: var(--ink-2); }
.form { display: flex; flex-direction: column; gap: 22px; margin-top: 14px; padding: 26px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.row-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 22px; }
.field { display: flex; flex-direction: column; gap: 8px; }
.field-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 16px; }
label { font-weight: 600; }
.optional { font-weight: 400; color: var(--muted); }
input[type="text"], textarea { width: 100%; padding: 12px 14px; border: 1px solid #c9c9c4; border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; }
textarea { resize: vertical; line-height: 1.5; }
input[type="text"]:focus, textarea:focus { outline: 2px solid var(--ink); outline-offset: 1px; border-color: var(--ink); }
.file-btn { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid #c9c9c4; border-radius: 8px; font-size: 15px; font-weight: 500; cursor: pointer; }
.file-btn:hover { border-color: var(--ink); }
.file-btn:focus-within { outline: 3px solid var(--ink); outline-offset: 2px; }
.hint { font-size: 14px; color: var(--muted); }
.hint.bad, .form-error { color: var(--accent-dark); font-weight: 500; }
.hint.good { color: var(--ok); }
.form-actions { display: flex; }

/* Interview page */
.stage { display: flex; flex-direction: column; gap: 18px; padding-top: 24px; padding-bottom: 48px; }
.notice { scroll-margin-top: 84px; padding: 14px 16px; border: 1px solid var(--accent); border-radius: 10px; background: #fdf1f1; color: var(--ink); font-weight: 500; }
.help { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.help ol { display: flex; flex-direction: column; gap: 6px; padding-left: 22px; }
.help p { color: var(--ink-2); font-size: 15.5px; }
.help-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 16px 36px; }
.help-row ol { flex: 1 1 320px; }
/* A plain sketch of Chrome's share window, so the 3 clicks are easy to find */
.picker { flex: 0 1 300px; display: flex; flex-direction: column; gap: 10px; padding: 14px; border: 1px solid #c9c9c4; border-radius: 10px; background: var(--band); font-size: 13.5px; color: var(--muted); }
.picker-tabs, .picker-list, .picker-foot { display: flex; gap: 6px; }
.picker-tabs span { padding: 4px 9px; border: 1px solid transparent; border-radius: 6px; white-space: nowrap; }
.picker-list { flex-direction: column; padding: 6px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.picker-list span { padding: 6px 9px; border: 1px solid transparent; border-radius: 6px; }
.picker .picked { border-color: var(--ink); background: var(--paper); color: var(--ink); font-weight: 600; }
.picker-foot { align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
.switch { position: relative; flex: none; width: 30px; height: 16px; border-radius: 8px; background: var(--ok); }
.switch::after { content: ""; position: absolute; top: 2px; right: 2px; width: 12px; height: 12px; border-radius: 50%; background: #ffffff; }
.picker-share { margin-left: auto; padding: 4px 12px; border-radius: 6px; background: var(--ink); color: #ffffff; }
.card { display: flex; flex-direction: column; gap: 10px; min-height: 300px; padding: 24px 26px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 10px 28px rgba(22, 23, 26, 0.06); }
.label { font-size: 13px; font-weight: 600; color: var(--muted); }
.question { font-size: 19px; line-height: 1.4; font-weight: 600; }
.rule { width: 100%; height: 1px; margin: 6px 0; border: 0; background: var(--line); }
.answer { font-size: var(--fs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
.answer.typing::after { content: ""; display: inline-block; width: 0.5em; height: 1em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
@media (prefers-reduced-motion: reduce) { .answer.typing::after { animation: none; } }
.tools, .controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.controls { justify-content: flex-start; }
.nav { display: flex; align-items: center; gap: 10px; }
.nav-count { min-width: 9em; text-align: center; font-size: 15px; color: var(--muted); }
.nav-count.back { color: var(--warn); font-weight: 600; }
.typed { display: flex; gap: 10px; }
.typed input { flex: 1 1 auto; min-width: 0; }

/* The answer box. It shows on the page, or in the small floating window. */
.float-box { display: flex; flex-direction: column; gap: 14px; }
.float-status { display: none; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; }
.float-note { padding: 14px 16px; border: 1px dashed #b9b9b4; border-radius: 10px; background: var(--paper); color: var(--ink-2); }

/* Inside the floating window: no page around it, every pixel for the answer */
body.float { background: var(--paper); overflow: hidden; }
body.float .float-box { height: 100vh; gap: 0; }
body.float .tools { flex: none; flex-wrap: nowrap; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
body.float .float-status { display: flex; min-width: 0; white-space: nowrap; }
body.float .nav { gap: 4px; }
body.float .nav-count { min-width: 0; font-size: 13px; white-space: nowrap; }
body.float .small-btn { min-width: 30px; min-height: 30px; padding: 0 7px; font-size: 14px; }
body.float .card { flex: 1 1 auto; min-height: 0; overflow-y: auto; gap: 6px; padding: 12px 14px 18px; border: 0; border-radius: 0; box-shadow: none; }
body.float .label, body.float .rule { display: none; }
body.float .question { font-size: 15px; color: var(--muted); }

@media (max-width: 640px) {
  .meter { display: none; }
  .form, .card { padding: 20px 18px; }
  .typed { flex-wrap: wrap; }
}

/* The desktop overlay window: one small panel, nothing around it */
body.overlay { height: 100vh; background: var(--paper); overflow: hidden; display: flex; flex-direction: column; }
/* The top strip is the drag handle in the desktop app */
.ov-bar { -webkit-app-region: drag; flex: none; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line); background: var(--band); }
/* In the desktop app, keep clear of the window's close/minimise buttons */
body.in-app .ov-bar { padding-left: 80px; }
.ov-status { font-size: 13px; font-weight: 600; white-space: nowrap; }
.ov-spacer { flex: 1 1 auto; }
.ov-count { min-width: 2.4em; text-align: center; font-size: 12px; color: var(--muted); }
.ov-btn { -webkit-app-region: no-drag; min-width: 30px; height: 28px; padding: 0 7px; border: 1px solid #c9c9c4; border-radius: 6px; background: var(--paper); color: var(--ink); font: inherit; font-size: 13px; font-weight: 600; line-height: 1; cursor: pointer; }
.ov-btn:hover { border-color: var(--ink); }
.ov-btn:disabled { opacity: 0.4; cursor: default; }
.ov-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 12px 16px 18px; }
.ov-wait { font-size: 15px; line-height: 1.5; color: var(--muted); }
.ov-q { font-size: 14px; line-height: 1.35; color: var(--muted); margin-bottom: 8px; }
.ov-a { font-size: var(--fs); line-height: 1.45; white-space: pre-wrap; overflow-wrap: anywhere; }
.ov-a.typing::after { content: ""; display: inline-block; width: 0.5em; height: 1em; margin-left: 3px; vertical-align: -0.15em; background: var(--accent); animation: blink 1s steps(2, start) infinite; }
@media (prefers-reduced-motion: reduce) { .ov-a.typing::after { animation: none; } }

/* Sign-in page */
.signin-card { display: flex; flex-direction: column; gap: 14px; max-width: 460px; margin-top: 24px; padding: 30px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }

/* The account in the top bar: email, time left, sign out */
.account { gap: 6px 16px; }
.acct-email { max-width: 22ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--muted); }
.acct-time { font-size: 14px; font-weight: 600; white-space: nowrap; }
.bar-btn { min-height: 36px; padding: 0 12px; border: 1px solid #c9c9c4; border-radius: 8px; background: var(--paper); color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; cursor: pointer; }
.bar-btn:hover { border-color: var(--ink); }
.trial-note { padding: 12px 14px; border: 1px solid var(--warn); border-radius: 10px; background: #fff8ec; font-weight: 500; }
@media (max-width: 640px) {
  .acct-email { display: none; }
}

/* Plans page. The same plan boxes as the website: 2 across, 1 on a phone. */
.plans { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 8px; }
.plan { display: flex; flex-direction: column; gap: 8px; padding: 26px 28px 28px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.plan-name { font-size: 18px; line-height: 1.3; font-weight: 600; }
.plan-price { font-size: 34px; line-height: 1.15; font-weight: 700; letter-spacing: -0.01em; }
.plan-what { font-size: 18px; line-height: 1.4; }
.plan-small { font-size: 15px; line-height: 1.4; color: var(--muted); }
.plan-buy { align-self: flex-start; margin-top: 10px; }
/* The plan we point people to gets a darker frame */
.plan-featured { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
/* The last plan runs the full width: name on the left, price on the right */
.plan-wide { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name price" "what small" "buy buy"; align-items: baseline; gap: 8px 32px; }
.plan-wide .plan-name { grid-area: name; }
.plan-wide .plan-price { grid-area: price; justify-self: end; }
.plan-wide .plan-what { grid-area: what; }
.plan-wide .plan-small { grid-area: small; justify-self: end; }
.plan-wide .plan-buy { grid-area: buy; justify-self: start; }
@media (max-width: 560px) {
  .plans { grid-template-columns: minmax(0, 1fr); }
  .plan-wide { display: flex; }
}
.plans-notes { display: flex; flex-direction: column; gap: 4px; margin: 6px 0 0; padding-left: 20px; font-size: 15px; color: var(--muted); }
/* The plan the account is on */
.plan-now { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px 24px; padding: 20px 22px; background: var(--paper); border: 1px solid var(--ink); border-radius: 12px; }
.plan-now-text { display: flex; flex-direction: column; gap: 4px; flex: 1 1 300px; }
.plan-now-text p { color: var(--ink-2); }
.plan-now-actions { display: flex; flex-wrap: wrap; gap: 10px; }
/* Messages on the Plans page */
.test-note { padding: 12px 14px; border: 1px dashed var(--warn); border-radius: 10px; background: #fff8ec; }
.result { padding: 14px 16px; border: 1px solid #c9c9c4; border-radius: 10px; background: var(--paper); font-weight: 500; }
.result.good { border-color: var(--ok); background: #f1f8f3; }
.notice a, .trial-note a { font-weight: 600; white-space: nowrap; }
