:root {
  color-scheme: dark;
  --bg: #101713;
  --panel: #18241d;
  --panel-strong: #203429;
  --line: rgba(241, 212, 154, 0.2);
  --text: #f7efdf;
  --muted: #c6b99f;
  --amber: #d98943;
  --amber-light: #f1d49a;
  --green: #496858;
  --steel: #8da096;
  --danger: #e29d70;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 20%, rgba(217, 137, 67, 0.22), transparent 28rem),
    radial-gradient(circle at 12% 100%, rgba(73, 104, 88, 0.55), transparent 32rem),
    linear-gradient(160deg, #0a0f0c 0%, #101713 42%, #17261e 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.16;
  background-image:
    repeating-radial-gradient(ellipse at 25% 20%, transparent 0 20px, rgba(241, 212, 154, 0.22) 21px 22px, transparent 23px 43px),
    linear-gradient(rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: 520px 320px, 100% 7px;
  mix-blend-mode: screen;
}

a {
  color: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--amber-light);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 10;
  transform: translateY(-160%);
  padding: 0.75rem 1rem;
  color: #111812;
  background: var(--amber-light);
}

.skip-link:focus {
  transform: translateY(0);
}

.shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100dvh;
}

.door-view,
.quiz-view,
.result-view {
  width: min(100%, 1120px);
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(1rem, env(safe-area-inset-top)) clamp(1rem, 4vw, 3rem) max(1.25rem, env(safe-area-inset-bottom));
}

.door-view {
  display: grid;
  align-items: center;
  position: relative;
}

.ambient {
  position: absolute;
  inset: 7vh 0 auto auto;
  width: min(44vw, 420px);
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.35), transparent 24%),
    linear-gradient(105deg, #16231c, #080b09);
  box-shadow: inset 22px 0 0 rgba(217, 137, 67, 0.14), -30px 20px 80px rgba(217, 137, 67, 0.18);
  transform: perspective(800px) rotateY(-14deg);
}

.ambient::after {
  content: "";
  position: absolute;
  right: 18%;
  top: 44%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber-light);
  box-shadow: 0 0 28px var(--amber);
}

