/* ============ AI Visibility Scanner — fluid animated shell ============ */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body, h1, h2, h3, p, figure, ul, blockquote { margin: 0; }
img { display: block; max-width: 100%; }
button, input { font: inherit; }

:root {
  color-scheme: dark;
  --bg: #0d111b;
  --bg-2: #0a0e17;
  --raised: #151b28;
  --text: #f2f5fa;
  --muted: #aeb9cc;
  --dim: #7f8ca3;
  --hairline: #2a3549;
  --accent: #7d97c8;
  --accent-2: #9db4d8;
  --win: #3ddc97;
  --gap: #ff5a5a;
  --warn: #d9c27a;

  --display: "termina", ui-sans-serif, system-ui, sans-serif;
  --body: "halyard-text", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --serif: "moret", Georgia, serif;

  --ease: cubic-bezier(.22, 1, .36, 1);
}

body {
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -.03em; }
h1, h2 { font-family: var(--serif); letter-spacing: 0; }
a { color: inherit; }
::selection { background: rgba(125,151,200,.36); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---------- aurora background ---------- */
.aurora { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .40;
  mix-blend-mode: screen; animation: drift 22s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 46vw; height: 46vw; left: -8vw; top: -10vh; background: radial-gradient(circle, #2f4a86, transparent 68%); }
.aurora span:nth-child(2) { width: 40vw; height: 40vw; right: -6vw; top: 14vh; background: radial-gradient(circle, #7d97c8, transparent 66%); animation-delay: -7s; }
.aurora span:nth-child(3) { width: 38vw; height: 38vw; left: 26vw; bottom: -16vh; background: radial-gradient(circle, #35507f, transparent 68%); animation-delay: -13s; }
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(4vw,3vh,0) scale(1.14); }
  100% { transform: translate3d(-3vw,-2vh,0) scale(.96); }
}

/* ---------- header / footer ---------- */
.site-header {
  position: relative; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px clamp(20px, 5vw, 56px);
}
.brand-logo { width: clamp(150px, 15vw, 200px); height: auto; }
.header-tag {
  font-family: var(--display); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--dim);
}
.site-footer {
  position: relative; z-index: 5; text-align: center;
  padding: 60px 24px 48px; margin-top: 40px;
  border-top: 1px solid var(--hairline);
}
.footer-logo { width: 160px; margin: 0 auto 18px; opacity: .8; }
.site-footer p { color: var(--dim); font-size: 14px; line-height: 1.6; }
.foot-micro { margin-top: 8px; font-size: 12px; max-width: 460px; margin-inline: auto; }

/* results-only legal disclaimer */
.disclaimer { margin-top: 30px; padding-top: 26px; border-top: 1px solid var(--hairline); }
.disc-inner { max-width: 720px; margin: 0 auto; text-align: left; }
.disc-inner p { color: var(--dim); font-size: 12.5px; line-height: 1.7; margin-bottom: 12px; }
.disc-inner strong { color: var(--muted); }
.disc-inner a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.disc-addr { font-size: 12px; }
.disc-legal { margin-top: 6px; font-size: 12px; }

/* ---------- stage machine ---------- */
#app { position: relative; z-index: 5; }
.stage {
  display: none;
  min-height: 68vh;
  padding: clamp(20px, 4vw, 40px) clamp(20px, 5vw, 56px) 40px;
  align-items: center; justify-content: center;
}
.stage.is-active { display: flex; animation: stageIn .7s var(--ease) both; }
.stage.is-leaving { animation: stageOut .4s var(--ease) both; }
@keyframes stageIn { from { opacity: 0; transform: translateY(18px) scale(.99); } to { opacity: 1; transform: none; } }
@keyframes stageOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-14px) scale(.99); } }

/* ---------- shared type ---------- */
.eyebrow {
  font-family: var(--display); color: var(--accent);
  font-size: 11px; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  display: inline-flex; align-items: center; gap: 9px;
}
.accent-text { color: var(--accent-2); }

/* ---------- STATE 1: form ---------- */
.form-wrap { width: min(100%, 620px); text-align: center; }
.form-wrap h1 { margin-top: 20px; font-size: clamp(42px, 6.2vw, 74px); line-height: 1.03; text-wrap: balance; }
.form-wrap h1 .hl, .res-hero h2 .hl { position: relative; white-space: nowrap; color: var(--win); padding: 0 .3em; margin: 0 .04em; background: rgba(61, 220, 151, .13); }
.form-wrap h1 .hl::before, .form-wrap h1 .hl::after,
.res-hero h2 .hl::before, .res-hero h2 .hl::after {
  content: ""; position: absolute; top: 50%; transform: translateY(-50%) scaleY(.4);
  width: .09em; height: 1.15em; border-radius: .05em; pointer-events: none;
  background: var(--win);
  opacity: 0; animation: hlBar .5s var(--ease) .6s forwards;
}
.form-wrap h1 .hl::before, .res-hero h2 .hl::before { left: 0; }
.form-wrap h1 .hl::after, .res-hero h2 .hl::after { right: 0; }
@keyframes hlBar { to { opacity: 1; transform: translateY(-50%) scaleY(1); } }
.hero-url {
  margin: 16px auto 0; display: inline-flex; align-items: center; gap: 9px;
  padding: 8px 16px; border: 1px solid var(--hairline); border-radius: 999px;
  background: rgba(21,27,40,.6); color: var(--accent-2); font-size: 14px;
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
}
.hero-url i { color: var(--dim); font-size: 12px; }
.form-wrap .lead { margin: 22px auto 0; max-width: 540px; color: var(--muted); font-size: 18px; line-height: 1.62; }
.form-wrap .lead em { color: var(--text); font-style: normal; font-weight: 400; }

.scan-form { margin-top: 40px; text-align: left; }
.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 8px; font-size: 13.5px; color: var(--muted); letter-spacing: .01em; }
.field label .opt { color: var(--dim); }
.input-shell {
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--hairline); border-radius: 3px;
  background: rgba(21,27,40,.7); backdrop-filter: blur(8px);
  padding: 0 16px; height: 56px;
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease), background .25s var(--ease);
}
.input-shell i { color: var(--dim); font-size: 15px; transition: color .25s; }
.input-shell input { flex: 1; height: 100%; border: 0; background: transparent; color: var(--text); outline: none; }
.input-shell input::placeholder { color: #5c6882; }
.input-shell:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(125,151,200,.14); background: rgba(21,27,40,.95); }
.input-shell:focus-within i { color: var(--accent); }
.input-shell.invalid { border-color: var(--gap); box-shadow: 0 0 0 4px rgba(217,154,122,.12); }

