:root {
  color-scheme: light;
  --bg: #f6f1ea;
  --surface: #fffaf3;
  --surface-2: #f0e4d8;
  --ink: #181411;
  --muted: #776d63;
  --line: #ded0c3;
  --accent: #8f3f2f;
  --accent-dark: #642820;
  --green: #2f7666;
  --gold: #b77a24;
  --blue: #405d86;
  --danger: #a33b32;
  --shadow: 0 24px 70px rgba(44, 29, 20, 0.14);
  --radius: 24px;
  --radius-sm: 14px;
  --max: 1180px;
}

/* Critical: keep hidden camera/playback/placeholder elements truly hidden.
   Without this, the placeholder can sit on top of the live camera feed. */
[hidden],
.is-hidden {
  display: none !important;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at top left, rgba(143, 63, 47, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(47, 118, 102, 0.12), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem max(1.25rem, calc((100vw - var(--max)) / 2 + 1.25rem));
  background: rgba(246, 241, 234, 0.86);
  border-bottom: 1px solid rgba(222, 208, 195, 0.8);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.25rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-weight: 800;
  font-size: 0.92rem;
  padding: 0.65rem 0.85rem;
  border-radius: 999px;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--ink);
  background: rgba(255, 250, 243, 0.86);
}

.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 5.5rem 1.25rem;
}

.section.soft {
  max-width: none;
  padding-inline: max(1.25rem, calc((100vw - var(--max)) / 2 + 1.25rem));
  background: rgba(255, 250, 243, 0.56);
  border-block: 1px solid rgba(222, 208, 195, 0.72);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.03fr) minmax(320px, 0.7fr);
  gap: clamp(2rem, 5vw, 5rem);
  align-items: center;
  min-height: calc(100vh - 78px);
}

.eyebrow {
  margin: 0 0 0.8rem;
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  font-size: clamp(2.7rem, 7vw, 6.3rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
  margin-bottom: 1.25rem;
}

h2 {
  font-size: clamp(2.1rem, 4vw, 4rem);
  line-height: 0.95;
  letter-spacing: -0.05em;
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.25rem;
  line-height: 1.15;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.hero-text,
.section-heading p,
.muted {
  color: var(--muted);
  font-size: 1.05rem;
}

.hero-text {
  max-width: 710px;
  margin-bottom: 1.5rem;
}

.hero-actions,
.studio-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.78rem 1.1rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
}

.button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.button.primary {
  background: var(--ink);
  color: var(--surface);
  box-shadow: 0 16px 30px rgba(24, 20, 17, 0.18);
}

.button.secondary {
  background: rgba(255, 250, 243, 0.78);
  border-color: var(--line);
  color: var(--ink);
}

.button.danger {
  background: var(--danger);
  color: white;
}

.button.full {
  width: 100%;
}

.hero-panel {
  display: grid;
  place-items: center;
}

.phone-frame {
  width: min(100%, 410px);
  min-height: 540px;
  display: grid;
  gap: 1rem;
  align-content: start;
  border: 1px solid rgba(24, 20, 17, 0.12);
  border-radius: 42px;
  padding: 1.3rem;
  background: linear-gradient(145deg, #fffdf7, #ead9ca);
  box-shadow: var(--shadow);
}

.mini-camera {
  width: 90px;
  height: 8px;
  margin: 0 auto 0.4rem;
  border-radius: 999px;
  background: rgba(24, 20, 17, 0.18);
}

.signal-card,
.signal-row,
.score-card,
.feature-card,
.guide-card,
.studio-card,
.review-card,
.coach-output article,
.timeline article {
  border: 1px solid rgba(222, 208, 195, 0.9);
  border-radius: var(--radius);
  background: rgba(255, 250, 243, 0.86);
  box-shadow: 0 16px 38px rgba(44, 29, 20, 0.08);
}

.signal-card {
  padding: 1.1rem;
}

.signal-card span,
.signal-row span,
.score-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.signal-card strong {
  display: block;
  font-size: 2.4rem;
  letter-spacing: -0.06em;
}

.signal-card small {
  color: var(--muted);
}

.signal-card.calm {
  border-color: rgba(47, 118, 102, 0.35);
}

.signal-card.warning {
  border-color: rgba(183, 122, 36, 0.45);
}

.signal-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
}

.signal-row b {
  font-size: 1.35rem;
}

.section-heading {
  max-width: 820px;
  margin-bottom: 2rem;
}

.inline-heading {
  max-width: none;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 1rem;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.6rem 0.85rem;
  color: var(--muted);
  background: rgba(255, 250, 243, 0.8);
  font-weight: 850;
}

.status-pill.ready {
  color: var(--green);
  border-color: rgba(47, 118, 102, 0.35);
}

.feature-grid,
.guide-grid,
.report-grid,
.app-grid,
.coach-output {
  display: grid;
  gap: 1rem;
}

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

.feature-card,
.guide-card,
.timeline article {
  padding: 1.25rem;
}

.feature-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  margin-bottom: 1rem;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-weight: 950;
}

