/* ==========================================================================
   AGAIN COFFEE — BRAND LAYER
   Loaded last on every page. Holds the brand-book rules the older layers
   fight with (type, spacing rhythm) and the identity elements: submark,
   brand pattern, marquee band. Tokens live in base.css :root.
   ========================================================================== */

/* ---------- Type: Space Grotesk only, no faux italics, no negative tracking ---------- */
em,
cite,
.italic {
  font-style: normal;
}

h1,
h2,
h3 {
  letter-spacing: 0;
}

/* ==========================================================================
   DESIGN SYSTEM
   One grid, one rhythm, one heading pattern, one button set.
   ========================================================================== */
:root {
  --container: 1280px;
  --gutter: clamp(20px, 5.5vw, 80px);
  --section-y: clamp(88px, 10vw, 152px);
  --radius-md: 16px;
  --radius-lg: 24px;
  --line-on-dark: rgba(255, 255, 255, 0.1);
  --line-on-light: rgba(0, 0, 0, 0.1);
  --muted-on-dark: rgba(255, 255, 255, 0.64);
  --muted-on-light: rgba(0, 0, 0, 0.6);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

.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;
}

/* ---------- Grid + section rhythm ----------
   ID selectors outrank the per-section !important paddings in responsive.css;
   [id="3d-experience"] because an ID starting with a digit is not a valid #selector. */
main #our-coffee,
main #categories,
main #hot-coffee,
main #our-story,
main [id="3d-experience"],
main #brew-guide,
main #film,
main #why-choose-us,
main #reviews,
main #instagram,
main #faq {
  padding: var(--section-y) var(--gutter) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}

main section .max-w-7xl,
main #film .film__inner,
.wrap {
  width: 100%;
  max-width: var(--container) !important;
  margin-inline: auto;
}

/* Dark chapters share one true black; a hairline separates neighbours */
main #categories,
main [id="3d-experience"],
main #brew-guide,
main #film,
main #reviews,
main #faq {
  background: var(--brand-black) !important;
  border: 0 !important;
  border-top: 1px solid var(--line-on-dark) !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

/* Light chapters */
main #our-coffee,
main #hot-coffee {
  background: var(--paper) !important;
  border: 0 !important;
}

main #our-story {
  background: var(--brand-white) !important;
  border: 0 !important;
  border-top: 1px solid var(--line-on-light) !important;
}

/* ---------- Section heading: eyebrow, title, lead (+ optional aside) ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px 64px;
  margin: 0 0 clamp(48px, 6vw, 80px) !important;
  padding: 0 !important;
  border: 0 !important;
}

.section-head__text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 760px;
}

.section-head__aside {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-on-dark);
}

.eyebrow__num {
  color: var(--brand-ember);
  font-weight: 600;
}

.eyebrow__num::after {
  content: "";
  display: inline-block;
  width: 28px;
  height: 1px;
  margin-left: 14px;
  background: currentColor;
  vertical-align: middle;
  opacity: 0.6;
}

main .section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 4.6vw, 4.25rem) !important;
  font-weight: 700 !important;
  line-height: 1.02 !important;
  letter-spacing: 0 !important;
  text-transform: uppercase;
  color: var(--brand-white) !important;
  text-wrap: balance;
}

main .section-lead {
  margin: 0 !important;
  max-width: 56ch;
  font-size: clamp(1rem, 1.15vw, 1.125rem) !important;
  font-weight: 400;
  line-height: 1.65 !important;
  color: var(--muted-on-dark) !important;
}

.on-light .eyebrow {
  color: var(--muted-on-light);
}

main .on-light .section-title,
main .on-light.section-title {
  color: var(--brand-black) !important;
}

main .on-light .section-lead {
  color: var(--muted-on-light) !important;
}

.section-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--muted-on-dark);
}

.section-hint .material-symbols-outlined {
  font-size: 18px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  font-size: 14px;
  font-weight: 500;
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease;
}

.text-link:hover {
  color: var(--brand-ember);
}

/* ---------- Buttons ----------
   White on dark, black on light. Ember stays an accent colour, not a button fill:
   white or black type on Ember fails contrast for small text. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 28px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease;
}

.btn .material-symbols-outlined {
  font-size: 18px;
}

.btn--sm {
  min-height: 44px;
  padding: 0 20px;
  font-size: 12px;
}

.btn--block {
  width: 100%;
}

.btn--primary {
  background: var(--brand-white);
  color: var(--brand-black) !important;
}

.btn--primary:hover {
  background: #E6E6E6;
}

.btn--ghost {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.32);
  color: var(--brand-white) !important;
}

.btn--ghost:hover {
  background: var(--brand-white);
  border-color: var(--brand-white);
  color: var(--brand-black) !important;
}

.on-light .btn--primary {
  background: var(--brand-black);
  color: var(--brand-white) !important;
}

.on-light .btn--primary:hover {
  background: #262626;
}

.on-light .btn--ghost {
  border-color: rgba(0, 0, 0, 0.24);
  color: var(--brand-black) !important;
}

.on-light .btn--ghost:hover {
  background: var(--brand-black);
  color: var(--brand-white) !important;
}

.btn:focus-visible,
.drawer-link:focus-visible,
.text-link:focus-visible {
  outline: 2px solid var(--brand-ember);
  outline-offset: 3px;
}

/* ---------- Mobile drawer (sits above the fixed header) ---------- */
#mobile-menu-drawer {
  z-index: 70 !important;
}

