/* ============================================================
   KittyScore — styles
   Look: cream paper, deep purple ink, hot-pink + yellow stickers.
   Signature device: bold outlines with hard "sticker" shadows on
   the things you touch and the things you share.
   ============================================================ */

@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 500 700;
  font-display: swap;
}
@font-face {
  font-family: 'Inter';
  src: url('/fonts/inter-latin.woff2') format('woff2');
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --purple: #2D1654;
  --pink: #FF4081;
  --yellow: #FFB703;
  --teal: #2EC4B6;
  --cream: #F8EDEB;
  --white: #FFFFFF;
  --navy: #0F172A;
  --ink-soft: #5B4B7A;
  --line: #E7D8DA;

  --display: 'Fredoka', 'Arial Rounded MT Bold', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --step--1: 0.875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.563rem;
  --step-3: 1.953rem;
  --step-4: clamp(2.2rem, 7vw, 3.6rem);

  --sticker: 4px 4px 0 var(--purple);
  --sticker-lg: 6px 6px 0 var(--purple);
  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 28px;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--purple);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
h1, h2, h3 { font-family: var(--display); line-height: 1.08; margin: 0 0 0.5em; font-weight: 700; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
p { margin: 0 0 1em; }
a { color: inherit; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--pink); outline-offset: 3px; border-radius: 6px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- logo ---------- */
.logo {
  display: inline-flex; align-items: flex-end; gap: 0.15em;
  font-family: var(--display); font-weight: 700; font-size: 1.7rem;
  text-decoration: none; letter-spacing: -0.01em; line-height: 1;
}
.logo__mark { width: 1.15em; height: 1.15em; margin-right: 0.12em; align-self: center; }
.logo__kitty { color: var(--purple); }
.logo__score { color: var(--pink); display: inline-flex; align-items: flex-end; }
.logo__paw { width: 0.7em; height: 0.7em; margin: 0 0.02em 0.02em; fill: var(--pink); }

/* ---------- header ---------- */
.site-header { padding: 0.9rem 0; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.site-nav { display: flex; align-items: center; gap: 1.25rem; font-weight: 600; font-size: var(--step--1); }
.site-nav a:not(.btn) { text-decoration: none; }
.site-nav a:not(.btn):hover { color: var(--pink); }
.site-nav .nav-link { display: none; }
@media (min-width: 720px) { .site-nav .nav-link { display: inline; } }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 52px; padding: 0.8rem 1.6rem;
  font-family: var(--display); font-weight: 600; font-size: 1.15rem;
  border: 3px solid var(--purple); border-radius: 999px;
  text-decoration: none; cursor: pointer;
  box-shadow: var(--sticker);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--purple); }
.btn--pink { background: var(--pink); color: var(--white); }
.btn--purple { background: var(--purple); color: var(--white); box-shadow: 4px 4px 0 var(--pink); }
.btn--teal { background: var(--teal); color: var(--purple); }
.btn--ghost { background: var(--white); color: var(--purple); }
.btn--small { min-height: 40px; padding: 0.45rem 1.05rem; font-size: 0.98rem; border-width: 2px; box-shadow: 3px 3px 0 var(--purple); }
.btn--block { width: 100%; }
.link-btn { background: none; border: 0; padding: 0.5rem; text-decoration: underline; cursor: pointer; font-weight: 600; color: var(--ink-soft); }

/* ---------- hero ---------- */
.hero { padding: 1.5rem 0 3.5rem; overflow: hidden; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr 0.95fr; } .hero { padding: 3rem 0 5rem; } }
.hero h1 { font-size: var(--step-4); letter-spacing: -0.02em; margin-bottom: 0.4em; }
.hero h1 .pop { color: var(--pink); display: block; }
.hero__sub { font-size: var(--step-1); max-width: 34ch; color: var(--ink-soft); }
.hero__micro { margin-top: 1.1rem; font-size: var(--step--1); font-weight: 600; color: var(--ink-soft); }
.hero__micro span + span::before { content: ''; display: inline-block; width: 5px; height: 5px; margin: 0 0.6rem 0.15em; border-radius: 50%; background: var(--pink); }

