/* ============================================================================
   THE FRESH PRESS — foundations
   Tokens, reset, typography, and the shared components (buttons, labels,
   dividers, cards) that every section is assembled from.
   ========================================================================= */

/* --- Tokens -------------------------------------------------------------- */

:root {
  /* Paper and ink. The site is printed on a warm sheet, not on white. */
  --paper:        #FBF6EC;
  --paper-2:      #F3EADA;
  --ink:          #14261C;
  --ink-soft:     #4A5B50;

  /* The press green anchors the brand; mint is the existing site's colour,
     kept so the redesign still reads as The Fresh Press. */
  --green-900:    #0C2E20;
  --green-700:    #14513A;
  --green:        #3F9A45;
  --mint:         #CFE8D5;
  --mint-soft:    #E4F1E7;

  /* Fruit. Each one is lifted from the product photography. */
  --orange:       #FF6A29;
  --mango:        #FFB300;
  --berry:        #C1185B;
  --plum:         #55184A;
  --melon:        #E7414B;
  --taro:         #7A4FB5;

  /* Typefaces */
  --display: 'Anton', 'Arial Narrow', system-ui, sans-serif;
  --serif:   'Newsreader', Georgia, 'Times New Roman', serif;
  --sans:    'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono:    'DM Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* A single fluid scale drives every heading. */
  --t-mega:  clamp(3rem, 11.2vw, 11.5rem);
  --t-xxl:   clamp(2.8rem, 8.5vw,  8rem);
  --t-xl:    clamp(2.2rem, 5.4vw,  4.6rem);
  --t-lg:    clamp(1.7rem, 3.2vw,  2.8rem);
  --t-md:    clamp(1.15rem, 1.6vw, 1.45rem);
  --t-sm:    0.95rem;
  --t-xs:    0.78rem;

  /* Rhythm */
  --gut:     clamp(1.25rem, 4vw, 3.5rem);
  --sec:     clamp(5rem, 11vw, 11rem);
  --maxw:    1560px;
  --r:       18px;
  --r-lg:    32px;

  /* Motion. One easing family, so nothing feels borrowed. */
  --ease:      cubic-bezier(0.22, 1, 0.36, 1);
  --ease-io:   cubic-bezier(0.65, 0, 0.35, 1);
  --spring:    cubic-bezier(0.34, 1.56, 0.64, 1);

  --hdr-h: 74px;
}

/* --- Reset --------------------------------------------------------------- */

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

* { margin: 0; }

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

/* The smooth-scroll engine drives window.scrollTo itself; native smoothing on
   top of it would fight the lerp. */
html.has-lenis { scroll-behavior: auto; }

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.is-locked { overflow: hidden; }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }

button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }

a { color: inherit; text-decoration: none; }

ul, ol { list-style: none; padding: 0; }

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

::selection { background: var(--orange); color: #fff; }

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

.skip {
  position: fixed; top: 10px; left: 10px; z-index: 200;
  padding: 12px 20px; background: var(--ink); color: var(--paper);
  border-radius: 100px; font-weight: 600; font-size: var(--t-sm);
  transform: translateY(-150%);
  transition: transform .3s var(--ease);
}
.skip:focus-visible { transform: none; }

/* --- Typography ---------------------------------------------------------- */

.shout {
  font-family: var(--display);
  font-weight: 400;
  text-transform: uppercase;
  line-height: 0.84;
  letter-spacing: -0.015em;
  /* Anton's default spacing is loose at display sizes. */
  word-spacing: 0.02em;
}

.ed {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.018em;
  /* Newsreader is a text face first; its optical-size axis is what adapts it
     to a 52px heading and a 17px press logo from the same file. */
  font-optical-sizing: auto;
}
.ed em { font-style: italic; }

.lede {
  font-size: var(--t-md);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 46ch;
}

/* The mono eyebrow — the detail that made the Aupale header feel expensive. */
.eyebrow {
  font-family: var(--mono);
  font-size: var(--t-xs);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--ink-soft);
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.eyebrow.no-dot::before { display: none; }

.num {
  font-family: var(--mono);
  font-size: var(--t-xs);
  letter-spacing: 0.1em;
  opacity: 0.5;
}

/* --- Layout -------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

.section { padding-block: var(--sec); position: relative; }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 26rem);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: end;
  margin-bottom: clamp(2.5rem, 5vw, 4.5rem);
}
@media (max-width: 820px) {
  .section-head { grid-template-columns: 1fr; align-items: start; }
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
  --bg: var(--ink);
  --fg: var(--paper);
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  padding: 1.05em 1.9em;
  border-radius: 100px;
  background: var(--bg);
  color: var(--fg);
  font-weight: 600;
  font-size: var(--t-sm);
  letter-spacing: 0.01em;
  overflow: hidden;
  isolation: isolate;
  transition: transform .45s var(--ease), color .35s var(--ease);
}
/* The fill wipes up from the bottom rather than cross-fading. */
.btn::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--fg);
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}
.btn:hover { color: var(--bg); transform: translateY(-2px); }
.btn:hover::before { transform: none; }

.btn .arw { transition: transform .45s var(--ease); }
.btn:hover .arw { transform: translateX(4px); }

