@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400..700;1,9..144,400..600&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

:root,
body.coffee {
  /* Override inline variables with high-contrast Yorkshire Roastery palette */
  --bg: #f6efe2 !important;
  --bg-elevated: #fbf8f1;
  --bg-subtle: #ebe1cf;
  --bg-espresso: #1e1815;
  --bg-roast: #2a211d;
  --ink: #1e1916 !important;
  --ink-muted: #52473f;
  --ink-on-dark: #f7f1e5;
  --ink-on-dark-muted: #d5c8b8;
  --accent: #9e3b1e !important;
  --accent-hover: #7d2c14;
  --accent-soft: #f2dfd7;
  --brass: #8a6236;
  --border: #d8cbb8;
  --border-strong: #8c7b6b;
  --focus: #1e1916;
  
  --font-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-pill: 999px;
  
  --shadow-sm: 0 2px 8px rgba(30, 25, 22, 0.05);
  --shadow-md: 0 12px 32px rgba(30, 25, 22, 0.08);
  --shadow-lg: 0 24px 64px rgba(30, 25, 22, 0.22);
  
  --container: 1280px;
  --gutter: clamp(1.125rem, 4vw, 3rem);
}

/* ==========================================================================
   BASE & ACCESSIBILITY SAFEGUARDS
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
  background-color: var(--bg);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body.coffee {
  margin: 0;
  padding: 0;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 15% 10%, rgba(158, 59, 30, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 40%, rgba(138, 98, 54, 0.05) 0%, transparent 50%);
}

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

/* Typography Hierarchy */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  color: var(--ink);
  margin: 0 0 1rem 0;
  font-variation-settings: "SOFT" 50, "WONK" 1;
}

h1 {
  font-size: clamp(2.4rem, 5vw, 4.25rem);
}

h1 em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent);
}

h2 {
  font-size: clamp(1.85rem, 3.5vw, 2.85rem);
}

h3 {
  font-size: clamp(1.25rem, 2vw, 1.55rem);
  line-height: 1.25;
}

p {
  margin: 0 0 1.25rem 0;
  max-width: 65ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: currentColor;
}