.hero__art { position: relative; justify-self: center; width: min(88vw, 400px); padding: 1.5rem 1rem 2rem; }
.polaroid {
  margin: 0; background: var(--white); padding: 14px 14px 0;
  border: 3px solid var(--purple); border-radius: var(--radius-sm);
  box-shadow: var(--sticker-lg);
}
.polaroid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.polaroid figcaption { font-family: var(--display); font-weight: 700; font-size: 1.5rem; text-align: center; padding: 0.4rem 0 0.6rem; }
.hero .polaroid { transform: rotate(-3deg); }
.sticker {
  position: absolute; font-family: var(--display); font-weight: 700;
  border: 3px solid var(--purple); box-shadow: var(--sticker); line-height: 1.15;
}
.sticker--chaos { top: 0.2rem; right: -0.4rem; background: var(--yellow); padding: 0.45rem 0.9rem; border-radius: 10px; transform: rotate(6deg); font-size: 1.15rem; }
.sticker--night { bottom: 4.6rem; left: -0.6rem; background: var(--white); padding: 0.55rem 0.85rem; border-radius: 16px 16px 16px 4px; transform: rotate(-4deg); font-size: 0.95rem; max-width: 13rem; }
.sticker--night b { color: var(--pink); display: block; font-size: 1.05rem; }
.doodle { position: absolute; pointer-events: none; }
.doodle--heart { width: 34px; top: 38%; right: -1.2rem; fill: var(--pink); transform: rotate(14deg); }
.doodle--sparks { width: 46px; top: -0.4rem; left: 0.4rem; stroke: var(--yellow); }

/* ---------- sections ---------- */
.section { padding: 3.5rem 0; }
.section__head { max-width: 40rem; margin-bottom: 2rem; }
.section__head p { color: var(--ink-soft); font-size: var(--step-1); }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.25rem; counter-reset: step; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.steps li { position: relative; padding: 1.5rem 1.4rem 1.4rem 4.6rem; background: var(--white); border-radius: var(--radius); border: 2px solid var(--line); }
.steps li::before {
  counter-increment: step; content: counter(step);
  position: absolute; left: 1.2rem; top: 1.25rem; width: 2.5rem; height: 2.5rem;
  display: grid; place-items: center; border-radius: 50%;
  font-family: var(--display); font-weight: 700; font-size: 1.3rem;
  background: var(--purple); color: var(--white);
}
.steps li:nth-child(2)::before { background: var(--pink); }
.steps li:nth-child(3)::before { background: var(--yellow); color: var(--purple); }
.steps h3 { font-size: var(--step-1); margin-bottom: 0.25em; }
.steps p { margin: 0; color: var(--ink-soft); }

.example { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 900px) { .example { grid-template-columns: 0.9fr 1.1fr; } }
.example__copy p { color: var(--ink-soft); font-size: var(--step-1); max-width: 30ch; }

