/* ==========================================================================
   Pebbl Protein — design tokens (swap palette and fonts here only)
   ========================================================================== */
:root {
  --paper: #F6F2EC;
  --stone: #B9B2A8;
  --sand: #E4D6C1;
  --clay: #D8B4A6;
  --sage: #A3B49C;
  --olive: #4F5A36;
  --terracotta: #A85A40;
  --ink: #3A3833;

  /* Derived tones */
  --ink-soft: #5C574F;          /* secondary text; AA on paper and sand */
  --sand-deep: #D6C2A4;         /* sand pebble marker, visible on paper */
  --terracotta-dark: #8E4A33;   /* hover */
  --olive-dark: #3F482B;        /* hover */

  --font-serif: "Fraunces", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 6px;
  --radius-pill: 999px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --measure: 66ch;
}

/* ==========================================================================
   Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; height: auto; }
figure { margin: 0; }

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-variation-settings: "SOFT" 100;
  font-optical-sizing: auto;
  line-height: 1.1;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 5.4vw, 4.4rem); line-height: 1.04; letter-spacing: -0.02em; }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 1.875rem); }

p { margin: 0; }
a { color: inherit; }

:focus-visible {
  outline: 2px solid var(--terracotta);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--olive); color: #fff;
  padding: .6rem 1rem; border-radius: var(--radius);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.section--sand { background: var(--sand); }

/* Visible placeholder for unconfirmed facts */
.todo {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .8em;
  font-weight: 500;
  line-height: 1.3;
  color: #6E2E1A;
  background: #F3DCD3;
  border: 1px dashed #A85A40;
  border-radius: 4px;
  padding: .05em .4em;
}
.todo--on-dark { color: var(--olive-dark); background: var(--paper); border-color: var(--paper); }

/* ==========================================================================
   Logo component (placeholder until final vector)
   ========================================================================== */
.logo {
  --pebble-1: var(--terracotta);
  --pebble-2: var(--sand-deep);
  --pebble-3: var(--sage);
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: var(--ink);
  text-decoration: none;
}
.logo__mark { width: 66px; height: 44px; flex: none; overflow: visible; }
.logo__mark .pebble { mix-blend-mode: multiply; opacity: .92; }
.logo__type { display: inline-flex; flex-direction: column; line-height: 1; }
.logo__word {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 2rem;
  letter-spacing: -0.02em;
  line-height: .9;
}
.logo__sub {
  display: inline-flex; align-items: center; gap: .45rem;
  font-size: .625rem;
  font-weight: 500;
  letter-spacing: .32em;
  margin-top: .35rem;
  color: var(--ink-soft);
}
.logo__rule { display: inline-block; width: 1.4rem; height: 1px; background: currentColor; opacity: .7; }

.logo--stacked { flex-direction: column; gap: .5rem; }
.logo--stacked .logo__mark { width: 84px; height: 56px; }
.logo--stacked .logo__type { align-items: center; }
.logo--stacked .logo__word { font-size: 2.6rem; }
.logo--stacked .logo__sub { margin-left: -1.9rem; } /* optically centre "PROTEIN" against the rule */

.logo--reversed {
  --pebble-1: #E9E1D3;
  --pebble-2: #D9CDB8;
  --pebble-3: #E3DACB;
  color: var(--paper);
}
.logo--reversed .logo__mark .pebble { mix-blend-mode: normal; opacity: .82; }
.logo--reversed .logo__sub { color: var(--paper); }

