/* PRO.TEIN — proteinapp.sirekapps.com
   Shares the Sirek Apps house style: monochrome, italic Playfair headlines,
   system sans for everything else. Structure borrows the shape of a modern
   app landing page — alternating bands, feature rows, a bento grid, an FAQ —
   but the surface treatment stays ours. */

:root {
  --paper: #ffffff;
  --void: #f5f5f4;
  --sunk: #ebebe9;
  --hairline: #e4e4e2;
  --muted: #6e6e6e;
  --faint: #9b9b9b;
  --ink: #0c0c0c;
  --inverse: #ffffff;

  /* One accent, used sparingly — it should feel like an underline in a book,
     not a brand colour. Deep enough to pass contrast on white. */
  --accent: #2f6b4f;
  --accent-soft: rgba(47, 107, 79, 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  --measure: 720px;
  --wide: 1120px;

  --serif: "Playfair Display", ui-serif, Georgia, "Times New Roman", serif;
  --sans: -apple-system, system-ui, "Segoe UI", Helvetica, Arial, sans-serif;

  --r: 16px;
}

/* Follow the system unless the visitor has chosen a side. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0c0c0c;
    --void: #141414;
    --sunk: #1c1c1c;
    --hairline: #262626;
    --muted: #9a9a9a;
    --faint: #6d6d6d;
    --ink: #f3f3f1;
    --inverse: #0c0c0c;
    --accent: #7fc9a3;
    --accent-soft: rgba(127, 201, 163, 0.15);
  }
}

:root[data-theme="dark"] {
  --paper: #0c0c0c;
  --void: #141414;
  --sunk: #1c1c1c;
  --hairline: #262626;
  --muted: #9a9a9a;
  --faint: #6d6d6d;
  --ink: #f3f3f1;
  --inverse: #0c0c0c;
  --accent: #7fc9a3;
  --accent-soft: rgba(127, 201, 163, 0.15);
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  width: 100%;
  max-width: var(--wide);
  margin: 0 auto;
  padding: 0 24px;
}

.wrap.narrow { max-width: var(--measure); }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; border-radius: 4px; }

img { max-width: 100%; }

/* TYPE
   The italic serif is the whole voice — the same one the app uses for its
   own headings, so the site and the product sound alike. */

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  letter-spacing: -0.01em;
  margin: 0;
  line-height: 1.1;
}

h1 { font-size: clamp(2.7rem, 7.4vw, 4.5rem); line-height: 1.04; }
h2 { font-size: clamp(2rem, 4.6vw, 2.9rem); }
h3 { font-size: clamp(1.3rem, 2.4vw, 1.6rem); }
h4 { font-size: 1.16rem; }

p { margin: 0 0 16px; }

.lead {
  font-size: clamp(1.1rem, 2vw, 1.28rem);
  color: var(--muted);
  margin: 22px 0 0;
  max-width: 46ch;
  line-height: 1.55;
}

.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 0 0 16px;
}

/* MASTHEAD */

nav {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
}

/* color-mix is recent; without it the bar would be transparent and text would
   collide with the page behind it, so fall back to a solid background. */
@supports not (background: color-mix(in srgb, red 50%, transparent)) {
  nav { background: var(--paper); }
}

nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  height: 62px;
}

/* The wordmark is sans on purpose — it is a product name, not prose. The serif
   italic is reserved for headlines so the two never compete. */
.mark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: 0.06em;
  line-height: 1;
  white-space: nowrap;
}

/* Rounded like the iOS icon itself; the hairline keeps the light icon from
   dissolving into a white nav bar. */
.mark-icon {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: block;
  border: 1px solid var(--hairline);
}

.icon-light { display: block; }
.icon-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .icon-light { display: none; }
  :root:not([data-theme="light"]) .icon-dark { display: block; }
}

:root[data-theme="dark"] .icon-light { display: none; }
:root[data-theme="dark"] .icon-dark { display: block; }

.nav-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.nav-right a {
  font-size: 0.85rem;
  color: var(--muted);
}

.nav-right a:hover { color: var(--ink); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
}

/* The hamburger is desktop-hidden rather than mobile-added, so the desktop bar
   is the default and needs no media query to be correct. */
.nav-toggle { display: none; }

/* MOBILE NAV
   Below this width the five links plus the theme toggle wrapped onto a second
   row, which pushed the bar to double height on every page. They now collapse
   into a disclosure panel that drops out of the bar. */
