/*
 * askradia.com, the launch page.
 *
 * Tokens are the app's own (src/design/tokens.css), carried here so the site
 * deploys standalone: deep violet, warm amber, violet-biased neutrals, a
 * serif display voice. Zero webfonts on purpose; the speed stance is part of
 * the brand. Amber keeps its one job from the app: it marks what was read.
 *
 * Nothing on this page moves layout after first paint: every image carries
 * its size, the only motion is opacity and transform, and the form's states
 * swap text inside boxes that already hold their space.
 */

:root {
  --violet-50:  #F3F0FF;
  --violet-100: #E7E0FF;
  --violet-300: #B09BFF;
  --violet-400: #8B6BFF;
  --violet-500: #6D46F2;
  --violet-600: #5B3FD9;
  --violet-700: #4A32B0;
  --violet-900: #241A57;
  --amber-300:  #F0BE5E;
  --amber-500:  #C8801A;
  --amber-700:  #7B4C0C;

  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-serif: ui-serif, "New York", Georgia, "Times New Roman", serif;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 18px;
  --radius-bubble: 18px;

  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --gutter: 16px;
  --max: 1160px;

  /* light */
  --bg:         #FBFAFD;
  --bg-raised:  #FFFFFF;
  --bg-sunken:  #F1EEF8;
  --ink:        #17141F;
  --ink-2:      #4A445C;
  --ink-3:      #665E78;
  --rule:       #E4E0EE;
  --accent:       var(--violet-600);
  --accent-hover: var(--violet-700);
  --accent-ink:   #FFFFFF;
  --accent-soft:  var(--violet-50);
  --you-bg:     var(--violet-600);
  --you-ink:    #FFFFFF;
  --pilot-bg:   #EEEAF7;
  --pilot-ink:  #17141F;
  --field-bg:   #FFFFFF;
  --field-border: #8F88AC;
  --read:       var(--amber-500);
  --read-ink:   var(--amber-700);
  --good:       #23663F;
  --bad:        #B3261E;
  --shadow: 0 1px 2px rgba(23, 20, 31, 0.05), 0 24px 60px -28px rgba(55, 37, 135, 0.35);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #100E17;
    --bg-raised:  #191622;
    --bg-sunken:  #0B0911;
    --ink:        #F0EDF7;
    --ink-2:      #B9B3CA;
    --ink-3:      #958DA8;
    --rule:       #2A2637;
    --accent:       var(--violet-400);
    --accent-hover: var(--violet-300);
    --accent-ink:   #100E17;
    --accent-soft:  #241E3C;
    --you-bg:     var(--violet-500);
    --you-ink:    #FFFFFF;
    --pilot-bg:   #26212F;
    --pilot-ink:  #F0EDF7;
    --field-bg:   #14111C;
    --field-border: #7A7393;
    --read:       var(--amber-300);
    --read-ink:   var(--amber-300);
    --good:       #6FCB98;
    --bad:        #F2867E;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 30px 70px -30px rgba(109, 70, 242, 0.35);
    color-scheme: dark;
  }
}

/* ---- base ---------------------------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.0625rem/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, p, ol, ul, dl, dd, figure { margin: 0; }
ol, ul { padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
main:focus, section:focus { outline: none; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
@media (min-width: 640px) { :root { --gutter: 32px; } }

.skip-link {
  position: absolute; left: var(--gutter); top: -100px; z-index: 10;
  background: var(--bg-raised); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  font-size: 0.8125rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--read-ink);
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--read);
}

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

.top { padding: 18px 0; }
.top-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; }
.brand-name { font: 600 1.25rem/1 var(--font-serif); letter-spacing: -0.01em; }
.brand-small .brand-name { font-size: 1rem; }
.top-join {
  font-size: 0.9375rem; font-weight: 600; text-decoration: none;
  padding: 0.55rem 0.9rem; border-radius: 999px; color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--rule);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}
@media (hover: hover) and (pointer: fine) {
  .top-join:hover { background: var(--accent-soft); box-shadow: inset 0 0 0 1px transparent; }
}

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

.hero { padding: 40px 0 72px; }
.hero-grid { display: grid; gap: 48px; align-items: center; }
@media (min-width: 960px) {
  .hero { padding: 64px 0 112px; }
  .hero-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 72px; }
}

.hero h1 {
  margin-top: 18px;
  font: 600 clamp(2.6rem, 7.2vw, 4.75rem)/1.02 var(--font-serif);
  letter-spacing: -0.03em;
  text-wrap: balance;
}
.h1-turn { display: block; color: var(--accent); font-style: italic; font-weight: 500; }
.lede {
  margin-top: 22px; max-width: 34em;
  font-size: clamp(1.0625rem, 1.6vw, 1.1875rem); line-height: 1.6; color: var(--ink-2);
  text-wrap: pretty;
}

/* ---- the form ------------------------------------------------------------ */

