/* ─────────────────────────────────────────────
   MIDNIGHT ROAST CO. — design system
   "The Apple of coffee" — minimal, cinematic, warm
   ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --espresso:   #0E0B09;
  --roast:      #171210;
  --cream:      #F4ECE0;
  --crema:      #C99A6A;
  --crema-soft: #E0B98A;
  --muted:      rgba(244,236,224,0.56);
  --dim:        rgba(244,236,224,0.34);
  --line:       rgba(244,236,224,0.10);
  --sand:       #EFE7DA;
  --ink:        #1A1411;
  --ink-muted:  rgba(26,20,17,0.62);
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", ui-monospace, "Cascadia Code", monospace;
}

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--espresso); color: var(--cream);
  font-family: var(--font); line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
img, video { display: block; max-width: 100%; }
a { color: inherit; }

/* ─── NAV ─── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 200;
  height: 80px; display: flex; align-items: center; gap: 28px;
  padding: 0 28px;
  background: transparent;
  transition: background .45s ease, backdrop-filter .45s ease, border-color .45s ease;
  border-bottom: 0.5px solid transparent;
}
nav.scrolled {
  background: rgba(14,11,9,0.72);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  border-bottom: 0.5px solid var(--line);
}
.nav-logo {
  font-size: 16px; font-weight: 600; letter-spacing: -0.01em;
  color: var(--cream); text-decoration: none; flex-shrink: 0;
  display: inline-flex; align-items: center; gap: 9px;
}
.nav-logo .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--crema); display: inline-block; }
.nav-links { list-style: none; display: flex; gap: 26px; margin-left: auto; }
.nav-links a {
  font-size: 13px; color: var(--muted); text-decoration: none; letter-spacing: 0.01em;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--cream); }
.nav-cta {
  flex-shrink: 0; font-size: 13px; font-weight: 500; letter-spacing: 0.01em;
  padding: 8px 18px; border-radius: 980px; text-decoration: none;
  background: var(--crema); color: #1a120b;
  transition: transform .2s, background .2s;
}
.nav-cta:hover { background: var(--crema-soft); transform: translateY(-1px); }
.nav-burger { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; margin-left: auto; }
.nav-burger span { width: 22px; height: 1.5px; background: var(--cream); display: block; }

/* ─── HERO (wheel-lock scrub) ─── */
.hero-wrap { height: 100svh; position: relative; overflow: hidden; }
.hero-sticky { position: absolute; inset: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.hero-video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; background: #000; }
.hero-veil { position: absolute; inset: 0; background:
  radial-gradient(ellipse 90% 70% at 50% 40%, transparent 40%, rgba(14,11,9,0.55) 100%),
  linear-gradient(to bottom, rgba(14,11,9,0.35) 0%, transparent 30%, transparent 60%, rgba(14,11,9,0.85) 100%); }
.hero-progress { position: absolute; bottom: 0; left: 0; height: 2px; width: 0%; z-index: 10;
  background: linear-gradient(90deg, transparent, var(--crema), transparent); transition: width .06s linear; }
.hero-content {
  position: relative; z-index: 5; text-align: center; padding: 0 24px; max-width: 860px;
  display: flex; flex-direction: column; align-items: center;
  transition: opacity .05s, transform .05s;
}
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 0.26em; text-transform: uppercase; color: var(--crema); }
.hero-content h1 {
  font-size: clamp(44px, 8vw, 104px); font-weight: 600; letter-spacing: -0.03em; line-height: 0.98;
  margin: 18px 0 0;
}
.hero-content .lead { font-size: clamp(16px, 2.2vw, 21px); color: var(--muted); max-width: 520px; margin: 20px auto 0; }
.hero-cta-row { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 34px; }

/* ─── BUTTONS ─── */
.btn { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 500;
  padding: 13px 26px; border-radius: 980px; text-decoration: none; transition: all .22s; cursor: pointer; border: none; white-space: nowrap; }