@media (max-width: 760px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    appearance: none;
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 999px;
    width: 38px;
    height: 32px;
    padding: 0;
    cursor: pointer;
    transition: border-color 0.15s ease;
  }

  .nav-toggle:hover { border-color: var(--ink); }

  /* Three bars drawn from one element: the middle is the element itself, the
     outer two are its pseudo-elements. On open they become an X — the middle
     fades and the outer two rotate onto the centre line. */
  .nav-toggle-box {
    position: relative;
    display: block;
    width: 16px;
    height: 10px;
  }

  .nav-toggle-bar,
  .nav-toggle-bar::before,
  .nav-toggle-bar::after {
    position: absolute;
    left: 0;
    width: 16px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.25s var(--ease), opacity 0.15s ease;
  }

  .nav-toggle-bar { top: 4.25px; }
  .nav-toggle-bar::before { content: ""; top: -4.5px; }
  .nav-toggle-bar::after  { content: ""; top: 4.5px; }

  .nav-open .nav-toggle-bar { background: transparent; }
  .nav-open .nav-toggle-bar::before { transform: translateY(4.5px) rotate(45deg); }
  .nav-open .nav-toggle-bar::after  { transform: translateY(-4.5px) rotate(-45deg); }

  /* The panel is positioned against the nav bar, which is the sticky element,
     so it travels with it. Hidden by clipping rather than display:none so the
     open/close can be animated. */
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--hairline);
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: max-height 0.3s var(--ease), opacity 0.2s ease, visibility 0.3s;
  }

  .nav-open .nav-links {
    max-height: 60vh;
    opacity: 1;
    visibility: visible;
    padding: 6px 24px 14px;
    overflow-y: auto;
  }

  .nav-right a {
    font-size: 1rem;
    padding: 13px 0;
    border-bottom: 1px solid var(--hairline);
  }

  .nav-right a:last-child { border-bottom: 0; }

  /* The current page is marked in the panel, where there's room to show it. */
  .nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
}

/* APP STORE BANNER
   Modelled on the iOS Smart App Banner: icon, two lines of text, and a small
   pill CTA. It sits above the sticky nav and scrolls away with the page rather
   than pinning, so it never eats vertical space on a phone twice. */
.app-banner {
  background: var(--void);
  border-bottom: 1px solid var(--hairline);
  font-size: 0.85rem;
}

.app-banner .wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 68px;
  padding-top: 10px;
  padding-bottom: 10px;
}

.app-banner-close {
  appearance: none;
  background: none;
  border: 0;
  color: var(--faint);
  cursor: pointer;
  font-size: 1.35rem;
  line-height: 1;
  padding: 4px 2px;
  margin-left: -4px;
  transition: color 0.15s ease;
}

.app-banner-close:hover { color: var(--ink); }

.app-banner-icon {
  width: 46px;
  height: 46px;
  border-radius: 22.5%;
  border: 1px solid var(--hairline);
  flex: 0 0 auto;
}

.app-banner-text {
  display: flex;
  flex-direction: column;
  line-height: 1.3;
  min-width: 0;
  flex: 1 1 auto;
}

.app-banner-text strong { font-weight: 600; letter-spacing: 0.02em; }

