:root {
  --bg: #071c24;
  --bg-2: #0b3340;
  --card: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.12);
  --text: #f4fbfc;
  --muted: #a9c4cb;
  --teal: #2ec4ce;
  --teal-deep: #12808c;
  --gold: #ffd54f;
  --gold-deep: #f0a93a;
  --font: "Nunito", system-ui, sans-serif;
  --display: "Nunito", system-ui, sans-serif;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.6;
  background: radial-gradient(1200px 700px at 80% -10%, rgba(46, 196, 206, 0.22), transparent 55%),
    radial-gradient(900px 600px at -10% 30%, rgba(240, 169, 58, 0.12), transparent 50%),
    linear-gradient(180deg, #071c24 0%, #0b3340 45%, #071c24 100%);
  overflow-x: hidden;
}

#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.site {
  position: relative;
  z-index: 1;
}

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

.wrap {
  width: min(1120px, calc(100% - 2rem));
  margin-inline: auto;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: blur(14px);
  background: rgba(7, 28, 36, 0.72);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.85rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 800;
  font-size: 1.15rem;
}

.brand img {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 28%;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.35);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  font-family: inherit;
  font-weight: 800;
  font-size: 1rem;
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  transition: transform 0.2s var(--ease), box-shadow 0.2s var(--ease), background 0.2s ease;
}

.btn:hover { transform: translateY(-2px); }

.btn-gold {
  color: #2a1a00;
  background: linear-gradient(135deg, #ffe082, var(--gold) 50%, var(--gold-deep));
  box-shadow: 0 12px 28px rgba(240, 169, 58, 0.35);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid var(--line);
}

/* hero like tähetark */
.hero {
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 3rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold);
  background: rgba(255, 213, 79, 0.1);
  border: 1px solid rgba(255, 213, 79, 0.25);
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 6vw, 3.8rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  font-weight: 900;
}

.hero h1 em {
  font-style: normal;
  color: var(--gold);
}

.hero-lead {
  margin: 1.1rem 0 0;
  max-width: 42ch;
  color: var(--muted);
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.hero-meta {
  margin: 1rem 0 0;
  color: rgba(169, 196, 203, 0.75);
  font-size: 0.92rem;
}

/* Toomas stage */
.toomas-stage {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 0.85rem;
}

.toomas-shadow {
  position: absolute;
  bottom: 2.2rem;
  width: 55%;
  height: 1.4rem;
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(0, 0, 0, 0.45), transparent 70%);
  filter: blur(2px);
}

#toomas-mount {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  border-radius: 50%;
}

#toomas-mount:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 8px;
}

#toomas-mount.is-pressing .toomas-float {
  transform: scale(0.96);
}

.toomas-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
  filter: drop-shadow(0 18px 30px rgba(0, 0, 0, 0.35));
}

.toomas-float {
  transform-origin: 100px 120px;
  animation: float 4.8s ease-in-out infinite;
}

.toomas-ear-l { transform-origin: 55px 70px; animation: ear 3.5s ease-in-out infinite; }
.toomas-ear-r { transform-origin: 145px 70px; animation: ear 3.5s ease-in-out infinite 0.2s; }

.toomas-lid {
  transform-box: fill-box;
  transform-origin: center top;
  transform: scaleY(0);
}

.toomas-svg.is-blinking .toomas-lid {
  animation: blink 0.22s ease;
}

.toomas-mouth-open { opacity: 0; }
.toomas-mouth-closed { opacity: 1; }

.toomas-svg.is-talking .toomas-mouth-open {
  animation: mouth 0.22s ease-in-out infinite alternate;
}
.toomas-svg.is-talking .toomas-mouth-closed {
  animation: mouth-hide 0.22s ease-in-out infinite alternate;
}

.toomas-svg.is-happy .toomas-eyes-open { opacity: 0; }
.toomas-svg.is-happy .toomas-eyes-happy { opacity: 1; }

.toomas-eyes-happy { opacity: 0; }

.toomas-badge {
  border: 0;
  cursor: pointer;
  font-family: inherit;
  font-weight: 800;
  font-size: 0.95rem;
  color: #2a1a00;
  padding: 0.65rem 1rem;
  border-radius: 999px;
  background: var(--gold);
  box-shadow: 0 10px 24px rgba(240, 169, 58, 0.35);
}

.toomas-badge:hover { transform: translateY(-2px); }

.spark {
  position: absolute;
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0.85;
  animation: twinkle 2.8s ease-in-out infinite;
  pointer-events: none;
}
.spark-1 { top: 8%; left: 8%; }
.spark-2 { top: 18%; right: 6%; animation-delay: 0.8s; }
.spark-3 { bottom: 28%; left: 2%; animation-delay: 1.4s; }

/* sections */
.section {
  padding: clamp(3rem, 7vw, 5rem) 0;
}

