/* The logged-out front page (templates/landing.html). Loaded after style.css, so the colour tokens
   (--bg, --surface, --text, --muted, --border, --grade-*) and dark mode come from there. Forest and gold are the
   store images' colours (marketing/tools/gen.py); they stay the same in both modes. */
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-700.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Familjen Grotesk";
  src: url("/static/fonts/familjen-grotesk-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}

.landing {
  --forest: #1b4430;
  --forest-2: #2f6f4f;
  --gold: #d39b1c;
  --gold-text: #f0c35a;
  --on-dark: #ffffff;
  --on-dark-muted: rgba(255, 255, 255, .84);
  --display: "Familjen Grotesk", var(--font);
  --gutter: clamp(16px, 4.5vw, 56px);
  --phone-w: clamp(200px, 22vw, 270px);
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
}
/* Resets at zero specificity, so every class below wins over them. */
:where(.landing) * { box-sizing: border-box; }
:where(.landing) :where(h1, h2, h3, p, ul) { margin: 0; }
:where(.landing) ul { padding: 0; list-style: none; }
:where(.landing) a { color: inherit; }
.landing main { margin: 0; padding: 0; max-width: none; }
.landing :focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

.lp-display {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .95;
  font-size: clamp(2.4rem, 5.2vw, 3.6rem);
  text-wrap: balance;
}
.lp-lead { font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.5; color: var(--muted); max-width: 30em; margin-top: 18px; }

/* ---- header ---- */
.lp-top {
  text-shadow: 0 1px 8px rgba(0, 0, 0, .35);
  position: absolute; z-index: 5; inset: 0 0 auto 0;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px var(--gutter); color: var(--on-dark);
}
.lp-brand { font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: -.03em; text-decoration: none; }
.lp-nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 24px); font-size: .95rem; }
.lp-nav a { text-decoration: none; }
.lp-nav a:hover { text-decoration: underline; }
.lp-cta { background: var(--on-dark); color: var(--forest) !important; border-radius: 999px; padding: 9px 18px; font-weight: 600; }
.lp-cta:hover { text-decoration: none !important; }