.app-banner-text span {
  color: var(--muted);
  font-size: 0.8rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-banner-cta {
  flex: 0 0 auto;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 7px 20px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: opacity 0.15s ease;
}

.app-banner-cta:hover { opacity: 0.82; }

.theme-toggle {
  appearance: none;
  background: none;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 6px 13px;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover { color: var(--ink); border-color: var(--ink); }

/* BANDS */

.section { padding: clamp(64px, 10vw, 116px) 0; }
.section-muted { background: var(--void); }
.section-tight { padding: clamp(44px, 7vw, 76px) 0; }

.section-head { max-width: 42ch; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head .lead { margin-top: 16px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.section-head.center .lead { margin-left: auto; margin-right: auto; }

/* HERO */

.hero { padding: clamp(48px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }

.hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: clamp(32px, 6vw, 72px);
  align-items: center;
}

/* The screenshots are pre-rendered device mockups: a phone with its own drop
   shadow on a fully transparent background, 4:3 landscape. So no border, no
   radius and no background — each of those would draw a visible box around a
   shape that isn't rectangular. Transparency is why these work unchanged in
   both themes; the only casualty is the drop shadow, which is a dark grey and
   simply disappears against the dark page. */
.shot {
  width: 100%;
  height: auto;
  margin: 0 auto;
  display: block;
}

/* Cropped tight to the device, so the max-width is very nearly the phone's own
   width — there is no longer any empty canvas padding it out. */
.hero-shot { max-width: 400px; }

@media (max-width: 860px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-shot { max-width: 330px; }
}

/* The Home Screen shot is a wide crop that bleeds off the bottom, so it needs
   more width than the portrait ones to read at the same apparent scale. */
.feature-shot.wide { max-width: 620px; }

/* BUTTONS */

.cta-row {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.badge { display: inline-block; line-height: 0; }
.badge img { height: 46px; width: auto; }

/* All four rules below are written at the same specificity so they compete
   fairly with each other and all outrank `.badge img`. A bare `.badge-dark`
   selector would lose to it and both badges would render at once. */
.badge .badge-light { display: block; }
.badge .badge-dark { display: none; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge .badge-light { display: none; }
  :root:not([data-theme="light"]) .badge .badge-dark { display: block; }
}

:root[data-theme="dark"] .badge .badge-light { display: none; }
:root[data-theme="dark"] .badge .badge-dark { display: block; }

.text-link {
  font-size: 0.9rem;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: var(--hairline);
}

.text-link:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* STEPS — the three-beat idea statement under the hero. */

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(24px, 4vw, 48px);
}

.step-kicker {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.5rem;
  display: block;
  margin-bottom: 8px;
}

.step p { color: var(--muted); margin: 0; }

.step {
  padding-top: 18px;
  border-top: 1px solid var(--ink);
}

@media (max-width: 720px) {
  .steps { grid-template-columns: 1fr; }
}

/* FEATURE ROWS — text and screenshot, alternating sides. */

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 6vw, 80px);
  align-items: center;
  padding: clamp(40px, 6vw, 72px) 0;
  border-top: 1px solid var(--hairline);
}

.feature-row:first-of-type { border-top: 0; }

.feature-row.flip .feature-text { order: 2; }

.feature-shot { max-width: 360px; }

.feature-text h3 { margin-bottom: 12px; }
.feature-text p { color: var(--muted); margin: 0; max-width: 42ch; }

@media (max-width: 780px) {
  .feature-row { grid-template-columns: 1fr; }
  /* Without this the flipped rows would put the image above the heading on
     phones, which reads as a caption for the section before it. */
  .feature-row.flip .feature-text { order: 0; }
  .feature-shot { max-width: 320px; }
  .feature-shot.wide { max-width: 480px; }
}

/* BENTO — the smaller features, as a grid of cells. */

.bento {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 14px;
}

.bento-cell {
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: 24px;
}

.section-muted .bento-cell { background: var(--paper); }

/* The bento cells sit under the section h2, so their headings are h3 — an
   h4 there skipped a level in the outline. They keep the smaller h4-ish
   size because visually they are captions, not sub-sections. */
.bento-cell h3 { font-size: 1.02rem; margin-bottom: 6px; }
.bento-cell p { color: var(--muted); margin: 0; font-size: 0.95rem; }

/* NUMBERS */

.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.stat {
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: 22px 24px;
  background: var(--paper);
}

.stat-value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2.2rem;
  line-height: 1;
  display: block;
}

.stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin-top: 10px;
  display: block;
}

/* FAQ — native disclosure widgets, so it works without JavaScript and is
   accessible for free. */

.faq { border-top: 1px solid var(--hairline); }

.faq details {
  border-bottom: 1px solid var(--hairline);
}

.faq summary {
  cursor: pointer;
  list-style: none;
  padding: 22px 44px 22px 0;
  position: relative;
  font-size: 1.05rem;
  font-weight: 500;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary::after {
  content: "+";
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--muted);
  line-height: 1;
}

.faq details[open] summary::after { content: "–"; }

.faq summary:hover { color: var(--ink); }

.faq-answer {
  color: var(--muted);
  padding: 0 44px 24px 0;
  max-width: 62ch;
  margin: 0;
}

/* CARDS — guide index */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: 26px;
  background: var(--paper);
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.card:hover { border-color: var(--ink); transform: translateY(-2px); }

.card h3 { margin-bottom: 10px; }

.card p {
  color: var(--muted);
  font-size: 0.95rem;
  margin: 0 0 18px;
}

.card .card-more {
  margin-top: auto;
  font-size: 0.8rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--muted);
}

.card:hover .card-more { color: var(--ink); }

/* ARTICLE */

.article { padding: clamp(44px, 7vw, 76px) 0 0; }

.breadcrumb {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 20px;
  letter-spacing: 0.04em;
}

.breadcrumb a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.article-meta {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  margin: 18px 0 0;
}

.prose { font-size: 1.05rem; }

.prose h2 {
  font-size: clamp(1.5rem, 3vw, 1.9rem);
  margin: 52px 0 14px;
}

.prose h3 {
  font-size: 1.25rem;
  margin: 34px 0 10px;
}

.prose ul, .prose ol {
  margin: 0 0 18px;
  padding-left: 1.25em;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.prose a,
a.inline {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--faint);
}