.btn--orange { --bg: var(--orange); --fg: #fff; }
.btn--orange:hover { color: var(--orange); }
.btn--green  { --bg: var(--green-900); --fg: var(--mint); }
.btn--paper  { --bg: var(--paper); --fg: var(--ink); }
.btn--ghost {
  --bg: transparent; --fg: currentColor;
  border: 1.5px solid currentColor;
  color: inherit;
}
.btn--ghost::before { background: currentColor; }
.btn--ghost:hover { color: var(--paper); }
.btn--sm { padding: 0.8em 1.4em; font-size: var(--t-xs); }

/* --- Dividers ------------------------------------------------------------ */

/* Johnny's cloud-edge, drawn with a repeating radial so it scales cleanly.
   --sc is the colour of the bumps, --sc-bg the field they sit in; both are
   needed wherever the divider falls between two coloured sections rather
   than against the paper. */
.scallop {
  height: clamp(26px, 4vw, 54px);
  position: relative;
  z-index: 2;
  background-color: var(--sc-bg, transparent);
  background-image:
    radial-gradient(circle at 50% 0, var(--sc, var(--paper)) 0 68%, transparent 69%);
  background-repeat: repeat-x;
  background-size: clamp(60px, 8vw, 120px) 100%;
}
.scallop--up {
  background-image:
    radial-gradient(circle at 50% 100%, var(--sc, var(--paper)) 0 68%, transparent 69%);
}

/* La Revoltosa's liquid edge. */
.wave { display: block; width: 100%; height: auto; }
.wave path { fill: var(--wv, var(--paper)); }
/* Flipped, the fill lands on top — for going from a colour back to paper. */
.wave--flip { transform: scaleY(-1); }

/* --- Product card -------------------------------------------------------- */

.card {
  --a: var(--orange);
  position: relative;
  display: flex;
  flex-direction: column;
  border-radius: var(--r-lg);
  padding: clamp(1.1rem, 1.6vw, 1.6rem);
  background: var(--card-bg, #fff);
  /* Stated, never inherited — cards sit on dark sections too, and the card
     itself is always light. */
  color: var(--ink);
  overflow: hidden;
  isolation: isolate;
  transition: transform .6s var(--ease), box-shadow .6s var(--ease);
}
/* The accent flood is the product's own colour, sampled from its photo. */
.card::before {
  content: '';
  position: absolute; inset: 0; z-index: -1;
  background: var(--a);
  opacity: 0;
  transition: opacity .5s var(--ease);
}
.card:hover {
  transform: translateY(-8px);
  box-shadow: 0 26px 50px -22px color-mix(in srgb, var(--a) 70%, transparent);
}
.card:hover::before { opacity: 1; }

.card__media {
  position: relative;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  margin-bottom: 1.1rem;
  border-radius: calc(var(--r-lg) - 10px);
  background: color-mix(in srgb, var(--a) 12%, #fff);
  transition: background .5s var(--ease);
}
.card:hover .card__media { background: color-mix(in srgb, #fff 22%, transparent); }

.card__media img {
  width: 78%;
  height: 78%;
  object-fit: contain;
  transition: transform .7s var(--ease);
}
.card:hover .card__media img { transform: scale(1.08) rotate(-3deg); }

.card__title {
  font-weight: 600;
  font-size: 1.02rem;
  line-height: 1.25;
  letter-spacing: -0.01em;
  transition: color .4s var(--ease);
}
.card__price {
  margin-top: 0.25rem;
  font-family: var(--mono);
  font-size: var(--t-xs);
  color: var(--ink-soft);
  transition: color .4s var(--ease);
}
.card:hover .card__title,
.card:hover .card__price { color: #fff; }

.card__foot {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.card__add {
  flex: none;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--a);
  color: #fff;
  transition: background .4s var(--ease), transform .4s var(--spring), color .4s var(--ease);
}
.card__add:hover { transform: scale(1.12) rotate(90deg); }
.card:hover .card__add { background: #fff; color: var(--a); }

/* Stretch the title's link over the whole card without swallowing the
   add-to-cart button. */
.card__link::after { content: ''; position: absolute; inset: 0; }
.card__add { position: relative; z-index: 1; }

/* --- Reveal primitives --------------------------------------------------- */

/* Set by JS only when it is actually going to animate, so a failed script
   never leaves the page invisible. */
[data-rise], [data-fade], [data-mask] { will-change: transform, opacity; }

.js [data-rise] {
  opacity: 0;
  transform: translateY(34px);
  transition: opacity .9s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-fade] {
  opacity: 0;
  transition: opacity 1s var(--ease);
  transition-delay: var(--d, 0ms);
}
.js [data-rise].in,
.js [data-fade].in { opacity: 1; transform: none; }

/* Line-by-line wipe for the big statements. */
.js [data-mask] .ln { overflow: hidden; display: block; padding-block: 0.04em; }
.js [data-mask] .ln > span {
  display: block;
  transform: translateY(105%);
  transition: transform 1.05s var(--ease);
  transition-delay: calc(var(--i, 0) * 85ms + var(--d, 0ms));
}
.js [data-mask].in .ln > span { transform: none; }

/* --- Marquee ------------------------------------------------------------- */

.marquee {
  display: flex;
  overflow: hidden;
  user-select: none;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
          mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
}
.marquee__row {
  display: flex;
  flex: none;
  align-items: center;
  gap: var(--mq-gap, 2.5rem);
  padding-right: var(--mq-gap, 2.5rem);
  animation: mq var(--mq-dur, 34s) linear infinite;
}
.marquee:hover .marquee__row { animation-play-state: paused; }
.marquee--rev .marquee__row { animation-direction: reverse; }
@keyframes mq { to { transform: translateX(-100%); } }

/* --- Reduced motion ------------------------------------------------------ */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* Reveals must land in their final state, not their start state. */
  .js [data-rise], .js [data-fade] { opacity: 1 !important; transform: none !important; }
  .js [data-mask] .ln > span,
  .js .hero__line > span { transform: none !important; }
  .js .hero__bowl { opacity: 1 !important; transform: none !important; }
  .marquee__row { animation: none; }
}