.join { margin-top: 32px; max-width: 40rem; }
.join-fields { display: grid; gap: 12px; align-items: start; }
@media (min-width: 640px) {
  .join-fields { grid-template-columns: 1fr 1.25fr auto; }
  .join-fields .button { margin-top: 1.625rem; }
}
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 0.875rem; font-weight: 600; color: var(--ink-2); line-height: 1.25rem; }
.field input {
  width: 100%; min-height: 48px; padding: 0 14px;
  font: inherit; font-size: 1rem; color: var(--ink);
  background: var(--field-bg); border: 1px solid var(--field-border); border-radius: var(--radius-md);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}
.field input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent); }
.field input[aria-invalid="true"] { border-color: var(--bad); }
.field-err { min-height: 0; font-size: 0.875rem; color: var(--bad); }
.field-err:empty { display: none; }

.button {
  min-height: 48px; padding: 0 22px; border: 0; border-radius: var(--radius-md);
  background: var(--accent); color: var(--accent-ink);
  font: 600 1rem/1 var(--font-sans); cursor: pointer; white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms var(--ease-out);
}
.button:hover { background: var(--accent-hover); }
.button:active { transform: scale(0.97); }
.button[disabled] { cursor: progress; opacity: 0.75; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.join-status { margin-top: 12px; font-size: 0.9375rem; min-height: 0; }
.join-status:empty { display: none; }
.join-status.is-err { color: var(--bad); }
.join-fine { margin-top: 12px; font-size: 0.875rem; line-height: 1.5; color: var(--ink-3); max-width: 36rem; }
.join-fine a { color: inherit; }

/* After a join: the fields give way to the confirmation, in the same box. */
.join-done {
  padding: 20px 22px; border-radius: var(--radius-lg);
  background: var(--accent-soft);
  animation: done-in 320ms var(--ease-out);
}
.join-done-title { font: 600 1.375rem/1.25 var(--font-serif); letter-spacing: -0.01em; display: flex; align-items: center; gap: 0.6rem; }
.join-done-title::before {
  content: ""; flex: none; width: 22px; height: 22px; border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center/14px no-repeat;
}
.join-done p { margin-top: 8px; color: var(--ink-2); }
@keyframes done-in { from { opacity: 0; transform: translateY(4px); } }

/* ---- the thread (the hero's example) ------------------------------------- */

.thread {
  background: var(--bg-raised);
  border-radius: 26px;
  box-shadow: var(--shadow), 0 0 0 1px var(--rule);
  padding: 16px 16px 20px;
  max-width: 440px; width: 100%; justify-self: center;
}
.thread-head {
  display: flex; align-items: center; gap: 0.5rem; justify-content: center;
  padding: 4px 0 14px; margin-bottom: 14px; border-bottom: 1px solid var(--rule);
  font-weight: 600; font-size: 0.9375rem;
}
.thread-body { display: flex; flex-direction: column; gap: 8px; }

.msg {
  max-width: 82%; padding: 10px 14px; border-radius: var(--radius-bubble);
  font-size: 0.9688rem; line-height: 1.42; text-wrap: pretty;
}
.msg-you { align-self: flex-end; background: var(--you-bg); color: var(--you-ink); border-bottom-right-radius: 6px; }
.msg-pilot { align-self: flex-start; background: var(--pilot-bg); color: var(--pilot-ink); border-bottom-left-radius: 6px; }

.msg-file { display: flex; gap: 12px; align-items: center; padding: 10px 14px 10px 10px; }
.file-glyph {
  flex: none; width: 38px; height: 46px; border-radius: 5px;
  background: var(--bg-raised); color: var(--accent);
  display: grid; place-items: end center; padding-bottom: 6px;
  font: 700 0.625rem/1 var(--font-sans); letter-spacing: 0.04em;
  box-shadow: 0 0 0 1px var(--rule);
  clip-path: polygon(0 0, calc(100% - 11px) 0, 100% 11px, 100% 100%, 0 100%);
  position: relative;
}
.file-glyph::after {
  content: ""; position: absolute; top: 0; right: 0; width: 11px; height: 11px;
  background: var(--rule); border-bottom-left-radius: 3px;
}
.file-text { display: grid; gap: 2px; min-width: 0; }
.file-name { font-weight: 600; }
.file-meta { font-size: 0.8125rem; color: var(--ink-3); display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.read-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--read); }