#mobile-menu-panel {
  background: var(--brand-black) !important;
}

.drawer-nav {
  display: flex;
  flex-direction: column;
  padding-top: 12px;
}

.drawer-link {
  display: block;
  width: 100%;
  padding: 18px 0;
  border: 0;
  border-bottom: 1px solid var(--line-on-dark);
  background: none;
  color: var(--brand-white);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.drawer-link:hover {
  color: var(--brand-ember);
}

.drawer-foot {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-top: 24px;
}

.drawer-foot__note {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-align: center;
  color: rgba(255, 255, 255, 0.5);
}

/* Closed off-canvas cart: its drop shadow used to bleed in along the right edge */
#cart-drawer.translate-x-full {
  box-shadow: none !important;
}

/* Closed cart: out of the Tab order too; visibility flips after the slide-out */
#cart-drawer {
  transition: transform 0.3s ease-in-out, visibility 0s linear 0s !important;
}

#cart-drawer.translate-x-full {
  visibility: hidden;
  transition: transform 0.3s ease-in-out, visibility 0s linear 0.3s !important;
}

/* Closed overlays: fully hidden, not just transparent. A full-screen backdrop blur
   at opacity 0 still paints a hairline along the viewport edge. Visibility flips
   after the fade-out so closing stays smooth. */
#mobile-menu-drawer,
#cart-drawer-overlay,
#search-modal,
#film-modal {
  transition: opacity 0.3s ease, visibility 0s linear 0s !important;
}

#mobile-menu-drawer.opacity-0:not(.is-open),
#cart-drawer-overlay.opacity-0,
#search-modal.opacity-0,
#film-modal.opacity-0 {
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s !important;
}

/* ---------- Footer: one closing message on Deep Indigo ---------- */
.again-footer__closing {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px 48px;
  overflow: hidden;
  margin-bottom: clamp(48px, 6vw, 80px);
  padding: clamp(40px, 6vw, 88px);
  border-radius: var(--radius-lg);
  background: var(--brand-indigo);
}

.again-footer__closing-text,
.again-footer__closing-actions {
  position: relative;
  z-index: 1;
}

.again-footer__closing-text {
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 640px;
}

.again-footer .again-footer__closing .again-footer__headline {
  margin: 0;
  font-size: clamp(2.75rem, 6.4vw, 5.5rem);
  line-height: 0.98;
  text-transform: uppercase;
}

.again-footer__closing-lead {
  margin: 0;
  max-width: 46ch;
  font-size: clamp(1rem, 1.2vw, 1.125rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
}

.again-footer__closing-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.eyebrow--on-indigo {
  color: rgba(255, 255, 255, 0.72) !important;
}

.again-footer .again-footer__inner {
  width: 100%;
  max-width: calc(var(--container) + 2 * var(--gutter));
  padding-inline: var(--gutter);
}

.again-footer__grid {
  padding-top: 0 !important;
}

/* Carousel arrows sit on the light #our-coffee section: give them ink, not white-on-white */
main #our-coffee #carousel-prev-btn,
main #our-coffee #carousel-next-btn {
  background: var(--brand-black) !important;
  border-color: var(--brand-black) !important;
  color: var(--brand-white) !important;
}

/* Hot row (home #hot-coffee) sits on paper like #our-coffee: ink arrows */
main #hot-coffee .home-shop__arrow {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--brand-black);
  background: var(--brand-black);
  color: var(--brand-white);
  cursor: pointer;
  transition: background 0.2s ease;
}
main #hot-coffee .home-shop__arrow:hover {
  background: #262626;
}

/* ---------- Product origin labels: quiet, so the accent stays rare ---------- */
.product-origin-label {
  color: rgba(255, 255, 255, 0.55) !important;
}

/* ---------- Marquee band ---------- */
.marquee-band {
  padding-block: clamp(20px, 2.4vw, 28px);
  background: var(--brand-black);
  border-block: 1px solid rgba(255, 255, 255, 0.1);
}

.marquee-word {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 1.8vw, 1.5rem);
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.marquee-mark {
  flex: 0 0 auto;
  width: 14px;
  height: 18px;
  color: var(--brand-ember);
}

/* ---------- Submark watermark on cards ---------- */
.card-submark {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 26px;
  height: 34px;
  color: #FFFFFF;
  opacity: 0.14;
  pointer-events: none;
}

/* ---------- Brand pattern (submark repeat, guidelines p.9–10) ----------
   Quiet by default: it should complement type and packaging, never compete. */
.brand-pattern {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image: url("../assets/logo/pattern-white.svg");
  background-size: 64px auto;
  opacity: 0.07;
}

