:root {
  color-scheme: light;
  --ink: #14211d;
  --muted: #5c6863;
  --line: #dce6df;
  --paper: #fbfcf7;
  --white: #ffffff;
  --leaf: #2f7d4b;
  --leaf-dark: #17392f;
  --lime: #b8ef5a;
  --tomato: #ff5a3d;
  --sky: #2796c3;
  --gold: #f4c542;
  --shadow: 0 18px 50px rgba(20, 33, 29, 0.14);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body,
button,
input,
select {
  font: inherit;
}

button,
a,
select,
input {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.skip-link {
  position: fixed;
  left: 1rem;
  top: 1rem;
  z-index: 20;
  transform: translateY(-180%);
  background: var(--ink);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: var(--radius);
}

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

.site-header {
  align-items: center;
  backdrop-filter: blur(18px);
  background: rgba(251, 252, 247, 0.88);
  border-bottom: 1px solid rgba(220, 230, 223, 0.86);
  display: grid;
  gap: 1rem;
  grid-template-columns: auto 1fr auto;
  left: 0;
  min-height: 72px;
  padding: 0 5vw;
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand,
.nav-links,
.domain-pill,
.hero-actions,
.button-row,
.meal-controls,
.split-controls,
.habit-header,
.site-footer {
  align-items: center;
  display: flex;
}

.brand {
  font-weight: 850;
  gap: 0.65rem;
  text-decoration: none;
}

.brand-mark {
  background: var(--leaf-dark);
  border-radius: 8px;
  color: var(--lime);
  display: grid;
  font-size: 0.78rem;
  height: 38px;
  letter-spacing: 0;
  place-items: center;
  width: 38px;
}

.nav-links {
  gap: clamp(0.75rem, 2vw, 1.8rem);
  justify-content: center;
}

.nav-links a,
.domain-pill {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 700;
  text-decoration: none;
}

.nav-links a:hover,
.domain-pill:hover {
  color: var(--leaf-dark);
}

.domain-pill {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.55rem 0.85rem;
}

.hero {
  isolation: isolate;
  min-height: max(640px, calc(100svh - 112px));
  overflow: hidden;
  position: relative;
}

.hero-image,
.hero-overlay {
  inset: 0;
  position: absolute;
}

.hero-image {
  height: 100%;
  object-fit: cover;
  width: 100%;
  z-index: -2;
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(251, 252, 247, 0.96) 0%, rgba(251, 252, 247, 0.88) 38%, rgba(251, 252, 247, 0.18) 70%),
    linear-gradient(0deg, rgba(20, 33, 29, 0.16), rgba(20, 33, 29, 0));
  z-index: -1;
}

.hero-content {
  display: grid;
  gap: 1.25rem;
  max-width: 620px;
  padding: clamp(5rem, 8vh, 7rem) 5vw 10rem;
}

.eyebrow {
  color: var(--tomato);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  margin: 0;
  text-transform: uppercase;
}

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

h1 {
  color: var(--leaf-dark);
  font-size: clamp(4rem, 7vw, 7.5rem);
  line-height: 0.9;
  margin-bottom: 0;
}

h2 {
  font-size: clamp(2rem, 4vw, 4rem);
  line-height: 0.98;
  margin-bottom: 0;
}

h3 {
  font-size: 1.2rem;
  margin-bottom: 0;
}

.hero-copy {
  color: #31423a;
  font-size: 1.25rem;
  line-height: 1.55;
  max-width: 34rem;
}

.hero-actions,
.button-row,
.meal-controls,
.split-controls {
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 850;
  min-height: 46px;
  padding: 0.78rem 1rem;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease, background 160ms ease;
}

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

.button-primary {
  background: var(--leaf-dark);
  box-shadow: 0 10px 22px rgba(23, 57, 47, 0.18);
  color: var(--white);
}

.button-ghost {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(23, 57, 47, 0.2);
  color: var(--leaf-dark);
}

.button-muted {
  background: var(--white);
  border-color: var(--line);
  color: var(--ink);
}

.hero-meter {
  align-items: stretch;
  background: var(--leaf-dark);
  bottom: 0;
  color: var(--white);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  left: 5vw;
  max-width: 760px;
  position: absolute;
  width: min(90vw, 760px);
}

.hero-meter > div {
  border-right: 1px solid rgba(255, 255, 255, 0.16);
  display: grid;
  gap: 0.18rem;
  min-height: 116px;
  padding: 1.2rem;
}

.hero-meter > div:last-child {
  border-right: 0;
}

.hero-meter strong {
  color: var(--lime);
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  line-height: 1;
}

.hero-meter span:not(.mini-label) {
  color: rgba(255, 255, 255, 0.74);
}

.mini-label {
  color: rgba(255, 255, 255, 0.58);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
}

.quick-bar {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-bar div {
  display: grid;
  gap: 0.25rem;
  min-height: 108px;
  padding: 1.4rem 5vw;
}

.quick-bar strong {
  color: var(--leaf-dark);
}

.quick-bar span {
  color: var(--muted);
}

.planner-band,
.meal-band,
.training-band,
.join-band {
  padding: clamp(4rem, 8vw, 7rem) 5vw;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin: 0 auto 2rem;
  max-width: 1180px;
}

.section-heading h2 {
  color: var(--leaf-dark);
}

.planner-grid,
.meal-layout,
.training-grid,
.join-band {
  display: grid;
  gap: 1rem;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  margin: 0 auto;
  max-width: 1180px;
}

.tool-panel,
.shopping-panel,
.join-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.input-panel,
.result-panel,
.tool-panel,
.shopping-panel,
.join-form {
  padding: clamp(1rem, 2.2vw, 1.6rem);
}

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

label {
  color: var(--muted);
  display: grid;
  font-size: 0.84rem;
  font-weight: 800;
  gap: 0.4rem;
}

input,
select {
  background: #f6faf5;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  min-height: 46px;
  padding: 0.7rem 0.75rem;
  width: 100%;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(39, 150, 195, 0.34);
  outline-offset: 2px;
}

.range-field {
  margin: 1.1rem 0;
}

input[type="range"] {
  accent-color: var(--leaf);
  padding: 0;
}

.result-panel {
  align-items: center;
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 230px minmax(0, 1fr);
}

.macro-ring {
  aspect-ratio: 1;
  background: conic-gradient(var(--leaf) 0 36%, var(--tomato) 36% 64%, var(--sky) 64% 86%, #e8efe9 86%);
  border-radius: 50%;
  display: grid;
  padding: 1rem;
  place-items: center;
  position: relative;
}

.macro-ring::after {
  background: var(--white);
  border-radius: 50%;
  content: "";
  inset: 20px;
  position: absolute;
}

.macro-ring span,
.macro-ring small {
  position: relative;
  z-index: 1;
}

.macro-ring span {
  color: var(--leaf-dark);
  font-size: 2rem;
  font-weight: 900;
  line-height: 1;
}

.macro-ring small {
  color: var(--muted);
  font-weight: 800;
  margin-top: 2.5rem;
}

.macro-results {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.macro-results article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.2rem;
  min-height: 94px;
  padding: 1rem;
}

.macro-results span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.macro-results strong {
  color: var(--leaf-dark);
  font-size: 1.7rem;
}

.meal-band {
  background:
    linear-gradient(90deg, rgba(47, 125, 75, 0.12), rgba(39, 150, 195, 0.08)),
    var(--white);
}

.meal-controls {
  margin: 0 auto 1rem;
  max-width: 1180px;
}

.meal-controls label {
  min-width: 180px;
}

.meal-list {
  display: grid;
  gap: 1rem;
}

.meal-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 34px rgba(20, 33, 29, 0.08);
  display: grid;
  gap: 0;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
}

.meal-card img {
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  width: 100%;
}

.meal-card-content {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
}

.meal-topline {
  align-items: start;
  display: flex;
  gap: 0.75rem;
  justify-content: space-between;
}

.meal-card h3 {
  color: var(--leaf-dark);
}

.meal-card p {
  color: var(--muted);
  line-height: 1.45;
  margin-bottom: 0;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  background: #eef6ed;
  border-radius: 999px;
  color: var(--leaf-dark);
  font-size: 0.78rem;
  font-weight: 850;
  padding: 0.35rem 0.55rem;
  white-space: nowrap;
}

.shopping-panel {
  align-self: start;
  position: sticky;
  top: 92px;
}

.shopping-panel h3 {
  color: var(--leaf-dark);
  margin-bottom: 1rem;
}

.shopping-panel ul {
  display: grid;
  gap: 0.55rem;
  list-style: none;
  margin: 0;
  max-height: 430px;
  overflow: auto;
  padding: 0;
}

.shopping-panel li {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 0.5rem;
  justify-content: space-between;
  padding-bottom: 0.5rem;
}

.shopping-panel li::before {
  background: var(--lime);
  border-radius: 999px;
  content: "";
  flex: 0 0 0.55rem;
  height: 0.55rem;
}

.totals {
  border-top: 2px solid var(--line);
  display: grid;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 1rem;
}

.totals span {
  color: var(--leaf-dark);
  font-weight: 900;
}

.training-band {
  background: var(--leaf-dark);
  color: var(--white);
}

.training-band .section-heading h2,
.training-band h3 {
  color: var(--white);
}

.training-band .tool-panel {
  background: #fafff8;
  color: var(--ink);
}

.split-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.split-day {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: grid;
  gap: 0.5rem;
  grid-template-columns: 62px minmax(0, 1fr);
  min-height: 86px;
  padding: 0.85rem;
}

.split-day strong:first-child {
  background: var(--leaf-dark);
  border-radius: var(--radius);
  color: var(--lime);
  display: grid;
  height: 48px;
  place-items: center;
  width: 48px;
}

.split-day span {
  color: var(--muted);
}

.habit-panel {
  display: grid;
  gap: 1rem;
}

.habit-header {
  justify-content: space-between;
}

.icon-button {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--leaf-dark);
  cursor: pointer;
  display: grid;
  font-size: 1.25rem;
  font-weight: 900;
  height: 44px;
  place-items: center;
  width: 44px;
}

.habit {
  display: grid;
  gap: 0.55rem;
}

.habit > div {
  align-items: center;
  display: flex;
  justify-content: space-between;
}

.habit span {
  color: var(--muted);
  font-weight: 800;
}

.habit-score {
  align-items: center;
  background: var(--leaf-dark);
  border-radius: var(--radius);
  color: var(--white);
  display: flex;
  justify-content: space-between;
  min-height: 78px;
  padding: 1rem;
}

.habit-score strong {
  color: var(--lime);
  font-size: 2rem;
}

.join-band {
  align-items: center;
}

.join-copy p:not(.eyebrow) {
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.6;
}

.join-form {
  display: grid;
  gap: 1rem;
}

.form-status {
  color: var(--leaf-dark);
  font-weight: 850;
  margin: 0;
  min-height: 1.4em;
}

.site-footer {
  background: var(--ink);
  color: rgba(255, 255, 255, 0.78);
  gap: 1rem;
  justify-content: space-between;
  min-height: 84px;
  padding: 0 5vw;
}

.site-footer a {
  color: var(--lime);
  font-weight: 850;
  text-decoration: none;
}

@media (max-width: 920px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .nav-links {
    display: none;
  }

  .hero {
    min-height: max(620px, calc(100svh - 104px));
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(251, 252, 247, 0.98), rgba(251, 252, 247, 0.7)),
      linear-gradient(0deg, rgba(20, 33, 29, 0.12), rgba(20, 33, 29, 0));
  }

  .planner-grid,
  .meal-layout,
  .training-grid,
  .join-band,
  .result-panel {
    grid-template-columns: 1fr;
  }

  .field-grid,
  .quick-bar {
    grid-template-columns: 1fr;
  }

  .shopping-panel {
    position: static;
  }

  .macro-ring {
    margin: 0 auto;
    max-width: 250px;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .site-header {
    min-height: 64px;
    padding: 0 1rem;
  }

  .domain-pill {
    display: none;
  }

  .hero {
    min-height: max(590px, calc(100svh - 96px));
  }

  .hero-content {
    padding: 3.25rem 1rem 8.8rem;
  }

  h1 {
    font-size: 4.2rem;
  }

  .hero-copy {
    font-size: 1.05rem;
  }

  .hero-meter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    left: 1rem;
    width: calc(100% - 2rem);
  }

  .hero-meter > div {
    border-bottom: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.16);
    min-height: 104px;
    padding: 0.82rem;
  }

  .planner-band,
  .meal-band,
  .training-band,
  .join-band {
    padding: 3.5rem 1rem;
  }

  .section-heading {
    align-items: start;
    display: grid;
  }

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

  .meal-card img {
    aspect-ratio: 16 / 10;
    min-height: 0;
  }

  .meal-topline {
    display: grid;
  }

  .macro-results {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: start;
    display: grid;
    padding: 1.4rem 1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