/* Single motion moment: the pebbles settle into their cluster on first load */
@media (prefers-reduced-motion: no-preference) {
  .pebble { transform-box: fill-box; transform-origin: center; }
  .js-settle .pebble--terracotta { animation: settle-left 1.1s cubic-bezier(.2,.8,.2,1) both .15s; }
  .js-settle .pebble--sand       { animation: settle-top  1.1s cubic-bezier(.2,.8,.2,1) both .05s; }
  .js-settle .pebble--sage       { animation: settle-right 1.1s cubic-bezier(.2,.8,.2,1) both .25s; }
}
@keyframes settle-left  { from { transform: translate(-14%, 18%) rotate(-8deg); opacity: 0; } }
@keyframes settle-top   { from { transform: translate(0, -30%) rotate(6deg);   opacity: 0; } }
@keyframes settle-right { from { transform: translate(14%, 18%) rotate(8deg);  opacity: 0; } }

/* ==========================================================================
   Buttons & links
   ========================================================================== */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px;
  padding: .75rem 1.6rem;
  border-radius: var(--radius-pill);
  font: 500 1rem/1.2 var(--font-sans);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, transform .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn--terracotta { background: var(--terracotta); color: #fff; }
.btn--terracotta:hover { background: var(--terracotta-dark); }
.btn--olive { background: var(--olive); color: #fff; }
.btn--olive:hover { background: var(--olive-dark); }
.btn--paper { background: var(--paper); color: var(--olive-dark); }
.btn--paper:hover { background: #fff; }
.btn--small { min-height: 44px; padding: .55rem 1.25rem; font-size: .95rem; }
.subscribe .btn:focus-visible { outline-color: var(--paper); }

.text-link {
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--stone);
  padding-bottom: 2px;
  transition: border-color .2s ease;
}
.text-link:hover { border-color: var(--ink); }

/* ==========================================================================
   Photography (placeholders)
   ========================================================================== */
.photo { position: relative; border-radius: var(--radius); overflow: hidden; background: var(--sand); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
/* Small marker on every placeholder photo. Remove this rule when licensed photography lands. */
.photo[data-todo]::after {
  content: "TODO: " attr(data-todo);
  position: absolute; right: .5rem; bottom: .5rem;
  font: 500 .625rem/1 var(--font-sans);
  color: var(--ink);
  background: rgba(246, 242, 236, .82);
  padding: .3rem .45rem;
  border-radius: 3px;
  opacity: .75;
  pointer-events: none;
}

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 242, 236, .92);
  backdrop-filter: saturate(1.2) blur(10px);
  -webkit-backdrop-filter: saturate(1.2) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-header.is-scrolled { border-bottom-color: rgba(185, 178, 168, .45); }
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
  min-height: 84px;
}
.site-nav ul { display: flex; gap: 2.25rem; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  text-decoration: none;
  font-weight: 500;
  padding: .4rem 0;
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.site-nav a:hover { border-bottom-color: var(--ink); }
.site-header__actions { display: flex; align-items: center; gap: .5rem; }

.menu-toggle {
  display: none;
  width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  align-items: center; justify-content: center;
}
.menu-toggle__bars, .menu-toggle__bars::before, .menu-toggle__bars::after {
  display: block; width: 20px; height: 1.5px; background: currentColor; border-radius: 2px;
  transition: transform .2s ease, opacity .2s ease;
}
.menu-toggle__bars { position: relative; }
.menu-toggle__bars::before, .menu-toggle__bars::after { content: ""; position: absolute; left: 0; }
.menu-toggle__bars::before { top: -6px; }
.menu-toggle__bars::after { top: 6px; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::before { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bars::after { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 820px) {
  .site-header__inner { min-height: 68px; }
  .logo--horizontal .logo__mark { width: 48px; height: 32px; }
  .logo--horizontal .logo__word { font-size: 1.6rem; }
  .logo--horizontal .logo__sub { font-size: .55rem; }
  .menu-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper);
    border-bottom: 1px solid rgba(185, 178, 168, .6);
    padding: .5rem var(--gutter) 1.25rem;
  }
  .site-nav:not(.is-open) { display: none; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav a { display: block; padding: .85rem 0; font-size: 1.125rem; border-bottom: 1px solid rgba(185, 178, 168, .35); }
}
@media (max-width: 400px) {
  .logo--horizontal .logo__sub { display: none; }
  .btn--small { padding-inline: 1rem; font-size: .9rem; }
}

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3.5rem, 8vw, 6.5rem); }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
}
.eyebrow { color: var(--olive); font-weight: 500; margin-bottom: 1.1rem; }
.hero__sub {
  font-size: clamp(1.2rem, 1.8vw, 1.4rem);
  line-height: 1.45;
  margin-top: 1.4rem;
  max-width: 26ch;
}
.hero__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 1.1rem 1.75rem; margin-top: 2.25rem; }
.hero__media { aspect-ratio: 4 / 3; box-shadow: 0 30px 60px -40px rgba(58, 56, 51, .45); }