.prose a:hover,
a.inline:hover { text-decoration-color: var(--ink); }

.prose strong { font-weight: 600; }

/* A pulled-out fact or figure. */
.callout {
  border-left: 2px solid var(--ink);
  padding: 4px 0 4px 20px;
  margin: 28px 0;
  color: var(--muted);
}

.callout strong { color: var(--ink); }

/* Tables — used by the food-list article. */
.table-scroll { overflow-x: auto; margin: 0 0 22px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  min-width: 380px;
}

th, td {
  text-align: left;
  padding: 11px 14px 11px 0;
  border-bottom: 1px solid var(--hairline);
}

th {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

td.num, th.num { text-align: right; padding-right: 0; font-variant-numeric: tabular-nums; }

/* Disclaimer sits at the foot of every guide. */
.disclaimer {
  margin-top: 48px;
  padding: 20px 22px;
  background: var(--void);
  border-radius: var(--r);
  font-size: 0.88rem;
  color: var(--muted);
}

.disclaimer p:last-child { margin-bottom: 0; }

/* In-article promo for the app. */
.inline-cta {
  margin: 48px 0;
  padding: 28px;
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  background: var(--void);
}

.inline-cta h3 { margin-bottom: 8px; }
.inline-cta p { color: var(--muted); margin: 0 0 18px; max-width: 46ch; }
.inline-cta .cta-row { margin-top: 0; }

/* Next/previous reading links. */
.related { margin-top: 56px; border-top: 1px solid var(--hairline); padding-top: 28px; }
/* "Keep reading" is an h2 for the document outline — it's a peer of the other
   article sections, and jumping h2 → h4 breaks screen-reader navigation. It is
   styled down to h4 size because visually it is a small end-matter label, not a
   section heading. Semantics and appearance disagree here on purpose. */
.related h2 { font-size: 1rem; margin: 0 0 14px; letter-spacing: 0.02em; }
.related ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.related a { text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--hairline); }
.related a:hover { text-decoration-color: var(--ink); }

/* FINAL CTA */

.closer { text-align: center; }
.closer .cta-row { justify-content: center; }
.closer .lead { margin-left: auto; margin-right: auto; }

/* FOOTER */

footer {
  border-top: 1px solid var(--hairline);
  padding: 40px 0 56px;
}

.footer-grid {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

footer a, footer span, footer p {
  font-size: 0.85rem;
  color: var(--muted);
}

footer a:hover { color: var(--ink); }

footer p { margin: 0; max-width: 34ch; }

/* Visually hidden but read aloud — used for skip links and extra context. */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   MOTION
   ============================================================
   Everything here is gated behind `html.js-motion`, a class that motion.js
   sets on itself in <head>. If the script fails, never loads, or the visitor
   has JS off, none of these rules apply and the page renders fully visible —
   content must never depend on an animation to be readable.

   The reduced-motion guard near the top of this file already flattens every
   duration to ~0, so a visitor who asked for less motion gets the finished
   state instantly rather than a slow version of the same movement. */

.js-motion .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
  /* --d is set per-element by motion.js to stagger siblings. */
  transition-delay: var(--d, 0ms);
}

.js-motion .reveal.in {
  opacity: 1;
  transform: none;
}

/* Reduced motion: still fade, but don't slide. A cross-fade reads as a
   rendering detail; sliding is what triggers vestibular discomfort. */
@media (prefers-reduced-motion: reduce) {
  .js-motion .reveal { transform: none; }
}

/* The hero is above the fold, so it can't wait for a scroll to trigger it.
   motion.js plays it on load instead. */
.js-motion .hero-lead {
  opacity: 0;
  transform: translateY(18px);
  transition:
    opacity 0.9s var(--ease),
    transform 0.9s var(--ease);
  transition-delay: var(--d, 0ms);
}

.js-motion .hero-lead.in { opacity: 1; transform: none; }

/* Reading-progress hairline. Sits on the bottom edge of the sticky nav and
   is driven by a scaleX transform, which the compositor can animate without
   touching layout. */
.progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  /* Not transitioned: it should track the scrollbar exactly, and easing here
     makes it feel laggy rather than smooth. */
  will-change: transform;
}

/* Nav gains a shadow only once the page has moved, so it looks flat at rest. */
nav {
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}

nav.scrolled {
  box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
}

:root[data-theme="dark"] nav.scrolled,
.dark-shadow nav.scrolled {
  box-shadow: 0 1px 24px rgba(0, 0, 0, 0.5);
}

/* Hover lift. Pointer-only: on touch there is no hover state to preview, and
   these would fire on tap and stick. */