.small, .fine {
  font-size: 0.875rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

a {
  color: var(--ink);
  text-underline-offset: 0.25em;
  text-decoration-thickness: 1.5px;
  transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

a:hover {
  color: var(--accent);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* ==========================================================================
   TOP NOTICE BAR & HEADER
   ========================================================================== */
.notice {
  background-color: var(--bg-espresso);
  color: var(--ink-on-dark);
  text-align: center;
  padding: 0.65rem var(--gutter);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem var(--gutter);
  background-color: rgba(246, 239, 226, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

header .brand {
  font-family: var(--font-display);
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

header nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem clamp(0.75rem, 2vw, 1.75rem);
}

header nav a {
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.5rem 0.4rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-bottom: 2px solid transparent;
}

header nav a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ==========================================================================
   BUTTONS, CONTROLS & INPUTS (3:1 border/bg & 44px targets)
   ========================================================================== */
button,
.button,
.secondary,
select,
input[type="text"],
input[type="email"],
input:not([type]) {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  min-height: 46px;
  border-radius: var(--radius-pill);
}

button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  font-weight: 600;
  background-color: var(--accent);
  color: #ffffff;
  border: 2px solid var(--accent);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

button:hover:not(:disabled),
.button:hover {
  background-color: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

button:active:not(:disabled),
.button:active {
  transform: translateY(0);
}

button:disabled {
  background-color: var(--bg-subtle);
  color: var(--ink-muted);
  border-color: var(--border-strong);
  cursor: not-allowed;
  opacity: 0.75;
  transform: none;
  box-shadow: none;
}

/* Secondary & Outline buttons */
.secondary,
button.back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.7rem 1.35rem;
  font-weight: 600;
  background-color: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.secondary:hover,
button.back:hover:not(:disabled) {
  background-color: var(--ink);
  color: var(--bg-elevated);
  border-color: var(--ink);
}

/* Shortlist Header Button */
.basketButton {
  background-color: var(--bg-espresso);
  border-color: var(--bg-espresso);
  color: var(--ink-on-dark);
  padding: 0.55rem 1.1rem;
  font-size: 0.9rem;
}

.basketButton:hover:not(:disabled) {
  background-color: var(--accent);
  border-color: var(--accent);
}

.basketButton #count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 0.4rem;
  border-radius: var(--radius-pill);
  background-color: var(--accent);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  margin-left: 0.25rem;
}

.basketButton:hover #count {
  background-color: var(--bg-espresso);
}

/* Form Controls */
label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.5rem;
}

select,
input[name="name"],
input[name="email"],
input[name="token"] {
  display: block;
  width: 100%;
  margin-top: 0.4rem;
  padding: 0.65rem 1rem;
  background-color: #ffffff;
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  appearance: none;
}

select {
  padding-right: 2.5rem;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%),
                    linear-gradient(135deg, var(--ink) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 12px) center;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  cursor: pointer;
}

select:hover,
input:hover {
  border-color: var(--ink);
}

/* ==========================================================================
   HERO SECTION & PRINCIPLES RIBBON
   ========================================================================== */
main {
  display: block;
}

.hero {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(2rem, 5vw, 4.5rem) var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.hero .copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.hero .copy > p {
  font-size: clamp(1.05rem, 1.4vw, 1.2rem);
  color: var(--ink-muted);
  margin-bottom: 1.75rem;
}

.hero .copy .button {
  margin-right: 0.75rem;
  margin-bottom: 0.75rem;
}

.hero .copy .secondary {
  margin-bottom: 0.75rem;
}

.hero .hero-note {
  font-size: 0.85rem;
  color: var(--ink-muted);
  margin-top: 0.75rem;
  margin-bottom: 0;
  padding-left: 0.75rem;
  border-left: 2px solid var(--accent);
}

.hero > img {
  width: 100%;
  height: clamp(300px, 46vw, 540px);
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  background-color: var(--bg-subtle);
}

/* Principles Bar */
.principles {
  background-color: var(--bg-roast);
  color: var(--ink-on-dark);
  padding: 1.15rem var(--gutter);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.85rem clamp(1.5rem, 5vw, 4.5rem);
  text-align: center;
}

.principles span {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}

.principles span::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #e58c6e;
}

/* ==========================================================================
   SHARED SECTION LAYOUT
   ========================================================================== */
.section {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3.25rem, 6vw, 6rem) var(--gutter);
  border-bottom: 1px solid var(--border);
}

.sectionhead {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem 3rem;
  align-items: end;
  margin-bottom: clamp(2rem, 4vw, 3.25rem);
}

.sectionhead p {
  margin: 0;
  color: var(--ink-muted);
  font-size: 1.05rem;
}

/* ==========================================================================
   INTERACTIVE COFFEE QUIZ
   ========================================================================== */
.section.quiz {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: stretch;
  background-color: var(--bg-elevated);
  border-radius: var(--radius-lg);
  margin-top: clamp(2rem, 4vw, 3.5rem);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.quiz-progress {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.45rem 0.9rem;
  background-color: var(--bg-subtle);
  border-radius: var(--radius-pill);
  font-size: 0.825rem;
  font-weight: 700;
  margin: 0.5rem 0 1.5rem 0;
  border: 1px solid var(--border-strong);
}

.quiz-progress #stepLabel {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.quiz-progress #stepName {
  color: var(--ink);
  padding-left: 0.75rem;
  border-left: 1.5px solid var(--border-strong);
}

#quizPanel {
  margin-bottom: 1.25rem;
}

#quizPanel h3 {
  margin-bottom: 1.15rem;
}