.btn-fill { background: var(--crema); color: #1a120b; }
.btn-fill:hover { background: var(--crema-soft); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--cream); border: 1px solid var(--line); }
.btn-ghost:hover { border-color: var(--crema); color: var(--crema); }
.btn-ink { background: var(--ink); color: var(--cream); }
.btn-ink:hover { background: #000; }

/* ─── SECTIONS ─── */
.section { padding: clamp(84px, 13vh, 168px) 24px; position: relative; }
.section--sand { background: var(--sand); color: var(--ink); }
.section--roast { background: var(--roast); }
.wrap { max-width: 1120px; margin: 0 auto; }
.measure { max-width: 680px; }
.center { text-align: center; margin-left: auto; margin-right: auto; }
.display { font-size: clamp(34px, 5.5vw, 76px); font-weight: 600; letter-spacing: -0.03em; line-height: 1.02; }
.display em { font-style: normal; color: var(--crema); }
.lead { font-size: clamp(16px, 1.6vw, 20px); line-height: 1.65; color: var(--muted); }
.section--sand .lead { color: var(--ink-muted); }
.section--sand .eyebrow { color: #9a6b3c; }

/* feature row: text + media */
.feature { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 88px); align-items: center; }
.feature.reverse .feature-media { order: -1; }
.feature-copy h2 { margin: 14px 0 18px; }
.feature-copy .lead { margin-bottom: 26px; }

.media {
  position: relative; aspect-ratio: 4/5; border-radius: 22px; overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 20%, rgba(201,154,106,0.20), transparent 60%),
    linear-gradient(155deg, #241a14 0%, var(--espresso) 100%);
  box-shadow: 0 30px 80px rgba(0,0,0,0.45);
}
.media.wide { aspect-ratio: 16/10; }
.feature-media .media { aspect-ratio: 3 / 2; }
.media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-tag { position: absolute; left: 18px; bottom: 16px; z-index: 2; font-family: var(--mono);
  font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: rgba(255,255,255,0.5); }

/* two-up cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.card {
  background: var(--roast); border: 0.5px solid var(--line); border-radius: 22px; overflow: hidden;
  display: flex; flex-direction: column;
}
.card .media { border-radius: 0; box-shadow: none; aspect-ratio: 16/11; }
.card-body { padding: 30px 30px 34px; }
.card-body h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin-bottom: 8px; }
.card-body p { font-size: 14.5px; color: var(--muted); line-height: 1.6; }

/* ─── PAGE HERO (interior pages) ─── */
.page-hero { padding: 168px 24px 64px; text-align: center; border-bottom: 0.5px solid var(--line); }
.page-hero h1 { font-size: clamp(40px, 7vw, 92px); font-weight: 600; letter-spacing: -0.03em; line-height: 1; margin: 16px 0 0; }
.page-hero .lead { margin: 22px auto 0; max-width: 560px; }
.soon { display: inline-block; margin-top: 30px; font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--crema); border: 1px solid var(--line); border-radius: 980px; padding: 8px 16px; }