@media (hover: hover) {
  .bento-cell,
  .card,
  .step {
    transition:
      transform 0.35s var(--ease),
      border-color 0.35s var(--ease),
      box-shadow 0.35s var(--ease);
  }

  .bento-cell:hover,
  .card:hover,
  .step:hover {
    transform: translateY(-3px);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--hairline));
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
  }

  .hero-shot,
  .feature-shot {
    transition: transform 0.6s var(--ease);
  }

  .hero-shot:hover,
  .feature-shot:hover { transform: translateY(-6px); }
}

/* Accent, used in the few places where it reinforces meaning rather than
   decorating: the link a reader is about to follow, and their own selection. */
::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

.faq summary { transition: color 0.2s var(--ease); }
.faq summary:hover { color: var(--accent); }
.faq summary::after { transition: transform 0.25s var(--ease); }

.card h3 { transition: color 0.25s var(--ease); }
.card:hover h3 { color: var(--accent); }

/* The "Read →" affordance: colour it, and nudge it on hover so the arrow
   reads as a direction rather than decoration. */
.card-more { color: var(--accent); }
.card-more,
.text-link { transition: transform 0.3s var(--ease), color 0.2s var(--ease); display: inline-block; }

@media (hover: hover) {
  .card:hover .card-more { transform: translateX(4px); }
  .text-link:hover { color: var(--accent); }
}

/* The one place the accent carries meaning in body copy: the small uppercase
   label that names each band. */
.eyebrow { color: var(--accent); }

/* ============================================================
   PROTEIN CALCULATOR
   ============================================================ */

.calc {
  background: var(--void);
  border: 1px solid var(--hairline);
  border-radius: var(--r);
  padding: clamp(22px, 4vw, 34px);
  margin: 36px 0 0;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px 22px;
}

.field-wide { grid-column: 1 / -1; }

@media (max-width: 620px) {
  .calc-grid { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.field .opt { text-transform: none; letter-spacing: 0; font-weight: 400; }

.field input,
.field select {
  width: 100%;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--hairline);
  border-radius: 10px;
  padding: 11px 13px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.field select {
  /* Native selects ignore most styling on some platforms; the arrow is drawn
     by the browser, so leave room for it rather than fighting it. */
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 51%, calc(100% - 13px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.field .hint {
  font-size: 0.78rem;
  color: var(--faint);
  margin: 7px 0 0;
  line-height: 1.45;
}

.input-row { display: flex; gap: 10px; align-items: stretch; }

.unit-toggle {
  display: flex;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--paper);
}

.unit {
  appearance: none;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.85rem;
  color: var(--muted);
  padding: 0 15px;
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.unit.on { background: var(--ink); color: var(--paper); }

.unit-static {
  display: flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  color: var(--faint);
  font-size: 0.85rem;
  flex: 0 0 auto;
}

.btn-primary {
  appearance: none;
  border: 0;
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 999px;
  padding: 13px 28px;
  margin-top: 24px;
  cursor: pointer;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}

@media (hover: hover) {
  .btn-primary:hover { transform: translateY(-2px); opacity: 0.9; }
}

.calc-error {
  color: #b3261e;
  font-size: 0.88rem;
  margin: 14px 0 0;
}

:root[data-theme="dark"] .calc-error { color: #f2b8b5; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .calc-error { color: #f2b8b5; }
}

/* RESULT */

.result {
  margin: 30px 0 0;
  padding: clamp(24px, 4vw, 36px);
  border: 1px solid var(--accent);
  border-radius: var(--r);
  background: var(--accent-soft);
}

.result .eyebrow { margin-bottom: 10px; }

.result-number {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(2.6rem, 8vw, 4rem);
  line-height: 1;
  margin: 0;
}

.result-unit {
  font-family: var(--sans);
  font-style: normal;
  font-size: 1rem;
  color: var(--muted);
  letter-spacing: 0.02em;
  display: block;
  margin-top: 10px;
}

.result-mid { margin: 16px 0 0; color: var(--muted); }

.result-rows { margin: 24px 0 0; border-top: 1px solid var(--hairline); }

.result-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--hairline);
  font-size: 0.92rem;
}

.result-label { color: var(--muted); }
.result-value { font-weight: 600; text-align: right; }

.result-why {
  margin: 22px 0 0;
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--muted);
}

/* The CTA inherits .inline-cta from the article styles, but inside the result
   panel it sits on a tinted background, so it needs its own separation. */
.result .inline-cta {
  margin-top: 28px;
  border-top: 1px solid var(--hairline);
  padding-top: 24px;
  background: none;
  border-left: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  padding-left: 0;
  padding-right: 0;
}