/* ---- hero ---- */
.lp-hero {
  position: relative; background: var(--forest); color: var(--on-dark);
  display: grid; grid-template-columns: minmax(0, 42fr) minmax(0, 58fr); min-height: min(92vh, 760px);
}
.lp-hero-copy { padding: 120px var(--gutter) 64px; align-self: center; position: relative; z-index: 3; container-type: inline-size; }
.lp-hero h1 { font-size: min(7rem, calc(100cqi / (var(--n, 7) * .58))); line-height: .92; padding-bottom: .06em; }
.lp-hero h1 span { display: block; }
.lp-kicker { font-weight: 600; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; color: var(--gold-text); margin-bottom: 18px; }
.lp-hero .lp-lead { color: var(--on-dark-muted); max-width: 25em; margin-top: 26px; }
.lp-hero-photo { position: relative; overflow: hidden; }
.lp-hero-photo > .lp-crop { position: absolute; inset: 0; }
.lp-crop { position: relative; }
.lp-crop img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lp-hero-photo .lp-crop::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(14, 30, 22, .55) 0%, rgba(14, 30, 22, 0) 18%),
    linear-gradient(90deg, var(--forest) 0%, rgba(27, 68, 48, 0) 24%);
}
.lp-scan {
  position: absolute; left: 0; right: 0; top: 46%; height: 2px; z-index: 2;
  background: var(--gold); box-shadow: 0 0 22px 5px rgba(211, 155, 28, .7);
}
.chip {
  position: absolute; left: var(--x); top: var(--y); z-index: 3; translate: -9px -50%;
  display: flex; align-items: center; gap: 8px; white-space: nowrap;
  background: rgba(255, 255, 255, .95); color: #1d1f1c; border-radius: 999px;
  padding: 7px 14px 7px 8px; font-size: .9rem; font-weight: 600; box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
}
.chip::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--forest-2); box-shadow: 0 0 0 4px rgba(47, 111, 79, .2); }
.chip em { font-style: normal; color: #6b6f68; font-weight: 500; }
/* Chips right of the middle point left, so they never run past the photo's edge. */
.chip.end { translate: calc(-100% + 9px) -50%; padding-right: 8px; padding-left: 14px; }
.chip.end::before { order: 2; }
.gchip.end { translate: calc(-100% + 14px) -50%; flex-direction: row-reverse; padding: 5px 5px 5px 12px; }
.chip.fat { background: var(--gold); color: #1d1f1c; }
.chip.fat::before { background: #1d1f1c; box-shadow: 0 0 0 4px rgba(29, 31, 28, .2); }
.chip.fat em { color: #1d1f1c; }
.lp-hero-photo > .phone { --phone-w: clamp(180px, 16vw, 230px); position: absolute; right: clamp(16px, 3vw, 40px); bottom: -150px; z-index: 4; transform: rotate(4deg); }
.lp-hero { overflow: visible; margin-bottom: 150px; }
.lp-hero-photo { overflow: visible; }
.lp-hero-photo > .lp-crop { overflow: hidden; }

/* The one orchestrated moment: the scan line sweeps once and the chips appear (landing.js adds .is-scanning). */
@media (prefers-reduced-motion: no-preference) {
  .lp-hero-photo.is-scanning .lp-scan { animation: lp-sweep 1.4s ease-in-out both; }
  .lp-hero-photo.is-scanning [data-chip] { animation: lp-pop .35s cubic-bezier(.2, .9, .3, 1.3) both; animation-delay: calc(.5s + var(--i) * 140ms); }
}
@keyframes lp-sweep { from { top: 4%; opacity: 0; } 15% { opacity: 1; } to { top: 46%; } }
@keyframes lp-pop { from { opacity: 0; scale: .6; } to { opacity: 1; scale: 1; } }

/* ---- store badges ---- */
.lp-stores { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-top: 28px; }
.lp-badge img { display: block; height: 52px; width: auto; }
.lp-badge.play img { height: 64px; margin: -6px 0; }
.lp-soon { font-size: .95rem; font-weight: 600; opacity: .85; }
.lp-web { margin-top: 14px; font-size: .95rem; color: var(--on-dark-muted); }
.lp-web a { color: var(--on-dark); font-weight: 600; }

/* ---- phone with video ---- */
.phone { width: var(--phone-w); flex: none; background: #0e100f; border-radius: calc(var(--phone-w) * .15); padding: calc(var(--phone-w) * .03); box-shadow: 0 40px 90px rgba(0, 0, 0, .35); }
.phone video { display: block; width: 100%; height: auto; aspect-ratio: 600 / 1304; border-radius: calc(var(--phone-w) * .125); background: #f2f2f6; object-fit: cover; }

/* ---- grade discs ---- */
.grade {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%; color: #fff;
  font-family: var(--display); font-weight: 700; font-size: 15px; letter-spacing: 0;
}
.grade-a { background: var(--grade-a); } .grade-b { background: var(--grade-b); } .grade-c { background: var(--grade-c); }
.grade-d { background: var(--grade-d); } .grade-e { background: var(--grade-e); }
.grade-b, .grade-c, .grade-d { color: #1d1f1c; }

/* ---- sections ---- */
.lp-meals, .lp-feature, .lp-more, .lp-end { padding: clamp(64px, 9vw, 110px) var(--gutter); }
.lp-feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 64px); align-items: center; position: relative; overflow: hidden; }
.lp-feature > .phone, .lp-copy > .phone { justify-self: center; }
.lp-copy > .phone { margin-top: 36px; }

/* meals: a staggered row; on a phone it scrolls sideways */
.lp-meal-row { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; margin-top: 36px; align-items: start; }
.lp-meal { position: relative; border-radius: 20px; overflow: hidden; }
.lp-meal:nth-child(even) { margin-top: 40px; }
.lp-meal img { display: block; width: 100%; height: auto; object-fit: cover; }
.lp-meal-tag {
  position: absolute; left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px;
  background: rgba(255, 255, 255, .95); color: #1d1f1c; border-radius: 14px; padding: 8px 10px;
  font-size: .85rem; font-weight: 600; line-height: 1.2;
}

/* menu */
.lp-menu { background: #23302a; color: var(--on-dark); }
.lp-menu .lp-lead { color: var(--on-dark-muted); }
.lp-board { display: flex; align-items: flex-end; justify-content: center; gap: clamp(16px, 3vw, 40px); }
.lp-board-photo { position: relative; width: min(360px, 60%); transform: rotate(-2deg); }
.lp-board-photo img { display: block; width: 100%; height: auto; border-radius: 12px; box-shadow: 0 30px 70px rgba(0, 0, 0, .5); }
.lp-board-grade { position: absolute; left: -18px; top: var(--y); transform: translateY(-50%); }
.lp-board-grade .grade { width: 40px; height: 40px; font-size: 20px; border: 3px solid #fff; box-shadow: 0 8px 18px rgba(0, 0, 0, .4); }
.lp-board > .phone { --phone-w: clamp(170px, 17vw, 220px); margin-bottom: -40px; }

/* grades on ingredients */
.lp-ingredients { position: relative; }
.lp-ingredients .lp-crop { border-radius: 22px; overflow: hidden; aspect-ratio: 820 / 750; }
.gchip {
  position: absolute; left: var(--x); top: var(--y); translate: -14px -50%;
  display: flex; align-items: center; gap: 7px; white-space: nowrap;
  background: #fff; color: #1d1f1c; border-radius: 999px; padding: 5px 12px 5px 5px;
  font-size: .85rem; font-weight: 600; box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}
.gchip .grade { width: 24px; height: 24px; font-size: 13px; }
.lp-why {
  position: absolute; left: 4%; top: calc(100% - 46px); width: min(270px, 52%); z-index: 3;
  background: var(--surface); color: var(--text); border-radius: 16px; padding: 12px 14px;
  font-size: .9rem; line-height: 1.4; box-shadow: 0 18px 40px rgba(0, 0, 0, .35);
}
.lp-why b { display: block; }
.lp-ingredients > .phone { --phone-w: clamp(150px, 12.5vw, 175px); position: absolute; right: -50px; bottom: -150px; z-index: 2; transform: rotate(4deg); }
.lp-grades { padding-bottom: clamp(150px, 14vw, 190px); }
.lp-grades > .lp-copy { padding-left: clamp(24px, 4vw, 60px); }
.lp-scale { display: flex; gap: 6px; margin-top: 22px; }
.lp-scale .grade { width: 38px; height: 38px; font-size: 18px; }

/* barcode */
.lp-barcode { background: var(--surface); }
.lp-barcode > .phone { order: 0; }

/* privacy */
.lp-privacy {
  color: var(--on-dark);
  background: radial-gradient(800px 600px at 90% -20%, rgba(211, 155, 28, .33), transparent 60%), linear-gradient(165deg, var(--forest-2), var(--forest));
}
.lp-privacy .lp-lead { color: var(--on-dark-muted); }
.lp-lock { width: 64px; height: 64px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; margin-bottom: 22px; }
.lp-lock svg { fill: none; stroke: var(--forest-2); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lp-nos { display: flex; flex-wrap: wrap; gap: 10px 26px; margin-top: 24px; font-weight: 600; }
.lp-nos li::before { content: "✓ "; color: var(--gold-text); }

/* everything else */
.lp-more .lp-display { font-size: clamp(2rem, 4vw, 2.8rem); max-width: 18em; }
.lp-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 64px; margin-top: 36px; max-width: 1000px; }
.lp-list li { display: flex; gap: 14px; }
.lp-list svg { flex: none; width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lp-list h3 { font-size: 1.05rem; margin: 0; } /* style.css gives h3 a top margin that beats the zero-specificity reset */
.lp-list p { color: var(--muted); line-height: 1.45; margin-top: 3px; }

/* closing call */
.lp-end { background: var(--forest); color: var(--on-dark); text-align: center; }
.lp-end .lp-display { font-size: clamp(2.6rem, 6vw, 4.5rem); max-width: 12em; margin: 0 auto; }
.lp-end .lp-stores { justify-content: center; }

/* footer */
.lp-foot { padding: 28px var(--gutter) 40px; font-size: .85rem; color: var(--muted); display: grid; gap: 14px; }
.lp-foot-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.lp-foot-notes { display: grid; gap: 6px; line-height: 1.5; max-width: 60em; }
.lp-foot .language-picker { margin: 0; }

/* ---- phones and small tablets ---- */
@media (max-width: 900px) {
  .lp-nav-wide { display: none; }
  /* minmax(0, …), not 1fr: Safari let a 1fr column grow to the hero copy's min-content (892 px on a 440 px iPhone)
     and everything in the hero, the photo and phone too, went off the right edge. */
  .lp-hero { grid-template-columns: minmax(0, 1fr); min-height: 0; margin-bottom: 0; }
  .lp-hero-copy { padding: 96px var(--gutter) 36px; }
  .lp-hero-photo { aspect-ratio: 820 / 750; margin-bottom: calc(min(44vw, 230px) * 2.24 - 20px); }
  .lp-hero-photo .lp-crop::after { background: linear-gradient(180deg, var(--forest) 0%, rgba(27, 68, 48, 0) 18%); }
  .lp-hero-photo > .phone { --phone-w: min(44vw, 230px); left: 50%; right: auto; top: calc(100% - 48px); bottom: auto; transform: translateX(-50%) rotate(3deg); }
  .lp-hero h1 { font-size: min(4.6rem, calc(100cqi / (var(--n, 7) * .58))); }
  .chip { font-size: .72rem; padding: 4px 9px 4px 6px; gap: 6px; }
  .chip.end { padding: 4px 6px 4px 9px; }
  .chip::before { width: 7px; height: 7px; }
  .lp-feature { grid-template-columns: minmax(0, 1fr); }
  .lp-barcode > .phone { order: 2; }
  .lp-meal-row {
    display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 12px;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); padding-bottom: 8px;
  }
  .lp-meal { flex: 0 0 62%; scroll-snap-align: center; }
  .lp-meal:nth-child(even) { margin-top: 0; }
  .lp-board { flex-direction: column; align-items: center; }
  .lp-board-photo { width: min(320px, 80%); }
  .lp-board > .phone { margin-bottom: 0; }
  .lp-grades .lp-copy { order: -1; padding-left: 0; }
  .lp-ingredients { display: flex; flex-direction: column; }
  .lp-ingredients > .phone { position: static; transform: none; margin: 28px auto 0; order: 2; }
  .lp-why { position: static; width: auto; margin-top: 14px; box-shadow: none; border: 1px solid var(--border); }
  .gchip { font-size: .72rem; padding: 3px 9px 3px 3px; }
  .gchip .grade { width: 20px; height: 20px; font-size: 11px; }
  .lp-list { grid-template-columns: minmax(0, 1fr); }
}
