@import url('https://fonts.googleapis.com/css2?family=Frank+Ruhl+Libre:wght@500;600;700;800&family=Heebo:wght@400;500;600;700;800&display=swap');

/* Local WebP copies of Unsplash photos: 1512621776951, 1540420773420, 1547592180. */

:root {
  --bg: #f2f5ee;
  --card: #fffdf8;
  --ink: #16251c;
  --muted: #58695f;
  --line: #d5ded5;
  --accent: #176b4c;
  --accent-bright: #28a36d;
  --accent-soft: #dff1e6;
  --citrus: #f3bd4d;
  --citrus-soft: #fff0c7;
  --coral: #e8795c;
  --sky: #7fc9cc;
  --warn: #725014;
  --warn-bg: #fff3d7;
  --danger: #8c342e;
  --danger-bg: #fff0ed;
  --shadow: 0 22px 70px rgba(30, 58, 40, .11);
  --shadow-soft: 0 10px 30px rgba(30, 58, 40, .08);
  --radius: 28px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 92px;
  background: var(--bg);
}

body {
  margin: 0;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 8% 18%, rgba(127, 201, 204, .18), transparent 28rem),
    radial-gradient(circle at 92% 48%, rgba(243, 189, 77, .14), transparent 30rem),
    var(--bg);
  color: var(--ink);
  font-family: "Heebo", Arial, sans-serif;
  line-height: 1.65;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  opacity: .28;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120' viewBox='0 0 120 120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.75' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.09'/%3E%3C/svg%3E");
  content: "";
  pointer-events: none;
}

a { color: inherit; }

:focus-visible {
  outline: 3px solid var(--citrus);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 12px;
  right: 12px;
  z-index: 200;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s ease;
}

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

.wrap {
  width: min(1180px, calc(100% - 36px));
  max-width: none;
  margin: auto;
  padding: 22px 0 0;
}

.home-link {
  position: relative;
  z-index: 3;
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  color: var(--accent);
  font-weight: 800;
  text-decoration: none;
}

.home-link::before { content: "←"; transition: transform .2s ease; }
.home-link:hover::before { transform: translateX(-5px); }

header {
  position: relative;
  isolation: isolate;
  min-height: 660px;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: clamp(28px, 7vw, 90px);
  align-items: end;
  padding: clamp(42px, 8vw, 92px);
  border-radius: 42px;
  background: #193d2d url("assets/hero.webp") center 46% / cover no-repeat;
  color: #fff;
  box-shadow: 0 35px 100px rgba(16, 42, 29, .2);
}

header::before {
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(90deg, rgba(11, 36, 24, .91) 0%, rgba(16, 48, 32, .73) 44%, rgba(16, 48, 32, .18) 76%),
    linear-gradient(0deg, rgba(10, 31, 21, .64), transparent 55%);
  content: "";
}

header::after {
  position: absolute;
  inset: auto -90px -120px auto;
  z-index: -1;
  width: 390px;
  aspect-ratio: 1;
  border: 1px solid rgba(255, 255, 255, .35);
  border-radius: 48% 52% 67% 33% / 41% 45% 55% 59%;
  content: "";
  animation: drift 14s ease-in-out infinite alternate;
}

header > div:first-child { max-width: 670px; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 22px;
  padding: 9px 15px;
  border: 1px solid rgba(255,255,255,.34);
  border-radius: 999px;
  background: rgba(255,255,255,.13);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.badge::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--citrus);
  box-shadow: 0 0 0 5px rgba(243,189,77,.18);
  content: "";
}

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

h1, h2 {
  font-family: "Frank Ruhl Libre", Georgia, serif;
  text-wrap: balance;
}

header h1 {
  max-width: 650px;
  margin: 0 0 20px;
  font-size: clamp(3.7rem, 8vw, 7.6rem);
  font-weight: 700;
  line-height: .83;
  letter-spacing: -.055em;
  text-shadow: 0 3px 22px rgba(0,0,0,.22);
}

