/* POPIAdesk interim site. Dark-only by decision: the brand statement is
   emerald on ink, and a launch holding page has no reason to carry two
   themes. Tokens below are copied from src/app/globals.css (dark block) so
   the interim site and the app cannot drift apart. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("fonts/newsreader-600.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/newsreader-400-italic.woff2") format("woff2");
}

:root {
  --background: #0f172a;
  --foreground: #f8fafc;
  --body: #cbd5e1;
  --muted: #94a3b8;
  --border: #334155;
  --brand: #10b981;
  --brand-foreground: #052e16;
  --brand-text: #34d399;
  --brand-soft: #04231a;
  --brand-soft-foreground: #6ee7b7;
  --success: #4ade80;
  --warning: #fbbf24;
  --destructive: #f87171;
  --card: rgba(148, 163, 184, 0.05);
  --card-border: rgba(52, 211, 153, 0.16);
  --sans:
    ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --serif: "Newsreader", ui-serif, Georgia, "Times New Roman", serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--body);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

/* The single ambient light source, behind everything, anchored where the
   score ring sits. Fixed so it does not travel with the scroll. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(58rem 32rem at 50% -8rem, rgba(16, 185, 129, 0.14), transparent 70%),
    radial-gradient(40rem 28rem at 88% 12%, rgba(52, 211, 153, 0.06), transparent 70%);
  pointer-events: none;
}

h1,
h2,
h3 {
  font-family: var(--serif);
  font-weight: 600;
  color: var(--foreground);
  letter-spacing: -0.015em;
  line-height: 1.15;
  margin: 0;
}

p {
  margin: 0;
}

a {
  color: var(--brand-text);
}

:focus-visible {
  outline: 2px solid var(--brand-text);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--brand);
  color: var(--brand-foreground);
  padding: 0.75rem 1rem;
  font-weight: 600;
  z-index: 10;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* Inline padding only. Blocks that also want vertical padding set
   padding-block, so the two never collide through the shorthand. */
.wrap {
  width: 100%;
  max-width: 60rem;
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* --- Header --- */

.masthead {
  padding-block-start: 1.75rem;
}

.brandmark {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--serif);
  font-size: 1.2rem;
  color: var(--foreground);
  text-decoration: none;
}

.brandmark svg {
  color: var(--brand-text);
}

/* --- Hero --- */

/* The hero keeps the page's 60rem gutter so its left edge lines up with the
   masthead and every section heading; the reading width is constrained on
   the text itself instead. */
.hero {
  padding-block: 3.5rem 1rem;
}

.hero h1 {
  max-width: 44rem;
}

.kicker {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand-text);
  font-weight: 600;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: clamp(2.1rem, 6.5vw, 3.5rem);
}

.hero .lead {
  margin-top: 1.35rem;
  font-size: clamp(1.02rem, 2.4vw, 1.18rem);
  max-width: 38rem;
}

.hero .lead em {
  font-family: var(--serif);
  font-style: italic;
  color: var(--brand-soft-foreground);
  font-size: 1.06em;
}

/* --- Sections --- */

section {
  padding-block: 3.5rem;
}

.section-head {
  max-width: 40rem;
  margin-bottom: 2rem;
}

.section-head h2 {
  font-size: clamp(1.5rem, 4vw, 2rem);
}

.section-head p {
  margin-top: 0.75rem;
  color: var(--muted);
}

/* --- Cards --- */

.cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 46rem) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  padding: 1.5rem;
}

.card svg {
  color: var(--brand-text);
}

.card h3 {
  font-size: 1.12rem;
  margin: 0.9rem 0 0.5rem;
}

.card p {
  font-size: 0.94rem;
  color: var(--muted);
}

/* --- Panel (quiz + explorer share this frame) --- */

.panel {
  background: linear-gradient(180deg, rgba(4, 35, 26, 0.55), rgba(148, 163, 184, 0.04));
  border: 1px solid var(--card-border);
  border-radius: 1.25rem;
  padding: clamp(1.35rem, 4vw, 2.25rem);
}

.meter {
  height: 4px;
  background: rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 1.5rem;
}

.meter span {
  display: block;
  height: 100%;
  width: 0;
  background: var(--brand);
  border-radius: 999px;
  transition: width 220ms ease;
}

.step-count {
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.area {
  margin-top: 0.35rem;
  font-size: 0.95rem;
  color: var(--brand-text);
  font-weight: 600;
}

.question {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3.4vw, 1.7rem);
  font-weight: 600;
  color: var(--foreground);
  line-height: 1.25;
  margin: 0.75rem 0 1.5rem;
  max-width: 34rem;
}

