/* ==========================================================================
   Ermona brand system
   Warm minimal. Manrope variable, bone ground, espresso ink, copper accent.
   ========================================================================== */

@font-face {
  font-family: 'Manrope';
  src: url('/css/manrope-var.woff2') format('woff2-variations');
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bone:    #FAF8F5;
  --panel:   #F1ECE4;
  --panel-2: #E8E1D6;
  --ink:     #17130F;
  --ink-70:  #4A423A;
  --muted:   #776C61;
  --line:    #E2DAD0;
  --line-2:  #CFC4B6;
  --copper:  #8C5A3C;
  --white:   #FFFFFF;

  --measure: 62ch;
  --wrap: 1240px;
  --gut: clamp(20px, 5vw, 64px);

  --step-1: clamp(0.78rem, 0.76rem + 0.1vw, 0.84rem);
  --step-0: clamp(0.95rem, 0.92rem + 0.16vw, 1.05rem);
  --step-1u: clamp(1.15rem, 1.05rem + 0.5vw, 1.4rem);
  --step-2: clamp(1.5rem, 1.25rem + 1.2vw, 2.1rem);
  --step-3: clamp(2rem, 1.5rem + 2.4vw, 3.4rem);
  --step-4: clamp(2.6rem, 1.6rem + 4.4vw, 5.4rem);
}

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

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

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: 'Manrope', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: var(--step-0);
  font-weight: 400;
  line-height: 1.65;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3, h4 { margin: 0; font-weight: 500; line-height: 1.1; letter-spacing: -0.02em; }
p { margin: 0; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gut); }
.narrow { max-width: 780px; }

/* ---------- shared type utilities ---------- */
.eyebrow {
  font-size: var(--step-1);
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}
.lede { font-size: var(--step-1u); line-height: 1.5; color: var(--ink-70); max-width: var(--measure); font-weight: 350; }
.h-xl { font-size: var(--step-4); font-weight: 300; letter-spacing: -0.035em; }
.h-lg { font-size: var(--step-3); font-weight: 350; letter-spacing: -0.03em; }
.h-md { font-size: var(--step-2); font-weight: 450; letter-spacing: -0.02em; }
.h-sm { font-size: var(--step-1u); font-weight: 550; letter-spacing: -0.01em; }
.small { font-size: var(--step-1); color: var(--muted); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em;
  padding: 1.05em 2.1em;
  font-size: var(--step-1);
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bone);
  transition: background .25s ease, color .25s ease, border-color .25s ease;
}
.btn:hover { background: transparent; color: var(--ink); }
.btn--ghost { background: transparent; color: var(--ink); }
.btn--ghost:hover { background: var(--ink); color: var(--bone); }
.btn[aria-disabled="true"] { pointer-events: none; opacity: .45; }

/* ---------- header ---------- */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bone) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.site-head__in { display: flex; align-items: center; justify-content: space-between; gap: 2rem; height: 76px; }
.wordmark { display: block; width: clamp(112px, 13vw, 148px); color: var(--ink); }
.wordmark svg { width: 100%; height: auto; display: block; fill: currentColor; }
.nav { display: flex; align-items: center; gap: clamp(1rem, 2.6vw, 2.4rem); }
.nav a {
  text-decoration: none; font-size: var(--step-1); font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-70);
  padding-block: 4px; border-bottom: 1px solid transparent; transition: color .2s, border-color .2s;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); border-color: var(--ink); }
@media (max-width: 700px) { .nav a.nav--hide-sm { display: none; } }

/* ---------- sections ---------- */
.section { padding-block: clamp(64px, 10vw, 132px); }
.section--panel { background: var(--panel); }
.section--tight { padding-block: clamp(48px, 7vw, 88px); }
.rule { height: 1px; background: var(--line); border: 0; margin: 0; }

.sec-head { display: grid; gap: 1.1rem; margin-bottom: clamp(36px, 5vw, 64px); }

/* ---------- hero ---------- */
.hero { position: relative; background: var(--panel); overflow: clip; }
.hero__in { display: grid; gap: clamp(32px, 5vw, 72px); align-items: center; padding-block: clamp(56px, 9vw, 116px); }
@media (min-width: 900px) { .hero__in { grid-template-columns: 1.05fr 1fr; } }
.hero__copy { display: grid; gap: 1.6rem; justify-items: start; }
.hero__art { position: relative; }
.hero__art img { width: 100%; mix-blend-mode: multiply; }