/* ---------- result card (shared by example + real result) ---------- */
.result-card {
  background: var(--white); border: 3px solid var(--purple); border-radius: var(--radius-lg);
  box-shadow: var(--sticker-lg); padding: 1.4rem;
}
.result-card__head { display: grid; grid-template-columns: 42% 1fr; gap: 1.1rem; align-items: center; margin-bottom: 1.4rem; }
.result-card .polaroid { padding: 8px 8px 0; transform: rotate(-3deg); border-width: 2px; box-shadow: var(--sticker); }
.result-card .polaroid figcaption { font-size: 1.15rem; padding: 0.25rem 0 0.4rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.polaroid__placeholder { display: grid; place-items: center; aspect-ratio: 1; font-size: 3.5rem; background: var(--cream); border-radius: 6px; }
.result-card__label { font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.bignum { font-family: var(--display); font-weight: 700; font-size: clamp(3.4rem, 15vw, 5rem); line-height: 0.95; margin: 0.05em 0 0.15em; font-variant-numeric: tabular-nums; }
.bignum small { font-size: 0.4em; color: var(--pink); margin-left: 0.05em; }
.archetype {
  font-size: clamp(1.25rem, 5vw, 1.65rem); margin: 0 0 0.35em; outline: none;
  display: inline; padding: 0 0.15em;
  background: linear-gradient(transparent 48%, var(--yellow) 48%, var(--yellow) 92%, transparent 92%);
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.result-card__desc { font-size: var(--step--1); color: var(--ink-soft); margin: 0.6em 0 0; }
.result-card__type { margin: -0.2rem 0 1.4rem; }
.result-card__type .archetype { font-size: clamp(1.5rem, 6.4vw, 2rem); }

.bars { display: grid; gap: 0.6rem; }
.bar { display: grid; grid-template-columns: 7.4rem 1fr 2.2rem; align-items: center; gap: 0.7rem; font-size: var(--step--1); font-weight: 600; }
.bar__track { height: 12px; background: #F1E6E8; border-radius: 99px; overflow: hidden; }
.bar__fill { display: block; height: 100%; width: var(--w); background: var(--c); border-radius: 99px; }
.bar__value { font-family: var(--display); font-weight: 700; font-size: 1.05rem; text-align: right; font-variant-numeric: tabular-nums; }
.example .result-card { transform: rotate(1deg); }

/* ---------- tools ---------- */
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.85rem; }
@media (min-width: 760px) { .tools { grid-template-columns: repeat(4, 1fr); } }
.tool {
  display: grid; gap: 0.2rem; padding: 1rem; border-radius: var(--radius);
  background: rgba(255,255,255,0.55); border: 2px dashed #D9C5C9; text-decoration: none; color: var(--ink-soft);
}
.tool__emoji { font-size: 1.6rem; }
.tool__name { font-family: var(--display); font-weight: 600; font-size: 1.08rem; color: var(--purple); }
.tool__status { font-size: 0.8rem; font-weight: 600; }
.tool--live { background: var(--white); border: 2px solid var(--purple); box-shadow: var(--sticker); color: var(--pink); }

/* ---------- footer ---------- */
.site-footer { background: var(--purple); color: #E9E1F5; padding: 2.5rem 0 2rem; margin-top: 3rem; font-size: var(--step--1); }
.site-footer .logo__kitty { color: var(--white); }
.site-footer .disclaimer { max-width: 62ch; margin: 1rem 0 1.4rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; list-style: none; padding: 0; margin: 0 0 1.2rem; font-weight: 600; }
.footer-links a { text-decoration: none; }
.footer-links a:hover { color: var(--yellow); }

/* ---------- flow (/score) ---------- */
.flow { width: min(100% - 2rem, 560px); margin: 0 auto; padding: 0.5rem 0 2rem; }
.progress { height: 10px; background: #EBDDE0; border-radius: 99px; overflow: hidden; margin: 0.25rem 0 1.5rem; }
.progress__fill { display: block; height: 100%; width: 0; background: var(--pink); border-radius: 99px; transition: width 0.35s ease; }
.step h1 { font-size: var(--step-3); outline: none; }
.step__lede { color: var(--ink-soft); }

.dropzone {
  display: grid; justify-items: center; gap: 0.9rem; text-align: center;
  padding: 2.2rem 1.2rem; border: 3px dashed #CDB6BC; border-radius: var(--radius-lg); background: var(--white);
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.is-drag { border-color: var(--pink); background: #FFF3F7; }
.dropzone__icon { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; background: var(--cream); }
.dropzone__icon svg { width: 34px; height: 34px; stroke: var(--purple); }
.dropzone__buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; }
.dropzone small { color: var(--ink-soft); }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.photo-ready { text-align: center; }
.photo-ready .polaroid { width: min(78%, 320px); margin: 0.5rem auto 1.6rem; transform: rotate(-2deg); }
.form-msg { min-height: 1.5em; margin: 0.8rem 0 0; font-weight: 600; text-align: center; color: var(--ink-soft); }
.form-msg--error { color: #C2185B; }
.skip { text-align: center; margin-top: 1rem; }

.field { margin-bottom: 1.4rem; }
.field > label, .field legend { display: block; font-family: var(--display); font-weight: 600; font-size: 1.15rem; margin-bottom: 0.45rem; padding: 0; }
.field legend small, .field label small { font-family: var(--body); font-weight: 500; font-size: 0.85rem; color: var(--ink-soft); }
fieldset.field { border: 0; margin: 0 0 1.4rem; padding: 0; }
.text-input {
  width: 100%; min-height: 56px; padding: 0.7rem 1rem; font: 600 1.15rem var(--body); color: var(--purple);
  background: var(--white); border: 3px solid var(--purple); border-radius: var(--radius-sm);
}
.text-input:focus { outline: none; box-shadow: var(--sticker); }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chip { position: relative; }
.chip input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.chip span {
  display: inline-block; padding: 0.55rem 1rem; border-radius: 999px; font-weight: 600; font-size: 0.95rem;
  background: var(--white); border: 2px solid #D9C5C9; transition: background 0.12s, border-color 0.12s;
}
.chip input:checked + span { background: var(--purple); border-color: var(--purple); color: var(--white); }
.chip input:focus-visible + span { outline: 3px solid var(--pink); outline-offset: 2px; }
.step__nav { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }

.q-meta { display: flex; justify-content: space-between; align-items: center; font-weight: 600; font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 0.6rem; }
.q-emoji { font-size: 2.6rem; line-height: 1; margin-bottom: 0.4rem; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 0.85rem; margin-top: 1.2rem; }
.option {
  display: grid; align-content: center; justify-items: center; gap: 0.45rem; min-height: 132px; padding: 1rem 0.7rem;
  text-align: center; background: var(--white); border: 3px solid var(--purple); border-radius: var(--radius);
  box-shadow: var(--sticker); cursor: pointer; transition: transform 0.1s, box-shadow 0.1s, background 0.12s;
}
.option__emoji { font-size: 2rem; line-height: 1; }
.option__label { font-weight: 650; font-size: 0.98rem; line-height: 1.25; }
.option:active, .option.is-picked { transform: translate(3px, 3px); box-shadow: 1px 1px 0 var(--purple); }
.option.is-picked { background: var(--yellow); }
@media (hover: hover) { .option:hover { background: #FFF6E0; } }

.analyzing { text-align: center; padding-top: 1.5rem; }
.scan { position: relative; width: min(70%, 280px); margin: 0 auto 1.8rem; border: 3px solid var(--purple); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--sticker-lg); background: var(--white); }
.scan img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.scan img.is-placeholder { object-fit: contain; padding: 18%; background: var(--cream); }
.scan::after {
  content: ''; position: absolute; left: 0; right: 0; height: 22%; top: -22%;
  background: linear-gradient(to bottom, transparent, rgba(255, 64, 129, 0.45), transparent);
  animation: scan 1.6s ease-in-out infinite;
}
@keyframes scan { to { top: 100%; } }
.analyze-line { font-family: var(--display); font-weight: 600; font-size: var(--step-1); min-height: 1.6em; }

/* result page */
#result-root > * + * { margin-top: 1.6rem; }
#result-root .bar__fill { width: 0; transition: width 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
#result-root.is-revealed .bar__fill { width: var(--w); }
#result-root .bar:nth-child(2) .bar__fill { transition-delay: 0.06s; }
#result-root .bar:nth-child(3) .bar__fill { transition-delay: 0.12s; }
#result-root .bar:nth-child(4) .bar__fill { transition-delay: 0.18s; }
#result-root .bar:nth-child(5) .bar__fill { transition-delay: 0.24s; }
#result-root .bar:nth-child(6) .bar__fill { transition-delay: 0.3s; }
#result-root .bar:nth-child(7) .bar__fill { transition-delay: 0.36s; }

.verdict { background: var(--purple); color: var(--white); border-radius: var(--radius-lg); padding: 1.5rem 1.4rem; }
.verdict h2 { font-size: var(--step-1); color: var(--yellow); margin-bottom: 0.4em; }
.verdict blockquote { margin: 0; font-family: var(--display); font-weight: 500; font-size: clamp(1.25rem, 4.6vw, 1.55rem); line-height: 1.3; }

.metrics h2, .radar-wrap h2, .share h2 { font-size: var(--step-2); }
.metric-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin: 0; }
.metric { background: var(--white); border-radius: var(--radius); padding: 0.9rem 0.9rem 0.8rem; border: 2px solid var(--line); }
.metric dt { font-size: 0.8rem; font-weight: 600; color: var(--ink-soft); line-height: 1.25; }
.metric dd { margin: 0.25rem 0 0; font-family: var(--display); font-weight: 700; font-size: 2rem; line-height: 1; }
.metric:nth-child(1) dd { color: var(--pink); }
.metric:nth-child(2) dd { color: var(--teal); }
.metric:nth-child(3) dd { color: #E09200; }
.metric--wide { grid-column: 1 / -1; }
.metric--night dd { font-size: 1.5rem; color: var(--pink); }
.split { display: flex; height: 2.4rem; border-radius: 99px; overflow: hidden; font-size: 1rem !important; border: 2px solid var(--purple); }
.split span { display: grid; align-items: center; padding: 0 0.8rem; white-space: nowrap; }
.split__a { flex: 0 0 var(--w); background: var(--teal); color: var(--purple); }
.split__b { flex: 1; background: var(--pink); color: var(--white); justify-items: end; }
.metric--wide dt { margin-bottom: 0.4rem; }

.radar-wrap { background: var(--white); border-radius: var(--radius-lg); padding: 1.3rem 1rem 0.6rem; border: 2px solid var(--line); }
.radar { width: 100%; max-width: 420px; margin: 0 auto; color: var(--purple); }
.radar text { font: 600 11px var(--body); fill: var(--purple); }

.result-note { font-size: var(--step--1); color: var(--ink-soft); text-align: center; padding: 0 1rem; }

.share { text-align: center; }
.format-toggle { display: inline-flex; padding: 4px; background: var(--white); border: 2px solid var(--purple); border-radius: 999px; margin-bottom: 1rem; }
.format-toggle button { border: 0; background: none; padding: 0.45rem 1.2rem; border-radius: 999px; font-weight: 700; cursor: pointer; }
.format-toggle button[aria-checked='true'] { background: var(--purple); color: var(--white); }
.share__preview { display: grid; place-items: center; margin-bottom: 1.2rem; }
.share__preview img { max-height: 440px; width: auto; border-radius: 14px; box-shadow: var(--sticker-lg); border: 3px solid var(--purple); background: var(--purple); }
.share__preview[data-format='square'] img { max-height: 320px; }
.share__actions { display: grid; gap: 0.8rem; }
.again { text-align: center; padding-top: 0.5rem; }

/* affiliate modules (only render when configured) */
.aff { background: var(--white); border-radius: var(--radius-lg); padding: 1.4rem; border: 2px solid var(--line); }
.aff h3 { font-size: var(--step-1); }
.aff__disclosure { font-size: 0.78rem; color: var(--ink-soft); margin: 1rem 0 0; }
.partner-grid { display: grid; gap: 0.75rem; }
.partner-card { display: flex; gap: 0.9rem; align-items: center; padding: 0.8rem; border-radius: var(--radius); border: 2px solid var(--line); text-decoration: none; }
.partner-card img { width: 72px; height: 72px; object-fit: cover; border-radius: 10px; }
.partner-card__text { display: grid; gap: 0.15rem; font-size: var(--step--1); }

/* legal / content pages */
.prose { width: min(100% - 2.5rem, 46rem); margin: 0 auto; padding: 1.5rem 0 1rem; }
.prose h1 { font-size: var(--step-4); }
.prose h2 { font-size: var(--step-2); margin-top: 1.8em; }
.prose .updated { color: var(--ink-soft); font-size: var(--step--1); }
.prose .callout { background: var(--white); border-left: 6px solid var(--yellow); padding: 1rem 1.2rem; border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

@media (max-width: 380px) {
  .options { grid-template-columns: 1fr; }
  .option { min-height: 84px; grid-template-columns: auto 1fr; justify-items: start; text-align: left; }
  .metric-grid { grid-template-columns: 1fr 1fr; }
  .bar { grid-template-columns: 6.4rem 1fr 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  #result-root .bar__fill { width: var(--w); }
}
