:root {
  color-scheme: light;
  --brand-blue: #2b73f5;
  --brand-cyan: #19c7ff;
  --brand-navy: #101827;
  --accent-orange: #ff6b19;
  --accent-green: #32b878;
  --accent-yellow: #f4d35e;
  --ink: #111827;
  --muted: #5f6b7a;
  --line: #e6ebf2;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --surface-blue: #eef5ff;
  --hero-bg: #fbfcff;
  --hero-panel: #eaf4ff;
  --screen-bg: #f7f9fc;
  --grid-line-a: rgba(43, 115, 245, 0.08);
  --grid-line-b: rgba(43, 115, 245, 0.06);
  --header-bg: rgba(246, 248, 251, 0.86);
  --header-card: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(16, 24, 39, 0.12);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #eef5ff;
  --muted: #9badc7;
  --line: #243247;
  --surface: #121b2a;
  --surface-soft: #0c1320;
  --surface-blue: rgba(43, 115, 245, 0.16);
  --hero-bg: #08111f;
  --hero-panel: #10233b;
  --screen-bg: #101827;
  --grid-line-a: rgba(118, 167, 255, 0.1);
  --grid-line-b: rgba(25, 199, 255, 0.08);
  --header-bg: rgba(8, 17, 31, 0.86);
  --header-card: rgba(18, 27, 42, 0.72);
  --shadow: 0 26px 80px rgba(0, 0, 0, 0.36);
}

:root[data-theme="dark"] .button-secondary {
  color: var(--ink);
  background: var(--surface);
}

:root[data-theme="dark"] .carbs {
  color: #f6d66f;
  background: rgba(244, 211, 94, 0.12);
}

:root[data-theme="dark"] .protein {
  color: #6ee0aa;
  background: rgba(50, 184, 120, 0.14);
}

:root[data-theme="dark"] .live-pill {
  color: #b8f0d3;
  background: rgba(50, 184, 120, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--surface-soft);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

body::selection {
  background: rgba(43, 115, 245, 0.18);
}

a {
  color: inherit;
  text-decoration: none;
}

code {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 30;
  padding: 10px 14px;
  background: var(--brand-navy);
  color: white;
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 14px 6vw;
  background: var(--header-bg);
  border-bottom: 1px solid rgba(230, 235, 242, 0.82);
  backdrop-filter: blur(18px);
}

.site-header.is-elevated {
  box-shadow: 0 12px 28px rgba(16, 24, 39, 0.08);
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 760;
}

.brand-mark img {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  box-shadow: 0 8px 22px rgba(43, 115, 245, 0.16);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--header-card);
}

.desktop-nav a,
.theme-toggle {
  min-height: 36px;
  padding: 9px 13px;
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
}

.desktop-nav a:hover,
.desktop-nav a:focus-visible {
  color: var(--brand-blue);
  background: var(--surface-blue);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  background: var(--header-card);
  cursor: pointer;
}

.theme-toggle-track {
  position: relative;
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  background: #dbe7f8;
}

.theme-toggle-thumb {
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: white;
  box-shadow: 0 3px 10px rgba(16, 24, 39, 0.18);
  transition: transform 0.24s ease, background 0.24s ease;
}

:root[data-theme="dark"] .theme-toggle-track {
  background: rgba(43, 115, 245, 0.34);
}

:root[data-theme="dark"] .theme-toggle-thumb {
  transform: translateX(18px);
  background: var(--brand-cyan);
}

.theme-toggle-text {
  min-width: 35px;
  text-align: left;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 1.05fr);
  align-items: center;
  gap: 42px;
  min-height: 86vh;
  padding: 46px 6vw 70px;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--grid-line-a) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line-b) 1px, transparent 1px),
    var(--hero-bg);
  background-size: 56px 56px;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  bottom: -160px;
  width: 58%;
  height: 56%;
  background: var(--hero-panel);
  transform: rotate(-10deg);
  border-radius: 8px;
  z-index: 0;
}

.hero-copy,
.hero-stage,
.section,
.split-section,
.ai-section,
.site-footer {
  position: relative;
  z-index: 1;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--brand-blue);
  font-size: 0.82rem;
  font-weight: 780;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 5.4rem;
  line-height: 0.95;
  font-weight: 820;
}

.hero-lede {
  max-width: 650px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 1.22rem;
  line-height: 1.64;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-weight: 760;
}

.button-primary {
  color: white;
  background: var(--brand-blue);
  box-shadow: 0 14px 30px rgba(43, 115, 245, 0.25);
}