.btn-primary {
  position: relative; overflow: hidden;
  width: 100%; margin-top: 26px; height: 60px;
  display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 3px; cursor: pointer;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #0b0f18; font-family: var(--display); font-weight: 700;
  font-size: 14px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none;
  transition: transform .2s var(--ease), box-shadow .3s var(--ease);
  box-shadow: 0 14px 40px rgba(125,151,200,.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 54px rgba(125,151,200,.42); }
.btn-primary:active { transform: translateY(0); }
.btn-primary::after {
  content: ""; position: absolute; top: 0; left: -60%; width: 40%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,.5), transparent);
  transform: skewX(-18deg); animation: sheen 3.4s var(--ease) infinite;
}
@keyframes sheen { 0%, 55% { left: -60%; } 100% { left: 140%; } }
.btn-primary.loading { pointer-events: none; }
.btn-primary.loading .btn-label { opacity: .6; }

.micro { margin-top: 18px; text-align: center; color: var(--dim); font-size: 12.5px; letter-spacing: .01em; }
.micro i { margin-right: 6px; color: var(--accent); }

/* consent checkbox */
.consent { display: flex; align-items: flex-start; gap: 12px; margin-top: 22px; cursor: pointer; text-align: left; }
.consent input { position: absolute; opacity: 0; width: 0; height: 0; }
.consent-box {
  flex: 0 0 auto; width: 22px; height: 22px; margin-top: 1px;
  border: 1px solid var(--hairline); border-radius: 4px;
  background: rgba(21,27,40,.7); display: grid; place-items: center;
  transition: all .2s var(--ease);
}
.consent-box i { color: #0b0f18; font-size: 12px; opacity: 0; transform: scale(.5); transition: all .2s var(--ease); }
.consent input:checked + .consent-box { background: var(--accent); border-color: var(--accent); }
.consent input:checked + .consent-box i { opacity: 1; transform: scale(1); }
.consent input:focus-visible + .consent-box { box-shadow: 0 0 0 4px rgba(125,151,200,.2); }
.consent-text { color: var(--muted); font-size: 13px; line-height: 1.55; }
.consent-text a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 2px; }
.consent.shake { animation: shake .4s var(--ease); }
.consent.shake .consent-box { border-color: var(--gap); box-shadow: 0 0 0 4px rgba(217,154,122,.15); }
@keyframes shake { 0%,100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }
.consent-nudge { margin-top: 12px; text-align: center; color: var(--gap); font-size: 13px; }

