/* TestsNation — lightweight homepage
   Brand: Fredoka, cream, orange, forest green, hard borders */

@import url('https://fonts.googleapis.com/css2?family=Fredoka:wght@400;500;600;700&display=swap');

:root {
  --bg: #fffaf0;
  --bg-deep: #f7efe0;
  --card: #ffffff;
  --ink: #141414;
  --muted: #5c5c5c;
  --faint: #8a8a8a;
  --line: #111;
  --soft: #e8e0d4;
  --orange: #ff6b1a;
  --orange-deep: #e85d10;
  --green: #1f3d2f;
  --green-hover: #2a5240;
  --yellow: #f4c947;
  --radius: 1.35rem;
  --font: 'Fredoka', 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  --shadow: 4px 4px 0 var(--line);
  --ease: cubic-bezier(.22, 1, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  min-height: 100vh;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
.wrap { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }

/* Noise atmosphere — not flat single color */
body::before {
  content: '';
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255,107,26,.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(244,201,71,.18), transparent 50%),
    radial-gradient(ellipse 50% 35% at 80% 100%, rgba(31,61,47,.08), transparent 55%);
}
main, header, footer, #quiz { position: relative; z-index: 1; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  border-bottom: 2px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: .85rem 0;
}
.brand {
  display: flex; align-items: center; gap: .65rem;
  font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em;
}
.brand-mark {
  width: 2.25rem; height: 2.25rem; border-radius: .7rem;
  background: var(--orange); color: #fff; border: 2px solid var(--line);
  display: grid; place-items: center; font-weight: 700; box-shadow: 2px 2px 0 var(--line);
}
.nav {
  display: flex; align-items: center; gap: .35rem;
}
.nav a {
  padding: .45rem .85rem; border-radius: 999px; font-weight: 600; font-size: .9rem;
  transition: background .2s var(--ease);
}
.nav a:hover { background: rgba(255,107,26,.12); }
.lang-switch {
  display: inline-flex; border: 2px solid var(--line); border-radius: 999px;
  padding: 2px; background: var(--card); margin-left: .35rem;
}
.lang-switch button {
  padding: .35rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700;
  color: var(--muted);
}
.lang-switch button.active { background: var(--orange); color: #fff; }

.cta {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .9rem 1.45rem; border-radius: 999px; font-weight: 700;
  border: 2px solid var(--line); box-shadow: var(--shadow);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background .2s;
}
.cta:hover { transform: translate(-1px, -1px); box-shadow: 5px 5px 0 var(--line); }
.cta:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--line); }
.cta-green { background: var(--green); color: #fff; }
.cta-green:hover { background: var(--green-hover); }
.cta-orange { background: var(--orange); color: #fff; }
.cta-orange:hover { background: var(--orange-deep); }
.cta-ghost { background: var(--card); }

/* ===== Hero ===== */
.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(3rem, 7vw, 5rem);
}
.hero-grid {
  display: grid; gap: 2rem; align-items: end;
  grid-template-columns: 1.05fr .95fr;
}
.hero-kicker {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .85rem; margin-bottom: 1.1rem;
  background: var(--orange); color: #fff; border: 2px solid var(--line);
  border-radius: 999px; font-size: .72rem; font-weight: 700;
  letter-spacing: .08em; text-transform: uppercase;
  animation: pop .6s var(--ease) both;
}
.hero h1 {
  font-size: clamp(2.6rem, 7vw, 4.6rem);
  line-height: .98; letter-spacing: -.04em; font-weight: 700;
  margin-bottom: 1rem; max-width: 11ch;
  animation: rise .7s var(--ease) .05s both;
}
.hero h1 em {
  font-style: normal; color: var(--orange);
  text-decoration: underline; text-decoration-thickness: .12em;
  text-underline-offset: .12em;
}
.hero-lead {
  font-size: 1.08rem; color: var(--muted); max-width: 34rem;
  margin-bottom: 1.6rem; animation: rise .7s var(--ease) .12s both;
}
.hero-actions {
  display: flex; flex-wrap: wrap; gap: .75rem;
  animation: rise .7s var(--ease) .2s both;
}
.hero-visual {
  position: relative;
  animation: rise .8s var(--ease) .15s both;
}
.hero-frame {
  border: 2.5px solid var(--line); border-radius: 1.6rem;
  overflow: hidden; background: var(--yellow);
  box-shadow: 8px 8px 0 var(--line);
  aspect-ratio: 1 / 1.05;
}
.hero-frame img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-chip {
  position: absolute; left: -0.6rem; bottom: 1.2rem;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 999px; padding: .55rem .9rem; font-weight: 700; font-size: .85rem;
  box-shadow: 3px 3px 0 var(--line);
  animation: float 3.5s ease-in-out infinite;
}
.hero-chip strong { color: var(--orange); }

@keyframes rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: none; }
}
@keyframes pop {
  from { opacity: 0; transform: scale(.9); }
  to { opacity: 1; transform: none; }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* ===== Sections ===== */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section-head { max-width: 40rem; margin-bottom: 1.75rem; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1;
  margin-bottom: .55rem;
}
.section-head p { color: var(--muted); }
.eyebrow {
  display: inline-block; margin-bottom: .7rem;
  font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  color: var(--orange);
}

/* Catalog */
.catalog {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(3, 1fr);
}
.test-card {
  display: flex; flex-direction: column; gap: .7rem;
  background: var(--card); border: 2px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem 1.2rem;
  box-shadow: 3px 3px 0 transparent;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  min-height: 100%;
}
.test-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 4px 4px 0 var(--line);
}
.test-card.featured {
  background: linear-gradient(160deg, #fff 0%, #ffe8d6 100%);
  grid-column: span 1;
}
.test-icon { font-size: 1.8rem; line-height: 1; }
.test-tag {
  display: inline-flex; width: fit-content;
  padding: .2rem .55rem; border-radius: 999px; font-size: .68rem; font-weight: 700;
  letter-spacing: .04em; text-transform: uppercase;
}
.test-card h3 { font-size: 1.25rem; letter-spacing: -.02em; }
.test-card .sub { color: var(--orange); font-size: .85rem; font-weight: 600; }
.test-card .desc { color: var(--muted); font-size: .9rem; flex: 1; }
.test-meta { font-size: .78rem; color: var(--faint); font-weight: 600; }

/* Why strip — one purpose */
.why {
  border-block: 2px solid var(--line);
  background: var(--bg-deep);
}
.why-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem;
}
.why-item h3 { font-size: 1.05rem; margin-bottom: .35rem; }
.why-item p { color: var(--muted); font-size: .92rem; }