.button-secondary {
  color: var(--brand-navy);
  background: white;
  border-color: var(--line);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  max-width: 680px;
  margin: 34px 0 0;
}

.hero-metrics div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--header-card);
}

.hero-metrics dt {
  font-weight: 800;
}

.hero-metrics dd {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero-stage {
  display: grid;
  place-items: center;
  min-height: 620px;
}

.phone-shell {
  width: min(380px, 100%);
  padding: 12px;
  border: 1px solid rgba(16, 24, 39, 0.1);
  border-radius: 42px;
  background: var(--brand-navy);
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  animation: phone-float 7s ease-in-out infinite;
}

.phone-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 34px;
  padding: 0 18px;
  color: white;
  font-size: 0.82rem;
  font-weight: 760;
}

.status-dots {
  width: 42px;
  height: 10px;
  background:
    radial-gradient(circle at 7px 5px, white 0 3px, transparent 3px),
    radial-gradient(circle at 21px 5px, white 0 3px, transparent 3px),
    radial-gradient(circle at 35px 5px, white 0 3px, transparent 3px);
}

.phone-content {
  min-height: 610px;
  padding: 22px;
  border-radius: 32px;
  background: var(--screen-bg);
}

.screen-head,
.board-top,
.exercise-line,
.meal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.muted-label,
.screen-head span,
.meal-row small,
.progress-card span,
.ai-card p,
.ai-insight p,
.feature-card p,
.panel-copy p,
.section-heading p {
  color: var(--muted);
}

.screen-head h2 {
  margin: 4px 0 0;
  font-size: 1.7rem;
}

.screen-head img {
  width: 42px;
  height: 42px;
  border-radius: 8px;
}

.day-strip {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin: 22px 0 14px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.day-strip span,
.day-strip strong {
  display: grid;
  place-items: center;
  min-height: 34px;
  border-radius: 8px;
  font-size: 0.86rem;
}

.day-strip strong {
  color: white;
  background: var(--brand-blue);
}

.calorie-card,
.macro-card,
.meal-row,
.feature-card,
.workout-board,
.progress-card,
.ai-card,
.ai-insight {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.calorie-card {
  display: grid;
  grid-template-columns: 1fr 130px;
  align-items: center;
  gap: 8px;
  padding: 18px;
  overflow: hidden;
}

.calorie-card p,
.macro-card p {
  margin: 0;
  font-weight: 760;
}

.calorie-card strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
}

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

.ring {
  position: relative;
  width: 116px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(var(--brand-blue) calc(var(--value) * 1%), #dfe9f8 0);
}

.ring::before {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 50%;
  background: var(--surface);
}

.ring span {
  position: absolute;
  inset: 34px;
  border-radius: 50%;
  background: var(--brand-cyan);
  opacity: 0.14;
}

.macro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.macro-card {
  padding: 15px;
}

.macro-card strong {
  display: block;
  margin-top: 10px;
}

.macro-card span {
  display: block;
  height: 7px;
  margin-top: 10px;
  border-radius: 8px;
  background: rgba(16, 24, 39, 0.08);
  overflow: hidden;
}

.macro-card i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: currentColor;
  animation: fill-bar 1.8s ease both;
}

.carbs {
  color: #9a7413;
  background: #fff8d9;
}

.protein {
  color: #096b45;
  background: #e5f8ee;
}

.food-rail {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  overflow: hidden;
}

.food-rail span {
  flex: 0 0 auto;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font-size: 0.84rem;
  animation: rail-drift 10s linear infinite;
}

.meal-row {
  margin-top: 12px;
  padding: 13px;
}

.meal-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--surface-blue);
}

.meal-row div {
  min-width: 0;
  flex: 1;
}

.meal-row strong,
.meal-row small {
  display: block;
}

.section,
.split-section,
.ai-section {
  padding: 92px 6vw;
}

.section-heading {
  max-width: 780px;
  margin-bottom: 32px;
}

.section-heading h2,
.panel-copy h2 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.08;
}

.section-heading p,
.panel-copy p {
  max-width: 700px;
  margin: 18px 0 0;
  font-size: 1.06rem;
  line-height: 1.72;
}

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

.feature-card,
.progress-card,
.ai-card,
.ai-insight {
  padding: 22px;
  box-shadow: 0 14px 34px rgba(16, 24, 39, 0.06);
}

.feature-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  color: white;
  background: var(--brand-blue);
  font-size: 0.82rem;
  font-weight: 820;
}

.feature-card h3,
.ai-card h3 {
  margin: 22px 0 10px;
  font-size: 1.18rem;
}