/* ─── REVEAL ─── */
.reveal { opacity: 0; transform: translateY(18px); will-change: opacity, transform;
  transition: opacity 1.1s cubic-bezier(.22,.61,.36,1), transform 1.1s cubic-bezier(.22,.61,.36,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal.d1 { transition-delay: .12s; } .reveal.d2 { transition-delay: .24s; } .reveal.d3 { transition-delay: .36s; }
/* images fade in on load (class added by effects.js) so they don't pop */
.media img.imgfade, .prod-img img.imgfade { opacity: 0; transition: opacity .7s ease; }
.media img.imgfade.loaded, .prod-img img.imgfade.loaded { opacity: 1; }

/* ─── BRAND FOOTER ─── */
.site-footer { background: var(--roast); border-top: 0.5px solid var(--line); padding: 72px 28px 40px; }
.foot-grid { max-width: 1120px; margin: 0 auto; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 40px; }
.foot-brand .nav-logo { font-size: 18px; }
.foot-brand p { color: var(--muted); font-size: 13.5px; margin-top: 14px; max-width: 280px; line-height: 1.6; }
.foot-col h4 { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--dim); margin-bottom: 16px; }
.foot-col a { display: block; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 11px; transition: color .2s; }
.foot-col a:hover { color: var(--cream); }
.foot-copy { max-width: 1120px; margin: 48px auto 0; padding-top: 22px; border-top: 0.5px solid var(--line);
  font-size: 12px; color: var(--dim); text-align: center; }

/* ─── PUBLICOVER MEDIA CREDIT ─── */
.pm-credit { background: #0a0807; border-top: 0.5px solid var(--line); padding: 26px 28px;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
.pm-credit .back-link { font-size: 12px; letter-spacing: 0.06em; color: rgba(255,255,255,0.95); text-decoration: none; transition: color .2s; }
.pm-credit .back-link:hover { color: #fff; }
.pm-credit .pm-logo-link { display: flex; align-items: center; justify-content: center; }
.pm-credit .pm-logo-link img { height: 44px; width: auto; filter: brightness(0) invert(1); opacity: 0.95; }
.pm-credit > div:last-child { text-align: right; }

/* ─── RESPONSIVE ─── */
@media (max-width: 860px) {
  .nav-links, .nav-cta { display: none; }
  .nav-burger { display: flex; }
  .feature { grid-template-columns: 1fr; gap: 32px; }
  .feature.reverse .feature-media { order: 0; }
  .duo { grid-template-columns: 1fr; }
  /* Brand sits full-width on its own row; link columns line up evenly below */
  .foot-grid { grid-template-columns: repeat(3, 1fr); gap: 30px 18px; text-align: center; justify-items: center; }
  .foot-brand { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; }
  .foot-brand p { max-width: 420px; }
  .pm-credit { grid-template-columns: 1fr auto 1fr; gap: 12px; }
}
@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* ─── SHOP ─── */
.shop-hero { position: relative; height: 72vh; min-height: 520px; display: flex; align-items: flex-end; justify-content: center; overflow: hidden; }
.shop-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shop-hero .shop-hero-in { position: relative; z-index: 2; text-align: center; padding: 0 24px 72px; }
.prod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.prod { background: var(--roast); border: 0.5px solid var(--line); border-radius: 20px; overflow: hidden; transition: border-color .25s, transform .25s; }
.prod:hover { border-color: rgba(201,154,106,0.42); transform: translateY(-3px); }
.prod-img { position: relative; aspect-ratio: 1/1; overflow: hidden; background: linear-gradient(155deg,#241a14,#0E0B09); }
.prod-img img { width: 100%; height: 100%; object-fit: cover; }
.prod-body { padding: 20px 22px 24px; }
.prod-name { font-size: 17px; font-weight: 600; letter-spacing: -0.01em; }
.prod-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.prod-row { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; }
.prod-price { font-size: 15px; font-weight: 600; color: var(--cream); }
.prod-add { font-size: 12px; font-weight: 600; padding: 8px 16px; border-radius: 980px; background: var(--crema); color: #1a120b; text-decoration: none; transition: background .2s; }
.prod-add:hover { background: var(--crema-soft); }
@media (max-width: 860px) { .prod-grid { grid-template-columns: 1fr 1fr; } .shop-hero { height: 56vh; min-height: 380px; } }
@media (max-width: 560px) { .prod-grid { grid-template-columns: 1fr; } }

/* ─── PAGE HERO with image ─── */
.page-hero--img { position: relative; min-height: 70vh; display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 64px; border-bottom: none; overflow: hidden; }
.page-hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.page-hero--img .hero-veil { position: absolute; inset: 0; }
.page-hero-in { position: relative; z-index: 2; text-align: center; }

/* ─── BRAND LOGO (image) ─── */
.nav-logo img { height: 60px; width: auto; display: block; }
.foot-brand .nav-logo img { height: 96px; }

/* ─── SUBSCRIPTIONS CAROUSEL (auto-scroll) ─── */
.sub-carousel { overflow: hidden;
  -webkit-mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
          mask: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent); }
.sub-track { display: flex; gap: 16px; width: max-content; animation: subScroll 46s linear infinite; }
.sub-track:hover { animation-play-state: paused; }
.sub-track img { flex: 0 0 auto; width: min(560px, 82vw); aspect-ratio: 16/9; object-fit: cover;
  border-radius: 18px; box-shadow: 0 20px 60px rgba(0,0,0,0.4); }
@keyframes subScroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .sub-track { animation: none; } }

/* ─── MOBILE MENU (overlay) ─── */
.mobile-menu { position: fixed; inset: 0; z-index: 300; background: var(--espresso);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  transform: translateY(-100%); opacity: 0; visibility: hidden;
  transition: transform .42s cubic-bezier(.16,1,.3,1), opacity .42s ease, visibility .42s; }
.mobile-menu.open { transform: translateY(0); opacity: 1; visibility: visible; }
.mobile-menu a { font-size: 30px; font-weight: 600; letter-spacing: -0.02em; color: var(--cream); text-decoration: none; padding: 11px; }
.mobile-menu a:hover, .mobile-menu a[aria-current="page"] { color: var(--crema); }
.mobile-menu .mm-cta { margin-top: 20px; font-size: 15px; font-weight: 500; padding: 13px 30px; border-radius: 980px; background: var(--crema); color: #1a120b; }
.mobile-menu-close { position: absolute; top: 20px; right: 24px; background: none; border: none; color: var(--cream); font-size: 30px; line-height: 1; cursor: pointer; }

/* ─── FACTS / STATS ROW ─── */
.facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line);
  border: 0.5px solid var(--line); border-radius: 20px; overflow: hidden; }
.fact { background: var(--espresso); padding: 44px 28px; text-align: center; }
.section--sand .facts { background: rgba(26,20,17,0.12); border-color: rgba(26,20,17,0.12); }
.section--sand .fact { background: var(--sand); }
.fact-n { font-size: clamp(34px,5vw,58px); font-weight: 600; letter-spacing: -0.03em; color: var(--crema); display: block; line-height: 1; }
.fact-l { font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }
.section--sand .fact-l { color: var(--ink-muted); }

/* ─── VALUES (3-up) ─── */
.tri { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.tri-num { font-family: var(--mono); font-size: 12px; letter-spacing: 0.12em; color: var(--crema); }
.tri-item h3 { font-size: 22px; font-weight: 600; letter-spacing: -0.01em; margin: 14px 0 8px; }
.tri-item p { font-size: 14.5px; color: var(--muted); line-height: 1.62; }

/* ─── LOCATION DETAILS ─── */
.loc-meta { list-style: none; margin: 26px 0 30px; display: flex; flex-direction: column; gap: 16px; }
.loc-meta li { display: flex; gap: 16px; align-items: baseline; }
.loc-meta .k { font-family: var(--mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crema); min-width: 92px; flex-shrink: 0; }
.loc-meta .v { font-size: 15.5px; color: var(--cream); }

/* ─── CHIP LIST (coming soon) ─── */
.chips { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.chip { font-size: 14px; color: var(--muted); border: 1px solid var(--line); border-radius: 980px; padding: 11px 20px; }
.chip.soon-chip { color: var(--dim); }
.chip.open-chip { color: var(--crema); border-color: rgba(201,154,106,0.4); }

@media (max-width: 860px) { .facts, .tri { grid-template-columns: 1fr; } }

/* second solid CTA (cream) — distinct from the caramel btn-fill */
.btn-cream { background: var(--cream); color: var(--ink); }
.btn-cream:hover { background: #fff; transform: translateY(-1px); }

/* ─── ARTICLE GRID (Journal) ─── */
.article-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.card.link { text-decoration: none; }
.card.link:hover { border-color: rgba(201,154,106,0.4); }
.card .media img { transition: transform .6s cubic-bezier(.16,1,.3,1); }
.card.link:hover .media img { transform: scale(1.04); }
.card-cat { font-family: var(--mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--crema); display: block; margin-bottom: 9px; }
.card-date { font-size: 12px; color: var(--dim); margin-top: 14px; }
@media (max-width: 860px) { .article-grid { grid-template-columns: 1fr; } }

/* ─── INQUIRY FORM (Wholesale) ─── */
.form { max-width: 560px; margin: 0 auto; display: grid; gap: 14px; text-align: left; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form input, .form textarea { width: 100%; background: var(--roast); border: 0.5px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--cream); font-family: var(--font); font-size: 15px; resize: vertical; }
.form input::placeholder, .form textarea::placeholder { color: var(--dim); }
.form input:focus, .form textarea:focus { outline: none; border-color: rgba(201,154,106,0.55); }
.section--sand .form input, .section--sand .form textarea { background: #fff; border-color: rgba(26,20,17,0.14); color: #14100D; }
.section--sand .form input::placeholder, .section--sand .form textarea::placeholder { color: rgba(20,16,13,0.55); }
.form button { justify-self: center; margin-top: 6px; }
@media (max-width: 560px) { .form .row { grid-template-columns: 1fr; } }

/* ─── ACCESSIBILITY: reduced motion ─── */
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