/* Quiz shell */
#quiz {
  scroll-margin-top: 4.5rem;
  background: var(--ink); color: #fff;
  border-block: 2px solid var(--line);
}
#quiz .section-head h2, #quiz .eyebrow { color: #fff; }
#quiz .eyebrow { color: var(--yellow); }
#quiz .section-head p { color: rgba(255,255,255,.72); }

.quiz-shell {
  background: var(--card); color: var(--ink);
  border: 2.5px solid var(--line); border-radius: 1.5rem;
  box-shadow: 8px 8px 0 var(--yellow);
  overflow: hidden;
}
.quiz-progress {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 1.2rem; border-bottom: 2px solid var(--line); background: #fff8ee;
}
.quiz-progress .bar {
  flex: 1; height: 8px; margin: 0 1rem; background: var(--soft);
  border-radius: 999px; overflow: hidden;
}
.quiz-progress .fill {
  height: 100%; width: 0%; background: var(--orange);
  transition: width .35s var(--ease);
}
.quiz-body { padding: clamp(1.25rem, 3vw, 2rem); min-height: 280px; }
.quiz-q {
  font-size: clamp(1.2rem, 3vw, 1.55rem); font-weight: 700;
  letter-spacing: -.02em; margin-bottom: 1.25rem; line-height: 1.3;
}
.choice-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: .85rem;
}
.choice {
  text-align: left; padding: 1.1rem 1rem;
  border: 2px solid var(--line); border-radius: 1rem; background: #fff;
  font-weight: 600; transition: background .15s, transform .15s var(--ease);
}
.choice:hover { background: #fff1e6; transform: translateY(-2px); }
.choice:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.choice small { display: block; margin-top: .35rem; color: var(--muted); font-weight: 500; font-size: .82rem; }
.quiz-nav {
  display: flex; justify-content: space-between; gap: .75rem;
  padding: 1rem 1.2rem; border-top: 2px solid var(--line);
}
.quiz-nav button {
  padding: .7rem 1.1rem; border: 2px solid var(--line); border-radius: 999px; font-weight: 700;
}
.quiz-nav .back { background: #fff; }
.quiz-nav .back:disabled { opacity: .35; cursor: not-allowed; }

/* Result */
.result {
  display: none; padding: clamp(1.25rem, 3vw, 2rem); text-align: center;
}
.result.show { display: block; animation: rise .5s var(--ease); }
.result-code {
  font-size: clamp(2.8rem, 8vw, 4.5rem); font-weight: 700; color: var(--orange);
  letter-spacing: -.04em; line-height: 1;
}
.result-name { font-size: 1.5rem; font-weight: 700; margin: .4rem 0 .6rem; }
.result-vibe { color: var(--muted); max-width: 28rem; margin: 0 auto 1.25rem; }
.result-art {
  width: min(280px, 70%); margin: 0 auto 1.25rem;
  border: 2px solid var(--line); border-radius: 1.2rem; overflow: hidden;
  background: var(--bg-deep); aspect-ratio: 1;
}
.result-art img { width: 100%; height: 100%; object-fit: cover; }
.result-actions { display: flex; flex-wrap: wrap; gap: .65rem; justify-content: center; }

/* FAQ */
.faq { display: grid; gap: .75rem; max-width: 720px; }
.faq details {
  background: var(--card); border: 2px solid var(--line);
  border-radius: 1rem; padding: 1rem 1.1rem;
}
.faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq p { margin-top: .65rem; color: var(--muted); font-size: .95rem; }

/* Footer */
.site-footer {
  border-top: 2px solid var(--line); padding: 2rem 0 2.5rem;
  background: var(--bg-deep);
}
.footer-inner {
  display: flex; flex-wrap: wrap; gap: 1rem;
  justify-content: space-between; align-items: center;
}
.footer-links { display: flex; flex-wrap: wrap; gap: .85rem; color: var(--muted); font-size: .9rem; font-weight: 600; }
.footer-links a:hover { color: var(--orange); }

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { order: -1; max-width: 380px; }
  .catalog { grid-template-columns: 1fr 1fr; }
  .why-grid { grid-template-columns: 1fr; }
  .nav .hide-sm { display: none; }
}
@media (max-width: 640px) {
  .catalog { grid-template-columns: 1fr; }
  .choice-grid { grid-template-columns: 1fr; }
  .header-inner { gap: .5rem; }
  .brand span:last-child { max-width: 9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; transition: none !important; scroll-behavior: auto !important;
  }
}