/* staggered reveal on load */
.reveal { opacity: 0; transform: translateY(16px); animation: revealUp .7s var(--ease) forwards; animation-delay: calc(var(--d) * .09s + .1s); }
@keyframes revealUp { to { opacity: 1; transform: none; } }

/* ---------- STATE 2: calculating ---------- */
.calc-wrap { width: min(100%, 560px); text-align: center; }
.orb { position: relative; width: 150px; height: 150px; margin: 0 auto 34px; }
.orb-ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid var(--hairline); }
.orb-ring.r1 { border-top-color: var(--accent); animation: spin 2.4s linear infinite; }
.orb-ring.r2 { inset: 16px; border-right-color: var(--accent-2); animation: spin 3.2s linear infinite reverse; }
.orb-ring.r3 { inset: 32px; border-bottom-color: var(--win); animation: spin 2s linear infinite; }
.orb-core {
  position: absolute; inset: 48px; border-radius: 50%;
  display: grid; place-items: center;
  background: radial-gradient(circle at 35% 30%, #223052, #0d111b);
  color: var(--accent-2); font-size: 26px;
  box-shadow: 0 0 40px rgba(125,151,200,.45), inset 0 0 20px rgba(125,151,200,.25);
  animation: pulse 1.8s var(--ease) infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.08); } }

.calc-wrap h2 { font-size: clamp(24px, 3.4vw, 34px); }
.calc-sub { margin-top: 12px; color: var(--muted); font-size: 16px; }
.calc-sub strong { color: var(--accent-2); }

.calc-steps { list-style: none; padding: 0; margin: 34px auto 0; max-width: 420px; text-align: left; }
.calc-steps li {
  display: flex; align-items: center; gap: 14px;
  padding: 11px 0; color: var(--dim); font-size: 15.5px;
  opacity: .4; transition: opacity .5s var(--ease), color .5s var(--ease);
}
.calc-steps li .dot {
  width: 20px; height: 20px; border-radius: 50%; flex: 0 0 auto;
  border: 1px solid var(--hairline); position: relative;
  transition: all .4s var(--ease);
}
.calc-steps li.active { opacity: 1; color: var(--text); }
.calc-steps li.active .dot { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(125,151,200,.15); }
.calc-steps li.active .dot::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%;
  border: 2px solid var(--accent); border-top-color: transparent; animation: spin .7s linear infinite;
}
.calc-steps li.done { opacity: 1; color: var(--muted); }
.calc-steps li.done .dot { border-color: var(--win); background: var(--win); }
.calc-steps li.done .dot::before {
  content: "\f00c"; font: 900 10px "Font Awesome 6 Free"; color: #0d111b;
  position: absolute; inset: 0; display: grid; place-items: center;
}

.calc-bar { margin-top: 30px; height: 4px; border-radius: 4px; background: var(--hairline); overflow: hidden; }
.calc-bar span { display: block; height: 100%; width: 0%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .5s var(--ease); }

/* ---------- STATE 3: results ---------- */
.results-wrap { width: min(100%, 860px); }
.r-reveal { opacity: 0; transform: translateY(24px); }
.r-reveal.show { animation: revealUp .8s var(--ease) forwards; animation-delay: calc(var(--rd) * .14s); }

.res-hero { text-align: center; }
.res-hero h2 { margin-top: 16px; font-size: clamp(40px, 5.8vw, 68px); line-height: 1.04; text-wrap: balance; }
.res-sub { margin: 20px auto 0; max-width: 620px; color: var(--muted); font-size: 17px; line-height: 1.66; }

.scorecard { margin-top: 44px; display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; }
.score-card { border: 1px solid var(--hairline); background: rgba(21,27,40,.7); backdrop-filter: blur(8px); padding: 30px 30px; }
.score-card.headline.gap { border-color: rgba(255,90,90,.4); background: linear-gradient(160deg, rgba(255,90,90,.09), rgba(21,27,40,.7)); }
.score-label { font-family: var(--display); color: var(--accent); font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; display: flex; align-items: center; gap: 9px; }
.score-big { margin-top: 14px; font-family: var(--display); font-weight: 600; font-size: clamp(48px, 7vw, 76px); line-height: .9; }
.score-card.gap .score-big { color: var(--gap); }
.score-big .of { color: var(--dim); font-size: .4em; }
.score-note { margin-top: 14px; color: var(--muted); font-size: 15px; line-height: 1.58; }
.split-row { margin-top: 18px; display: grid; gap: 14px; }
.mini { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 12px; border-bottom: 1px solid var(--hairline); }
.mini:last-child { border-bottom: 0; padding-bottom: 0; }
.mini .k { color: var(--muted); font-size: 14px; }
.mini .v { font-family: var(--display); font-weight: 600; font-size: 21px; }
.mini .v.win { color: var(--win); }