.lead {
  max-width: 600px;
  margin-bottom: 0;
  color: rgba(255,255,255,.88);
  font-size: clamp(1rem, 2vw, 1.22rem);
  line-height: 1.75;
}

.hero-note {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 24px 0 0;
  color: #fff7d9;
  font-weight: 700;
}

.hero-note::before {
  width: 34px;
  height: 2px;
  background: var(--citrus);
  content: "";
}

.progressbox.card {
  min-width: 0;
  padding: 24px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 24px;
  background: rgba(10, 36, 23, .56);
  color: #fff;
  box-shadow: 0 18px 60px rgba(0,0,0,.18);
  backdrop-filter: blur(18px);
}

.progresslabel {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
  color: rgba(255,255,255,.75);
  font-size: 14px;
}

.progresslabel b { color: #fff; font-size: 1rem; }

.bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}

.bar > div {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--citrus), #f7dc7a);
  box-shadow: 0 0 18px rgba(243,189,77,.55);
  transition: width .65s cubic-bezier(.2,.8,.2,1);
}

#resetBtn {
  min-height: 44px;
  margin-top: 14px;
  padding: 0 15px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  background: rgba(255,255,255,.1);
  color: #fff;
}

.summary {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: -34px 42px 42px;
}

.stat {
  min-height: 126px;
  padding: 22px;
  border: 1px solid rgba(213,222,213,.85);
  border-radius: 22px;
  background: rgba(255,253,248,.94);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(12px);
  transition: transform .22s ease, box-shadow .22s ease;
}

.stat:hover { transform: translateY(-5px); box-shadow: var(--shadow); }
.stat:nth-child(2) { background: var(--citrus-soft); }
.stat:nth-child(3) { background: var(--accent-soft); }
.stat:nth-child(4) { background: #dff0f2; }
.stat b { display: block; margin-bottom: 5px; font: 700 1.8rem/1 "Frank Ruhl Libre", serif; }
.stat span { color: var(--muted); font-size: 14px; }

.visual-story {
  display: grid;
  grid-template-columns: 1.35fr .65fr;
  grid-template-rows: 190px 190px;
  gap: 14px;
  margin: 34px 0 50px;
}

.visual-story figure {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
}

.visual-story figure:first-child { grid-row: 1 / span 2; }
.visual-story img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s cubic-bezier(.2,.8,.2,1); }
.visual-story figure:hover img { transform: scale(1.045); }
.visual-story figcaption {
  position: absolute;
  inset: auto 18px 18px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(18,40,28,.72);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.journey-map {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 0 0 44px;
  padding: 26px 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.journey-line {
  position: absolute;
  top: 49px;
  right: 10%;
  left: 10%;
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #dfe6df;
}

.journey-line span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-bright), var(--citrus));
  transition: width .75s cubic-bezier(.2,.8,.2,1);
}

