:root {
  color-scheme: dark;
  --bg: #050816;
  --bg-strong: #0c1530;
  --panel: rgba(8, 16, 33, 0.82);
  --panel-strong: rgba(10, 22, 46, 0.96);
  --ink: #f6f9ff;
  --muted: #adc2ef;
  --line: rgba(132, 161, 255, 0.14);
  --accent: #3b82f6;
  --accent-strong: #8b5cf6;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.46);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 14% 10%, rgba(59, 130, 246, 0.25), transparent 24%),
    radial-gradient(circle at 82% 18%, rgba(139, 92, 246, 0.22), transparent 22%),
    linear-gradient(145deg, #020617 0%, #07111f 40%, #0b1c3d 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: radial-gradient(circle at center, black 40%, transparent 82%);
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 28px;
  min-height: 74vh;
  align-items: end;
  padding: 40px 0 16px;
}

.hero-copy,
.hero-panel,
.panel {
  border: 1px solid var(--line);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}

.hero-copy {
  background: linear-gradient(160deg, rgba(7, 17, 34, 0.94), rgba(12, 21, 48, 0.84));
  padding: 44px;
  border-radius: 36px;
}

.eyebrow,
.mini-label,
.field-label,
.stat-label {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.74rem;
  font-family: "Space Grotesk", sans-serif;
}

.eyebrow {
  color: #c4b5fd;
}

.hero-copy h1 {
  margin: 18px 0 16px;
  max-width: 11ch;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(3.1rem, 8vw, 6.4rem);
  line-height: 0.92;
}

.hero-text {
  max-width: 34rem;
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.65;
  color: var(--muted);
}

.hero-inline-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.hero-inline-stats span,
.detail-strip span {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(132, 161, 255, 0.18);
  font-size: 0.92rem;
}

.hero-panel {
  position: relative;
  overflow: hidden;
  min-height: 560px;
  border-radius: 40px;
  background:
    radial-gradient(circle at 22% 18%, rgba(59, 130, 246, 0.35), transparent 22%),
    radial-gradient(circle at 78% 76%, rgba(139, 92, 246, 0.22), transparent 22%),
    linear-gradient(160deg, #030817 0%, #0a1530 44%, #112657 100%);
}

.hero-orbit {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.hero-orbit-one {
  inset: 12% auto auto 10%;
  width: 300px;
  height: 300px;
  animation: floatOrbit 12s ease-in-out infinite;
}

.hero-orbit-two {
  right: -40px;
  bottom: 28px;
  width: 240px;
  height: 240px;
  animation: floatOrbit 10s ease-in-out infinite reverse;
}

.hero-readout {
  position: absolute;
  inset: auto 28px 28px 28px;
  padding: 26px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.05);
  color: #f7fbff;
  border: 1px solid rgba(157, 178, 255, 0.16);
  backdrop-filter: blur(8px);
  animation: riseIn 700ms ease both;
}

.hero-calories {
  display: block;
  margin: 14px 0 18px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2.8rem, 7vw, 4.8rem);
  line-height: 0.95;
}

.macro-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.macro-row span,
.history-meta {
  color: rgba(221, 232, 255, 0.92);
}

.workspace {
  display: grid;
  grid-template-columns: 1fr 0.92fr;
  gap: 22px;
  margin-top: 18px;
}

.panel {
  background: var(--panel);
  border-radius: 30px;
  padding: 28px;
}

.panel-form {
  background: linear-gradient(180deg, rgba(8, 16, 33, 0.88), rgba(10, 22, 46, 0.84));
}

.panel-heading {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

.panel-heading h2 {
  margin: 0;
  font-size: 1.55rem;
  font-family: "Space Grotesk", sans-serif;
}

.panel-heading p,
.empty-copy,
.disclaimer,
.error-text {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.field-group + .field-group {
  margin-top: 20px;
}

.segment-grid,
.input-grid,
.stats-grid,
.results-column {
  display: grid;
  gap: 14px;
}

.segment-grid {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-top: 10px;
}

.segment {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.segment:hover,
.segment:focus-visible,
.history-card:hover,
.history-card:focus-visible,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.segment:hover,
.segment:focus-visible,
.history-card:hover,
.history-card:focus-visible {
  box-shadow: 0 0 0 1px rgba(100, 149, 255, 0.16), 0 0 28px rgba(59, 130, 246, 0.16);
}

.segment.active {
  border-color: rgba(116, 146, 255, 0.64);
  background: linear-gradient(180deg, rgba(42, 78, 168, 0.34), rgba(91, 70, 192, 0.22));
  box-shadow: 0 0 0 1px rgba(116, 146, 255, 0.2), 0 0 34px rgba(96, 126, 255, 0.2);
}

.segment-title {
  font-weight: 800;
  font-size: 0.98rem;
}

.segment-hint {
  color: var(--muted);
  line-height: 1.45;
  text-align: left;
}

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

.input-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.text-input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
  font: inherit;
  color: var(--ink);
}

.text-input:focus,
.segment:focus-visible,
.primary-button:focus-visible,
.ghost-button:focus-visible,
.history-card:focus-visible,
.text-button:focus-visible,
.goal-info-toggle:focus-visible {
  outline: 2px solid rgba(93, 132, 255, 0.52);
  outline-offset: 2px;
}

.panel-actions {
  display: flex;
  gap: 12px;
  margin-top: 24px;
}

.goal-info {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.04);
  overflow: hidden;
}

.goal-info-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  cursor: pointer;
  padding: 14px 16px;
  font-weight: 700;
}

.goal-info-toggle::-webkit-details-marker {
  display: none;
}

.info-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  font-size: 0.82rem;
  font-family: "Space Grotesk", sans-serif;
}