@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__media { aspect-ratio: 5 / 4; }
}

/* ==========================================================================
   Section markers (single pebble instead of icons)
   ========================================================================== */
.section-marker { width: 46px; height: 40px; fill: currentColor; display: block; margin-bottom: 1.4rem; }
.section-title { text-align: center; margin-bottom: clamp(2.5rem, 5vw, 3.75rem); }

/* ==========================================================================
   Problem
   ========================================================================== */
.problem { padding-block: var(--section-y); }
.problem__inner { max-width: 760px; text-align: left; }
.problem h2 { margin-bottom: 2rem; }
.prose { max-width: var(--measure); color: var(--ink); }
.prose p + p { margin-top: 1.1rem; }
.problem .prose { font-size: 1.1875rem; line-height: 1.65; }
.problem__close {
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  line-height: 1.2;
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 2.75rem);
  border-top: 1px solid var(--stone);
  text-wrap: balance;
}
.problem__media { margin-top: clamp(3rem, 6vw, 4.5rem); aspect-ratio: 16 / 8; }
@media (max-width: 640px) { .problem__media { aspect-ratio: 4 / 3; } }

/* ==========================================================================
   How it works
   ========================================================================== */
.how { padding-block: var(--section-y); }
.how__grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(2.5rem, 4vw, 3.5rem);
}
.how__item { display: flex; flex-direction: column; align-items: center; text-align: center; }
.how__item .section-marker { margin-bottom: 1.25rem; }
.how__item h3 { margin-bottom: .6rem; }
.how__item p { color: var(--ink-soft); max-width: 30ch; margin-bottom: 1.75rem; }
.how__media { margin-top: auto; aspect-ratio: 1; width: 100%; }
.claim {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  text-align: center;
  font-size: .875rem;
  font-style: italic;
  color: var(--ink-soft);
}
@media (max-width: 820px) {
  .how__grid { grid-template-columns: 1fr; max-width: 440px; margin-inline: auto; }
}

/* ==========================================================================
   Interlude
   ========================================================================== */
.interlude { padding-bottom: var(--section-y); }
.interlude__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.1fr);
  gap: clamp(1rem, 2vw, 1.5rem);
}
.interlude__tall { aspect-ratio: 4 / 5; }
.interlude__wide { aspect-ratio: auto; }
@media (max-width: 720px) {
  .interlude__grid { grid-template-columns: 1fr; }
  .interlude__wide { aspect-ratio: 16 / 9; }
}

/* ==========================================================================
   Why whey
   ========================================================================== */
.whey { padding-block: var(--section-y); }
.whey__inner {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.whey h2 { margin-bottom: 1.6rem; }
.whey .prose { font-size: 1.125rem; }
.whey__media { aspect-ratio: 4 / 5; }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0; margin: 2.5rem 0 0;
  border-top: 1px solid rgba(58, 56, 51, .2);
}
.facts__item { padding: 1.1rem 1.25rem 1.1rem 0; border-bottom: 1px solid rgba(58, 56, 51, .2); }
.facts__item:nth-child(odd) { border-right: 1px solid rgba(58, 56, 51, .2); }
.facts__item:nth-child(even) { padding-left: 1.25rem; }
.facts dt { font-size: .875rem; color: var(--ink-soft); margin-bottom: .35rem; }
.facts dd { margin: 0; font-family: var(--font-serif); font-variation-settings: "SOFT" 100; font-size: 1.25rem; line-height: 1.35; }
.facts dd small { font-family: var(--font-sans); font-size: .8rem; color: var(--ink-soft); }