.brand-pattern--on-indigo {
  opacity: 0.09;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, transparent 35%, #000 85%);
  mask-image: linear-gradient(90deg, transparent 0%, transparent 35%, #000 85%);
}

.brand-pattern--on-light {
  background-image: url("../assets/logo/pattern-black.svg");
  opacity: 0.05;
}

/* ---------- FAQ: good to know before ordering ---------- */
main #faq {
  background: var(--brand-black);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(40px, 6vw, 96px);
  align-items: start;
}

/* Not sticky: the page wrapper's overflow-x:hidden makes sticky offset instead of pin */
.faq-intro {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.faq-intro h2 {
  margin: 0;
}

.faq-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.faq-contact:hover {
  background: #FFFFFF;
  color: #000000;
}

.faq-mark {
  width: 44px;
  height: 58px;
  margin-top: 24px;
  color: var(--brand-ember);
}

.faq-list {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.faq-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.faq-item summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 0;
  color: #FFFFFF;
  font-size: clamp(1.05rem, 1.5vw, 1.25rem);
  font-weight: 600;
  line-height: 1.35;
  list-style: none;
  cursor: pointer;
}

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

.faq-item summary:hover {
  color: var(--brand-ember);
}

.faq-item__icon {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: transform 0.25s ease;
}

.faq-item[open] .faq-item__icon {
  transform: rotate(45deg);
  color: var(--brand-ember);
}

.faq-item p {
  max-width: 60ch;
  margin: 0;
  padding: 0 40px 28px 0;
  color: rgba(255, 255, 255, 0.68);
  font-size: 15px;
  line-height: 1.7;
}

.faq-item p a {
  color: #FFFFFF;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq-item p strong {
  color: #FFFFFF;
  font-weight: 600;
}

@media (max-width: 900px) {
  .faq-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .faq-mark {
    display: none;
  }

  .faq-item p {
    padding-right: 0;
  }
}

/* ==========================================================================
   SECTIONS (phase 3): fewer boxes, hairlines instead of cards, one accent
   ========================================================================== */

/* ---------- Hero: full-screen film, logo + one line + scroll cue ---------- */
/* The header floats over the hero, so main loses its top padding on the home page */
main.has-video-hero {
  padding-top: 0 !important;
}

main #hero.hero-video {
  --hero-track: 0.3em;
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 0 !important;
  margin: 0;
  padding: 0 !important;
  overflow: hidden;
  isolation: isolate;
  background: #050607 !important;
  color: var(--brand-white);
}

.hero-video__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* Landscape screens play the cut with bottom-left captions: crop from the right only so the captions keep their margin */
@media (min-width: 768px) and (orientation: landscape) {
  .hero-video__media {
    object-position: left center;
  }
}

/* Darker toward the bottom plus a light vignette; the film stays the star.
   Two quiet extras keep white type readable on the bright scenes (latte, storefront):
   a soft pool behind the logo and line, and a short band under the clear header. */
.hero-video__shade {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse 34% 26% at 50% 50%, rgba(0, 0, 0, 0.3) 0%, transparent 100%),
    linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0, transparent 140px),
    radial-gradient(ellipse 120% 95% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.32) 100%),
    linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
}

@media (max-width: 767px) {
  .hero-video__shade {
    background:
      radial-gradient(ellipse 60% 22% at 50% 50%, rgba(0, 0, 0, 0.3) 0%, transparent 100%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.3) 0, transparent 110px),
      radial-gradient(ellipse 120% 95% at 50% 45%, transparent 55%, rgba(0, 0, 0, 0.32) 100%),
      linear-gradient(to bottom, transparent 30%, rgba(0, 0, 0, 0.45) 100%);
  }
}

.hero-video__content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding-inline: 16px;
  text-align: center;
  transition: opacity 0.6s ease-out;
}

/* The film's closing logo reveal: ours fades out so the two never overlap (toggled in hero.js) */
main #hero.is-film-logo .hero-video__content {
  opacity: 0;
}

main #hero .hero-video__brand {
  margin: 0;
  line-height: 0;
  opacity: 0;
}

.hero-video__logo {
  display: block;
  width: 220px;
  max-width: 70vw;
  height: auto;
}

/* Wide tracking leaves a trailing gap after the last letter; the matching left padding keeps the line centred */
main #hero .hero-video__tagline {
  margin: 0;
  padding-left: var(--hero-track);
  font-family: var(--font-body);
  font-size: 13px !important;
  font-weight: 400;
  line-height: 1.7 !important;
  letter-spacing: var(--hero-track);
  text-transform: uppercase;
  text-wrap: balance;
  color: rgba(255, 255, 255, 0.8) !important;
  opacity: 0;
}

.hero-video__cue {
  position: absolute;
  left: 50%;
  bottom: calc(32px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 4px 8px;
  transform: translateX(-50%);
  color: var(--brand-white);
  text-decoration: none;
}

.hero-video__mouse {
  display: flex;
  justify-content: center;
  width: 24px;
  height: 40px;
  padding-top: 8px;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
  border-radius: 12px;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.hero-video__dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand-white);
  animation: heroCueDot 1.8s ease-in-out infinite;
}