.answers {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* --- Buttons --- */

.btn {
  font: inherit;
  font-weight: 600;
  min-height: 44px;
  padding: 0.6rem 1.35rem;
  border-radius: 0.7rem;
  border: 1px solid var(--card-border);
  background: rgba(148, 163, 184, 0.07);
  color: var(--foreground);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.btn:hover {
  background: rgba(52, 211, 153, 0.12);
  border-color: var(--brand-text);
}

.btn:active {
  transform: translateY(1px);
}

.btn-brand {
  background: var(--brand);
  color: var(--brand-foreground);
  border-color: var(--brand);
}

.btn-brand:hover {
  background: #34d399;
  border-color: #34d399;
}

.btn-ghost {
  background: none;
  border-color: transparent;
  color: var(--brand-text);
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.btn-ghost:hover {
  background: rgba(52, 211, 153, 0.1);
  border-color: transparent;
}

/* Carries its own spacing so that hiding it on the first question leaves no
   gap behind. */
.btn-back {
  margin-top: 1.25rem;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

/* --- Result --- */

.result {
  display: grid;
  gap: 1.75rem;
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 40rem) {
  .result {
    grid-template-columns: auto 1fr;
    gap: 2.25rem;
  }
}

.ring {
  width: 148px;
  height: 148px;
  flex: none;
  justify-self: center;
}

.ring circle {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
}

.ring .track {
  stroke: rgba(148, 163, 184, 0.18);
}

.ring .value {
  stroke: var(--brand);
  transform: rotate(-90deg);
  transform-origin: 50% 50%;
  transition: stroke-dashoffset 900ms cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-figure {
  position: relative;
  display: grid;
  place-items: center;
}

.ring-number {
  position: absolute;
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 600;
  color: var(--foreground);
  line-height: 1;
}

.band {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  border: 1px solid currentColor;
}

.band-low {
  color: var(--success);
}

.band-medium {
  color: var(--warning);
}

.band-high {
  color: #fdba74;
}

.band-critical {
  color: var(--destructive);
}

.result h3 {
  font-size: 1.35rem;
  margin: 0.85rem 0 0.6rem;
}

.result p {
  color: var(--body);
}

.result .aside {
  margin-top: 0.9rem;
  font-size: 0.9rem;
  color: var(--muted);
}

/* --- Conditions explorer --- */

.grid-conditions {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 46rem) {
  .grid-conditions {
    grid-template-columns: repeat(4, 1fr);
  }
}

.tile {
  position: relative;
  font: inherit;
  text-align: left;
  min-height: 8.5rem;
  padding: 0.95rem;
  border-radius: 0.85rem;
  border: 1px solid var(--card-border);
  background: rgba(15, 23, 42, 0.5);
  color: var(--body);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background-color 160ms ease,
    transform 160ms ease;
}

.tile:hover {
  border-color: var(--brand-text);
  transform: translateY(-2px);
}

.tile[aria-pressed="true"] {
  background: var(--brand-soft);
  border-color: rgba(52, 211, 153, 0.4);
}

.tile .num {
  font-family: var(--serif);
  font-size: 1.5rem;
  color: var(--brand-text);
  line-height: 1;
}

.tile .name {
  display: block;
  margin-top: 0.4rem;
  font-weight: 600;
  color: var(--foreground);
  font-size: 0.92rem;
  line-height: 1.3;
}

.tile .detail {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.82rem;
  color: var(--brand-soft-foreground);
  line-height: 1.45;
}

.tally {
  margin-top: 1.1rem;
  font-size: 0.92rem;
  color: var(--muted);
}

.tally strong {
  color: var(--brand-text);
  font-weight: 600;
}

/* --- CTA + footer --- */

.cta {
  text-align: center;
  border: 1px solid var(--card-border);
  background: rgba(4, 35, 26, 0.45);
  border-radius: 1.25rem;
  padding: clamp(1.75rem, 5vw, 2.75rem);
}

.cta h2 {
  font-size: clamp(1.4rem, 3.6vw, 1.9rem);
}

.cta p {
  margin: 0.75rem auto 0;
  max-width: 30rem;
  color: var(--muted);
}

.cta .btn-row {
  justify-content: center;
  margin-top: 1.5rem;
}

.fineprint {
  margin-top: 1rem;
  font-size: 0.84rem;
  color: var(--muted);
}

footer {
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  padding: 2rem 0 3rem;
  font-size: 0.88rem;
  color: var(--muted);
}

footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin-top: 0.6rem;
}

footer a {
  color: var(--muted);
}

footer a:hover {
  color: var(--brand-text);
}

.disclaimer {
  margin-top: 1.25rem;
  font-size: 0.82rem;
}

/* --- Long-form content (guides and legal pages) --- */

.article h1,
.article .lead,
.article .prose,
.article .article-meta {
  max-width: 44rem;
}

.article-meta {
  margin-top: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.tag {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--brand-soft-foreground);
  background: var(--brand-soft);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  padding: 0.2rem 0.65rem;
}

.prose {
  margin-top: 2.5rem;
}

.prose h2 {
  font-size: clamp(1.3rem, 3.4vw, 1.6rem);
  margin: 2.5rem 0 0.85rem;
}

.prose h3 {
  font-size: 1.1rem;
  margin: 1.75rem 0 0.6rem;
}

.prose p,
.prose ul,
.prose ol {
  margin: 0 0 1.1rem;
}

.prose ul,
.prose ol {
  padding-left: 1.35rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose strong {
  color: var(--foreground);
  font-weight: 600;
}

.prose section {
  margin-bottom: 2rem;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
  font-size: 0.92rem;
}

.prose th,
.prose td {
  border: 1px solid var(--border);
  padding: 0.5rem 0.7rem;
  text-align: left;
  vertical-align: top;
}

/* --- Post list --- */

.post-list {
  display: grid;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.post-list a {
  display: block;
  padding: 1.4rem;
  border: 1px solid var(--card-border);
  border-radius: 1rem;
  background: var(--card);
  text-decoration: none;
  transition:
    border-color 160ms ease,
    transform 160ms ease;
}

.post-list a:hover {
  border-color: var(--brand-text);
  transform: translateY(-2px);
}

.post-list h2 {
  font-size: 1.2rem;
}

.post-list p {
  margin-top: 0.5rem;
  color: var(--muted);
  font-size: 0.94rem;
}

.post-list .article-meta {
  margin-top: 0.75rem;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

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