:root {
  color-scheme: dark;
  --bg: #120d10;
  --surface: #1e161a;
  --surface-2: #2a1b21;
  --wine: #7c203a;
  --wine-bright: #b84768;
  --gold: #d7b46a;
  --ivory: #f7f1ea;
  --muted: #c9bcc0;
  --cta-bg: #f1e3d7;
  --cta-text: #35131d;
  --line: rgba(247, 241, 234, 0.14);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  background:
    radial-gradient(circle at 50% 10%, rgba(124, 32, 58, 0.25), transparent 34rem),
    linear-gradient(180deg, #181014 0%, var(--bg) 44%, #0c090b 100%);
  color: var(--ivory);
}

button, summary { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

a { color: var(--ivory); }
a:hover { color: var(--gold); }
a:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
  border-radius: 4px;
}

.app-shell {
  width: min(100%, 480px);
  min-height: 100vh;
  min-height: 100svh;
  margin: 0 auto;
  padding: max(26px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
}

.screen {
  min-height: calc(100svh - 54px);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.screen[hidden],
.score-card[hidden] { display: none !important; }
.centered { align-items: center; text-align: center; }

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.18em;
}

h1, h2, p { overflow-wrap: anywhere; }

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.1rem, 15vw, 4.7rem);
  line-height: 0.94;
  letter-spacing: -0.055em;
  font-weight: 600;
}

#landing-title {
  font-size: clamp(2.05rem, 10.5vw, 3.2rem);
  line-height: 1.04;
  letter-spacing: -0.06em;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: keep-all;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 9vw, 3.2rem);
  line-height: 1.08;
  font-weight: 600;
}

.lead {
  margin: 24px 0 0;
  font-size: 1.12rem;
  line-height: 1.7;
  color: var(--muted);
}
.lead strong { color: var(--ivory); font-size: 1.18em; }

.subcopy,
.instruction,
.result-support,
.error-message,
.disclaimer,
.score-note,
.details-card p {
  color: var(--muted);
  line-height: 1.72;
}

.subcopy { margin: 8px 0 22px; font-size: 0.98rem; }
.disclaimer, .score-note { font-size: 0.79rem; }

.orbit-visual,
.measure-orbit {
  position: relative;
  width: 210px;
  aspect-ratio: 1;
  margin: 28px auto 22px;
}

.glass-ring,
.orbit-guide,
.measure-orbit::before {
  position: absolute;
  inset: 16%;
  border: 1px solid rgba(247, 241, 234, 0.24);
  border-radius: 50%;
  content: "";
}

.glass-ring::after {
  position: absolute;
  inset: 14%;
  border: 10px solid rgba(124, 32, 58, 0.38);
  border-top-color: rgba(184, 71, 104, 0.82);
  border-radius: 50%;
  content: "";
  transform: rotate(-24deg);
}

.wine-orbit {
  position: absolute;
  inset: 3%;
  border: 1px dashed rgba(215, 180, 106, 0.52);
  border-radius: 50%;
}

.phone-mark {
  position: absolute;
  top: 4%;
  left: 50%;
  transform: translateX(-50%) rotate(10deg);
  color: var(--ivory);
  font-size: 2rem;
}

.button {
  width: 100%;
  min-height: 54px;
  border-radius: 16px;
  border: 1px solid transparent;
  font-weight: 760;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.button:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.button-primary {
  background: var(--cta-bg);
  color: var(--cta-text);
  box-shadow: 0 10px 30px rgba(241, 227, 215, 0.12);
}

.button-secondary {
  margin-top: 10px;
  background: transparent;
  color: var(--ivory);
  border-color: var(--line);
}

.button:disabled { opacity: 0.55; cursor: progress; }

.safety-card {
  margin-top: 18px;
  padding: 15px 16px;
  background: rgba(247, 241, 234, 0.055);
  border: 1px solid var(--line);
  border-radius: 15px;
}
.safety-card strong { font-size: 0.88rem; }
.safety-card p { margin: 7px 0 0; color: var(--muted); line-height: 1.6; font-size: 0.86rem; }

.countdown-number {
  margin: 36px 0 10px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(7rem, 38vw, 11rem);
  line-height: 0.9;
}

.orbit-guide {
  position: relative;
  width: 120px;
  height: 120px;
  inset: auto;
  margin: 12px 0 22px;
  border-style: dashed;
}

.measure-orbit::before { inset: 18%; border-color: rgba(215, 180, 106, 0.42); }
.measure-orbit span {
  position: absolute;
  top: 4%;
  left: 48%;
  width: 18px;
  height: 18px;
  background: var(--cta-bg);
  border-radius: 50%;
  box-shadow: 0 0 0 9px rgba(241, 227, 215, 0.08);
  transform-origin: 8px 96px;
  animation: orbit 1.6s linear infinite;
}

.remaining {
  margin: 4px 0 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.5rem;
  color: var(--ivory);
}
.remaining small { font-family: system-ui, sans-serif; font-size: 0.9rem; color: var(--muted); }

progress {
  width: min(100%, 310px);
  height: 9px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-2);
}
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--gold); }
progress::-moz-progress-bar { background: var(--gold); }

.analysis-dots { display: flex; gap: 12px; margin: 42px 0 28px; }
.analysis-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  animation: pulse 1.1s ease-in-out infinite;
}
.analysis-dots span:nth-child(2) { animation-delay: 0.14s; }
.analysis-dots span:nth-child(3) { animation-delay: 0.28s; }

.result-style {
  font-size: clamp(2.45rem, 11vw, 4.2rem);
  overflow-wrap: normal;
  word-break: keep-all;
}
.result-message {
  margin: 22px 0 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.3rem;
  line-height: 1.58;
  color: var(--ivory);
}
.result-support { margin: 10px 0 20px; font-size: 0.92rem; }

.score-card {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: baseline;
  gap: 7px;
  margin: 4px 0 14px;
  padding: 17px 18px;
  background: linear-gradient(135deg, rgba(124, 32, 58, 0.4), rgba(42, 27, 33, 0.82));
  border: 1px solid rgba(215, 180, 106, 0.24);
  border-radius: 18px;
}
.score-card span { color: var(--gold); font-size: 0.75rem; letter-spacing: 0.12em; font-weight: 720; }
.score-card strong { font-size: 2.35rem; color: var(--ivory); }
.score-card small { color: var(--muted); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 14px;
}
.metric-grid div {
  min-width: 0;
  padding: 13px 8px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 241, 234, 0.035);
  text-align: center;
}
.metric-grid span { display: block; min-height: 2.8em; color: var(--muted); font-size: 0.72rem; line-height: 1.4; }
.metric-grid strong { display: block; margin-top: 4px; font-size: 1.45rem; }

.details-card {
  margin: 2px 0 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(247, 241, 234, 0.025);
}
.details-card summary { padding: 14px 0; cursor: pointer; color: var(--ivory); font-weight: 680; }
.details-card dl { margin: 0 0 12px; }
.details-card dl div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-top: 1px solid var(--line); }
.details-card dt { color: var(--muted); }
.details-card dd { margin: 0; font-weight: 700; }
.details-card p { margin: 0 0 14px; font-size: 0.78rem; }

.error-message { max-width: 34ch; margin: 18px auto 30px; }

.site-footer {
  width: min(100%, 480px);
  margin: 0 auto;
  padding: 0 22px max(32px, env(safe-area-inset-bottom));
  color: var(--muted);
  text-align: center;
  font-size: 0.78rem;
  line-height: 1.65;
}
.site-footer p { margin: 0 0 8px; }
.site-footer a { color: var(--muted); text-underline-offset: 0.2em; }
.site-footer a:hover { color: var(--ivory); }

.public-page {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: max(30px, env(safe-area-inset-top)) 22px max(40px, env(safe-area-inset-bottom));
}
.public-page-header { margin-bottom: 28px; }
.public-page-title {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 11vw, 4rem);
  line-height: 1.05;
}
.public-page-lead {
  margin: 18px 0 0;
  color: var(--muted);
  line-height: 1.75;
}
.public-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 24px 0 0;
  font-size: 0.86rem;
}
.public-nav a { color: var(--muted); }
.public-section {
  margin-top: 18px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(247, 241, 234, 0.035);
}
.public-section h2 {
  margin: 0 0 12px;
  font-size: 1.45rem;
}
.public-section p,
.public-section li {
  color: var(--muted);
  line-height: 1.75;
}
.public-section p { margin: 10px 0 0; }
.public-section ul { margin: 10px 0 0; padding-left: 1.2rem; }
.public-section strong { color: var(--ivory); }
.public-back {
  display: inline-block;
  margin-top: 26px;
  font-weight: 700;
}

@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.35; transform: scale(0.75); } 50% { opacity: 1; transform: scale(1); } }

@media (min-width: 520px) {
  .app-shell { padding-left: 30px; padding-right: 30px; }
  .site-footer { padding-left: 30px; padding-right: 30px; }
  .public-page { padding-left: 30px; padding-right: 30px; }
}

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