@media (prefers-reduced-motion: no-preference) {
  .thread-body > li { animation: bubble-in 420ms var(--ease-out) both; }
  .thread-body > li:nth-child(1) { animation-delay: 100ms; }
  .thread-body > li:nth-child(2) { animation-delay: 450ms; }
  .thread-body > li:nth-child(3) { animation-delay: 1150ms; }
  .thread-body > li:nth-child(4) { animation-delay: 1600ms; }
  .thread-body > li:nth-child(5) { animation-delay: 1900ms; }
}
@keyframes bubble-in { from { opacity: 0; transform: translateY(6px) scale(0.98); } }
.msg-you { transform-origin: bottom right; }
.msg-pilot { transform-origin: bottom left; }

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

.section { padding: 72px 0; border-top: 1px solid var(--rule); }
@media (min-width: 960px) { .section { padding: 104px 0; } }
.section-title {
  font: 600 clamp(1.9rem, 4vw, 2.75rem)/1.1 var(--font-serif);
  letter-spacing: -0.02em; text-wrap: balance;
}

/* what makes it different */
.why .section-title { margin-bottom: 8px; }
.why-row { margin-top: 56px; display: grid; gap: 24px; align-items: center; }
@media (min-width: 880px) {
  .why-row { grid-template-columns: 1fr 1.15fr; gap: 64px; margin-top: 72px; }
  .why-flip .why-copy { order: 2; }
}
.why-title { font: 600 clamp(1.5rem, 1.2rem + 1.2vw, 2rem)/1.15 var(--font-serif); letter-spacing: -0.015em; text-wrap: balance; }
.why-lede { margin-top: 12px; color: var(--ink-2); font-size: 1.0625rem; max-width: 32rem; }
.why-frame { max-width: none; }
.why-frame .msg { max-width: 86%; }
.routes { display: grid; gap: 10px; }
.routes li {
  display: grid; gap: 6px; padding: 12px 14px; border-radius: 16px; background: var(--pilot-bg);
}
.route-q { color: var(--ink); font-size: 0.9688rem; }
.route-to { font: 600 0.875rem/1.3 var(--font-sans); color: var(--accent); }
.route-to em { font-style: normal; font-weight: 400; color: var(--ink-3); margin-left: 4px; }
.read-line { display: inline-flex; align-items: center; gap: 7px; font-size: 0.8125rem; color: var(--ink-3); margin-top: 4px; }
.answer { margin-top: 6px; font-size: 0.9688rem; line-height: 1.55; color: var(--ink); }
.cite {
  display: inline-grid; place-items: center; min-width: 1.15rem; height: 1.15rem; margin-left: 2px; padding: 0 3px;
  border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font: 600 0.6875rem/1 var(--font-sans); vertical-align: 0.2em;
}
.sources { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 8px; }
.sources li {
  display: inline-flex; align-items: center; gap: 7px; padding: 5px 10px 5px 6px;
  border-radius: 999px; box-shadow: 0 0 0 1px var(--rule); font-size: 0.8125rem; color: var(--ink-2);
}
.src-n {
  display: grid; place-items: center; width: 1.15rem; height: 1.15rem; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font: 600 0.6875rem/1 var(--font-sans);
}

/* examples */
.ex-grid { margin-top: 40px; display: grid; gap: 16px; }
@media (min-width: 760px) { .ex-grid { grid-template-columns: 1fr 1fr; gap: 20px; } }
.ex {
  display: flex; flex-direction: column; gap: 8px;
  padding: 24px; border-radius: var(--radius-lg);
  background: var(--bg-raised); box-shadow: 0 0 0 1px var(--rule);
}
.ex-label { margin-bottom: 6px; font: 600 0.8125rem/1.3 var(--font-sans); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.ex .msg { max-width: 88%; }


/* FAQ */
.faq-wrap { display: grid; gap: 32px; }
@media (min-width: 960px) { .faq-wrap { grid-template-columns: 1fr 2fr; gap: 64px; } }
.faq-list { display: grid; }
.faq-list > div { padding: 20px 0; border-top: 1px solid var(--rule); }
.faq-list > div:first-child { border-top: 0; padding-top: 0; }
.faq-list dt { font-weight: 600; font-size: 1.0625rem; }
.faq-list dd { margin-top: 6px; color: var(--ink-2); max-width: 40rem; }

/* closing join */
.join-end { background: var(--bg-sunken); }
.join-end-inner { display: flex; flex-direction: column; align-items: center; text-align: center; }
.join-end-mark { margin-bottom: 20px; }
.join-centered { margin-left: auto; margin-right: auto; width: 100%; text-align: left; }
.join-centered .join-fine { margin-left: auto; margin-right: auto; text-align: center; }

/* footer */
.foot { padding: 28px 0 40px; font-size: 0.875rem; color: var(--ink-3); }
.foot-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.foot-row .brand { margin-right: auto; color: var(--ink); }
.foot a { color: inherit; }
