/* =========================================================
   Kalavire – styles.css
   Brand system as CSS custom properties + base + sections.
   Built incrementally, one section at a time.
   ========================================================= */

:root {
  /* Background — deep-water navy */
  --bg-navy-top: #14273B;
  --bg-navy-bottom: #0A1622;

  /* Accent */
  --emerald: #10B981;

  /* Glow tones */
  --glow-1: #34D399;
  --glow-2: #6EE7B7;
  --glow-3: #D1FAE5;

  /* Text */
  --text: #ECF5F5;
  --text-muted: #94A3B8;

  /* Score-tier scale */
  --tier-heikko: #64748B;
  --tier-kohtalainen: #F59E0B;
  --tier-hyva: #84CC16;
  --tier-erinomainen: #22C55E;
  --tier-legendaarinen: #10B981;

  /* Surfaces / lines */
  --surface: rgba(255, 255, 255, 0.03);
  --surface-2: rgba(255, 255, 255, 0.05);
  --line: rgba(148, 163, 184, 0.16);

  /* Layout */
  --maxw: 1100px;
  --gutter: 1.5rem;
  --radius: 16px;
  --radius-sm: 10px;

  /* Type */
  --font: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg-navy-bottom);
  background-image: linear-gradient(180deg, var(--bg-navy-top) 0%, var(--bg-navy-bottom) 70%);
  background-repeat: no-repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: 0.01em;
  margin: 0 0 0.5em;
}

/* ---------- Layout helper ---------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}

/* ---------- Focus visibility ---------- */
/* No border-radius here: it would mutate the element's own shape on focus
   (e.g. snap the pill CTAs from 999px to 4px). The outline follows each
   element's own radius in modern browsers. */
:focus-visible {
  outline: 2px solid var(--glow-1);
  outline-offset: 3px;
}

/* ---------- Header ---------- */
.site-header { padding-block: 1.75rem; }
.site-header__inner { display: flex; align-items: center; }
.brand { display: inline-flex; }
.brand__logo { height: 38px; width: auto; }

/* =========================================================
   Hero
   ========================================================= */
.hero { padding-block: 2rem 4.5rem; }

.hero__inner {
  display: grid;
  gap: 2.5rem;
  align-items: center;
}

.hero__title {
  font-size: clamp(2rem, 5vw + 1rem, 3.25rem);
  letter-spacing: -0.01em;
  max-width: 18ch;
}

.hero__subhead {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.25rem);
  font-weight: 400;
  max-width: 46ch;
  margin: 0 0 2rem;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 0.85rem; }

/* Placeholder store buttons — NOT official badge artwork */
.store-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 1.5rem;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface-2);
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}
.store-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(148, 163, 184, 0.35);
}
.store-btn--primary {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #04130D;
}
.store-btn--primary:hover {
  background: var(--glow-1);
  border-color: var(--glow-1);
}

/* ---------- Hero gauge ---------- */
.hero__visual { display: flex; justify-content: center; }

.gauge {
  position: relative;
  width: min(78vw, 360px);
  aspect-ratio: 1;
}

.gauge__svg {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible; /* let the glow breathe past the viewBox */
}

.gauge__track { stroke: var(--line); }

.gauge__arc {
  stroke: var(--emerald);
  /* circumference = 2*pi*110 = 691.15; 78% filled -> offset = 22% = 152.05 */
  stroke-dasharray: 691.15;
  stroke-dashoffset: 152.05; /* default + reduced-motion resting state */
  filter: drop-shadow(0 0 5px rgba(16, 185, 129, 0.45));
}

.gauge__dot {
  fill: var(--glow-3);
  filter: drop-shadow(0 0 4px var(--glow-2)) drop-shadow(0 0 11px rgba(52, 211, 153, 0.7));
}

/* Gauge fill-on-load — subtle, motion only */
@keyframes gauge-fill {
  from { stroke-dashoffset: 691.15; }
  to   { stroke-dashoffset: 152.05; }
}
@keyframes gauge-dot-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@media (prefers-reduced-motion: no-preference) {
  .gauge__arc { animation: gauge-fill 1.8s cubic-bezier(0.22, 1, 0.36, 1) both; }
  .gauge__dot { animation: gauge-dot-in 0.6s ease-out 1.4s both; }
}

/* =========================================================
   Section scaffold (reused by later sections)
   ========================================================= */
.section {
  padding-block: 4rem;
  border-top: 1px solid var(--line);
}
.section__title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  margin-bottom: 0.6rem;
}
.section__lead {
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1vw + 0.9rem, 1.2rem);
  font-weight: 400;
  max-width: 54ch;
  margin: 0 0 2.25rem;
}