.brandline,
.kicker,
.micro,
.domain,
.review-meta {
  color: var(--amber-light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.brandline {
  position: absolute;
  top: 1.25rem;
  left: clamp(1rem, 4vw, 3rem);
  color: var(--muted);
}

.door-card {
  width: min(100%, 650px);
  padding-block: 5rem 3rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 1rem;
  font-size: clamp(3.1rem, 12vw, 7.8rem);
  line-height: 0.88;
  letter-spacing: 0;
  text-transform: uppercase;
}

.lead {
  max-width: 36rem;
  color: var(--muted);
  font-size: clamp(1.05rem, 2.2vw, 1.35rem);
  line-height: 1.55;
}

.challenge-note,
.side-diagnosis,
.rare {
  max-width: 35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(24, 36, 29, 0.76);
  color: var(--amber-light);
}

.door-actions,
.result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  align-items: center;
  margin-top: 2rem;
}

.primary,
.secondary,
.ghost,
.answer,
.store-link,
.store-cta {
  border-radius: 8px;
}

.primary,
.secondary,
.ghost {
  min-height: 3.25rem;
  border: 1px solid transparent;
  padding: 0.9rem 1.1rem;
  cursor: pointer;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.primary {
  color: #111812;
  background: linear-gradient(180deg, var(--amber-light), var(--amber));
  box-shadow: 0 14px 34px rgba(217, 137, 67, 0.22);
}

.secondary {
  color: var(--text);
  background: var(--panel-strong);
  border-color: var(--line);
}

.ghost,
.store-link {
  color: var(--muted);
  background: transparent;
  border-color: rgba(198, 185, 159, 0.22);
}

.store-link {
  display: inline-flex;
  align-items: center;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  text-decoration: none;
}

.store-link::after,
.store-cta span::after {
  content: " →";
}

.meter-secret {
  position: absolute;
  right: clamp(1rem, 4vw, 3rem);
  bottom: 1.2rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(241, 212, 154, 0.06);
  cursor: pointer;
}

.meter-secret::before {
  content: "";
  position: absolute;
  inset: 13px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 18px rgba(217, 137, 67, 0.55);
}

.meter-secret.knocked::after {
  content: "Koputus rekisteröity.";
  position: absolute;
  right: 0;
  bottom: 3.2rem;
  width: 12rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.quiz-view {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 1.5rem;
}

.quiz-top {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
}

.exposure {
  display: grid;
  gap: 0.45rem;
  width: min(58vw, 360px);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.exposure b {
  justify-self: end;
  color: var(--amber-light);
}

.exposure i {
  position: relative;
  height: 0.55rem;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.2);
}

.exposure i::before {
  content: "";
  position: absolute;
  inset: 0;
  width: calc((var(--progress) + 0.08) * 100%);
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--amber));
}

.question-panel {
  align-self: center;
  max-width: 800px;
  margin-inline: auto;
  width: 100%;
}

.question-panel h2 {
  margin-bottom: 1.5rem;
  font-size: clamp(2rem, 7vw, 4.2rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.answers {
  display: grid;
  gap: 0.8rem;
}

.answer {
  display: grid;
  grid-template-columns: 2.2rem 1fr;
  gap: 0.85rem;
  align-items: center;
  width: 100%;
  min-height: 4.7rem;
  border: 1px solid var(--line);
  padding: 0.95rem;
  color: var(--text);
  background: rgba(24, 36, 29, 0.9);
  text-align: left;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.answer:hover {
  transform: translateY(-2px);
  border-color: rgba(241, 212, 154, 0.5);
  background: rgba(32, 52, 41, 0.95);
}

.answer span {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 6px;
  color: #111812;
  background: var(--amber-light);
  font-weight: 950;
}

.result-view {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: center;
}

.result-card {
  position: relative;
  overflow: hidden;
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(241, 212, 154, 0.26);
  border-radius: 8px;
  padding: clamp(1.2rem, 4vw, 2.5rem);
  background:
    linear-gradient(135deg, rgba(217, 137, 67, 0.12), transparent 40%),
    linear-gradient(180deg, rgba(32, 52, 41, 0.96), rgba(14, 20, 16, 0.98));
  box-shadow: var(--shadow);
}

.result-card::before {
  content: "MINUN VANLIFE-DIAGNOOSINI";
  position: absolute;
  top: 1rem;
  right: -3.6rem;
  padding: 0.4rem 4rem;
  color: #111812;
  background: var(--amber-light);
  font-size: 0.68rem;
  font-weight: 950;
  transform: rotate(24deg);
}

.percent {
  color: var(--amber-light);
  font-size: clamp(5rem, 18vw, 10rem);
  font-weight: 950;
  line-height: 0.9;
}

.result-card h1 {
  margin-block: 0.5rem 0.8rem;
  font-size: clamp(2rem, 7vw, 4.6rem);
  overflow-wrap: break-word;
  text-transform: none;
  word-break: normal;
}

.diagnosis-line,
.closer {
  color: var(--text);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.45;
}

.findings {
  margin-block: 1.5rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
}

.findings h2 {
  color: var(--muted);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.findings ul {
  display: grid;
  gap: 0.65rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.findings li {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.55rem;
  color: var(--muted);
}

.findings li::before {
  content: "✓";
  color: var(--amber-light);
  font-weight: 950;
}

.disclaimer {
  color: var(--steel);
  font-size: 0.85rem;
}

.domain {
  margin-bottom: 0;
}

.result-actions {
  align-content: center;
  flex-direction: column;
  align-items: stretch;
}

.result-actions > * {
  width: 100%;
}

.store-cta {
  display: grid;
  gap: 0.35rem;
  border: 1px solid rgba(217, 137, 67, 0.36);
  padding: 1rem;
  color: var(--text);
  background: rgba(217, 137, 67, 0.08);
  text-decoration: none;
}

.store-cta span {
  color: var(--amber-light);
  font-weight: 950;
  text-transform: uppercase;
}

.share-feedback {
  min-height: 2.5rem;
  color: var(--muted);
  line-height: 1.4;
}

.share-feedback span {
  display: block;
  margin-top: 0.5rem;
  overflow-wrap: anywhere;
  color: var(--amber-light);
}

.review-meta {
  margin-bottom: 0.8rem;
  color: var(--steel);
  overflow-wrap: anywhere;
}

.review-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.9rem;
  background: rgba(24, 36, 29, 0.74);
}

.review-panel summary {
  cursor: pointer;
  color: var(--amber-light);
  font-weight: 900;
}

.review-panel pre {
  max-height: 44vh;
  overflow: auto;
  margin: 0.9rem 0;
  padding: 0.8rem;
  border-radius: 8px;
  color: var(--muted);
  background: rgba(0, 0, 0, 0.24);
  font-size: 0.78rem;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.noscript {
  padding: 2rem;
}

@media (max-width: 760px) {
  .ambient {
    inset: 7vh -18vw auto auto;
    width: 58vw;
    opacity: 0.72;
  }

  .door-card {
    padding-top: 6rem;
  }

  .door-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .door-actions > * {
    width: 100%;
    justify-content: center;
  }

  .quiz-top {
    align-items: stretch;
    flex-direction: column-reverse;
  }

  .exposure {
    width: 100%;
  }

  .result-view {
    display: block;
    grid-template-columns: 1fr;
  }

  .result-actions {
    margin-top: 1rem;
  }
}

@media (max-width: 430px) {
  h1 {
    font-size: 3.5rem;
  }

  .brandline {
    max-width: 13rem;
    line-height: 1.35;
  }

  .question-panel h2 {
    font-size: 2.2rem;
  }

  .answer {
    min-height: 4.9rem;
  }

  .result-card {
    padding: 1.2rem;
  }

  .result-card::before {
    position: static;
    display: inline-block;
    margin-bottom: 1rem;
    padding: 0.42rem 0.6rem;
    transform: none;
  }

  .result-card h1 {
    font-size: 1.55rem;
    line-height: 1.12;
  }

  .percent {
    font-size: 4.55rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}