.hero-video__cue-label {
  padding-left: var(--hero-track);
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: var(--hero-track);
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.7);
  transition: color 0.3s ease;
}

.hero-video__cue:hover .hero-video__mouse,
.hero-video__cue:focus-visible .hero-video__mouse {
  transform: translateY(-3px);
  border-color: var(--brand-white);
}

.hero-video__cue:hover .hero-video__cue-label,
.hero-video__cue:focus-visible .hero-video__cue-label {
  color: var(--brand-white);
}

/* Entrance waits for the brand preloader to open (again-preloader.js sets html.agp-done); hidden until then */
html.agp-done main #hero .hero-video__brand {
  animation: heroLogoIn 0.9s ease-out 0.3s both;
}

html.agp-done main #hero .hero-video__tagline {
  animation: heroFadeIn 0.6s ease-out 0.7s both;
}

html.agp-done .hero-video__logo {
  animation: heroFloat 6s ease-in-out 1.2s infinite;
}

/* The preloader's scroll lock (html.agp-lock) hides the scrollbar. Keep its gutter reserved meanwhile,
   so the page does not shift sideways when the lock lifts and the scrollbar returns. */
html.agp-lock {
  scrollbar-gutter: stable;
}

@keyframes heroLogoIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@keyframes heroCueDot {
  0% { transform: translateY(0); opacity: 0; }
  20% { opacity: 1; }
  70%, 100% { transform: translateY(12px); opacity: 0; }
}

@media (max-width: 767px) {
  .hero-video__content {
    gap: 24px;
  }

  .hero-video__logo {
    width: 160px;
  }
}

@media (prefers-reduced-motion: reduce) {
  main #hero .hero-video__brand,
  main #hero .hero-video__tagline,
  .hero-video__logo,
  .hero-video__dot {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Header over the hero: the same pill, but clear, so the film shows through */
header.fixed > div.is-over-hero,
header.fixed > div.is-over-hero nav {
  background: transparent !important;
  border-color: transparent !important;
  box-shadow: none !important;
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
}

header.fixed > div.is-over-hero nav .nav-link,
header.fixed > div.is-over-hero nav button,
header.fixed > div.is-over-hero #mobile-cart-toggle-btn,
header.fixed > div.is-over-hero #mobile-menu-toggle-btn {
  color: var(--brand-white) !important;
}

header.fixed > div.is-over-hero #mobile-cart-toggle-btn,
header.fixed > div.is-over-hero #mobile-menu-toggle-btn {
  background: transparent !important;
  border-color: rgba(255, 255, 255, 0.4) !important;
}

/* ---------- Shop: the bundle sits under the three packs ---------- */
.bundle-card {
  display: grid;
  grid-template-columns: minmax(0, 320px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
  margin-top: clamp(24px, 3vw, 40px);
  padding: clamp(20px, 2.4vw, 28px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 28px;
  background: #121216;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.bundle-card__media {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 18px;
  background: #EDEDED;
}

.bundle-card__media img {
  position: absolute;
  bottom: 12%;
  width: auto;
  object-fit: contain;
}

.bundle-card__media img:first-child {
  left: 8%;
  height: 58%;
}

.bundle-card__media img:last-child {
  right: 10%;
  height: 78%;
}

/* One studio photo with its own backdrop (The Drop UFO) fills the frame */
.bundle-card__media.bundle-card__media--photo img {
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bundle-card__body {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

main #our-coffee .bundle-card__name {
  margin: 0;
  font-size: clamp(1.25rem, 1.8vw, 1.5rem);
  font-weight: 700 !important;
  text-transform: uppercase;
  color: var(--brand-white) !important;
}

main #our-coffee .bundle-card__desc {
  margin: 0;
  max-width: 44ch;
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.62) !important;
}

.bundle-card__buy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}

.bundle-card__price {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--brand-white);
  white-space: nowrap;
}

.bundle-card__price s {
  margin-left: 6px;
  font-size: 14px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.5);
}

main #our-coffee .bundle-card .btn--primary {
  background: var(--brand-white);
  color: var(--brand-black) !important;
}

main #our-coffee .bundle-card .btn--primary:hover {
  background: #E6E6E6;
}

@media (max-width: 900px) {
  .bundle-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .bundle-card__buy {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* ---------- Story: one large film still, text beside it ---------- */
.story-grid {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(40px, 6vw, 104px);
  align-items: center;
}

.story-media {
  position: relative;
  margin: 0;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand-black);
}

.story-media video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-media__caption {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--brand-white);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.story-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

main #our-story .story-text .section-title {
  font-size: clamp(2rem, 3.4vw, 3.25rem) !important;
}

main #our-story .story-lead {
  margin: 0;
  font-size: clamp(1.125rem, 1.5vw, 1.375rem);
  font-weight: 500;
  line-height: 1.5;
  color: var(--brand-black) !important;
}

main #our-story .story-body {
  margin: 0;
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.7;
  color: var(--muted-on-light) !important;
}