.res-engines { margin-top: 40px; }
/* email / full-report banner */
.res-email { margin-top: 40px; display: flex; gap: 20px; align-items: flex-start; border: 1px solid rgba(61,220,151,.3); background: linear-gradient(160deg, rgba(61,220,151,.09), rgba(21,27,40,.6)); border-radius: 4px; padding: 28px 30px; }
.re-icon { flex: 0 0 auto; display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; border: 1px solid rgba(61,220,151,.38); color: var(--win); font-size: 22px; }
.re-title { font-family: var(--display); font-weight: 600; font-size: 18px; letter-spacing: -.01em; }
.re-title strong { color: var(--win); font-weight: 600; }
.re-sub { margin-top: 10px; color: var(--muted); font-size: 15px; line-height: 1.62; }
.re-link { margin-top: 16px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; border: 1px dashed var(--hairline); border-radius: 3px; background: rgba(13,17,27,.5); font-size: 13.5px; color: var(--accent-2); font-family: ui-monospace, "SF Mono", Menlo, monospace; }
.re-link > i { color: var(--dim); }
.re-status { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--warn); }
.re-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--warn); box-shadow: 0 0 0 0 rgba(217,194,122,.6); animation: livePulse 1.6s var(--ease) infinite; }
@keyframes livePulse { 0% { box-shadow: 0 0 0 0 rgba(217,194,122,.5); } 70% { box-shadow: 0 0 0 7px rgba(217,194,122,0); } 100% { box-shadow: 0 0 0 0 rgba(217,194,122,0); } }

.mini-h { font-family: var(--display); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); text-align: center; margin-bottom: 18px; }
.engine-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.engine { border: 1px solid var(--hairline); background: rgba(21,27,40,.6); padding: 22px 14px; text-align: center; border-radius: 3px; }
.e-icon { display: grid; place-items: center; width: 44px; height: 44px; margin: 0 auto 12px; border-radius: 50%; font-size: 18px; border: 1px solid var(--hairline); }
.e-icon.perp { color: #6fd0c4; } .e-icon.oai { color: #9db4d8; } .e-icon.goog { color: #e0a97a; } .e-icon.gem { color: #a99df0; }
.e-name { display: block; font-size: 14px; margin-bottom: 12px; color: var(--text); }
.badge { display: inline-block; font-family: var(--display); font-size: 10px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; padding: 5px 10px; border-radius: 2px; border: 1px solid; }
.badge.no { color: var(--gap); border-color: rgba(255,90,90,.42); }
.badge.warn { color: var(--warn); border-color: rgba(217,194,122,.4); }
.badge.yes { color: var(--win); border-color: rgba(61,220,151,.45); }

.res-reframe { margin-top: 46px; text-align: center; }
.res-reframe i { color: var(--accent); font-size: 26px; }
.res-reframe blockquote { margin-top: 18px; font-family: var(--serif); font-weight: 600; font-size: clamp(21px, 2.6vw, 30px); line-height: 1.4; color: var(--text); }

.res-cta { margin-top: 50px; text-align: center; border: 1px solid var(--hairline); background: linear-gradient(160deg, rgba(125,151,200,.08), rgba(21,27,40,.6)); border-radius: 4px; padding: 44px 32px; }
.cta-icon { display: grid; place-items: center; width: 58px; height: 58px; margin: 0 auto 22px; border-radius: 50%; border: 1px solid var(--hairline); color: var(--accent); font-size: 21px; }
.res-cta h3 { font-size: clamp(22px, 2.8vw, 30px); line-height: 1.14; text-wrap: balance; }
.res-cta p { margin: 16px auto 0; max-width: 520px; color: var(--muted); font-size: 16px; line-height: 1.62; }
.res-cta .btn-primary { width: auto; padding: 0 34px; margin-top: 30px; }
.btn-ghost { display: block; margin: 20px auto 0; background: transparent; border: 0; color: var(--dim); font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:hover { color: var(--text); }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .scorecard { grid-template-columns: 1fr; }
  .engine-grid { grid-template-columns: repeat(2, 1fr); }
  .form-wrap h1 { font-size: clamp(30px, 8vw, 44px); }
}
@media (prefers-reduced-motion: reduce) {
  .aurora span, .btn-primary::after, .orb-ring, .orb-core { animation: none !important; }
  .reveal, .r-reveal { animation: none !important; opacity: 1 !important; transform: none !important; }
  .stage.is-active { animation: none; }
}

/* honeypot — visually hidden, off-screen (bots still see it) */
.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