/* =========================================================
   Mitä saat — score explainer + tier strip
   ========================================================= */
.score-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1.25rem 2rem;
  max-width: 640px;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.score-card__value {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.score-card__number {
  font-size: clamp(3rem, 8vw, 4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.02em;
}
.score-card__max {
  color: var(--text-muted);
  font-weight: 500;
  font-size: 1.1rem;
}
.score-card__reason {
  flex: 1 1 16rem;
}
.score-card__tier {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0 0 0.35rem;
  font-weight: 600;
}
.score-card__tier::before {
  content: "";
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 999px;
  background: var(--tier-hyva);
  box-shadow: 0 0 8px rgba(132, 204, 22, 0.6);
}
.score-card__text {
  margin: 0 0 0.5rem;
  color: var(--text);
}
.score-card__note {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Quiet five-tier scale strip */
.tier-strip { margin-top: 2.5rem; max-width: 640px; }
.tier-strip__list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.6rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.tier-strip__item {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  text-align: center;
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text-muted);
}
.tier-strip__item::before {
  content: "";
  height: 5px;
  border-radius: 999px;
  background: var(--tier);
  opacity: 0.85;
}

/* =========================================================
   Miten se toimii — factor cards + species + source
   ========================================================= */
.how-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.how-card {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1.5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.how-card__icon {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--emerald);
}
.how-card__icon svg { width: 26px; height: 26px; }
.how-card__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0;
}
.how-card__text {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* Per-species note + chips */
.species { margin-top: 2.25rem; }
.species__label { margin: 0 0 0.85rem; color: var(--text-muted); }
.species__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.species__chip {
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 0.85rem;
  font-weight: 500;
}

.source-note {
  margin: 1.75rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* =========================================================
   Mitä se ei lupaa — confident honesty cards
   ========================================================= */
.promise-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.promise {
  padding: 1.6rem 1.5rem 1.6rem 1.65rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 2px solid var(--emerald);
  border-radius: var(--radius);
}
.promise__title {
  margin: 0 0 0.5rem;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.promise__text {
  margin: 0;
  color: var(--text-muted);
}

/* =========================================================
   Kuvakaappaukset — swappable phone placeholder frames
   ========================================================= */
.shots {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  justify-items: center;
}
.shot {
  margin: 0;
  width: 100%;
  max-width: 260px;
}
.shot__frame {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  aspect-ratio: 9 / 19.5;
  padding: 1.25rem;
  text-align: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 2px dashed rgba(148, 163, 184, 0.32);
  border-radius: 28px;
}
.shot__icon {
  width: 34px;
  height: 34px;
  opacity: 0.75;
}
.shot__label {
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  border-top: 1px solid var(--line);
  padding-block: 2.5rem 3rem;
}
.site-footer__top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem 2rem;
}
.site-footer__wordmark {
  height: 26px;
  width: auto;
}
.site-footer__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}
.site-footer__nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  transition: color 160ms ease;
}
.site-footer__nav a:hover { color: var(--text); }
.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.site-footer__copy { margin: 0; }
.site-footer__lang {
  padding: 0.25rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
}

/* =========================================================
   Legal / text pages — narrow reading column (privacy, support)
   ========================================================= */
.legal { padding-block: 3rem 4rem; }
.prose {
  max-width: 68ch;
  margin-inline: auto;
}
.prose h1 {
  font-size: clamp(1.9rem, 4vw, 2.6rem);
  margin-bottom: 0.5rem;
}
.prose h2 {
  font-size: 1.3rem;
  margin-top: 2.5rem;
  margin-bottom: 0.6rem;
}
.prose h3 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-top: 1.5rem;
  margin-bottom: 0.4rem;
}
.prose p { margin: 0 0 1rem; }
.prose ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
}
.prose li { margin-bottom: 0.35rem; }
/* Underline keeps in-text links distinguishable beyond colour alone (WCAG 1.4.1). */
.prose a {
  color: var(--glow-1);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}
.prose__lead { color: var(--text-muted); }
.prose .todo {
  color: var(--text-muted);
  font-style: italic;
}

/* =========================================================
   Responsive
   ========================================================= */
@media (min-width: 560px) {
  .how-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 640px) {
  .shots { grid-template-columns: repeat(3, 1fr); align-items: start; }
  .shot { max-width: none; }
}
@media (min-width: 760px) {
  .promise-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 820px) {
  .hero { padding-block: 3rem 6rem; }
  .hero__inner {
    grid-template-columns: 1.1fr 0.9fr;
    gap: 3.5rem;
  }
  .section { padding-block: 5.5rem; }
  .how-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