.feature-card p,
.ai-card p,
.ai-insight p {
  margin: 0;
  line-height: 1.62;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  align-items: center;
  gap: 24px;
  background: var(--brand-navy);
  color: white;
}

.split-section .eyebrow {
  color: var(--brand-cyan);
}

.split-section p {
  color: #c8d3e2;
}

.workout-board {
  padding: 24px;
  color: var(--ink);
}

.board-top {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.board-top span {
  color: var(--muted);
  font-size: 0.9rem;
}

.board-top strong {
  font-size: 1.2rem;
}

.exercise-line {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: var(--surface-soft);
}

.exercise-line.active {
  color: white;
  background: var(--brand-blue);
  box-shadow: 0 12px 28px rgba(43, 115, 245, 0.24);
}

.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 18px;
  padding: 10px 12px;
  border-radius: 8px;
  color: #0f5132;
  background: #e6f8ef;
  font-weight: 760;
}

.live-pill span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: var(--accent-green);
  animation: pulse 1.8s ease-out infinite;
}

.progress-section {
  background: var(--surface);
}

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

.progress-card {
  min-height: 158px;
}

.progress-card small,
.progress-card span {
  display: block;
}

.progress-card small {
  color: var(--brand-blue);
  font-weight: 780;
}

.progress-card strong {
  display: block;
  margin: 18px 0 8px;
  font-size: 2.5rem;
}

.progress-card.accent {
  color: white;
  background: var(--accent-orange);
  border-color: transparent;
}

.progress-card.accent small,
.progress-card.accent span {
  color: rgba(255, 255, 255, 0.84);
}

.ai-section {
  background:
    linear-gradient(180deg, rgba(43, 115, 245, 0.08), transparent 42%),
    var(--surface-soft);
}

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

.ai-card span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  color: white;
  background: var(--brand-blue);
  font-size: 0.82rem;
  font-weight: 820;
}

.ai-insight {
  grid-column: span 3;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) auto;
  align-items: center;
  gap: 20px;
  padding: 24px;
  color: white;
  background: var(--brand-navy);
  border-color: transparent;
  overflow: hidden;
}

.insight-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.insight-header img {
  width: 46px;
  height: 46px;
  border-radius: 8px;
}

.insight-header strong,
.insight-header small {
  display: block;
}

.insight-header small,
.ai-insight p {
  color: #c8d3e2;
}

.insight-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.insight-actions span {
  padding: 10px 12px;
  border-radius: 8px;
  color: white;
  background: rgba(255, 255, 255, 0.12);
  font-size: 0.9rem;
  font-weight: 760;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 26px 6vw;
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.site-footer p {
  margin: 0;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes phone-float {
  0%,
  100% {
    transform: translateY(0) rotate(2deg);
  }
  50% {
    transform: translateY(-14px) rotate(-1deg);
  }
}

@keyframes fill-bar {
  from {
    width: 0;
  }
}

@keyframes rail-drift {
  0%,
  15% {
    transform: translateX(0);
  }
  65%,
  100% {
    transform: translateX(-42px);
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(50, 184, 120, 0.42);
  }
  100% {
    box-shadow: 0 0 0 12px rgba(50, 184, 120, 0);
  }
}

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

  .hero,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: auto;
  }

  .phone-shell {
    width: min(360px, 100%);
    transform: none;
  }

  h1 {
    font-size: 4.2rem;
  }

  .feature-layout,
  .progress-grid,
  .ai-grid {
    grid-template-columns: 1fr 1fr;
  }

  .ai-insight {
    grid-column: span 2;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .site-header {
    padding-inline: 18px;
  }

  .hero,
  .section,
  .split-section,
  .ai-section {
    padding-inline: 18px;
  }

  h1 {
    font-size: 3.3rem;
  }

  .hero-lede {
    font-size: 1.04rem;
  }

  .hero-metrics,
  .feature-layout,
  .progress-grid,
  .ai-grid,
  .macro-grid {
    grid-template-columns: 1fr;
  }

  .ai-insight {
    grid-column: span 1;
    padding: 20px;
  }

  .insight-actions {
    justify-content: flex-start;
  }

  .phone-content {
    min-height: 560px;
    padding: 16px;
  }

  .calorie-card {
    grid-template-columns: 1fr;
  }

  .ring {
    width: 104px;
    margin: 0 auto;
  }

  .section-heading h2,
  .panel-copy h2 {
    font-size: 2rem;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

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

  .reveal {
    opacity: 1;
    transform: none;
  }
}