.choices {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

.choices button {
  width: 100%;
  justify-content: space-between;
  text-align: left;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background-color: #ffffff;
  color: var(--ink);
  border: 2px solid var(--border-strong);
  font-size: 1rem;
  font-weight: 600;
}

.choices button::after {
  content: "";
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  transition: all 0.2s ease;
}

.choices button:hover {
  border-color: var(--accent);
  background-color: var(--accent-soft);
  color: var(--ink);
}

.choices button[aria-pressed="true"] {
  background-color: var(--bg-espresso);
  color: var(--ink-on-dark);
  border-color: var(--bg-espresso);
}

.choices button[aria-pressed="true"]::after {
  background-color: #e58c6e;
  border-color: #e58c6e;
  box-shadow: inset 0 0 0 3px var(--bg-espresso);
}

/* Match Result Panel */
.match-card {
  background-color: var(--bg-espresso);
  color: var(--ink-on-dark);
  padding: clamp(1.75rem, 3.5vw, 2.75rem);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.match-card .eyebrow {
  color: #e58c6e;
}

.match-card h3 {
  color: var(--ink-on-dark);
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 1rem;
}

#quizResult {
  font-size: 1.05rem;
  color: var(--ink-on-dark-muted);
  padding: 1.25rem;
  background-color: rgba(255, 255, 255, 0.05);
  border-left: 3px solid #e58c6e;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
}

.match-card #matchAdd {
  width: 100%;
  margin-bottom: 0.75rem;
  background-color: #d95f3b;
  border-color: #d95f3b;
  color: #ffffff;
}

.match-card #matchAdd:hover {
  background-color: #c04a27;
  border-color: #c04a27;
}

.match-card .secondary {
  width: 100%;
  color: var(--ink-on-dark);
  border-color: rgba(247, 241, 229, 0.65);
  margin-bottom: 1.25rem;
}

.match-card .secondary:hover {
  background-color: var(--ink-on-dark);
  color: var(--bg-espresso);
  border-color: var(--ink-on-dark);
}

.match-card .small {
  color: var(--ink-on-dark-muted);
  margin-bottom: 0;
  font-size: 0.8rem;
}

/* ==========================================================================
   PRODUCT COLLECTION CARDS (Contain Images, Never Crop)
   ========================================================================== */
.products {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(1.5rem, 2.5vw, 2.25rem);
}

.product {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.product:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.product .visual {
  background: radial-gradient(circle at 50% 45%, #fbf8f2 0%, #eadfcd 100%);
  border-radius: var(--radius-sm);
  padding: 1.25rem 1rem 0.75rem;
  margin-bottom: 1.25rem;
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.product .pack-photo {
  width: 100%;
  height: 220px;
  object-fit: contain;
  object-position: center;
  margin-bottom: 0.75rem;
  filter: drop-shadow(0 10px 16px rgba(30, 25, 22, 0.12));
}

.product .visual small {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-muted);
  background-color: rgba(255, 255, 255, 0.75);
  padding: 0.25rem 0.6rem;
  border-radius: var(--radius-pill);
}

.product .eyebrow {
  margin-bottom: 0.4rem;
}

.product h3 {
  margin-bottom: 0.6rem;
}

.product > p {
  font-size: 0.95rem;
  color: var(--ink-muted);
  margin-bottom: 0.9rem;
}

.product > p.small {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink);
  background-color: var(--bg-subtle);
  padding: 0.45rem 0.75rem;
  border-radius: var(--radius-sm);
  margin-top: auto;
  margin-bottom: 1.1rem;
}

.product label {
  margin-bottom: 1rem;
}

.product button[data-add] {
  width: 100%;
  margin-bottom: 0.6rem;
}

.product .product-detail-open {
  width: 100%;
}

#added {
  margin-top: 1.5rem;
  font-weight: 600;
  color: var(--accent);
  min-height: 1.5em;
}

/* ==========================================================================
   STORY, GUIDES, INVITE BANNER, FAQ & PRIVACY
   ========================================================================== */
.section.story {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(2rem, 4vw, 4rem);
  align-items: center;
}