.story-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  width: 100%;
  margin: 8px 0 0;
  border-top: 1px solid var(--line-on-light);
}

.story-facts > div {
  padding: 20px 12px 0 0;
}

.story-facts dt {
  font-size: clamp(1.5rem, 2.2vw, 2rem);
  font-weight: 700;
  line-height: 1.1;
  color: var(--brand-black);
}

.story-facts dd {
  margin: 6px 0 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted-on-light);
}

main #our-story .text-link {
  color: var(--brand-black);
}

main #our-story .text-link:hover {
  color: var(--brand-ember);
}

@media (max-width: 900px) {
  .story-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .story-media {
    aspect-ratio: 4 / 3;
  }
}

/* ---------- Your daily cup: four moments, pack to cup ---------- */
.ritual {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(20px, 2.4vw, 36px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ritual-step {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ritual-step__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 5;
  margin: 0 0 24px;
  border-radius: var(--radius-lg);
  background: #0A0A0A;
}

.ritual-step__media img,
.ritual-step__media video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The clip fades in over its own poster once it is actually playing */
.ritual-step__media video {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}

.ritual-step__media.is-playing video {
  opacity: 1;
}

.ritual-step__num {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ember);
}

.ritual-step__title {
  margin: 0 0 10px;
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 600;
  line-height: 1.3;
  color: var(--brand-white);
}

.ritual-step__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-on-dark);
}

/* Pack facts: one quiet row under the moments */
.pack-specs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px 24px;
  margin: clamp(16px, 2vw, 32px) 0 0;
  padding-top: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--line-on-dark);
}

.pack-specs dt {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.pack-specs dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 6px 0 0;
  font-size: 15px;
  font-weight: 500;
  color: var(--brand-white);
}

@media (max-width: 1023px) {
  .ritual {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 48px;
  }

  .pack-specs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Phones: the moments become a swipeable row, the next card peeking in */
@media (max-width: 639px) {
  .ritual {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    overscroll-behavior-x: contain;
  }

  .ritual::-webkit-scrollbar {
    display: none;
  }

  .ritual-step {
    flex: 0 0 78%;
    scroll-snap-align: start;
  }
}

/* ---------- Brew rituals: four open columns ---------- */
.brew-cols {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-on-dark);
}

.brew-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 32px clamp(20px, 2vw, 32px) 0;
  border-left: 1px solid var(--line-on-dark);
}

.brew-col:first-child {
  padding-left: 0;
  border-left: 0;
}

.brew-col:last-child {
  padding-right: 0;
}

.brew-col__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.brew-col__num {
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-ember);
}

main #brew-guide .brew-col__icon {
  font-size: 28px;
  color: var(--brand-white);
}

.brew-col__kicker {
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

main #brew-guide .brew-col__name {
  margin: 0;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  text-transform: none;
  color: var(--brand-white);
}

main #brew-guide .brew-col__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  color: var(--muted-on-dark);
}

.brew-col__specs {
  display: flex;
  flex-direction: column;
  margin: auto 0 0;
  padding-top: 16px;
}

.brew-col__specs div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line-on-dark);
  font-size: 14px;
}

.brew-col__specs dt {
  color: rgba(255, 255, 255, 0.5);
}

.brew-col__specs dd {
  margin: 0;
  font-weight: 500;
  text-align: right;
  color: var(--brand-white);
}

.brew-col__link {
  display: inline-flex;
  gap: 8px;
  padding: 14px 0 4px;
  border-top: 1px solid var(--line-on-dark);
  font-size: 14px;
  font-weight: 500;
  color: var(--brand-white);
  text-decoration: none;
  transition: color 0.2s ease;
}

.brew-col__link:hover {
  color: var(--brand-ember);
}

@media (max-width: 1023px) {
  .brew-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .brew-col:nth-child(2) {
    padding-right: 0;
  }

  .brew-col:nth-child(3) {
    padding-left: 0;
    border-left: 0;
  }

  .brew-col:nth-child(n + 3) {
    margin-top: 32px;
    border-top: 1px solid var(--line-on-dark);
  }
}

@media (max-width: 639px) {
  .brew-cols {
    grid-template-columns: minmax(0, 1fr);
  }

  .brew-col,
  .brew-col:nth-child(n) {
    padding: 28px 0 0;
    border-left: 0;
  }

  .brew-col + .brew-col {
    margin-top: 32px;
    border-top: 1px solid var(--line-on-dark);
  }
}

/* ---------- Shop by category: image tiles on black ---------- */
main #categories {
  background: var(--brand-black) !important;
  border: 0 !important;
  border-top: 1px solid var(--line-on-dark) !important;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(var(--cat-cols, 4), minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--brand-white);
  text-decoration: none;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.cat-tile:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-4px);
}

.cat-tile:focus-visible {
  outline: 2px solid var(--brand-white);
  outline-offset: 3px;
}

.cat-tile__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #141418;
}

.cat-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.cat-tile:hover .cat-tile__media img {
  transform: scale(1.05);
}

