:root {
  --bg: #f3ecdf;
  --paper: #faf6ee;
  --ink: #2b2620;
  --ink-2: #554c41;
  --muted: #8c8273;
  --line: #e1d6c3;
  --pill: #e9dfcd;
  --accent: #9a4e2e;
  --sage: #5f6f5a;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --read: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans: "Inter", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --ease: cubic-bezier(.2, .7, .2, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 50% -10%, #f8f2e6 0%, transparent 60%),
    radial-gradient(900px 500px at 100% 110%, #efe4d1 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  font: 400 15px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}
body::before { /* paper grain */
  content: "";
  position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .55 0 0 0 0 .5 0 0 0 0 .42 0 0 0 .09 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
::selection { background: #e6cdb8; }
button { font: inherit; color: inherit; cursor: pointer; }
[hidden] { display: none !important; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(16px, 4vw, 40px);
  background: linear-gradient(var(--bg) 60%, transparent);
}
.mark { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.mark-dot { width: 26px; height: 26px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232B2620' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M7 4h10a4 4 0 0 1 4 4v4a4 4 0 0 1-4 4h-7l-4 4v-4.4A4 4 0 0 1 3 12V8a4 4 0 0 1 4-4z'/%3E%3C/svg%3E") center / contain no-repeat; }
.mark-word { font: 400 24px/1 var(--serif); letter-spacing: .01em; }
.top-right { display: flex; align-items: center; gap: 14px; }
.seal { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); letter-spacing: .01em; }
.seal svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }
.researched { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--sage); animation: rise .6s var(--ease) both; }
.researched svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.btn-quiet {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 7px 16px; font-size: 13px; font-weight: 500; transition: border-color .2s, background .2s;
}
.btn-quiet:hover { border-color: #cbbda6; background: #fff; }

main { position: relative; z-index: 1; flex: 1; display: flex; flex-direction: column; }
.view { flex: 1; display: flex; flex-direction: column; animation: rise .7s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* ---------- connect ---------- */
.connect { width: min(620px, 100%); margin: 0 auto; padding: clamp(24px, 7vh, 80px) 16px 64px; }
.eyebrow { margin: 0 0 22px; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.eyebrow span { color: var(--accent); font-weight: 600; }
h1 { font: 400 clamp(40px, 7vw, 62px)/1.02 var(--serif); letter-spacing: -.01em; margin: 0 0 22px; }
h1 em { font-style: italic; color: var(--accent); }
.lede { font: 400 18.5px/1.55 var(--read); color: var(--ink-2); margin: 0 0 34px; max-width: 34em; }

.actions { display: flex; align-items: center; flex-wrap: wrap; gap: 14px 26px; }
.btn-google {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 14px 24px 14px 20px; border-radius: 999px;
  background: var(--ink); color: var(--paper); text-decoration: none; font-weight: 500; font-size: 15px;
  box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 10px 24px -12px rgba(43,38,32,.55);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), opacity .2s;
}
.btn-google svg { width: 20px; height: 20px; background: #fff; border-radius: 50%; padding: 3px; }
.btn-google:hover { transform: translateY(-1px); box-shadow: 0 1px 0 rgba(255,255,255,.08) inset, 0 16px 30px -14px rgba(43,38,32,.6); }
.btn-google[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--ink-2); font-size: 15px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s; }
.btn-link:hover { color: var(--ink); border-color: var(--ink); }
.btn-link span { display: inline-block; transition: transform .25s var(--ease); }
.btn-link:hover span { transform: translateX(3px); }
.notice { margin: 18px 0 0; font-size: 14px; color: var(--accent); }

.assure {
  margin-top: 48px; padding: 24px 26px 8px;
  background: color-mix(in srgb, var(--paper) 75%, transparent);
  border: 1px solid var(--line); border-radius: 20px;
}
.assure-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.assure-lock { width: 22px; height: 22px; fill: none; stroke: var(--sage); stroke-width: 1.6; stroke-linecap: round; }
.assure h2 { font: 400 22px/1.2 var(--serif); margin: 0; }
.assure ul { list-style: none; margin: 0; padding: 0; }
.assure li { padding: 12px 0 14px 34px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 14.5px; position: relative; }
.assure li:first-child { border-top: 0; }
.assure li::before { content: ""; position: absolute; left: 6px; top: 20px; width: 10px; height: 10px; border-radius: 50%; border: 1.5px solid var(--sage); }
.assure b { color: var(--ink); font-weight: 600; }

/* ---------- secure / lock ---------- */
.secure { margin: auto; padding: 40px 16px 80px; text-align: center; width: min(520px, 100%); }
.lock-stage { position: relative; width: 220px; height: 220px; margin: 0 auto 28px; }
.lock { position: absolute; left: 50%; top: 50%; width: 112px; height: 130px; transform: translate(-50%, -50%); overflow: visible; }
.lock .shackle { fill: none; stroke: var(--ink); stroke-width: 9; stroke-linecap: round; transform: translateY(-17px); transition: transform .6s cubic-bezier(.5, 1.9, .55, 1) .1s; }
.lock .body { fill: var(--ink); transform-origin: 60px 93px; }
.lock .keyhole { fill: var(--bg); transition: opacity .25s ease .55s; }
.lock .check { fill: none; stroke: var(--bg); stroke-width: 7; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 60; stroke-dashoffset: 60; transition: stroke-dashoffset .55s var(--ease) .75s; }

.letter {
  position: absolute; left: 50%; top: 50%; width: 30px; height: 21px; margin: -10px 0 0 -15px;
  border: 1.5px solid var(--ink-2); border-radius: 4px; background: var(--paper); opacity: 0;
  animation: drift 2.6s var(--ease) infinite;
}
.letter::after { /* envelope flap */
  content: ""; position: absolute; left: 4px; right: 4px; top: 2px; height: 9px;
  border: 1.5px solid var(--ink-2); border-top: 0; border-left-color: transparent; border-right-color: transparent;
  border-bottom-left-radius: 2px; border-bottom-right-radius: 2px;
  background: linear-gradient(to bottom right, transparent 47%, var(--ink-2) 49%, var(--ink-2) 53%, transparent 55%) left/50% 100% no-repeat,
              linear-gradient(to bottom left, transparent 47%, var(--ink-2) 49%, var(--ink-2) 53%, transparent 55%) right/50% 100% no-repeat;
  border: 0;
}
.l1 { --x: -96px; --y: -62px; --r: -14deg; animation-delay: 0s; }
.l2 { --x: 98px;  --y: -40px; --r: 12deg;  animation-delay: .45s; }
.l3 { --x: -86px; --y: 58px;  --r: 10deg;  animation-delay: .9s; }
.l4 { --x: 92px;  --y: 70px;  --r: -8deg;  animation-delay: 1.35s; }
.l5 { --x: -10px; --y: -104px; --r: 6deg;  animation-delay: 1.8s; }
.l6 { --x: 4px;   --y: 104px; --r: -6deg;  animation-delay: 2.2s; }
@keyframes drift {
  0% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)) scale(1); }
  25% { opacity: 1; }
  80% { opacity: .9; transform: translate(0, 14px) rotate(0) scale(.35); }
  100% { opacity: 0; transform: translate(0, 14px) rotate(0) scale(.2); }
}

.ring { position: absolute; inset: 30px; border-radius: 50%; border: 1.5px solid var(--sage); opacity: 0; }

.lock-stage[data-state="reading"] .lock { animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { transform: translate(-50%, -50%) scale(1.03); } }

.lock-stage[data-state="sealed"] .letter { animation: none; opacity: 0; transition: opacity .3s; }
.lock-stage[data-state="sealed"] .shackle { transform: translateY(0); }
.lock-stage[data-state="sealed"] .body { animation: thunk .45s var(--ease) .38s; }
.lock-stage[data-state="sealed"] .keyhole { opacity: 0; }
.lock-stage[data-state="sealed"] .check { stroke-dashoffset: 0; }
.lock-stage[data-state="sealed"] .ring { animation: ripple 1.6s var(--ease) both; }
.lock-stage[data-state="sealed"] .r1 { animation-delay: .45s; }
.lock-stage[data-state="sealed"] .r2 { animation-delay: .7s; }
.lock-stage[data-state="sealed"] .r3 { animation-delay: .95s; }
@keyframes thunk { 40% { transform: scale(1.06, .95); } }
@keyframes ripple { 0% { opacity: .7; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.35); } }

.secure-status { font: 400 30px/1.2 var(--serif); margin: 0 0 8px; transition: opacity .3s; }
.secure-detail { margin: 0 auto; color: var(--muted); font-size: 14px; max-width: 30em; }
.secure-done { margin-top: 28px; animation: rise .7s var(--ease) both; }
.secure-summary { font: italic 400 19px/1.55 var(--read); color: var(--ink-2); margin: 0 auto 28px; max-width: 30em; }
.btn-primary {
  border: 0; border-radius: 999px; padding: 14px 28px; background: var(--ink); color: var(--paper);
  font-weight: 500; font-size: 15px; box-shadow: 0 10px 24px -12px rgba(43,38,32,.55);
  transition: transform .25s var(--ease);
}
.btn-primary:hover { transform: translateY(-1px); }

/* ---------- interview ---------- */
#v-chat { width: min(700px, 100%); margin: 0 auto; padding: 0 16px; }
.thread { flex: 1; padding: 28px 0 24px; display: flex; flex-direction: column; gap: 26px; }
.msg { animation: rise .5s var(--ease) both; max-width: 100%; overflow-wrap: anywhere; white-space: pre-wrap; }
.msg.agent { font: 400 19.5px/1.6 var(--read); color: var(--ink); padding-left: 22px; position: relative; }
.msg.agent::before { content: ""; position: absolute; left: 0; top: .72em; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); opacity: .85; }
.msg.user {
  align-self: flex-end; max-width: min(85%, 520px);
  background: var(--pill); color: var(--ink); padding: 12px 18px; border-radius: 20px 20px 6px 20px; font-size: 15.5px;
}
.msg.agent.streaming::after { content: ""; display: inline-block; width: 2px; height: 1.05em; margin-left: 2px; vertical-align: -.15em; background: var(--accent); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { opacity: 0; } }
.typing { display: inline-flex; gap: 6px; padding: 10px 0 0; }
.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: dot 1.3s ease-in-out infinite; }
.typing i:nth-child(2) { animation-delay: .15s; }
.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.day { align-self: center; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.composer {
  position: sticky; bottom: 0; z-index: 3;
  display: flex; align-items: flex-end; gap: 10px;
  margin: 0 -6px 20px; padding: 10px 10px 10px 20px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 26px;
  box-shadow: 0 18px 40px -26px rgba(43,38,32,.45), 0 0 0 6px var(--bg);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: #cdbfa7; }
.composer textarea {
  flex: 1; border: 0; outline: 0; resize: none; background: transparent;
  font: 400 16px/1.5 var(--sans); color: var(--ink); padding: 9px 0; max-height: 200px;
}
.composer textarea::placeholder { color: var(--muted); }
.send {
  flex: none; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--ink);
  display: grid; place-items: center; transition: opacity .2s, transform .2s var(--ease);
}
.send svg { width: 18px; height: 18px; fill: none; stroke: var(--paper); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.send:disabled { opacity: .3; cursor: default; }
.send:not(:disabled):hover { transform: translateY(-1px); }


/* ---------- summary ---------- */
.done { width: min(720px, 100%); margin: 0 auto; padding: clamp(24px, 6vh, 64px) 16px 80px; }
.done h1 { font-size: clamp(36px, 6vw, 52px); }
.done .lede { margin-bottom: 40px; }
.finding {
  background: var(--paper); border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; margin-bottom: 16px;
  animation: rise .6s var(--ease) both;
}
.finding-head { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.finding h3 { font: 400 23px/1.25 var(--serif); margin: 0 0 8px; }
.sev { display: inline-flex; gap: 4px; flex: none; }
.sev i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.sev i.on { background: var(--accent); }
.finding p { margin: 0 0 12px; color: var(--ink-2); }
.finding blockquote { margin: 0 0 14px; padding-left: 16px; border-left: 2px solid var(--accent); font: italic 400 17px/1.5 var(--read); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: 12.5px; background: var(--pill); color: var(--ink-2); padding: 4px 11px; border-radius: 999px; }
.sub { font: 400 24px/1.2 var(--serif); margin: 40px 0 12px; }
.plain { margin: 0; padding-left: 20px; color: var(--ink-2); }
.plain li { margin: 6px 0; }
.thanks { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.insights { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; margin: 0 0 28px; }
.insight { background: var(--paper); border: 1px solid var(--line); border-radius: 18px; padding: 16px 18px 18px; display: flex; flex-direction: column; animation: rise .6s var(--ease) both; }
.insight-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.insight-n { font: italic 400 20px/1 var(--serif); color: var(--accent); }
.insight h3 { font: 400 21px/1.2 var(--serif); margin: 0 0 12px; }
.stats { display: flex; gap: 14px; margin: 0 0 12px; }
.stat b { display: block; font: 500 15px/1.25 var(--sans); color: var(--ink); }
.stat span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.insight blockquote { margin: auto 0 0; padding-left: 12px; border-left: 2px solid var(--accent); font: italic 400 15px/1.45 var(--read); color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.dl { display: flex; align-items: center; gap: 12px 18px; flex-wrap: wrap; }
.dl .btn-primary { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; }
.dl svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dl p { flex: 1; min-width: 220px; margin: 0; font-size: 13.5px; color: var(--muted); }
.share { margin-top: 32px; }
.share-h { margin: 0 0 10px; font-size: 14px; color: var(--ink-2); }
.share input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: 400 16px/1.5 var(--sans); padding: 9px 0; }
.share .btn-primary { padding: 10px 20px; }
.gathering { margin: auto; text-align: center; padding: 80px 16px; }
.gathering .typing { justify-content: center; }

@media (max-width: 560px) {
  .seal, .researched { display: none; }
  .msg.agent { font-size: 18px; }
  .assure { padding: 20px 18px 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- start-page form ---------- */
.about { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px; align-items: end; margin-top: 22px; animation: rise .5s var(--ease) both; }
.about label { display: grid; gap: 6px; font-size: 12.5px; color: var(--muted); letter-spacing: .02em; }
.about input {
  font: 400 15px/1.4 var(--sans); color: var(--ink); background: var(--paper);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; outline: 0; min-width: 0;
  transition: border-color .2s;
}
.about input:focus { border-color: #cbbda6; }
.about .btn-primary { padding: 13px 24px; }
@media (max-width: 560px) { .about { grid-template-columns: 1fr; } }

/* ---------- profile-building steps ---------- */
.prep { margin: 30px auto 0; width: min(360px, 100%); text-align: left; animation: rise .6s var(--ease) both; }
.prep-title { font: 400 24px/1.2 var(--serif); margin: 0 0 14px; text-align: center; }
.steps { list-style: none; margin: 0 0 26px; padding: 0; }
.steps li { display: flex; align-items: center; gap: 12px; padding: 7px 0; font-size: 14.5px; color: var(--muted); transition: color .3s; }
.steps li::before {
  content: ""; flex: none; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--line); border-top-color: var(--accent); animation: spin .9s linear infinite;
}
.steps li.done, .steps li.cached { color: var(--ink); }
.steps li.done::before, .steps li.cached::before {
  animation: none; border-color: var(--sage); background: var(--sage) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M3.5 7.2l2.3 2.3 4.7-5' fill='none' stroke='%23faf6ee' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/100% no-repeat;
}
.steps li.failed, .steps li.skipped { color: #b9ae9c; text-decoration: line-through; }
.steps li.failed::before, .steps li.skipped::before { animation: none; border-color: var(--line); }
.prep .btn-primary { display: block; margin: 0 auto; }
.btn-primary:disabled { opacity: .45; cursor: default; transform: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- interview progress (a rough indicator, never a number) ---------- */
.top { position: sticky; }
.progress {
  position: absolute; left: 50%; bottom: 2px; transform: translateX(-50%);
  width: min(668px, calc(100% - 32px)); height: 3px; border-radius: 3px;
  background: var(--line); overflow: hidden;
}
.progress span {
  display: block; height: 100%; width: 4%; border-radius: inherit;
  background: linear-gradient(90deg, var(--sage), var(--accent));
  transition: width 1.4s var(--ease);
}
