/* Ember Lane: café website concept by Mint Labs. Fictional brand. */
:root {
  --cream: #efe3d0;
  --cream-2: #e8d9c2;
  --paper: #f7efe3;
  --ink: #3a2418;
  --ink-soft: #5d4334;
  --clay: #8a4520;
  --line: rgba(58, 36, 24, .16);
  --serif: "Gloock", "Iowan Old Style", "Palatino Linotype", serif;
  --sans: "Instrument Sans", "Helvetica Neue", Arial, sans-serif;
  --side: max(20px, 5.5vw);
  --top-h: 92px;
}
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--cream); color: var(--ink); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 16px/1.55 var(--sans); background: var(--cream); }
img { display: block; max-width: 100%; height: auto; }
section[id], .mxs-step { scroll-margin-top: var(--top-h); }
a { color: inherit; }
button { font: inherit; color: inherit; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; text-wrap: balance; }
:focus-visible { outline: 2px solid var(--clay); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: 12px; top: -60px; z-index: 50; background: var(--ink); color: var(--cream); padding: 10px 14px; border-radius: 999px; text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- header ---------- */
.top { position: fixed; inset: 0 0 auto; z-index: 20; }
.concept-bar { margin: 0; padding: 6px var(--side); background: var(--ink); color: var(--cream); font-size: 11.5px; letter-spacing: .02em; text-align: center; }
.concept-bar a { color: inherit; text-underline-offset: 2px; }
.bar { display: flex; align-items: center; gap: 24px; padding: 16px var(--side); background: linear-gradient(var(--cream) 55%, rgba(239, 227, 208, 0)); }
.logo { font: 400 21px/1 var(--serif); letter-spacing: .04em; text-transform: uppercase; text-decoration: none; margin-right: auto; }
.nav { display: flex; align-items: center; gap: 26px; font-size: 14px; }
.nav a { text-decoration: none; }
.nav a:not(.nav-shop):hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-shop, .pill { display: inline-flex; align-items: center; gap: 10px; min-height: 42px; padding: 0 20px; border: 0; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; transition: background .2s, transform .2s; }
.nav-shop:hover, .pill:hover { background: #24150d; }
.pill:active { transform: scale(.98); }
.bag-button { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: transparent; cursor: pointer; }
.bag-button svg { width: 20px; height: 20px; }
.bag-count { position: absolute; top: -3px; right: -3px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 999px; background: var(--clay); color: #fff; font-size: 11px; font-weight: 600; line-height: 19px; }
.bag-count:empty, .bag-count[data-n="0"] { display: none; }

/* ---------- shared type ---------- */
.eyebrow { margin: 0 0 14px; color: var(--clay); font-size: 12px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.eyebrow span { display: inline-block; margin-right: 10px; padding: 3px 8px; border: 1px solid currentColor; border-radius: 999px; letter-spacing: .08em; }
.lede { margin: 0; max-width: 34ch; color: var(--ink-soft); font-size: clamp(15px, 1.15vw, 17px); }
.text-link { display: inline-flex; gap: 8px; align-items: center; font-size: 14px; font-weight: 500; text-decoration: none; border-bottom: 1px solid var(--line); padding-bottom: 2px; }
.text-link:hover { border-color: currentColor; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 26px; }
h1 { font-size: clamp(52px, 7.4vw, 118px); line-height: .92; text-transform: uppercase; margin-bottom: 22px; letter-spacing: -.005em; }
h2 { font-size: clamp(40px, 5.4vw, 86px); line-height: .94; text-transform: uppercase; margin-bottom: 20px; }

/* ---------- story: still layout (no JS, reduced motion, data saver, missing frames) ---------- */
.story { padding: calc(var(--top-h) + 40px) var(--side) 40px; }
.story .poster, .story .mxs-canvas, .mxs-watch, .mxs-hint, .scroll-cue, .mxs-loading { display: none; }
.mxs-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0 6vw; align-items: center; padding: 30px 0; }
.mxs-step .still { grid-row: 1 / span 8; grid-column: 2; width: 100%; max-width: 560px; justify-self: center;
  -webkit-mask: radial-gradient(closest-side, #000 80%, transparent); mask: radial-gradient(closest-side, #000 80%, transparent); }
.mxs-step:nth-child(odd of .mxs-step) .still { grid-column: 1; }
.mxs-step > :not(.still) { grid-column: 2; }
.mxs-step:nth-child(odd of .mxs-step) > :not(.still) { grid-column: 2; }
.mxs-step:nth-child(even of .mxs-step) > :not(.still) { grid-column: 1; grid-row: auto; }

/* ---------- story: film layout ---------- */
.film .story { padding: 0; }
.film .mxs-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: var(--cream); }
.film .story .poster, .film .story .mxs-canvas { display: block; position: absolute; inset: 0; width: 100%; height: 100%; }
.film .poster img { width: 100%; height: 100%; object-fit: cover; }
.film .mxs-canvas { opacity: 0; transition: opacity .35s; }
.film .mxs-ready .mxs-canvas { opacity: 1; }
.film .mxs-step { display: block; position: absolute; z-index: 2; left: var(--side); top: 50%; transform: translateY(-42%); width: min(44vw, 620px); padding: 0;
  opacity: 0; visibility: hidden; will-change: opacity; pointer-events: none; }
.film .mxs-step[data-step="0"] { opacity: 1; visibility: visible; }
.film .mxs-step .still { display: none; }
.film .mxs-step a, .film .mxs-step button { pointer-events: auto; }
.film .mxs-watch { display: inline-flex; position: absolute; z-index: 3; right: var(--side); bottom: 28px; align-items: center; gap: 8px; min-height: 42px; padding: 0 18px;
  border: 1px solid var(--line); border-radius: 999px; background: rgba(247, 239, 227, .7); backdrop-filter: blur(8px); font-size: 13px; font-weight: 500; cursor: pointer; }
.film .mxs-watch span { font-size: 9px; }
.film .mxs-playing .mxs-watch { opacity: 0; pointer-events: none; }
.film .mxs-hint { display: block; position: absolute; z-index: 3; right: var(--side); bottom: 34px; margin: 0; font-size: 12px; color: var(--ink-soft); opacity: 0; transition: opacity .3s; pointer-events: none; }
.film .mxs-playing .mxs-hint { opacity: 1; }
.film .scroll-cue { display: flex; position: absolute; z-index: 2; left: var(--side); bottom: 28px; align-items: center; gap: 12px; font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-soft);
  opacity: calc(1 - var(--mxs-pos, 0) * 4); }
.scroll-cue span { position: relative; width: 1px; height: 34px; background: var(--line); overflow: hidden; }
.scroll-cue span::after { content: ""; position: absolute; left: 0; top: -40%; width: 1px; height: 40%; background: var(--ink); animation: cue 1.8s ease-in-out infinite; }
@keyframes cue { to { top: 100%; } }
.film .mxs-loading { display: block; position: absolute; z-index: 3; right: var(--side); top: calc(var(--top-h) + 16px); font-size: 11px; color: var(--ink-soft); }

.notes { list-style: none; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 24px 0 0; padding: 0; max-width: 560px; }
.notes li { padding: 14px 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: rgba(247, 239, 227, .72); backdrop-filter: blur(6px); font-size: 13px; line-height: 1.4; color: var(--ink-soft);
  box-shadow: 0 18px 40px -26px rgba(58, 36, 24, .45); }
.notes b { display: block; margin-bottom: 6px; color: var(--ink); font: 400 15px/1 var(--serif); text-transform: uppercase; letter-spacing: .04em; }
.film .notes li { transform: translateY(calc((1 - var(--mxs-pos, 0) / 3) * 60px)); }

/* ---------- visit ---------- */
.visit { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 48px 6vw; align-items: end; padding: 140px var(--side) 120px; border-top: 1px solid var(--line); }
.hours { margin: 0; display: grid; gap: 0; }
.hours div { display: flex; justify-content: space-between; gap: 20px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.hours dt { font-weight: 600; }
.hours dd { margin: 0; text-align: right; color: var(--ink-soft); }

/* ---------- shop ---------- */
.shop { padding: 120px var(--side) 120px; text-align: center; background: var(--paper); }
.shop .lede { margin: 0 auto; }
.products { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; max-width: 1180px; margin: 64px auto 0; }
.product { display: grid; justify-items: center; gap: 6px; padding: 0 0 30px; border-radius: 22px; background: var(--cream); overflow: hidden; }
.product img { width: 100%; aspect-ratio: 1; object-fit: cover; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.product:hover img { transform: translateY(-6px); }
.product h3 { margin-top: 8px; font-size: 30px; text-transform: uppercase; }
.size { margin: 0; color: var(--ink-soft); font-size: 13px; }
.buy { display: flex; align-items: center; gap: 16px; margin-top: 14px; }
.price { font: 400 24px/1 var(--serif); }
.add { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 18px; border: 0; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14px; font-weight: 500; cursor: pointer; }
.add:hover { background: #24150d; }
.fine { margin: 34px 0 0; font-size: 13px; color: var(--ink-soft); }

/* ---------- footer ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 40px; padding: 40px var(--side) 48px; border-top: 1px solid var(--line); font-size: 13px; color: var(--ink-soft); }
.foot .logo { margin-right: 0; color: var(--ink); }
.foot p { margin: 0 auto 0 0; max-width: 60ch; }

/* ---------- bag drawer ---------- */
.bag { position: fixed; inset: 0; z-index: 40; background: rgba(36, 21, 13, .35); }
.bag[hidden] { display: none; }
.bag-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(420px, 100%); display: flex; flex-direction: column; padding: 26px 26px 22px; background: var(--paper); box-shadow: -30px 0 60px -30px rgba(36, 21, 13, .5); animation: slide .35s cubic-bezier(.2, .8, .2, 1); outline: none; }
@keyframes slide { from { transform: translateX(100%); } }
.bag-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.bag-head h2 { font-size: 34px; margin: 0; }
.bag-close { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 50%; background: none; font-size: 22px; line-height: 1; cursor: pointer; }
.bag-items { list-style: none; margin: 0; padding: 8px 0; flex: 1; overflow: auto; }
.bag-items li { display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.bag-items img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; }
.bag-items b { display: block; font-weight: 500; font-size: 14px; }
.bag-items small { color: var(--ink-soft); font-size: 13px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 34px; height: 34px; border: 0; background: none; cursor: pointer; font-size: 16px; }
.qty span { min-width: 18px; text-align: center; font-size: 14px; }
.bag-empty { margin: 30px 0; color: var(--ink-soft); }
.bag-foot { padding-top: 16px; }
.bag-foot p { display: flex; justify-content: space-between; margin: 0 0 8px; font-size: 14px; }
.bag-total b { font: 400 22px/1 var(--serif); }
.checkout { width: 100%; justify-content: center; margin-top: 10px; min-height: 50px; }
.checkout:disabled { opacity: .45; cursor: not-allowed; }
.bag-foot .fine { display: block; margin-top: 12px; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 30; margin: 0; padding: 12px 18px; border-radius: 999px; background: var(--ink); color: var(--cream); font-size: 14px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- tablet / phone ---------- */
@media (max-width: 900px) {
  .nav a:not(.nav-shop) { display: none; }
  .products { grid-template-columns: 1fr; max-width: 460px; }
  .visit { grid-template-columns: 1fr; padding: 100px var(--side) 90px; }
}
@media (max-width: 700px) {
  :root { --top-h: 96px; }
  .concept-bar { font-size: 10.5px; padding: 6px 14px; }
  .bar { gap: 12px; padding: 12px var(--side); }
  .logo { font-size: 18px; }
  .nav-shop { min-height: 38px; padding: 0 14px; font-size: 13px; }
  .mxs-step, .mxs-step:nth-child(n) { grid-template-columns: 1fr; }
  .mxs-step .still, .mxs-step:nth-child(n) .still { grid-column: 1; grid-row: auto; margin-bottom: 8px; }
  .mxs-step > :not(.still), .mxs-step:nth-child(n) > :not(.still) { grid-column: 1; }
  .notes { grid-template-columns: 1fr; }
  .shop { padding: 90px var(--side); }
}
/* the film on tall screens: picture sits in the upper half (see the 9:16 frames), copy sits below it */
@media (max-aspect-ratio: 9/10) {
  .film .mxs-step { left: var(--side); right: var(--side); top: auto; bottom: max(92px, 11svh); width: auto; transform: none; }
  .film h1 { font-size: clamp(42px, 12vw, 76px); margin-bottom: 14px; }
  .film h2 { font-size: clamp(36px, 10.5vw, 64px); margin-bottom: 12px; }
  .film .lede { font-size: 15px; }
  .film .notes { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; margin-top: 16px; }
  .film .notes li { padding: 10px; font-size: 11.5px; }
  .film .notes b { font-size: 12.5px; }
  .film .actions { margin-top: 18px; }
  .film .mxs-watch { bottom: 24px; }
  .film .scroll-cue { bottom: 24px; }
}
@media (max-aspect-ratio: 9/10) and (max-height: 700px) {
  .film .step-hero .lede, .film #pour .lede { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