.section.story img {
  width: 100%;
  height: clamp(280px, 38vw, 460px);
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

/* Brew Guides Grid */
.guides {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
  counter-reset: guide-counter;
}

.guides article {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.75rem;
  position: relative;
  counter-increment: guide-counter;
}

.guides article::before {
  content: "0" counter(guide-counter);
  display: inline-block;
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  background-color: var(--accent-soft);
  padding: 0.25rem 0.7rem;
  border-radius: var(--radius-pill);
  margin-bottom: 1rem;
}

.guides article p {
  margin-bottom: 0;
  color: var(--ink-muted);
}

/* Invite CTA Banner */
.section.invite {
  background-color: var(--bg-espresso);
  color: var(--ink-on-dark);
  border-radius: var(--radius-lg);
  padding: clamp(2.25rem, 5vw, 4rem);
  margin: clamp(2rem, 4vw, 3.5rem) auto;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.section.invite .eyebrow {
  color: #e58c6e;
}

.section.invite h2 {
  color: var(--ink-on-dark);
  margin-bottom: 0.6rem;
}

.section.invite p {
  color: var(--ink-on-dark-muted);
  margin-bottom: 0;
}

.section.invite button {
  background-color: #d95f3b;
  border-color: #d95f3b;
  color: #ffffff;
  padding: 0.9rem 1.85rem;
  font-size: 1rem;
  flex-shrink: 0;
}

.section.invite button:hover {
  background-color: #c04a27;
  border-color: #c04a27;
}

/* Details / Accordion FAQ */
details {
  background-color: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 0.85rem;
  overflow: hidden;
}

summary {
  padding: 1.15rem 1.35rem;
  font-weight: 700;
  font-size: 1.05rem;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 48px;
}

summary::-webkit-details-marker {
  display: none;
}

summary::after {
  content: "+";
  font-size: 1.35rem;
  font-weight: 500;
  color: var(--accent);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background-color: var(--accent-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

details[open] summary {
  border-bottom: 1px solid var(--border);
}

details[open] summary::after {
  content: "−";
}

details > p,
details > form {
  padding: 1.25rem 1.35rem;
  margin: 0;
  color: var(--ink-muted);
}

/* Privacy Section */
#privacy {
  background-color: var(--bg-elevated);
  border-radius: var(--radius-lg);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  border: 1px solid var(--border);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
  background-color: var(--bg-espresso);
  color: var(--ink-on-dark-muted);
  padding: clamp(3rem, 5vw, 4.5rem) var(--gutter);
  display: grid;
  grid-template-columns: 1fr;
  gap: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

footer > div {
  max-width: var(--container);
  width: 100%;
  margin: 0 auto;
}

footer b {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--ink-on-dark);
}

footer a {
  color: var(--ink-on-dark);
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.25rem 0.35rem;
}

footer a:hover {
  color: #e58c6e;
}

footer details {
  background-color: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--ink-on-dark);
  padding: 0.75rem 1.15rem;
  margin-bottom: 1rem;
}

footer details summary {
  padding: 0.4rem 0;
  color: var(--ink-on-dark);
  border-bottom: none;
}

footer details[open] summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
  margin-bottom: 0.5rem;
}

footer details summary::after {
  background-color: rgba(255, 255, 255, 0.12);
  color: #e58c6e;
}

footer details p {
  padding: 0.5rem 0 0.25rem;
  color: var(--ink-on-dark-muted);
  font-size: 0.875rem;
}

/* ==========================================================================
   DIALOGS / MODALS (Never force closed dialogs open)
   ========================================================================== */
dialog:not([open]) {
  display: none;
}

dialog[open] {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(92vw, 580px);
  max-height: 88vh;
  overflow-y: auto;
  background-color: var(--bg-elevated);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3.5vw, 2.5rem);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
}

dialog#productDetail[open] {
  width: min(92vw, 880px);
}

dialog::backdrop {
  background-color: rgba(22, 18, 15, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

dialog .close {
  position: sticky;
  top: 0;
  float: right;
  width: 44px;
  height: 44px;
  min-height: 44px;
  padding: 0;
  border-radius: 50%;
  background-color: var(--bg-subtle);
  color: var(--ink);
  border: 1.5px solid var(--border-strong);
  font-size: 1.45rem;
  line-height: 1;
  margin-left: 1rem;
  margin-bottom: 0.5rem;
  z-index: 2;
}

dialog .close:hover {
  background-color: var(--ink);
  color: var(--bg-elevated);
  border-color: var(--ink);
}

/* Basket Shortlist Dialog */
#basketRows {
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  margin: 1rem 0;
}

#basketRows > div {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
}