.cat-tile__mark {
  width: 44px;
  height: 58px;
  color: rgba(255, 255, 255, 0.24);
}

.cat-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.cat-tile__num {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted-on-dark);
}

.cat-tile__name {
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 600;
  line-height: 1.25;
}

.cat-tile__desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-on-dark);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cat-tile__count {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--muted-on-dark);
}

.cat-tile__arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--brand-white);
  font-size: 20px;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.cat-tile:hover .cat-tile__arrow {
  background: var(--brand-white);
  color: var(--brand-black);
}

@media (max-width: 1023px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .cat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-tile,
  .cat-tile__media img {
    transition: none;
  }

  .cat-tile:hover,
  .cat-tile:hover .cat-tile__media img {
    transform: none;
  }
}

/* ---------- Why Again: four promises on white ---------- */
main #why-choose-us {
  background: var(--brand-white) !important;
  border-top: 1px solid var(--line-on-light) !important;
}

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

.promise {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 28px;
  border-top: 1px solid var(--brand-black);
}

.promise__mark {
  width: 22px;
  height: 29px;
  margin-bottom: 16px;
  color: var(--brand-black);
}

.promise__label {
  display: flex;
  gap: 10px;
  margin: 0;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-on-light);
}

main #why-choose-us .promise__title {
  margin: 0;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 600;
  line-height: 1.25;
  text-transform: none;
  color: var(--brand-black) !important;
}

main #why-choose-us .promise__desc {
  margin: 0;
  font-size: 15px;
  line-height: 1.65;
  color: var(--muted-on-light) !important;
}

@media (max-width: 1023px) {
  .promise-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    row-gap: 48px;
  }
}

@media (max-width: 639px) {
  .promise-grid {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 40px;
  }
}

/* ---------- Reviews: one featured quote, two beside it ---------- */
.quotes {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(32px, 4vw, 64px);
  align-items: stretch;
}

.quotes__side {
  display: flex;
  flex-direction: column;
  gap: clamp(32px, 4vw, 48px);
}

.quote {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  margin: 0;
  padding-top: 28px;
  border-top: 1px solid var(--line-on-dark);
}

.quote blockquote {
  margin: 0;
}

main #reviews .quote blockquote p {
  margin: 0;
  font-size: clamp(1.0625rem, 1.3vw, 1.25rem);
  font-weight: 400;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.86);
}

main #reviews .quote--featured blockquote p {
  font-size: clamp(1.375rem, 2.2vw, 1.875rem);
  font-weight: 500;
  line-height: 1.3;
  color: var(--brand-white);
}

.quote--featured {
  border-top-color: var(--brand-ember);
}

.quote figcaption {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quote__avatar {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  font-size: 13px;
  font-weight: 600;
  color: var(--brand-white);
}

.quote__who {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
}

.quote__who strong {
  font-size: 15px;
  font-weight: 600;
  color: var(--brand-white);
}

@media (max-width: 900px) {
  .quotes {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* responsive.css pads "#reviews > div > div:last-child" for the old card strip */
main #reviews > div > div.quotes {
  padding: 0 !important;
  gap: clamp(32px, 4vw, 64px) !important;
}

/* ---------- Film: chapter tabs and arrows on one row ---------- */
main #film .film__controls {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center !important;
  gap: 12px !important;
}

main #film .film__nav-arrows {
  display: flex !important;
  flex-direction: row !important;
  gap: 8px !important;
}

main #film .film__tabs {
  min-width: 0;
}

/* ---------- Roast dots (pack specs, product cards) ---------- */
.roast-indicator-5dots {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.roast-indicator-5dots .dot {
  display: block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-ember);
}

.roast-indicator-5dots .dot.outline {
  border: 1px solid var(--brand-ember);
  background: transparent;
}

/* ==========================================================================
   BREWS PAGE (phase 4): same grid, rhythm, headings and accent rules as home.
   brews.html's own <style> loads after this file, so selectors start with main.bz.
   ========================================================================== */
main.bz .wrap,
main.bz .bz-roastfilm .wrap {
  width: 100% !important;
  max-width: calc(var(--container) + 2 * var(--gutter)) !important;
  margin-inline: auto;
  padding-inline: var(--gutter) !important;
}

/* The .wrap carries the gutter; responsive.css also pads every <section> on phones */
main.bz > section {
  padding-inline: 0 !important;
}

/* Flat bands with hairlines instead of overlapping rounded panels */
main.bz > section:not(.bz-hero) {
  margin-top: 0 !important;
  padding-block: var(--section-y) !important;
  border-radius: 0 !important;
  border-top: 1px solid var(--line-on-light);
}

main.bz .bz-studio,
main.bz .bz-taste,
main.bz .bz-faq {
  background: var(--paper) !important;
}

main.bz .bz-roastfilm,
main.bz .bz-water-sec {
  background: var(--brand-white) !important;
  color: var(--brand-black) !important;
}

main.bz .bz-ruler-sec {
  background: var(--brand-black) !important;
  border-top-color: var(--brand-black);
}