@media (max-width: 820px) {
  .whey__inner { grid-template-columns: 1fr; }
  .whey__media { order: -1; aspect-ratio: 4 / 3; }
}
@media (max-width: 480px) {
  .facts { grid-template-columns: 1fr; }
  .facts__item:nth-child(odd) { border-right: 0; }
  .facts__item:nth-child(even) { padding-left: 0; }
}

/* ==========================================================================
   Subscription
   ========================================================================== */
.subscribe { background: var(--olive); color: var(--paper); padding-block: var(--section-y); }
.subscribe__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, .85fr);
  align-items: center;
  gap: clamp(2.5rem, 6vw, 5.5rem);
}
.subscribe .logo { margin-bottom: 2.25rem; }
.subscribe .logo--stacked { align-items: flex-start; }
.subscribe .logo--stacked .logo__type { align-items: flex-start; }
.subscribe .logo--stacked .logo__sub { margin-left: 0; }
.subscribe h2 { margin-bottom: 1.25rem; }
.subscribe p { font-size: 1.125rem; max-width: 42ch; }
.price {
  display: flex; align-items: baseline; gap: .75rem;
  margin: 2rem 0 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(246, 242, 236, .3);
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 100;
  font-size: 1.75rem !important;
}
.price__label { font-family: var(--font-sans); font-size: 1rem; }
.subscribe__media { aspect-ratio: 4 / 5; background: var(--olive-dark); }
@media (max-width: 820px) {
  .subscribe__inner { grid-template-columns: 1fr; }
  .subscribe__media { aspect-ratio: 1; }
}

/* ==========================================================================
   FAQ
   ========================================================================== */
.faq { padding-block: var(--section-y); }
.faq__inner {
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr);
  gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: start;
}
.faq__intro { position: sticky; top: 110px; }
.faq__intro h2 { margin-bottom: 2rem; }
.faq__media { aspect-ratio: 3 / 2; }

.faq__list { border-top: 1px solid var(--stone); }
.faq details { border-bottom: 1px solid var(--stone); }
.faq summary {
  list-style: none;
  cursor: pointer;
  display: flex; justify-content: space-between; align-items: center; gap: 1.5rem;
  padding: 1.4rem 0;
  font-family: var(--font-serif);
  font-variation-settings: "SOFT" 100;
  font-size: clamp(1.15rem, 1.8vw, 1.35rem);
  line-height: 1.3;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 14px; height: 14px;
  background:
    linear-gradient(currentColor, currentColor) center / 14px 1.5px no-repeat,
    linear-gradient(currentColor, currentColor) center / 1.5px 14px no-repeat;
  transition: transform .25s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--terracotta-dark); }
.faq__answer { padding: 0 2.5rem 1.5rem 0; color: var(--ink-soft); max-width: var(--measure); }
@media (max-width: 820px) {
  .faq__inner { grid-template-columns: 1fr; }
  .faq__intro { position: static; }
  .faq__media { display: none; }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { background: var(--sand); padding-block: clamp(3.5rem, 7vw, 5rem) 2.5rem; }
.site-footer__inner { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1.75rem; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 2rem; list-style: none; margin: 0; padding: 0; }
.footer-links a { text-decoration: none; font-weight: 500; }
.footer-links a:hover { text-decoration: underline; text-underline-offset: 4px; }
.disclaimer { max-width: 62ch; font-size: .875rem; color: var(--ink-soft); }
.legal { font-size: .8125rem; color: var(--ink-soft); }
.legal--todo { margin-top: -1rem; }
html:not(.js) .menu-toggle { display: none !important; }