#basketRows > div:last-child {
  border-bottom: none;
}

dialog#basket button:not(.close) {
  width: 100%;
  margin-bottom: 0.65rem;
}

#selectionReview {
  margin: 0.75rem 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--accent);
}

/* Lead & Removal Forms */
#leadForm,
#removeForm {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 1rem;
}

.honeypot {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

label.consent {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-weight: 500;
  font-size: 0.9rem;
  line-height: 1.45;
  background-color: var(--bg-subtle);
  padding: 0.9rem 1rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

label.consent input[type="checkbox"] {
  width: 22px;
  height: 22px;
  min-height: 22px;
  margin: 0.1rem 0 0 0;
  accent-color: var(--accent);
  flex-shrink: 0;
  cursor: pointer;
}

#leadStatus,
#removeStatus {
  font-weight: 600;
  color: var(--accent);
  margin: 0.75rem 0;
}

#receiptDownload {
  width: 100%;
  margin-bottom: 0.5rem;
}

/* Product Detail Modal Layout */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: start;
  clear: both;
}

.detail-grid > div:first-child {
  background: radial-gradient(circle at 50% 45%, #fbf8f2 0%, #eadfcd 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  text-align: center;
}

.detail-grid img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  margin: 0 auto 0.75rem;
  filter: drop-shadow(0 12px 20px rgba(30, 25, 22, 0.14));
}

.product-facts {
  margin: 1.25rem 0;
  border-top: 1px solid var(--border);
}

.product-facts > div {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.product-facts dt {
  font-weight: 700;
  color: var(--ink);
}

.product-facts dd {
  margin: 0;
  color: var(--ink-muted);
  text-align: right;
}

#detailFormat {
  margin-bottom: 1rem;
}

#detailAdd,
#detailJoin {
  width: 100%;
  margin-bottom: 0.65rem;
}

/* ==========================================================================
   RESPONSIVE BREAKPOINTS (390px / 768px / 1440px)
   ========================================================================== */
@media (max-width: 480px) {
  header {
    padding: 0.85rem 1rem;
  }
  header nav {
    width: 100%;
    justify-content: space-between;
    gap: 0.35rem;
  }
  header nav a {
    font-size: 0.85rem;
    padding: 0.4rem 0.25rem;
  }
  .hero .copy .button,
  .hero .copy .secondary {
    width: 100%;
    margin-right: 0;
  }
  .section.quiz,
  .section.invite,
  #privacy {
    border-radius: var(--radius-md);
    margin-left: 0.75rem;
    margin-right: 0.75rem;
  }
}

@media (min-width: 768px) {
  .sectionhead {
    grid-template-columns: 1.1fr 0.9fr;
  }
  .choices {
    grid-template-columns: repeat(3, 1fr);
  }
  .choices button {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    min-height: 96px;
  }
  .products {
    grid-template-columns: repeat(2, 1fr);
  }
  .section.story {
    grid-template-columns: 1fr 1.05fr;
  }
  .guides {
    grid-template-columns: repeat(3, 1fr);
  }
  .section.invite {
    flex-direction: row;
    align-items: center;
    margin-left: var(--gutter);
    margin-right: var(--gutter);
  }
  .detail-grid {
    grid-template-columns: 0.95fr 1.05fr;
  }
  footer {
    grid-template-columns: 1fr 1.25fr;
    align-items: start;
  }
}

@media (min-width: 1080px) {
  .hero {
    grid-template-columns: 1.05fr 0.95fr;
  }
  .section.quiz {
    grid-template-columns: 1.15fr 0.85fr;
    padding: clamp(2.5rem, 4vw, 4rem);
  }
  .products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