/* Hero: ALL CAPS like the home hero, one Ember phrase */
main.bz .bz-hero h1 {
  font-size: clamp(2.75rem, 6vw, 5.5rem) !important;
  line-height: 1 !important;
  text-transform: uppercase;
}

/* Eyebrows: the page styles them Deep Indigo at 11px; match the home system */
main.bz .bz-hero .eyebrow,
main.bz .section-head .eyebrow,
main.bz .bz-faq .eyebrow {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted-on-light);
}

main.bz .bz-ruler-sec .section-head .eyebrow {
  color: var(--muted-on-dark);
}

/* Grind ruler: one accent, on the selected setting only */
main.bz .bz-gcard .um {
  color: rgba(255, 255, 255, 0.6);
}

main.bz .bz-gcard:hover .um,
main.bz .bz-gcard.on .um {
  color: var(--brand-ember);
}

/* Water & freshness: on white, numbers in ink, one Ember rule */
main.bz .bz-water-sec .bz-water-grid {
  border-top: 2px solid var(--brand-ember);
}

main.bz .bz-water-sec .bz-w + .bz-w {
  border-left-color: var(--line-on-light);
}

main.bz .bz-water-sec .bz-w .big {
  font-weight: 700;
  color: var(--brand-black);
}

main.bz .bz-water-sec .bz-w h4 {
  color: var(--brand-black);
}

main.bz .bz-water-sec .bz-w p,
main.bz .bz-water-sec .bz-w small {
  color: var(--muted-on-light);
  opacity: 1;
}

/* Brewing help: same intro rhythm as the home FAQ */
main.bz .bz-faq-grid > div:first-child {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
}

main.bz .bz-faq-grid > div:first-child p {
  margin-top: 0;
}

main.bz .bz-q summary::after {
  color: var(--brand-black);
}

/* ---------- Keyboard focus: one Ember ring everywhere ----------
   Several older rules set outline: none on sliders and the newsletter field. */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
[tabindex]:not([tabindex="-1"]):focus-visible {
  outline: 2px solid var(--brand-ember) !important;
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  padding: 12px 18px;
  border-radius: 999px;
  background: var(--brand-white);
  color: var(--brand-black);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: none;
}

/* ---------- Calmer motion ---------- */
@media (prefers-reduced-motion: reduce) {
  .animate-marquee-runner {
    animation: none !important;
  }
}

/* ---------- Header: the current page (shop, story, about pages set aria-current) ---------- */
header.fixed nav .nav-link[aria-current="page"] {
  background: var(--color-surface-container-high);
  color: var(--brand-white) !important;
}

.drawer-link[aria-current="page"] {
  color: var(--brand-ember);
}

/* Home: product names link to their detail pages without changing the card look */
.card-name-link {
  color: inherit;
  text-decoration: none;
}

.card-name-link:hover {
  color: var(--brand-ember);
}

/* ---------- Footer: page links above the legal line ---------- */
.again-footer__nav {
  padding: 28px 0;
  border-top: 1px solid var(--line-on-dark);
}

.again-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.again-footer__links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.again-footer__links a:hover {
  color: var(--brand-white);
}

/* Legal pages: one quiet row under the page links */
.again-footer__legal {
  padding: 0 0 24px;
}

.again-footer__legal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.again-footer__legal a {
  color: rgba(255, 255, 255, 0.56);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.2s ease;
}

.again-footer__legal a:hover,
.again-footer__form-note a:hover {
  color: var(--brand-white);
}

.again-footer__form-note a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==========================================================================
   INSTAGRAM FEED (#instagram, js/instagram-feed.js)
   White chapter between the dark reviews and FAQ. Tiles are 4:5 like the feed;
   clips play muted while on screen, a click opens the <dialog> viewer.
   ========================================================================== */
main #instagram {
  background: var(--brand-white) !important;
  border-top: 1px solid var(--line-on-light) !important;
}

.ig-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(8px, 1vw, 16px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.ig-grid__item {
  min-width: 0;
}

.ig-grid__item.is-skeleton {
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-md);
  background: var(--paper);
}

.ig-tile {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--paper);
  cursor: pointer;
}

.ig-tile__img,
.ig-tile__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 1.2s var(--ease-out);
}

.ig-tile__video {
  opacity: 0;
  transition: opacity 0.5s var(--ease-out), transform 1.2s var(--ease-out);
}

.ig-tile.is-previewing .ig-tile__video {
  opacity: 1;
}

.ig-tile:hover .ig-tile__img,
.ig-tile:hover .ig-tile__video {
  transform: scale(1.03);
}

/* Small play mark: white on a flat black disc, so it reads on light and dark frames */
.ig-tile__badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--brand-white);
  font-size: 20px;
}

/* Caption shows on hover / keyboard focus over one flat veil (no gradient behind text) */
.ig-tile__caption {
  position: absolute;
  inset: auto 0 0;
  z-index: 1;
  display: -webkit-box;
  overflow: hidden;
  padding: 16px 18px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--brand-white);
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  text-align: left;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out);
}

.ig-tile:hover .ig-tile__caption,
.ig-tile:focus-visible .ig-tile__caption {
  opacity: 1;
  transform: none;
}