.journey-step {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.journey-step b {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 4px solid var(--card);
  border-radius: 50%;
  background: #dfe6df;
  color: var(--ink);
  font-size: 1rem;
  box-shadow: 0 0 0 1px var(--line);
  transition: transform .25s ease, background .25s ease, color .25s ease;
}

.journey-step:hover b { transform: translateY(-4px); }
.journey-step.done b { background: var(--accent); color: #fff; box-shadow: 0 0 0 1px var(--accent); }
.journey-step.current b { background: var(--citrus); color: var(--ink); transform: scale(1.08); }

nav {
  position: sticky;
  top: 10px;
  z-index: 20;
  width: fit-content;
  max-width: calc(100vw - 24px);
  margin: 0 auto 48px;
  padding: 7px;
  border: 1px solid rgba(213,222,213,.88);
  border-radius: 999px;
  background: rgba(255,253,248,.88);
  box-shadow: 0 12px 35px rgba(25,53,35,.12);
  backdrop-filter: blur(18px);
}

.navinner { display: flex; gap: 4px; overflow-x: auto; max-width: 100%; padding: 0; scrollbar-width: none; }
.navinner::-webkit-scrollbar { display: none; }
nav a {
  flex: 0 0 auto;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
nav a:hover, nav a.active { background: var(--ink); color: #fff; }

section { margin: 0 0 34px; scroll-margin-top: 94px; }

.card {
  position: relative;
  overflow: hidden;
  padding: clamp(24px, 4vw, 48px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,253,248,.97);
  box-shadow: var(--shadow-soft);
}

.card h2 { margin-bottom: 20px; font-size: clamp(2.1rem, 5vw, 4rem); line-height: .98; letter-spacing: -.035em; }
.card h3 { margin-bottom: 9px; font-size: 1.05rem; }

#before .card {
  background:
    radial-gradient(circle at 8% 10%, rgba(127,201,204,.22), transparent 18rem),
    var(--card);
}

.routine { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.routine > div { padding: 22px; border-radius: 20px; background: rgba(255,255,255,.65); border: 1px solid var(--line); }

.callout { margin: 22px 0; padding: 19px 22px; border-radius: 18px; }
.callout strong { display: block; margin-bottom: 5px; }
.callout.warn { border: 1px solid #ecd396; background: var(--warn-bg); color: #5e4316; }
.callout.danger { border: 1px solid #e8bcb5; background: var(--danger-bg); color: #6c2824; }
.callout.good { border: 1px solid #b9dbc7; background: var(--accent-soft); }

.day .card { padding-top: clamp(72px, 9vw, 104px); }
.day .card::before {
  position: absolute;
  top: 10px;
  left: 24px;
  color: rgba(23,107,76,.085);
  font: 800 clamp(7rem, 17vw, 13rem)/1 "Frank Ruhl Libre", serif;
  content: attr(data-day-number);
  pointer-events: none;
}

.day:nth-of-type(3n+1) .card { background: linear-gradient(145deg, #fffdf8 55%, #e8f4ec); }
.day:nth-of-type(3n+2) .card { background: linear-gradient(145deg, #fffdf8 55%, #fff1cc); }
.day:nth-of-type(3n) .card { background: linear-gradient(145deg, #fffdf8 55%, #e4f2f3); }

.dayhead { position: relative; display: flex; justify-content: space-between; gap: 22px; align-items: start; margin-bottom: 28px; }
.daynum { margin-bottom: 6px; color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .04em; }
.dayhead h2 { margin-bottom: 0; }
.kcal { flex: 0 0 auto; padding: 8px 13px; border-radius: 999px; background: var(--ink); color: #fff; font-size: 14px; font-weight: 800; }

.meals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.meal {
  position: relative;
  min-height: 170px;
  padding: 22px;
  border: 1px solid rgba(213,222,213,.9);
  border-radius: 22px;
  background: rgba(255,255,255,.72);
  transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
}
.meal:hover { transform: translateY(-4px); border-color: #abc8b5; box-shadow: var(--shadow-soft); }
.meal h3 { display: flex; align-items: center; gap: 9px; }
.meal h3::before { width: 10px; height: 10px; border-radius: 50%; background: var(--coral); content: ""; }
.meal:nth-child(2) h3::before { background: var(--citrus); }
.meal:nth-child(3) h3::before { background: var(--sky); }
.meal:nth-child(4) h3::before { background: var(--accent-bright); }
.meal ul { margin: 10px 0 0; padding-right: 20px; }
.meal li { margin: 3px 0; }

.tipgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 16px; }
.tip { padding: 18px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.58); color: var(--muted); }
.tip strong { display: block; margin-bottom: 5px; color: var(--ink); }

.checkrow {
  position: relative;
  display: flex;
  min-height: 58px;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding: 12px 18px;
  border: 1px solid #b9d3c2;
  border-radius: 18px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 800;
  cursor: pointer;
  transition: transform .2s ease, background .2s ease, color .2s ease;
}
.checkrow:hover { transform: translateY(-2px); }
.checkrow:has(input:checked) { background: var(--accent); color: #fff; }
.checkrow input { width: 22px; height: 22px; accent-color: var(--citrus); }

table { width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 18px; border-collapse: separate; border-spacing: 0; background: #fff; }
th, td { padding: 15px 17px; border-bottom: 1px solid var(--line); text-align: right; }
th { background: var(--accent-soft); }
tr:last-child td { border-bottom: 0; }
.small { color: var(--muted); font-size: 13px; }
.sources a { color: var(--accent); font-weight: 700; }

footer { padding: 24px 0 56px; color: var(--muted); font-size: 13px; text-align: center; }
.photo-credit { display: block; margin-top: 8px; }

.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s cubic-bezier(.2,.8,.2,1); }
.js .reveal.visible { opacity: 1; transform: none; }

.celebration {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(10,31,21,.62);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  backdrop-filter: blur(10px);
  transition: opacity .3s ease;
}
.celebration.show { opacity: 1; visibility: visible; pointer-events: auto; }
.celebration-card { max-width: 520px; padding: 38px; border-radius: 30px; background: var(--card); text-align: center; box-shadow: 0 30px 100px rgba(0,0,0,.28); transform: scale(.92); transition: transform .35s cubic-bezier(.2,.9,.2,1.2); }
.celebration.show .celebration-card { transform: scale(1); }
.celebration-mark { display: grid; width: 72px; height: 72px; place-items: center; margin: 0 auto 20px; border-radius: 50%; background: var(--citrus); color: var(--ink); font: 800 2rem/1 "Frank Ruhl Libre", serif; }
.celebration h2 { margin-bottom: 12px; font-size: 2.5rem; }
.celebration button { min-height: 48px; margin-top: 14px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent); color: #fff; font: 800 1rem "Heebo", sans-serif; cursor: pointer; }

@keyframes drift { to { transform: translate(-35px,-24px) rotate(16deg); } }

@media (max-width: 880px) {
  header { min-height: 610px; grid-template-columns: 1fr; align-content: end; padding: 48px 34px; }
  header::before { background: linear-gradient(0deg, rgba(9,31,20,.93), rgba(10,38,24,.38) 75%); }
  .progressbox.card { max-width: 390px; }
  .summary { grid-template-columns: repeat(2, 1fr); margin-inline: 18px; }
  .tipgrid { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .wrap { width: min(100% - 20px, 1180px); padding-top: 12px; }
  .home-link { margin-right: 8px; }
  header { min-height: 620px; padding: 36px 24px; border-radius: 30px; background-position: 62% center; }
  header h1 { font-size: clamp(3.5rem, 19vw, 5.2rem); }
  .summary { grid-template-columns: 1fr 1fr; margin: -24px 10px 34px; gap: 9px; }
  .stat { min-height: 112px; padding: 17px; }
  .stat b { font-size: 1.5rem; }
  .visual-story { grid-template-columns: 1fr 1fr; grid-template-rows: 260px 150px; }
  .visual-story figure:first-child { grid-column: 1 / span 2; grid-row: auto; }
  .journey-map { padding: 20px 10px; }
  .journey-line { top: 43px; }
  .journey-step b { width: 42px; height: 42px; }
  .journey-step span { font-size: 11px; }
  nav { top: 6px; margin-bottom: 34px; border-radius: 22px; }
  nav a { padding-inline: 12px; }
  .card { padding: 24px 20px; border-radius: 24px; }
  .day .card { padding-top: 72px; }
  .day .card::before { left: 14px; }
  .dayhead { display: grid; }
  .kcal { justify-self: start; }
  .meals, .routine { grid-template-columns: 1fr; }
  .meal { min-height: 0; }
  table { display: block; overflow-x: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

@media print {
  nav, .journey-map, .visual-story, button, .celebration { display: none !important; }
  body { background: #fff; }
  .wrap { width: 100%; }
  header { min-height: auto; padding: 28px; color: #111; background: #fff; box-shadow: none; }
  header::before, header::after { display: none; }
  .lead, .hero-note { color: #333; }
  .summary { margin: 20px 0; }
  .card, .stat { box-shadow: none; }
  .day { break-inside: avoid; }
}