.section-label {
  margin: 0 0 0.55rem;
  color: var(--teal);
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.8rem, 4.5vw, 2.6rem);
  line-height: 1.15;
  font-weight: 900;
}

.section .lead {
  margin: 0 0 1.75rem;
  max-width: 48ch;
  color: var(--muted);
}

.center { text-align: center; }
.center .lead { margin-inline: auto; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.feature {
  padding: 1.35rem 1.3rem;
  border-radius: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
  text-align: left;
}

.feature .icon {
  display: inline-grid;
  place-items: center;
  width: 2.6rem;
  height: 2.6rem;
  margin-bottom: 0.85rem;
  border-radius: 0.85rem;
  background: rgba(46, 196, 206, 0.15);
  color: var(--teal);
  font-size: 1.25rem;
}

.feature h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
  font-weight: 800;
}

.feature p {
  margin: 0;
  color: var(--muted);
  font-size: 0.98rem;
}

/* demo */
.demo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  align-items: center;
}

.phone {
  width: min(260px, 70vw);
  margin-inline: auto;
  aspect-ratio: 9 / 18.5;
  padding: 0.6rem;
  border-radius: 2rem;
  background: linear-gradient(160deg, #1c3337, #0a1518);
  box-shadow: var(--shadow);
}

.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 1.5rem;
  background: #0a4f56;
}

.phone-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.phone-screen img.is-active { opacity: 1; }

.demo-dots {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.demo-dots button {
  width: 0.7rem;
  height: 0.7rem;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  cursor: pointer;
}

.demo-dots button.is-active {
  background: var(--gold);
}

.demo-label {
  margin: 0 0 0.75rem;
  font-weight: 800;
  color: var(--gold);
  min-height: 1.4em;
}

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

.list-clean li {
  padding: 1rem 1.1rem;
  border-radius: 1.1rem;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--muted);
}

.changelog {
  max-width: 640px;
  margin-inline: auto;
  text-align: left;
  padding: 1.4rem 1.5rem;
  border-radius: 1.4rem;
  background: var(--card);
  border: 1px solid var(--line);
}

.changelog strong {
  color: var(--gold);
  font-size: 1.1rem;
}

.changelog ul {
  margin: 0.75rem 0 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.finale {
  padding: clamp(2.5rem, 6vw, 3.5rem) 1.5rem;
  border-radius: 2rem;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(255, 213, 79, 0.2), transparent 40%),
    linear-gradient(135deg, #0a4f56, #12808c 65%, #2ec4ce);
  box-shadow: var(--shadow);
}

.finale h2 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.finale p {
  margin: 0 auto 1.35rem;
  max-width: 36ch;
  color: rgba(244, 251, 252, 0.88);
}

.qr-wrap {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  align-items: center;
}

.qr-card {
  justify-self: center;
  width: min(100%, 280px);
  padding: 1.25rem 1.25rem 1.1rem;
  border-radius: 1.5rem;
  text-align: center;
  background: #fff;
  color: #163037;
  box-shadow: var(--shadow);
}

.qr-link {
  display: block;
  border-radius: 1rem;
  overflow: hidden;
}

.qr-img {
  width: 100%;
  height: auto;
  margin-inline: auto;
  image-rendering: pixelated;
}

.qr-caption {
  margin: 0.85rem 0 0.15rem;
  font-weight: 800;
  font-size: 1.05rem;
  color: #0e5c64;
}

.qr-version {
  margin: 0;
  font-size: 0.9rem;
  color: #5a6f75;
}

.finale-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
  justify-content: center;
}

.finale-qr {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 0.55rem 0.55rem;
  border-radius: 1rem;
  text-decoration: none;
  background: #fff;
  color: #0e5c64;
  font-weight: 800;
  font-size: 0.85rem;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.finale-qr img {
  width: 96px;
  height: 96px;
  border-radius: 0.4rem;
}

.site-footer {
  padding: 2.5rem 1rem 3rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer strong { color: var(--text); }

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes ear {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-4deg); }
}

@keyframes blink {
  0%, 100% { transform: scaleY(0); }
  40%, 60% { transform: scaleY(1); }
}

@keyframes mouth {
  from { opacity: 0.15; }
  to { opacity: 1; }
}

@keyframes mouth-hide {
  from { opacity: 1; }
  to { opacity: 0.15; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.15); }
}

@media (max-width: 900px) {
  .hero-grid,
  .demo-grid,
  .feature-grid,
  .qr-wrap {
    grid-template-columns: 1fr;
  }

  .hero-grid { text-align: center; }
  .hero-lead { margin-inline: auto; }
  .hero-actions { justify-content: center; }
  .toomas-stage { order: -1; }
  .feature-grid { grid-template-columns: 1fr; }
  .qr-card { order: -1; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
