/* ==========================================================================
   Happy Café — Barista Course page
   ========================================================================== */

/* ---------- Extraction hero ---------- */
.extract { position: relative; height: 320vh; background: var(--cream); }
.extract-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; display: flex; align-items: center; }
.extract-bgword { position: absolute; left: 0; bottom: 6vh; white-space: nowrap; pointer-events: none; font-family: var(--font-display); font-style: italic; font-size: clamp(5rem, 14vw, 13rem); line-height: 1; letter-spacing: -0.04em; color: transparent; -webkit-text-stroke: 1px rgba(122,78,49,.18); }
.extract-bgword span { display: inline-block; will-change: transform; }
.extract-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(30px, 5vw, 80px); align-items: center; max-width: 1480px; padding-top: var(--nav-h); position: relative; z-index: 1; }
.extract-copy { display: grid; gap: 20px; justify-items: start; }
.course-title { font-size: clamp(3rem, 7.4vw, 7.6rem); }
.course-title .ct-line { display: block; }
.course-script { margin: -8px 0 0 4px; transform: rotate(-2deg); }

.extract-visual { position: relative; display: grid; justify-items: center; }
.machine { width: min(100%, 420px); height: auto; overflow: visible; filter: drop-shadow(0 40px 50px rgba(42,24,15,.22)); }
.stream { fill: none; stroke: #4a240f; stroke-width: 6; stroke-linecap: round; stroke-dasharray: 280; stroke-dashoffset: 280; }
#streamR { stroke-width: 5; }
.cup-steam path { fill: none; stroke: rgba(122,78,49,.45); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 40; stroke-dashoffset: 40; opacity: 0; }
.gauge { position: absolute; left: 0; top: 4%; width: clamp(96px, 9vw, 130px); }
.g-face { fill: var(--paper); stroke: var(--line-strong); stroke-width: 2; }
.g-track { fill: none; stroke: var(--sand); stroke-width: 8; stroke-linecap: round; }
.g-fill { fill: none; stroke: var(--caramel); stroke-width: 8; stroke-linecap: round; stroke-dasharray: 210; stroke-dashoffset: 210; }
.g-ticks line { stroke: var(--mocha); stroke-width: 1.5; }
#gaugeNeedle line { stroke: var(--espresso); stroke-width: 3; stroke-linecap: round; }
#gaugeNeedle circle { fill: var(--espresso); }
#gaugeNeedle { transform-origin: 60px 60px; transform: rotate(-135deg); }
.g-val { font-family: var(--font-display); font-size: 18px; fill: var(--espresso); }
.g-unit { font-size: 8px; letter-spacing: 2px; font-weight: 700; fill: var(--muted); }
.readouts { list-style: none; padding: 0; margin: 18px 0 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; width: min(100%, 460px); }
.readouts li { display: grid; gap: 2px; padding: 12px 10px; border-radius: 16px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); text-align: center; }
.readouts span { font-size: .64rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--caramel); }
.readouts b { font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; line-height: 1; font-variant-numeric: tabular-nums; }
.readouts i { font-style: normal; }
.readouts small { font-family: var(--font-body); font-size: .75rem; color: var(--muted); }
.extract-hint { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); display: grid; justify-items: center; gap: 8px; font-size: .7rem; letter-spacing: .22em; text-transform: uppercase; font-weight: 700; color: var(--mocha); z-index: 2; }
.eh-bar { width: 140px; height: 2px; background: var(--line); overflow: hidden; }
.eh-bar i { display: block; height: 100%; background: var(--caramel); transform-origin: left; transform: scaleX(0); }

@media (max-width: 900px) {
  .extract { height: 280vh; }
  .extract-grid { grid-template-columns: 1fr; gap: 10px; align-content: center; }
  .extract-copy { gap: 12px; }
  .extract-copy .lead { display: none; }
  .course-title { font-size: clamp(2.4rem, 10vw, 4rem); }
  .course-script { font-size: 1.7rem; }
  .extract-visual { grid-template-columns: 1fr; }
  .machine { width: min(56vw, 250px); }
  .gauge { width: 76px; left: 2%; }
  .readouts { margin-top: 8px; }
  .readouts li { padding: 8px 6px; }
  .readouts b { font-size: 1.2rem; }
  .extract-hint { bottom: 12px; }
}
@media (max-height: 700px) { .extract-hint { display: none; } }
@media (max-height: 720px) and (max-width: 900px) {
  .extract-copy .btn-group { display: none; }
}