.ig-tile:focus-visible {
  outline: 2px solid var(--brand-ember);
  outline-offset: 3px;
}

.ig-feed__fallback {
  margin: 0;
  font-size: 16px;
  color: var(--muted-on-light);
}

@media (max-width: 639px) {
  .ig-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ig-tile__badge {
    top: 8px;
    right: 8px;
    width: 26px;
    height: 26px;
    font-size: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ig-tile__img,
  .ig-tile__video,
  .ig-tile__caption {
    transition: none;
  }

  .ig-tile:hover .ig-tile__img {
    transform: none;
  }
}

/* ---------- Post viewer ---------- */
html.ig-modal-open {
  overflow: hidden;
}

.ig-modal {
  width: min(1040px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 32px);
  margin: auto;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius-lg);
  background: var(--brand-black);
  color: var(--brand-white);
}

.ig-modal::backdrop {
  background: rgba(0, 0, 0, 0.86);
}

.ig-modal__panel {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  max-height: calc(100dvh - 34px);
}

.ig-modal__media {
  position: relative;
  aspect-ratio: 4 / 5;
  max-height: calc(100dvh - 34px);
  background: #0A0A0A;
}

.ig-modal__video,
.ig-modal__img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0A0A0A;
}

.ig-modal__side {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
  padding: clamp(20px, 2.4vw, 32px);
  border-left: 1px solid var(--line-on-dark);
}

.ig-modal__top {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line-on-dark);
}

/* Submark on white: an approved pair, with room around the mark */
.ig-modal__avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--brand-white);
  color: var(--brand-black);
}

.ig-modal__avatar svg {
  width: 14px;
  height: 18px;
}

.ig-modal__title {
  flex: 1 1 auto;
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.ig-modal__handle {
  color: var(--brand-white);
  text-decoration: none;
}

.ig-modal__handle:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.ig-modal__close,
.ig-modal__nav button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: transparent;
  color: var(--brand-white);
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.ig-modal__close:hover,
.ig-modal__nav button:hover {
  background: var(--brand-white);
  color: var(--brand-black);
}

.ig-modal__close .material-symbols-outlined,
.ig-modal__nav .material-symbols-outlined {
  font-size: 20px;
}

.ig-modal__caption {
  flex: 1 1 auto;
  margin: 0;
  overflow-y: auto;
  font-size: 16px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.86);
}

.ig-modal__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 20px;
  border-top: 1px solid var(--line-on-dark);
}

.ig-modal__permalink {
  color: var(--brand-white);
}

.ig-modal__nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ig-modal__count {
  min-width: 44px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  color: var(--muted-on-dark);
}

/* Phones and small tablets: media on top, details below */
@media (max-width: 767px) {
  .ig-modal {
    overflow-y: auto;
  }

  .ig-modal__panel {
    grid-template-columns: minmax(0, 1fr);
    max-height: none;
  }

  .ig-modal__media {
    aspect-ratio: auto;
    height: min(62dvh, 125vw);
  }

  .ig-modal__side {
    border-left: 0;
    border-top: 1px solid var(--line-on-dark);
  }
}

/* ---------- Shop by category: image tiles on black ---------- */
main #categories {
  background: var(--brand-black) !important;
  border: 0 !important;
  border-top: 1px solid var(--line-on-dark) !important;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(var(--cat-cols, 4), minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.cat-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  border: 1px solid var(--line-on-dark);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
  color: var(--brand-white);
  text-decoration: none;
  transition: border-color 0.3s var(--ease-out), transform 0.3s var(--ease-out);
}

.cat-tile:hover {
  border-color: rgba(255, 255, 255, 0.4);
  transform: translateY(-4px);
}

.cat-tile:focus-visible {
  outline: 2px solid var(--brand-white);
  outline-offset: 3px;
}

.cat-tile__media {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #141418;
}

.cat-tile__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}

.cat-tile:hover .cat-tile__media img {
  transform: scale(1.05);
}

.cat-tile__mark {
  width: 44px;
  height: 58px;
  color: rgba(255, 255, 255, 0.24);
}

.cat-tile__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 8px;
  padding: 20px 22px 24px;
}

.cat-tile__num {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--muted-on-dark);
}

.cat-tile__name {
  font-size: clamp(1.125rem, 1.4vw, 1.375rem);
  font-weight: 600;
  line-height: 1.25;
}

.cat-tile__desc {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted-on-dark);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.cat-tile__count {
  margin-top: auto;
  padding-top: 8px;
  font-size: 13px;
  color: var(--muted-on-dark);
}

.cat-tile__arrow {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: var(--brand-white);
  font-size: 20px;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

.cat-tile:hover .cat-tile__arrow {
  background: var(--brand-white);
  color: var(--brand-black);
}

@media (max-width: 1023px) {
  .cat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .cat-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  .cat-tile,
  .cat-tile__media img {
    transition: none;
  }

  .cat-tile:hover,
  .cat-tile:hover .cat-tile__media img {
    transform: none;
  }
}