.goal-info-body {
  padding: 0 16px 16px;
}

.goal-info-body h3 {
  margin: 6px 0 8px;
  font-size: 1rem;
  font-family: "Space Grotesk", sans-serif;
}

.goal-info-body p {
  margin: 0 0 10px;
  line-height: 1.6;
  color: var(--muted);
}

.primary-button,
.ghost-button,
.text-button {
  border: none;
  cursor: pointer;
  font: inherit;
}

.primary-button,
.ghost-button {
  padding: 14px 18px;
  border-radius: 999px;
  transition: transform 180ms ease, background 180ms ease, color 180ms ease, box-shadow 180ms ease;
}

.primary-button {
  background: linear-gradient(135deg, var(--accent), var(--accent-strong));
  color: white;
  box-shadow: 0 0 0 rgba(59, 130, 246, 0);
}

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

.ghost-button {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
  border: 1px solid var(--line);
}

.primary-button:hover,
.primary-button:focus-visible,
.ghost-button:hover,
.ghost-button:focus-visible {
  box-shadow: 0 0 26px rgba(59, 130, 246, 0.32), 0 0 42px rgba(139, 92, 246, 0.18);
}

.results-column {
  align-content: start;
}

.stats-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 6px;
}

.stat-tile {
  padding: 18px;
  border-radius: 22px;
  background: var(--panel-strong);
  border: 1px solid rgba(119, 151, 255, 0.12);
}

.stat-value {
  display: block;
  margin: 12px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 4vw, 2.5rem);
}

.stat-subtext {
  color: var(--muted);
}

.detail-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.disclaimer {
  margin-top: 18px;
}

.empty-state {
  padding: 14px 0 4px;
}

.history-heading {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.text-button {
  padding: 0;
  background: transparent;
  color: #c4b5fd;
  font-weight: 700;
}

.history-list {
  display: grid;
  gap: 12px;
}

.history-card {
  padding: 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
  text-align: left;
  cursor: pointer;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.history-card.active {
  border-color: rgba(116, 146, 255, 0.5);
  background: linear-gradient(180deg, rgba(42, 78, 168, 0.24), rgba(91, 70, 192, 0.18));
  box-shadow: 0 0 24px rgba(59, 130, 246, 0.16);
}

.history-topline {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.history-topline span {
  color: var(--muted);
  font-size: 0.88rem;
}

.history-meta {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.error-text {
  margin-top: 14px;
  color: #f9a8d4;
}

@keyframes floatOrbit {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }

  50% {
    transform: translate3d(0, -10px, 0) scale(1.02);
  }
}

@keyframes riseIn {
  from {
    opacity: 0;
    transform: translateY(24px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 980px) {
  .hero,
  .workspace {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .hero-copy h1 {
    max-width: 12ch;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 18px;
  }

  .hero-copy,
  .panel,
  .hero-readout {
    padding: 22px;
  }

  .hero-panel {
    min-height: 420px;
  }

  .segment-grid,
  .input-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .panel-actions {
    flex-direction: column;
  }

  .hero-copy h1 {
    font-size: clamp(2.4rem, 14vw, 4rem);
  }
}