/* ---------- Modules ---------- */
.learn { background: var(--cream-soft); }
.learn-head { max-width: 820px; }
.modules { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-strong); }
.module {
  position: relative; display: grid; grid-template-columns: 90px 1fr 60px; gap: 20px; align-items: center;
  padding: clamp(22px, 3vw, 38px) 0; border-bottom: 1px solid var(--line-strong);
  cursor: default; isolation: isolate;
}
.module::before { content: ""; position: absolute; inset: 0 -2vw; z-index: -1; background: var(--espresso); transform: scaleY(0); transform-origin: bottom; transition: transform .6s var(--ease-out); border-radius: 18px; }
.m-num { font-family: var(--font-display); font-style: italic; font-size: 1.4rem; color: var(--caramel); transition: color .5s; }
.m-main h3 { font-size: clamp(1.8rem, 4vw, 3.6rem); transition: color .5s, transform .6s var(--ease-out); }
.m-main p { margin: 10px 0 0; color: var(--muted); max-width: 60ch; transition: color .5s; }
.m-thumb { display: none; }
.m-arrow { font-size: 1.8rem; color: var(--mocha); justify-self: end; transition: transform .6s var(--ease-out), color .5s; }
@media (hover: hover) and (pointer: fine) {
  .module:hover::before { transform: scaleY(1); transform-origin: top; }
  .module:hover .m-main h3 { color: var(--cream); transform: translateX(18px); }
  .module:hover .m-main p { color: var(--on-dark-muted); }
  .module:hover .m-num { color: var(--latte); }
  .module:hover .m-arrow { color: var(--latte); transform: rotate(-45deg); }
}
.module-float { position: fixed; left: 0; top: 0; z-index: 30; width: 320px; aspect-ratio: 4 / 3; border-radius: 22px; overflow: hidden; pointer-events: none; opacity: 0; transform: scale(.6); box-shadow: var(--shadow-lift); }
.module-float img { width: 100%; height: 100%; object-fit: cover; }
@media (hover: none), (pointer: coarse), (max-width: 760px) {
  .module { grid-template-columns: 1fr; gap: 12px; }
  .m-num { order: -1; }
  .m-thumb { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 18px; order: -1; }
  .m-arrow { display: none; }
  .module-float { display: none; }
}