/* ---------- product grid ---------- */
.prods { display: grid; gap: clamp(24px, 3.4vw, 44px); }
@media (min-width: 800px) { .prods { grid-template-columns: 1fr 1fr; } }
.prod {
  display: grid; grid-template-rows: auto 1fr;
  background: var(--white); border: 1px solid var(--line);
  text-decoration: none; color: inherit;
  transition: border-color .3s ease, transform .3s ease;
}
.prod:hover { border-color: var(--line-2); transform: translateY(-3px); }
.prod__fig { background: var(--panel); aspect-ratio: 4 / 3; overflow: hidden; display: grid; place-items: center; }
.prod__fig img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2,.7,.3,1); }
.prod:hover .prod__fig img { transform: scale(1.035); }
.prod__body { padding: clamp(22px, 2.6vw, 34px); display: grid; gap: 0.7rem; align-content: start; }
.prod__more { font-size: var(--step-1); font-weight: 650; letter-spacing: .14em; text-transform: uppercase; color: var(--copper); }

/* ---------- feature rows ---------- */
.rows { display: grid; gap: clamp(52px, 8vw, 112px); }
.row { display: grid; gap: clamp(26px, 4vw, 64px); align-items: center; }
@media (min-width: 860px) {
  .row { grid-template-columns: 1fr 1fr; }
  .row--flip .row__art { order: -1; }
}
.row__copy { display: grid; gap: 1.1rem; align-content: start; }
.row__art img { width: 100%; border: 1px solid var(--line); }

/* ---------- spec table ---------- */
.specs { width: 100%; border-collapse: collapse; font-size: var(--step-0); }
.specs th, .specs td { text-align: left; padding: 0.95em 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.specs th { font-weight: 600; color: var(--muted); width: 42%; font-size: var(--step-1); letter-spacing: .06em; text-transform: uppercase; }
.specs tr:last-child th, .specs tr:last-child td { border-bottom: 0; }

/* ---------- in-the-box list ---------- */
.box-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; counter-reset: b; }
.box-list li {
  display: flex; gap: 1rem; align-items: baseline;
  padding: 0.85em 0; border-bottom: 1px solid var(--line);
}
.box-list li::before {
  counter-increment: b; content: counter(b, decimal-leading-zero);
  font-size: var(--step-1); font-weight: 650; color: var(--copper); letter-spacing: .08em; flex: none;
}

/* ---------- value cards ---------- */
.cards { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); }
@media (min-width: 760px) { .cards { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--bone); padding: clamp(26px, 3.2vw, 40px); display: grid; gap: 0.7rem; align-content: start; }
.card__n { font-size: var(--step-1); font-weight: 650; letter-spacing: .18em; color: var(--copper); }

/* ==========================================================================
   Self-playing brew sequence (grind, brew, foam)
   ========================================================================== */
.seq { display: grid; gap: clamp(28px, 4vw, 56px); align-items: center; }
@media (min-width: 900px) { .seq { grid-template-columns: 0.85fr 1.15fr; } }

.seq__steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.seq__step {
  display: grid; grid-template-columns: auto 1fr; gap: 1.1rem;
  padding: 1.15em 0; border-bottom: 1px solid var(--line);
  opacity: .42; transition: opacity .5s ease;
}
.seq__step[data-on] { opacity: 1; }
.seq__dot {
  width: 10px; height: 10px; margin-top: .55em; border-radius: 50%;
  border: 1px solid var(--line-2); background: transparent;
  transition: background .4s ease, border-color .4s ease, box-shadow .4s ease;
}
.seq__step[data-on] .seq__dot { background: var(--copper); border-color: var(--copper); box-shadow: 0 0 0 5px color-mix(in srgb, var(--copper) 16%, transparent); }
.seq__label { font-size: var(--step-1); font-weight: 650; letter-spacing: .16em; text-transform: uppercase; }
.seq__text { color: var(--muted); font-size: var(--step-1); margin-top: .25rem; }