.feature-card p,
.guide-card p,
.guide-card li,
.timeline p,
.coach-output p,
.coach-output li,
.score-card p {
  color: var(--muted);
}

.app-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.7fr);
  align-items: start;
}

.studio-card,
.review-card {
  padding: 1rem;
}

.video-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border-radius: 22px;
  background: #16120f;
  border: 1px solid rgba(24, 20, 17, 0.16);
}

video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

#liveVideo {
  transform: scaleX(-1);
}

.video-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.6rem;
  padding: 2rem;
  text-align: center;
  color: rgba(255, 250, 243, 0.8);
  background:
    linear-gradient(45deg, rgba(255, 250, 243, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 250, 243, 0.05) 75%),
    #16120f;
  background-size: 38px 38px;
}

.video-placeholder strong {
  font-size: clamp(1.4rem, 3vw, 2rem);
  color: white;
}

.recording-badge {
  position: absolute;
  top: 1rem;
  left: 1rem;
  padding: 0.45rem 0.75rem;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-weight: 950;
  box-shadow: 0 12px 22px rgba(163, 59, 50, 0.28);
}

.recording-badge::before {
  content: "";
  width: 8px;
  height: 8px;
  display: inline-block;
  margin-right: 0.45rem;
  border-radius: 999px;
  background: white;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  50% { opacity: 0.25; }
}

.studio-controls {
  margin-top: 1rem;
}

.meter-card {
  margin-top: 1rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(240, 228, 216, 0.42);
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.7rem;
  color: var(--muted);
  font-weight: 850;
}

.meter-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 20, 17, 0.1);
}

.meter-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green), var(--gold), var(--danger));
  transition: width 0.08s linear;
}

.meter-card small {
  display: block;
  margin-top: 0.65rem;
  color: var(--muted);
}

.review-card h3 {
  margin-top: 0.35rem;
}

.range-label {
  display: grid;
  gap: 0.6rem;
  margin: 1rem 0;
  color: var(--ink);
  font-weight: 850;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.checklist {
  display: grid;
  gap: 0.65rem;
  margin: 1rem 0;
}

.checklist label {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.82rem;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.38);
  color: #3d342d;
  font-weight: 760;
}

.checklist input {
  margin-top: 0.2rem;
  accent-color: var(--accent);
}

.report-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.score-card {
  min-height: 210px;
  padding: 1.15rem;
}

.score-card strong {
  display: block;
  margin: 0.5rem 0;
  font-size: clamp(2.3rem, 5vw, 4rem);
  line-height: 0.9;
  letter-spacing: -0.07em;
}

.primary-score {
  background: var(--ink);
  color: var(--surface);
}

.primary-score span,
.primary-score p {
  color: rgba(255, 250, 243, 0.72);
}

.coach-output {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 1rem;
}

.coach-output article {
  padding: 1.25rem;
}

ul {
  padding-left: 1.15rem;
  margin: 0.8rem 0 0;
}

li + li {
  margin-top: 0.42rem;
}

.guide-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-card {
  min-height: 280px;
}

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

.timeline span {
  display: inline-flex;
  margin-bottom: 0.85rem;
  padding: 0.42rem 0.6rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-dark);
  font-size: 0.78rem;
  font-weight: 950;
}

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

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

@media (max-width: 1050px) {
  .hero,
  .app-grid,
  .feature-grid,
  .coach-output {
    grid-template-columns: 1fr;
  }

  .report-grid,
  .guide-grid,
  .timeline {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .site-header,
  .inline-heading,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .section,
  .section.soft {
    padding-block: 4rem;
  }

  .hero {
    min-height: auto;
  }

  .report-grid,
  .guide-grid,
  .timeline {
    grid-template-columns: 1fr;
  }

  .studio-controls .button,
  .hero-actions .button {
    width: 100%;
  }
}

@media (max-width: 540px) {
  .nav-links {
    display: none;
  }

  h1 {
    font-size: 2.55rem;
  }

  h2 {
    font-size: 2.15rem;
  }
}

/* Side mirror preview update */
.hero-live-preview,
.side-preview-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(24, 20, 17, 0.14);
  background: #16120f;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 243, 0.04);
}

.hero-live-preview {
  aspect-ratio: 16 / 10;
  min-height: 150px;
}

.side-preview-card {
  aspect-ratio: 16 / 10;
  margin-bottom: 1rem;
}

#heroLiveVideo,
#sideLiveVideo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: scaleX(-1);
}

.hero-live-placeholder,
.side-preview-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 0.35rem;
  padding: 1.2rem;
  text-align: center;
  color: rgba(255, 250, 243, 0.82);
  background:
    linear-gradient(45deg, rgba(255, 250, 243, 0.05) 25%, transparent 25%, transparent 75%, rgba(255, 250, 243, 0.05) 75%),
    #16120f;
  background-size: 28px 28px;
}

.hero-live-placeholder[hidden],
.side-preview-placeholder[hidden] {
  display: none;
}

.side-preview-placeholder strong {
  color: white;
  font-size: 1.15rem;
}

.side-preview-placeholder span {
  color: rgba(255, 250, 243, 0.72);
  font-size: 0.95rem;
}