/* ---------- Journey ---------- */
.journey { background: var(--espresso); }
.journey-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: start; }
.journey-visual { position: sticky; top: 14vh; }
.jv-frame { position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius-lg); overflow: hidden; background: var(--coffee); }
.jv-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transform: scale(1.12); transition: opacity .9s var(--ease-out), transform 1.6s var(--ease-out); }
.jv-frame img.is-on { opacity: 1; transform: scale(1); }
.jv-count { margin-top: 14px; font-family: var(--font-display); color: var(--on-dark-muted); font-size: 1.1rem; }
.jv-count b { color: var(--latte); font-weight: 500; font-size: 1.6rem; }
.journey-steps { display: grid; gap: 0; }
.jstep { min-height: 72vh; display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 30px 0; opacity: .28; transition: opacity .6s var(--ease-out); }
.jstep.is-on { opacity: 1; }
.js-num { font-family: var(--font-display); font-style: italic; font-size: 1.3rem; color: var(--latte); }
.jstep h3 { font-size: clamp(2rem, 3.8vw, 3.4rem); }
.jstep p { margin: 0; color: var(--on-dark-muted); font-size: 1.05rem; max-width: 48ch; }
.jstep strong { color: var(--on-dark); }
.jstep em { color: var(--latte); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips li { padding: 9px 14px; border-radius: 999px; background: rgba(246,236,223,.08); box-shadow: inset 0 0 0 1px rgba(246,236,223,.18); font-size: .9rem; }
.versus { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.versus > div { padding: 18px; border-radius: 18px; background: rgba(246,236,223,.06); box-shadow: inset 0 0 0 1px rgba(246,236,223,.16); }
.versus .win { background: rgba(180,122,70,.22); box-shadow: inset 0 0 0 1px rgba(214,180,142,.45); }
.versus h4 { margin: 0 0 6px; font-family: var(--font-display); font-weight: 500; font-size: 1.3rem; color: var(--on-dark); }
.versus p { font-size: .92rem; }
.checklist { margin: 0; padding: 0; list-style: none; counter-reset: c; display: grid; gap: 10px; }
.checklist li { counter-increment: c; display: flex; gap: 12px; align-items: baseline; color: var(--on-dark); }
.checklist li::before { content: counter(c, decimal-leading-zero); font-family: var(--font-display); font-style: italic; color: var(--latte); }
.recipe { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.recipe li { display: grid; padding: 16px; border-radius: 18px; background: rgba(246,236,223,.08); box-shadow: inset 0 0 0 1px rgba(246,236,223,.18); }
.recipe b { font-family: var(--font-display); font-weight: 500; font-size: 1.6rem; color: var(--on-dark); }
.recipe span { font-size: .78rem; color: var(--on-dark-muted); }
@media (max-width: 900px) {
  .journey-grid { grid-template-columns: 1fr; }
  .journey-visual { top: calc(var(--nav-h) * .3); z-index: 2; }
  .jv-frame { aspect-ratio: 16 / 9; }
  .jstep { min-height: auto; padding: 60px 0; }
  .versus, .recipe { grid-template-columns: 1fr; }
}

/* ---------- Grind lab ---------- */
.grindlab { background: var(--cream); }
.lab { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(20px, 4vw, 60px); align-items: center; padding: clamp(24px, 4vw, 50px); border-radius: var(--radius-lg); background: var(--paper); box-shadow: var(--shadow-soft); }
.lab-visual { position: relative; height: 420px; display: grid; justify-items: center; }
.lab-grounds { position: absolute; top: 6px; left: 50%; transform: translateX(-50%); width: 220px; height: 60px; display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; align-content: end; }
.lab-grounds i { display: block; border-radius: 40%; background: #5a3320; }
.lab-basket { position: absolute; top: 80px; width: 200px; height: 46px; border-radius: 6px 6px 40px 40px; background: linear-gradient(90deg, #8f8378, #e9e2d8 40%, #8f8378); }
.lab-bed { position: absolute; left: 10px; right: 10px; top: 6px; height: 16px; border-radius: 4px; background: #4a2c1c; }
.lab-drops { position: absolute; top: 126px; width: 40px; height: 170px; left: 50%; transform: translateX(-50%); }
.lab-drops i { position: absolute; left: 50%; width: 8px; height: 14px; margin-left: -4px; border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: #5a2e16; }
.lab-cup { position: absolute; bottom: 40px; width: 150px; height: 120px; border-radius: 0 0 50px 50px; background: rgba(255,255,255,.6); box-shadow: inset 0 0 0 3px rgba(42,24,15,.25); overflow: hidden; }
.lab-cup-fill { position: absolute; left: 0; right: 0; bottom: 0; height: 55%; background: linear-gradient(#c58c51 0 10px, #4a240f 10px); transition: height .6s var(--ease-out), filter .6s; }
.lab-timer { position: absolute; right: 0; top: 40%; display: grid; justify-items: center; padding: 14px 16px; border-radius: 18px; background: var(--cream); }
.lab-timer b { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; font-weight: 500; font-variant-numeric: tabular-nums; }
.lab-timer span { font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.lab-panel { display: grid; gap: 30px; }
.lab-range { display: grid; gap: 12px; }
.lab-range input { -webkit-appearance: none; appearance: none; width: 100%; height: 12px; border-radius: 99px; background: linear-gradient(90deg, #3b1f12 0%, #b47a46 33%, #d6b48e 50%, #b47a46 67%, #e9d3b4 100%); outline: none; }
.lab-range input::-webkit-slider-thumb { -webkit-appearance: none; width: 34px; height: 34px; border-radius: 50%; background: var(--espresso); border: 5px solid var(--paper); box-shadow: 0 6px 18px rgba(42,24,15,.4); cursor: grab; }
.lab-range input::-moz-range-thumb { width: 26px; height: 26px; border-radius: 50%; background: var(--espresso); border: 5px solid var(--paper); box-shadow: 0 6px 18px rgba(42,24,15,.4); cursor: grab; }
.lab-range input:focus-visible { box-shadow: 0 0 0 4px rgba(180,122,70,.3); }
.lr-labels { display: flex; justify-content: space-between; font-size: .74rem; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; color: var(--muted); }
.lab-result { padding: 24px; border-radius: 22px; background: var(--cream); display: grid; gap: 16px; transition: background-color .5s; }
.lr-tag { justify-self: start; padding: 8px 16px; border-radius: 999px; font-weight: 700; font-size: .9rem; background: var(--ok); color: #fff; transition: background-color .5s; }
.lab[data-zone="fine"] .lr-tag { background: #3b1f12; }
.lab[data-zone="coarse"] .lr-tag { background: #b47a46; }
.lab-result dl { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.lab-result dt { font-size: .68rem; letter-spacing: .18em; text-transform: uppercase; font-weight: 700; color: var(--caramel); }
.lab-result dd { margin: 4px 0 0; font-family: var(--font-display); font-size: 1.3rem; line-height: 1.15; }
@media (max-width: 860px) {
  .lab { grid-template-columns: 1fr; }
  .lab-visual { height: 340px; }
  .lab-cup { bottom: 10px; }
  .lab-drops { height: 140px; }
}

/* ---------- Milk lab ---------- */
.milklab { background: var(--cream-soft); }
.cups { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(14px, 2vw, 28px); }
.cup { margin: 0; display: grid; gap: 18px; }
.cup-glass { position: relative; height: 260px; border-radius: 10px 10px 70px 70px; background: rgba(255,255,255,.55); box-shadow: inset 0 0 0 3px rgba(42,24,15,.18), 0 30px 40px -30px rgba(42,24,15,.4); overflow: hidden; }
.cup-glass > div { position: absolute; left: 0; right: 0; }
.c-esp { bottom: 0; height: 0; background: linear-gradient(#5a2e16, #2a140a); }
.c-milk { height: 0; background: linear-gradient(#d9b994, #b88a5e); }
.c-foam { height: 0; background: repeating-radial-gradient(circle at 30% 40%, #fffaf3 0 3px, #f3e6d3 3px 6px); }
.cup figcaption { display: grid; gap: 6px; }
.cup h3 { font-size: 1.7rem; }
.cup p { margin: 0; color: var(--muted); font-size: .92rem; }
.foam-tag { justify-self: start; margin-top: 4px; padding: 6px 12px; border-radius: 999px; background: var(--espresso); color: var(--cream); font-size: .78rem; font-weight: 700; }
.thermo { margin-top: clamp(40px, 6vw, 70px); max-width: 720px; }
.thermo-bar { position: relative; height: 14px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.thermo-bar i { position: absolute; inset: 0; background: linear-gradient(90deg, #e9d3b4, #b47a46, #7a2e14); transform-origin: left; transform: scaleX(0); }
.thermo-zone { position: absolute; top: -4px; bottom: -4px; left: 66.6%; width: 8.4%; border-radius: 4px; box-shadow: 0 0 0 2px var(--espresso); }
.thermo-labels { position: relative; height: 1.4em; margin-top: 10px; font-size: .78rem; font-weight: 600; color: var(--muted); }
.thermo-labels span { position: absolute; top: 0; }
.thermo-labels span:first-child { left: 0; }
.thermo-labels .tz { left: 70.8%; transform: translateX(-50%); color: var(--espresso); white-space: nowrap; }
.thermo-labels span:last-child { right: 0; }
@media (max-width: 900px) { .cups { grid-template-columns: 1fr 1fr; } .cup-glass { height: 200px; } }

/* ---------- Order (Americano vs Long Black) ---------- */
.order { background: var(--cream); }
.order-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: center; }
.order-copy { display: grid; gap: 20px; justify-items: start; }
.order-glasses { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.og { margin: 0; display: grid; gap: 16px; }
.og-glass { position: relative; height: 280px; border-radius: 8px 8px 30px 30px; background: rgba(255,255,255,.6); box-shadow: inset 0 0 0 3px rgba(42,24,15,.2); overflow: hidden; }
.og-layer, .og-crema { position: absolute; left: 0; right: 0; height: 0; }
.og[data-order="americano"] .og-a { bottom: 0; background: linear-gradient(#4a240f, #2a140a); }
.og[data-order="americano"] .og-b { background: rgba(120,66,32,.55); }
.og[data-order="americano"] .og-crema { background: rgba(214,170,120,.5); }
.og[data-order="longblack"] .og-a { bottom: 0; background: rgba(150,110,80,.25); }
.og[data-order="longblack"] .og-b { background: linear-gradient(#5a2e16, #3b1d0e); }
.og[data-order="longblack"] .og-crema { background: linear-gradient(#e7bd85, #b27238); }
.og h3 { font-size: 1.8rem; }
.og ol { margin: 0; padding-left: 18px; color: var(--coffee); }
.og span { font-size: .85rem; color: var(--muted); }
@media (max-width: 900px) { .order-grid { grid-template-columns: 1fr; } .og-glass { height: 220px; } }

/* ---------- Drinks grid ---------- */
.drinks { background: var(--cream-soft); }
.drinks-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 20px; }
.drinks-head > div:first-child { display: grid; gap: 18px; }
.drink-filter { display: flex; gap: 6px; padding: 6px; border-radius: 999px; background: var(--paper); box-shadow: inset 0 0 0 1px var(--line); }
.drink-filter button { min-height: 42px; padding: 0 20px; border-radius: 999px; font-weight: 600; font-size: .9rem; color: var(--coffee); transition: background-color .35s, color .35s; }
.drink-filter button[aria-selected="true"] { background: var(--espresso); color: var(--cream); }
.drink-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 18px; }
.drink { position: relative; border-radius: 24px; overflow: hidden; background: var(--paper); box-shadow: 0 14px 40px -28px rgba(42,24,15,.45); transform-style: preserve-3d; transition: box-shadow .5s; }
.drink[hidden] { display: none; }
.drink:hover { box-shadow: 0 30px 60px -30px rgba(42,24,15,.55); }
.drink-img { aspect-ratio: 4 / 3; overflow: hidden; }
.drink-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease-out); }
.drink:hover .drink-img img { transform: scale(1.07); }
.drink-body { padding: 18px 20px 22px; display: grid; gap: 8px; }
.drink-tag { justify-self: start; font-size: .62rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--cream); color: var(--mocha); }
.drink-tag.cold { background: #e3ecef; color: #3c5a66; }
.drink h3 { font-size: 1.5rem; }
.drink p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }

/* ---------- Enrol ---------- */
.enrol { background: var(--ink); }
.enrol-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(30px, 6vw, 100px); align-items: center; }
.enrol-card { display: grid; gap: 26px; justify-items: start; }
.enrol-points { list-style: none; margin: 0; padding: 0; width: 100%; border-top: 1px solid rgba(246,236,223,.14); }
.enrol-points li { display: grid; grid-template-columns: 150px 1fr; gap: 16px; padding: 16px 0; border-bottom: 1px solid rgba(246,236,223,.14); }
.enrol-points b { font-size: .72rem; letter-spacing: .2em; text-transform: uppercase; color: var(--latte); font-weight: 700; padding-top: 3px; }
.enrol-points span { color: var(--on-dark); }
.enrol-visual .reveal-img { aspect-ratio: 16 / 10; border-radius: var(--radius-lg); }
@media (max-width: 900px) {
  .enrol-grid { grid-template-columns: 1fr; }
  .enrol-points li { grid-template-columns: 1fr; gap: 4px; }
}

/* ---------- Reduced motion ---------- */
.reduce-motion .extract { height: auto; }
.reduce-motion .extract-sticky { position: relative; height: auto; min-height: 100svh; padding: 40px 0; }
.reduce-motion .stream { stroke-dashoffset: 0; }
.reduce-motion .jstep { opacity: 1; }