/* the stage: a machine over a glass, drawn in CSS */
.stage {
  position: relative; aspect-ratio: 5 / 4; background: var(--white);
  border: 1px solid var(--line); overflow: hidden;
  display: grid; place-items: center; padding-bottom: 46px;
}
.brewer { position: relative; width: min(40%, 178px); height: 84%; }

/* machine body */
.brewer__body {
  position: absolute; left: 25%; right: 25%; top: 12%; height: 44%;
  background: linear-gradient(100deg, #2C2621 0%, #17130F 58%, #211C18 100%);
  border-radius: 26px 26px 8px 8px;
}
/* hopper lip on top */
.brewer__body::before {
  content: ''; position: absolute; left: 20%; right: 20%; top: -8px; height: 13px;
  background: #2C2621; border-radius: 6px 6px 0 0;
}
/* power ring */
.brewer__ring {
  position: absolute; left: 50%; top: 56%; width: 20px; height: 20px;
  transform: translate(-50%, -50%); border-radius: 50%;
  border: 2px solid #5C5148; transition: border-color .45s ease, box-shadow .45s ease;
}
.stage[data-phase="brew"] .brewer__ring {
  border-color: #4FA3D9; box-shadow: 0 0 0 4px rgba(79,163,217,.22);
}
/* charge pips */
.brewer__pips { position: absolute; left: 50%; top: 74%; transform: translateX(-50%); display: flex; gap: 3px; }
.brewer__pips i { width: 4px; height: 4px; border-radius: 1px; background: #5C5148; }
.stage[data-phase="brew"] .brewer__pips i,
.stage[data-phase="foam"] .brewer__pips i { background: #C8BCAE; }

/* portafilter collar + spout */
.brewer__collar {
  position: absolute; left: 33%; right: 33%; top: 56%; height: 4.5%;
  background: #241E1A; border-radius: 0 0 5px 5px;
}
.brewer__spout {
  position: absolute; left: 47%; right: 47%; top: 60.5%; height: 3.5%;
  background: #241E1A;
}

/* the glass */
.glass {
  position: absolute; left: 18%; right: 18%; top: 65%; bottom: 0;
  border: 2px solid var(--ink); border-top: 0;
  border-radius: 3px 3px 16px 16px;
  background: rgba(23,19,15,.03);
  overflow: hidden;
}
.glass__liquid {
  position: absolute; left: 0; right: 0; bottom: 0; height: 0;
  background: linear-gradient(180deg, #7A4A29 0%, #3A2113 100%);
  transition: height 1.6s cubic-bezier(.35,0,.25,1);
}
.stage[data-phase="brew"] .glass__liquid { height: 66%; }
.stage[data-phase="foam"] .glass__liquid { height: 62%; transition-duration: .6s; }

.glass__foam {
  position: absolute; left: 0; right: 0; bottom: 62%; height: 0; opacity: 0;
  background: linear-gradient(180deg, #FCF8F1 0%, #E4D3BE 100%);
  transition: height 1s ease .1s, opacity .5s ease;
}
.stage[data-phase="foam"] .glass__foam { height: 26%; opacity: 1; }

/* crema line sits on the espresso while brewing */
.glass__crema {
  position: absolute; left: 0; right: 0; bottom: 66%; height: 5px; opacity: 0;
  background: #B98A55; transition: opacity .5s ease 1.2s;
}
.stage[data-phase="brew"] .glass__crema { opacity: 1; }

/* beans falling into the hopper during grind */
.grounds { position: absolute; left: 50%; top: -6%; width: 0; height: 12%; opacity: 0; transition: opacity .3s; }
.stage[data-phase="grind"] .grounds { opacity: 1; }
.ground {
  position: absolute; top: 0; width: 7px; height: 8px; border-radius: 3.5px / 4.5px;
  background: #57351F;
}
.stage[data-phase="grind"] .ground { animation: fall 1.15s linear infinite; }
.ground:nth-child(1) { animation-delay: 0s;   margin-left: -17px; }
.ground:nth-child(2) { animation-delay: .22s; margin-left:   4px; }
.ground:nth-child(3) { animation-delay: .44s; margin-left:  -7px; }
.ground:nth-child(4) { animation-delay: .66s; margin-left:  14px; }
.ground:nth-child(5) { animation-delay: .88s; margin-left:  -1px; }
@keyframes fall {
  from { transform: translateY(0) rotate(0deg); opacity: 0; }
  18%  { opacity: 1; }
  85%  { opacity: 1; }
  to   { transform: translateY(56px) rotate(200deg); opacity: 0; }
}

/* espresso stream during brew */
.stream {
  position: absolute; left: 50%; top: 64%; width: 3px; height: 0;
  transform: translateX(-50%); border-radius: 2px;
  background: linear-gradient(180deg, #8A5730, #3A2113); opacity: 0;
}
.stage[data-phase="brew"] .stream { opacity: 1; animation: pour 1.5s ease-out forwards; }
@keyframes pour { to { height: 12%; } }

/* frother wand swings in during foam */
.wand {
  position: absolute; right: 20%; top: 58%; width: 9px; height: 28%;
  background: var(--ink); border-radius: 5px;
  transform-origin: top center;
  transform: translateY(-22px) rotate(26deg); opacity: 0;
  transition: transform .7s cubic-bezier(.3,.85,.3,1), opacity .45s ease;
}
.wand::after {
  content: ''; position: absolute; left: 50%; bottom: -5px; width: 14px; height: 8px;
  transform: translateX(-50%); background: #3C332C; border-radius: 3px;
}
.stage[data-phase="foam"] .wand { opacity: 1; transform: translateY(0) rotate(14deg); }

.stage__cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: .85em 1.2em; border-top: 1px solid var(--line);
  font-size: var(--step-1); letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); background: var(--bone);
  display: flex; justify-content: space-between; gap: 1rem;
}

@media (prefers-reduced-motion: reduce) {
  .glass__liquid { height: 62% !important; transition: none; }
  .glass__foam { height: 26% !important; opacity: 1 !important; transition: none; }
  .glass__crema { opacity: 0 !important; }
  .ground { animation: none !important; }
  .grounds { opacity: 0 !important; }
  .stream { opacity: 0 !important; }
  .wand { opacity: 1 !important; transform: rotate(14deg) !important; transition: none; }
  .brewer__ring { border-color: #4FA3D9 !important; }
  .seq__step { opacity: 1 !important; }
}

/* ---------- callout / notice ---------- */
.notice {
  border: 1px solid var(--line-2); background: var(--white);
  padding: clamp(22px, 3vw, 36px); display: grid; gap: .8rem;
}

/* ---------- footer ---------- */
.site-foot { border-top: 1px solid var(--line); padding-block: clamp(48px, 6vw, 76px) 2.4rem; background: var(--panel); }
.foot-grid { display: grid; gap: clamp(28px, 4vw, 56px); }
@media (min-width: 780px) { .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot-col { display: grid; gap: .7rem; align-content: start; }
.foot-col h3 { font-size: var(--step-1); font-weight: 650; letter-spacing: .18em; text-transform: uppercase; color: var(--muted); }
.foot-col a { text-decoration: none; color: var(--ink-70); }
.foot-col a:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.foot-bottom {
  margin-top: clamp(36px, 5vw, 64px); padding-top: 1.6rem; border-top: 1px solid var(--line-2);
  display: flex; flex-wrap: wrap; gap: 1rem 2rem; justify-content: space-between;
  font-size: var(--step-1); color: var(--muted);
}

/* ---------- reveal on scroll ---------- */
.js .rv { opacity: 0; transform: translateY(16px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.7,.3,1); }
.js .rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .js .rv { opacity: 1; transform: none; transition: none; } }

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--ink); color: var(--bone);
  padding: .8em 1.2em; z-index: 100;
}
.skip:focus { left: 8px; top: 8px; }
:focus-visible { outline: 2px solid var(--copper); outline-offset: 3px; }

/* ---------- availability CTA (pre-launch / live) ---------- */
[data-when] { display: none; }
[data-when].on { display: grid; gap: 1rem; justify-items: start; }
.avail-note {
  display: inline-flex; align-items: center; gap: .7em;
  font-size: var(--step-1); font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted);
}
.avail-note::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--copper); flex: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }
