:root {
  color-scheme: dark;
  --bg: #141116;
  --surface: #1e1a22;
  --surface-2: #271f2c;
  --ink: #f6eef2;
  --muted: #b6a7b1;
  --accent: #ff9a72;
  --accent-dark: #ffb593;
  --violet: #ab9cff;
  --soft-peach: rgba(255, 154, 114, 0.14);
  --soft-violet: rgba(171, 156, 255, 0.14);
  --soft-mint: rgba(93, 201, 155, 0.14);
  --line: #362d3c;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: radial-gradient(circle at 12% 8%, #2a1e25 0, transparent 34%),
              radial-gradient(circle at 88% 20%, #231d36 0, transparent 30%),
              var(--bg);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input { font: inherit; }

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(20, 17, 22, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(54, 45, 60, 0.8);
}

.nav { display: flex; align-items: center; justify-content: space-between; min-height: 74px; gap: 1rem; }

.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 800; font-size: 1.15rem; letter-spacing: -0.02em; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 13px;
  background: linear-gradient(135deg, var(--accent), #ffc29d);
  box-shadow: 0 8px 18px rgba(255, 154, 114, 0.25); font-size: 1.2rem;
}
.nav-links { display: flex; align-items: center; gap: 1.6rem; font-size: 0.95rem; font-weight: 600; }
.nav-links a:not(.nav-cta) { color: var(--muted); transition: color 0.2s ease; }
.nav-links a:not(.nav-cta):hover { color: var(--accent); }
.nav-cta {
  padding: 0.55rem 1.15rem; border-radius: 999px; color: var(--ink);
  background: #2c2533; transition: transform 0.15s ease, background 0.2s ease, color 0.2s ease;
}
.nav-cta:hover { background: var(--violet); color: #1a1420; transform: translateY(-1px); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  border: 0; border-radius: 999px; padding: 0.85rem 1.5rem;
  font-weight: 700; font-size: 0.96rem; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(0.98); }
.btn.primary { background: linear-gradient(135deg, var(--accent), #ffbe9a); color: #2a1410; box-shadow: 0 12px 24px rgba(255, 154, 114, 0.22); }
.btn.primary:hover { box-shadow: 0 16px 30px rgba(255, 154, 114, 0.32); }
.btn.ghost { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-dark); background: #302736; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.6; cursor: progress; transform: none; }

.hero { display: grid; grid-template-columns: 1.05fr 1fr; align-items: center; gap: 3rem; padding: 4.5rem 0 3.5rem; }
.badge, .eyebrow {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 0.4rem 0.8rem; border-radius: 999px; background: var(--soft-peach); color: var(--accent-dark);
}
.hero h1 { font-size: clamp(2.2rem, 5.4vw, 3.6rem); line-height: 1.08; letter-spacing: -0.045em; margin: 1rem 0; }
.gradient-text { background: linear-gradient(100deg, var(--accent) 10%, var(--violet) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { font-size: 1.08rem; color: var(--muted); max-width: 34rem; margin: 0 0 1.8rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; list-style: none; padding: 0; margin: 1.8rem 0 0; color: var(--muted); font-size: 0.88rem; }
.chips li { display: flex; align-items: center; gap: 0.4rem; }
.chips li::before { content: "✓"; color: var(--accent); font-weight: 900; }

.hero-art { position: relative; animation: fadeInUp 0.7s ease both; }
.hero-img { width: 100%; border-radius: 36px; box-shadow: var(--shadow); }
.float-card {
  position: absolute; display: flex; align-items: center; gap: 0.7rem;
  background: rgba(30, 26, 34, 0.94); border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px; padding: 0.7rem 0.9rem; box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
  animation: float 5s ease-in-out infinite;
}
.float-card strong { display: block; font-size: 0.88rem; line-height: 1.2; }
.float-card small { display: block; color: var(--muted); font-size: 0.72rem; }
.status-float { top: 8%; left: -4%; }
.age-float { right: -3%; bottom: 12%; animation-delay: -2.4s; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.dot-green { background: #5dd29b; box-shadow: 0 0 0 5px rgba(93, 210, 155, 0.16); }
.float-emoji { font-size: 1.4rem; }

.section { padding: 3rem 0; }
.section-head { text-align: center; max-width: 660px; margin: 0 auto 2rem; }
.section-head h2, .login-info h2, .calc-copy h2 {
  font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.2; letter-spacing: -0.03em; margin: 0.7rem 0 0.6rem;
}
.section-head p { color: var(--muted); margin: 0; }

.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.feature-card { padding: 1.7rem; transition: transform 0.2s ease, box-shadow 0.2s ease; }
.feature-card:hover { transform: translateY(-5px); box-shadow: 0 26px 54px rgba(0, 0, 0, 0.45); }
.feature-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 18px; font-size: 1.5rem; margin-bottom: 1rem; }
.icon-peach { background: var(--soft-peach); }
.icon-lilac { background: var(--soft-violet); }
.icon-mint { background: var(--soft-mint); }
.feature-card h3 { margin: 0 0 0.4rem; font-size: 1.12rem; }
.feature-card p { margin: 0; color: var(--muted); font-size: 0.95rem; }

.login-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; padding: 2.4rem; align-items: center; }
.login-info p { color: var(--muted); }
.api-note { display: flex; gap: 0.8rem; background: var(--soft-violet); border-radius: 18px; padding: 1rem 1.1rem; margin: 1.2rem 0; }
.api-note > span { font-size: 1.4rem; }
.api-note strong { display: block; font-size: 0.92rem; }
.api-note p { margin: 0.15rem 0 0; font-size: 0.86rem; color: #c9c0ef; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.5rem; color: var(--muted); font-size: 0.9rem; }
.check-list li::before { content: "🐾"; margin-right: 0.5rem; }

.login-form { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 1.6rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.86rem; font-weight: 700; margin-bottom: 0.4rem; }
.input-wrap { display: flex; align-items: center; gap: 0.6rem; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 0 0.9rem; transition: border-color 0.2s, box-shadow 0.2s; }
.input-wrap:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 154, 114, 0.14); }
.input-wrap span { opacity: 0.7; }
.input-wrap input { flex: 1; border: 0; outline: 0; background: transparent; padding: 0.85rem 0; color: var(--ink); min-width: 0; }
.input-wrap input::placeholder { color: #82737e; }
.form-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: 0.86rem; margin-bottom: 1.2rem; }
.remember { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); cursor: pointer; }
.remember input { accent-color: var(--accent); }
#forgotLink { color: var(--accent-dark); font-weight: 700; }
#forgotLink:hover { text-decoration: underline; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.35); border-top-color: #fff; animation: spin 0.7s linear infinite; }
.spinner[hidden] { display: none; }
.status { min-height: 1.4rem; margin-top: 0.9rem; font-size: 0.9rem; font-weight: 600; }
.status.error { color: #ff9188; }
.status.info { color: #bdb2ff; }
.status.success { color: #7fe0ad; }
.fineprint { font-size: 0.76rem; color: #94838e; margin: 0.5rem 0 0; text-align: center; }
.fineprint a { color: var(--accent-dark); text-decoration: underline; }
.shake { animation: shake 0.4s ease; }

.calc-wrap { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: 2.4rem; padding: 2.4rem; align-items: center; }
.calc-copy p { color: var(--muted); }
.calc-disclaimer { font-size: 0.85rem; background: var(--soft-peach); border-radius: 14px; padding: 0.8rem 1rem; color: #d9b6a6; }
.calc-panel { background: var(--surface-2); border: 1px solid var(--line); border-radius: 20px; padding: 1.6rem; }
.calc-label-row { display: flex; justify-content: space-between; align-items: baseline; font-weight: 700; margin-bottom: 1rem; }
.calc-label-row output { font-size: 1.4rem; color: var(--accent); font-weight: 800; }
.range-row { display: grid; grid-template-columns: 1fr 90px; gap: 1rem; align-items: center; }
input[type="range"] { width: 100%; accent-color: var(--accent); cursor: pointer; }
input[type="number"] { width: 100%; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); padding: 0.6rem 0.7rem; color: var(--ink); outline: 0; }
input[type="number"]:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 154, 114, 0.14); }
.ticks { display: flex; justify-content: space-between; font-size: 0.68rem; color: #8f808a; margin-top: 0.35rem; }
.result-card { margin-top: 1.6rem; background: linear-gradient(135deg, rgba(255, 154, 114, 0.16), rgba(171, 156, 255, 0.12)); border: 1px solid rgba(255, 255, 255, 0.05); border-radius: 18px; padding: 1.2rem 1.3rem; }
.result-caption { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: #d9ac98; font-weight: 800; }
.result-line { display: flex; align-items: baseline; gap: 0.45rem; flex-wrap: wrap; }
.result-line strong { font-size: 3rem; line-height: 1.1; color: var(--accent-dark); letter-spacing: -0.05em; }
.stage-pill { margin-left: auto; background: var(--surface); border-radius: 999px; padding: 0.3rem 0.75rem; font-size: 0.78rem; font-weight: 700; color: var(--violet); }
.meter { height: 8px; background: rgba(255, 255, 255, 0.09); border-radius: 99px; overflow: hidden; margin: 0.8rem 0; }
.meter-fill { height: 100%; width: 25%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--violet)); transition: width 0.35s ease; }
.result-note { margin: 0; font-size: 0.9rem; color: #d2bcb1; }

.gallery-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }
.cat-card { margin: 0; overflow: hidden; cursor: pointer; transition: transform 0.2s ease, box-shadow 0.2s ease; outline: none; }
.cat-card:hover, .cat-card:focus-visible { transform: translateY(-6px) rotate(-1deg); box-shadow: 0 28px 55px rgba(0, 0, 0, 0.45); }
.cat-card:nth-child(2):hover, .cat-card:nth-child(2):focus-visible { transform: translateY(-6px) rotate(1deg); }
.cat-photo { background: var(--soft-peach); aspect-ratio: 1 / 1; overflow: hidden; }
.cat-photo img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s ease; }
.cat-card:hover .cat-photo img { transform: scale(1.05); }
.cat-card figcaption { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; padding: 1rem 1.1rem; }
.cat-card figcaption strong { font-size: 1.05rem; }
.cat-card figcaption span { font-size: 0.82rem; color: var(--muted); text-align: right; }
.gallery-toast { text-align: center; min-height: 1.4rem; color: var(--accent-dark); font-weight: 700; margin: 1rem 0 0; opacity: 0; transition: opacity 0.2s ease; }
.gallery-toast.show { opacity: 1; }

.fact-card { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding: 1.8rem 2rem; background: linear-gradient(120deg, var(--surface), #2a2029); }
.fact-text { margin: 0.6rem 0 0; font-size: 1.08rem; max-width: 720px; }

.footer { border-top: 1px solid var(--line); padding: 1.6rem 0; color: var(--muted); font-size: 0.85rem; }
.footer-inner { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(6px); } 60% { transform: translateX(-4px); } 80% { transform: translateX(4px); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 2rem; padding-top: 3rem; }
  .hero-art { max-width: 560px; margin-inline: auto; }
  .feature-grid, .gallery-grid { grid-template-columns: 1fr 1fr; }
  .login-wrap, .calc-wrap { grid-template-columns: 1fr; }
  .status-float { left: 0; }
  .age-float { right: 0; }
}

@media (max-width: 640px) {
  .container { width: min(100% - 1.5rem, 1120px); }
  .nav { flex-wrap: wrap; padding-block: 0.8rem; }
  .nav-links { width: 100%; justify-content: space-between; gap: 0.6rem; font-size: 0.85rem; }
  .nav-cta { padding: 0.45rem 0.9rem; }
  .hero { padding-block: 2.5rem 2rem; }
  .hero-actions .btn { flex: 1 1 100%; }
  .feature-grid, .gallery-grid { grid-template-columns: 1fr; }
  .login-wrap, .calc-wrap { padding: 1.4rem; }
  .login-form, .calc-panel { padding: 1.2rem; }
  .fact-card { flex-direction: column; align-items: flex-start; padding: 1.4rem; }
  .range-row { grid-template-columns: 1fr 72px; }
  .stage-pill { margin-left: 0; }
}

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