/* ==========================================================================
   Maison Clair Soir: come in from the cold. Tokens and rules live in DESIGN.md.
   Scenes are real photographs plus light (glows, vignettes, a floor shadow);
   nothing real is drawn in CSS (CONVENTIONS.md §9).
   ========================================================================== */

:root {
  --soot: #1d1714;
  --soot-deep: #15100d;
  --hearth-room: #221914;
  --ember: #c4531f;
  --ember-deep: #a8441a;
  --ember-dark: #8a3713;
  --amber: #f2a650;
  --linen: #f3eadc;
  --linen-2: #e7d9c3;
  --pine: #1e3529;
  --pine-deep: #152820;
  --cranberry: #8a2f3a;
  --ink: #2b211b;
  --ink-soft: #5e4f43;
  --on-dark: #f3eadc;
  --on-dark-soft: rgb(243 234 220 / 0.78);

  --serif: "Brygada 1918", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(20px, 5vw, 88px);
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: 72px; /* anchors land below the fixed masthead */
  background: var(--soot);
  color-scheme: dark;
  accent-color: var(--ember);
  scrollbar-color: #5a4537 var(--soot-deep);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

body {
  margin: 0;
  background: var(--soot);
  color: var(--on-dark);
  font-family: var(--sans);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: rgb(242 166 80 / 0.38);
  color: inherit;
}

/* Paper grain, static */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 80;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .45 0 0 0 0 .38 0 0 0 0 .3 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

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

h1,
h2,
h3,
p,
ul,
figure {
  margin: 0;
}

h1,
h2,
h3 {
  text-wrap: balance;
}

p,
li {
  text-wrap: pretty;
}

ul {
  padding: 0;
  list-style: none;
}

button,
input {
  font: inherit;
  color: inherit;
}

input {
  caret-color: var(--ember-deep);
}

a {
  color: inherit;
  text-underline-offset: 0.22em;
}

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

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--linen);
  color: var(--ink);
  transform: translateY(-160%);
}

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

/* Hero line reveal (JS adds these only when motion is allowed) */
.is-pending {
  opacity: 0;
}

.line-mask {
  display: block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}

.line-inner {
  display: block;
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  border: 0;
  border-radius: 999px;
  background: var(--linen);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 10px 24px -14px rgb(0 0 0 / 0.7);
  transition:
    background-color 0.25s,
    transform 0.4s var(--ease);
}

.button:hover {
  background: #fff7ec;
}

.button:active {
  transform: translateY(1px);
}

.button--order {
  background: var(--ember-deep);
  color: var(--linen);
  box-shadow: 0 12px 26px -16px rgb(60 20 5 / 0.8);
}

.button--order:hover:not(:disabled) {
  background: var(--ember-dark);
}

.button--order:disabled {
  background: transparent;
  color: var(--ink-soft);
  box-shadow: none;
  padding-inline: 0;
  justify-content: flex-start;
  cursor: not-allowed;
}

.button--ghost {
  background: none;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px rgb(43 33 27 / 0.35);
}

.button--ghost:hover {
  background: rgb(43 33 27 / 0.06);
}

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */

.masthead {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 14px var(--gutter);
  /* Solid from the first pixel: over the bright tree a transparent bar lost its links */
  background: var(--soot);
  box-shadow: 0 1px 0 rgb(243 234 220 / 0.08);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.55rem;
  letter-spacing: 0.02em;
  line-height: 1;
  text-decoration: none;
}

.wordmark__logo {
  width: 34px;
  height: 34px;
  border-radius: 8px;
}

.masthead .wordmark {
  margin-right: auto;
}

.masthead__nav {
  display: none;
  gap: 26px;
}

.masthead__nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--on-dark-soft);
  text-decoration: none;
  font-size: 0.9375rem;
  transition: color 0.2s;
}

.masthead__nav svg {
  flex: none;
}

.masthead__nav a:hover {
  color: var(--on-dark);
}

.lang {
  position: relative;
  flex: none;
}

.lang__trigger {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  list-style: none;
  border-radius: 999px;
  color: var(--on-dark);
  cursor: pointer;
}

.lang__trigger::-webkit-details-marker {
  display: none;
}

.lang__trigger:hover,
.lang[open] .lang__trigger {
  background: rgb(243 234 220 / 0.1);
}

.lang__options {
  position: absolute;
  inset: calc(100% + 8px) 0 auto auto;
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgb(243 234 220 / 0.25);
  border-radius: 10px;
  background: var(--soot);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.3);
}

.lang button {
  min-height: 44px;
  padding-inline: 16px;
  border: 0;
  border-radius: 5px;
  background: none;
  color: var(--on-dark-soft);
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: start;
  cursor: pointer;
}

.lang button:hover {
  color: var(--on-dark);
}

.lang button[aria-pressed="true"] {
  background: var(--linen);
  color: var(--ink);
}

@media (min-width: 760px) {
  .masthead__nav {
    display: flex;
  }
}

/* --------------------------------------------------------------------------
   Scenes: a photograph, a floor shadow, the product and its fire light
   -------------------------------------------------------------------------- */

.scene {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--soot-deep);
}

.scene__bg {
  position: absolute;
  inset: -8% 0;
  width: 100%;
  height: 116%;
  max-width: none;
  object-fit: cover;
  will-change: transform;
}

/* A real scene photo (CONFIG.scenes) replaces background + product */
.scene__photo {
  position: absolute;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.scene.has-photo .scene__bg,
.scene.has-photo .scene__product,
.scene.has-photo .scene__floor,
.scene.has-photo .glow {
  display: none;
}

.scene__floor {
  position: absolute;
  inset: auto 0 0;
  height: 34%;
  z-index: 1;
  background: linear-gradient(180deg, transparent 0%, rgb(16 11 8 / 0.82) 38%, #120d0a 100%);
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background: radial-gradient(120% 95% at 55% 50%, transparent 50%, rgb(10 7 5 / 0.65) 100%);
}

.glow {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  will-change: opacity;
}

.glow__flicker {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(242 140 60 / 0.5),
    rgb(232 110 40 / 0.2) 45%,
    transparent 100%
  );
  animation: flicker 5.3s ease-in-out infinite;
}

@keyframes flicker {
  0%,
  100% {
    opacity: 0.82;
    transform: scale(1);
  }
  18% {
    opacity: 1;
    transform: scale(1.03);
  }
  31% {
    opacity: 0.88;
  }
  47% {
    opacity: 0.97;
    transform: scale(0.985);
  }
  63% {
    opacity: 0.8;
  }
  78% {
    opacity: 1;
    transform: scale(1.02);
  }
}

.scene__product {
  position: absolute;
  z-index: 2;
  will-change: transform;
}

.scene__product img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 26px 30px rgb(0 0 0 / 0.6));
}

/* Contact shadow where the product meets the surface */
.scene__product::after {
  content: "";
  position: absolute;
  left: 6%;
  right: 6%;
  bottom: -3%;
  height: 8%;
  z-index: -1;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(0 0 0 / 0.75), transparent);
}

.snow {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  position: relative;
  overflow-x: clip;
  min-height: max(660px, 100svh);
  display: grid;
  align-items: end;
  background: var(--hearth-room);
}

.scene--hero {
  position: absolute;
  inset: 0;
}

/* Carry the room tone under the trio without fading the products. */
.scene--hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  background:
    radial-gradient(ellipse 27% 9% at 66% 91%, rgb(242 140 60 / 0.12), transparent),
    linear-gradient(180deg, transparent 70%, var(--hearth-room)),
    linear-gradient(90deg, rgb(18 12 9 / 0.88), rgb(18 12 9 / 0.55) 34%, transparent 62%);
}

.scene--hero .scene__bg {
  object-position: 70% 40%;
}

/* Keep the three fires at their relative sizes. */
.scene--hero .scene__product {
  --trio-clearance: 5.25rem;
  z-index: 5; /* above the edge darkening, so the names stay readable */
  right: 5%;
  bottom: calc(max(9%, var(--trio-clearance)) + 3.75rem);
  width: min(54vw, 900px);
  aspect-ratio: 2.25;
}

.hero-trio .trio__item {
  position: absolute;
  bottom: 0;
  display: block;
  text-decoration: none;
}

.hero-trio img {
  display: block;
  width: 100%;
  height: auto;
}

.trio__name {
  position: absolute;
  top: calc(100% + 14px);
  left: 50%;
  transform: translateX(-50%);
  white-space: nowrap;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(0.9rem, 0.75rem + 0.5vw, 1.25rem);
  color: var(--on-dark);
  text-shadow: 0 1px 14px rgb(0 0 0 / 0.85);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s;
}

.trio__item:hover .trio__name,
.trio__item:focus-visible .trio__name {
  border-color: var(--amber);
}

.hero-trio .trio__item--hearth {
  left: 21%;
  width: 52%;
  z-index: 1;
}

.hero-trio .trio__item--moon,
.hero-trio .trio__item--lantern {
  bottom: -8%;
}

.hero-trio .trio__item--moon {
  right: 7%;
  width: 30%;
  z-index: 2;
}

.hero-trio .trio__item--lantern {
  left: 10%;
  width: 21%;
  z-index: 3;
}

.scene--hero .glow {
  right: 0;
  bottom: 0;
  width: min(60vw, 980px);
  aspect-ratio: 1.3;
  transform: translate(4%, 22%);
}

.garland {
  position: absolute;
  inset: 0 0 auto;
  z-index: 6;
  height: 80px;
  pointer-events: none;
}

.garland svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

/* Below the masthead (72px), so the bulbs stay visible when the bar turns solid */
.garland--hero {
  top: 80px;
}

.bulb-glow {
  position: absolute;
  width: 38px;
  height: 38px;
  margin: -19px 0 0 -19px;
  border-radius: 50%;
  background: radial-gradient(
    closest-side,
    rgb(255 214 150 / 0.75),
    rgb(242 166 80 / 0.25) 45%,
    transparent 100%
  );
  will-change: opacity;
  animation: twinkle var(--d, 5s) ease-in-out var(--w, 0s) infinite;
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.55;
  }
  45% {
    opacity: 1;
  }
  70% {
    opacity: 0.8;
  }
}

.hero__copy {
  position: relative;
  z-index: 7;
  display: grid;
  justify-items: start;
  gap: 18px;
  max-width: 40rem;
  padding: 0 var(--gutter) clamp(48px, 9svh, 96px);
}

.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.9rem, 1.6rem + 5vw, 6rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
}

.hero__copy .button {
  margin-top: 8px;
}

@media (max-width: 899px) {
  .hero {
    display: block;
    min-height: 0;
    background: linear-gradient(180deg, var(--soot-deep) calc(100% - 56px), var(--hearth-room));
  }

  .scene--hero {
    position: relative;
    height: max(460px, 66svh);
  }

  .scene--hero::after {
    background:
      radial-gradient(ellipse 44% 12% at 48% 88%, rgb(242 140 60 / 0.12), transparent),
      linear-gradient(180deg, transparent 74%, var(--soot-deep));
  }

  .scene--hero .scene__bg {
    object-position: 82% 40%;
  }

  .scene--hero .scene__product {
    left: 4%;
    right: 4%;
    bottom: max(13%, var(--trio-clearance));
    width: auto;
  }

  .scene--hero .glow {
    left: -20%;
    right: -20%;
    width: auto;
    bottom: -10%;
    transform: none;
  }

  .hero__copy {
    margin-top: -12px;
    padding-bottom: 56px;
  }
}

/* --------------------------------------------------------------------------
   Product sections: all at night, scenes run to the section edge
   -------------------------------------------------------------------------- */

.product {
  position: relative;
  display: grid;
  overflow-x: clip;
  background: var(--soot);
  color: var(--on-dark);
}

.product--hearth {
  background: var(--hearth-room);
}

.product--lantern {
  background: var(--soot-deep);
}

.product--moon {
  background: var(--pine-deep);
}

.product:not(.product--hearth)::before,
.assure::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: clamp(72px, 12vw, 160px);
  z-index: 5;
  pointer-events: none;
  background: linear-gradient(180deg, var(--prev, transparent), transparent);
}

.product--lantern {
  --prev: var(--hearth-room);
}

.product--moon {
  --prev: var(--soot-deep);
}

.product__copy {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 22px;
  max-width: 36rem;
  padding: clamp(56px, 9vw, 120px) var(--gutter);
}

.product__more {
  display: grid;
  justify-items: start;
  gap: 22px;
}

.product__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.8rem + 3.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.product__feel {
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 1.05rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}

.product__facts {
  display: grid;
  gap: 10px;
  margin: 6px 0 10px;
}

.product__facts li {
  position: relative;
  padding-left: 22px;
  color: var(--on-dark-soft);
}

.product__facts li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 10px;
  height: 1px;
  background: var(--amber);
}

.product__media {
  position: relative;
}

.product .scene {
  height: 100%;
  min-height: min(110vw, 620px);
  -webkit-mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
  mask-image: linear-gradient(180deg, #000 82%, transparent 100%);
}

/* The Hearth stands on the photographed table, presents to its left */
.product--hearth .product__media {
  --hearth-mask: linear-gradient(
    180deg,
    transparent var(--reveal-edge, 0%),
    #000 calc(var(--reveal-edge, 0%) + clamp(64px, 9vw, 128px))
  );
  -webkit-mask-image: var(--hearth-mask);
  mask-image: var(--hearth-mask);
}

.scene--hearth .scene__bg {
  object-position: 8% 50%;
}

.scene--hearth .scene__floor {
  height: 20%;
}

.scene--hearth .scene__product {
  right: 3%;
  bottom: 12%;
  width: min(68%, 560px);
}

.scene--hearth .glow {
  right: -8%;
  width: 92%;
  top: 22%;
  bottom: -8%;
}

.scene--cabin .scene__bg {
  object-position: 50% 30%;
}

/* The lantern stands on the snow line of the photograph, not in the air */
.scene--cabin .scene__floor {
  height: 18%;
}

.scene--cabin .scene__product {
  bottom: 10%;
  width: min(30%, 240px);
  margin-inline: 0;
  left: 16%;
  right: auto;
}

/* Off-centre, clear of the brightest treetop behind the handle */
.scene--cabin .glow {
  left: -8%;
  right: 30%;
  top: 22%;
  bottom: -6%;
}

/* The candle photo is a macro: soften it so it reads as depth behind the fire, not as an
   object the fire has to be compared with */
.scene--dinner .scene__bg {
  object-position: 0% 50%;
  filter: blur(3px) brightness(0.88);
}

.scene--dinner .scene__product {
  left: 10%;
  bottom: 12%;
  width: min(40%, 330px);
}

.scene--dinner .glow {
  left: -12%;
  width: 82%;
  top: 18%;
  bottom: -6%;
}

@media (min-width: 900px) {
  .product {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
    align-items: stretch;
  }

  .product--lantern {
    grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  }

  .product--hearth .product__copy {
    padding-top: clamp(56px, 7svh, 96px);
    padding-bottom: clamp(120px, 15svh, 200px);
  }

  .product .scene {
    min-height: min(92svh, 860px);
  }

  /* Feather the inner edge into the copy column: no box edge */
  /* ...and the bottom edge into the next section: both fades, intersected */
  .product--lantern .scene {
    -webkit-mask-image:
      linear-gradient(90deg, #000 78%, transparent 100%),
      linear-gradient(180deg, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(90deg, #000 78%, transparent 100%),
      linear-gradient(180deg, #000 84%, transparent 100%);
    mask-composite: intersect;
  }

  .product--hearth .scene,
  .product--moon .scene {
    -webkit-mask-image:
      linear-gradient(270deg, #000 80%, transparent 100%),
      linear-gradient(180deg, #000 84%, transparent 100%);
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(270deg, #000 80%, transparent 100%),
      linear-gradient(180deg, #000 84%, transparent 100%);
    mask-composite: intersect;
  }

  .scene--dinner .scene__product {
    left: 18%;
  }
}

@media (max-width: 899px) {
  /* Every section opens with its picture on phones */
  .product--hearth .product__media,
  .product--moon .product__media {
    order: -1;
  }

  .product--hearth .product__copy {
    padding-top: 40px;
  }
}

/* --------------------------------------------------------------------------
   Reassurance: one calm paragraph
   -------------------------------------------------------------------------- */

.assure {
  --prev: var(--pine-deep);
  position: relative;
  background: var(--soot);
  padding: clamp(56px, 8vw, 96px) var(--gutter);
}

.assure__run {
  max-width: 62rem;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + 0.9vw, 1.85rem);
  line-height: 1.5;
  color: var(--on-dark-soft);
}

.assure__run strong {
  font-weight: 500;
  color: var(--on-dark);
}

/* --------------------------------------------------------------------------
   Shop: the one lit table in the house
   -------------------------------------------------------------------------- */

.shop {
  background: var(--linen);
  color: var(--ink);
  color-scheme: light;
  padding: clamp(72px, 10vw, 128px) var(--gutter) 0;
}

.shop__intro {
  display: grid;
  gap: 16px;
  max-width: 40rem;
  margin-bottom: clamp(32px, 5vw, 56px);
}

.shop__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.6rem, 1.8rem + 3.4vw, 4.75rem);
  line-height: 1;
  letter-spacing: -0.02em;
}

.shop__lede {
  color: var(--ink-soft);
  max-width: 46ch;
}

.shop__body {
  display: grid;
  gap: 8px;
}

.slip {
  border-top: 1px solid rgb(43 33 27 / 0.18);
}

.line {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  grid-template-areas:
    "img text step"
    "img price step";
  align-items: center;
  column-gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid rgb(43 33 27 / 0.18);
  transition: background-color 0.4s;
}

.line__img {
  grid-area: img;
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.line__text {
  grid-area: text;
}

.line__name {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.15;
}

.line__note {
  color: var(--ink-soft);
  font-size: 0.875rem;
  line-height: 1.35;
}

.line__price {
  grid-area: price;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.line.has-qty .line__name::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  vertical-align: middle;
  border-radius: 50%;
  background: var(--ember);
}

.line.is-flash {
  background: rgb(242 166 80 / 0.18);
}

.stepper {
  grid-area: step;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgb(43 33 27 / 0.3);
}

.line.has-qty .stepper {
  box-shadow: inset 0 0 0 1.5px var(--ink);
}

.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: none;
  font-size: 1.15rem;
  cursor: pointer;
}

.stepper button:hover:not(:disabled) {
  background: rgb(43 33 27 / 0.07);
}

.stepper button:disabled {
  color: rgb(43 33 27 / 0.32);
  cursor: default;
}

.stepper input {
  width: 2.4ch;
  height: 44px;
  border: 0;
  background: none;
  text-align: center;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  appearance: textfield;
}

.stepper input::-webkit-outer-spin-button,
.stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop :focus-visible,
.modal :focus-visible {
  outline-color: var(--ember-deep);
}

/* Summary: sticky bottom bar on phones, sticky column on desktop */
.summary {
  position: sticky;
  bottom: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 16px;
  margin: 16px calc(var(--gutter) * -1) 0;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom));
  background: var(--linen);
  box-shadow: 0 -14px 30px -18px rgb(43 33 27 / 0.35);
}

.summary__title {
  display: none;
}

.summary__status {
  grid-column: 1 / -1;
  font-size: 0.875rem;
  color: var(--ink);
}

.summary__status:empty {
  display: none;
}

.summary__line {
  display: grid;
  font-variant-numeric: tabular-nums;
}

.summary__count {
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.summary__total strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.45rem;
  margin-left: 6px;
}

.summary .button--order {
  grid-row: span 2;
  grid-column: 2;
}

.summary__hint,
.summary__note {
  grid-column: 1;
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.summary__note {
  display: none;
}

.summary.is-ready .summary__hint {
  display: none;
}

@media (min-width: 640px) {
  .line {
    grid-template-columns: 88px minmax(0, 1fr) 7rem auto;
    grid-template-areas: "img text price step";
    padding: 20px 0;
  }

  .line__img {
    width: 88px;
    height: 76px;
  }

  .line__name {
    font-size: 1.4rem;
  }

  .line__note {
    font-size: 0.9375rem;
  }

  .line__price {
    text-align: right;
  }
}

@media (min-width: 1000px) {
  .shop__body {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    column-gap: clamp(40px, 5vw, 88px);
    align-items: start;
    padding-bottom: clamp(72px, 10vw, 128px);
  }

  .summary {
    top: 100px;
    bottom: auto;
    margin: 0;
    padding: 4px 0 0 clamp(24px, 3vw, 40px);
    grid-template-columns: none;
    gap: 14px;
    background: none;
    box-shadow: inset 1px 0 0 rgb(43 33 27 / 0.18);
  }

  .summary__title {
    display: block;
    font-family: var(--serif);
    font-weight: 500;
    font-size: 1.5rem;
  }

  .summary__line {
    gap: 6px;
  }

  .summary__total strong {
    font-size: 2rem;
  }

  .summary .button--order {
    grid-row: auto;
    grid-column: auto;
    width: 100%;
    min-height: 58px;
    font-size: 1.0625rem;
  }

  .summary__hint,
  .summary__note {
    grid-column: auto;
  }

  .summary__note {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   Footer: compact, legal links open modals
   -------------------------------------------------------------------------- */

.footer {
  display: grid;
  gap: 14px;
  padding: 28px var(--gutter) calc(28px + env(safe-area-inset-bottom));
  background: var(--pine-deep);
  color: var(--on-dark-soft);
  font-size: 0.8125rem;
}

.footer__brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 14px;
}

.footer .wordmark {
  font-size: 1.25rem;
  color: var(--on-dark);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
}

.footer__legal button {
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--on-dark-soft);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-decoration-color: rgb(243 234 220 / 0.3);
  text-underline-offset: 4px;
  cursor: pointer;
}

.footer__rights {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer__legal button:hover {
  color: var(--on-dark);
  text-decoration-color: currentColor;
}

@media (min-width: 1000px) {
  .footer {
    grid-template-columns: auto 1fr auto;
    align-items: center;
    column-gap: 40px;
  }

  .footer__legal {
    justify-content: center;
  }
}

/* --------------------------------------------------------------------------
   Fixed "Choose your lamp"
   -------------------------------------------------------------------------- */

.fab {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 60;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 24px 0 20px;
  border-radius: 999px;
  background: var(--soot);
  color: var(--on-dark);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  box-shadow:
    inset 0 0 0 1px rgb(242 166 80 / 0.45),
    0 14px 30px -12px rgb(0 0 0 / 0.65);
  transform: translate3d(-50%, 0, 0);
  transition:
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease),
    visibility 0s linear 0s;
}

.fab__flame {
  width: 14px;
  height: 18px;
  fill: var(--amber);
}

.fab:hover {
  background: #2c221d;
}

.fab.is-hidden {
  opacity: 0;
  visibility: hidden;
  transform: translate3d(-50%, 14px, 0);
  transition:
    opacity 0.3s var(--ease),
    transform 0.35s var(--ease),
    visibility 0s linear 0.35s;
}

@media (min-width: 900px) {
  .fab {
    left: auto;
    right: var(--gutter);
    bottom: 28px;
    transform: none;
  }

  .fab.is-hidden {
    transform: translate3d(0, 14px, 0);
  }
}

/* Sticky bottom button — centered on mobile, hidden on desktop (FAB covers it) */
.fab-sticky {
  position: fixed;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 55;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  max-width: 280px;
  min-height: 52px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--soot);
  color: var(--on-dark);
  font-weight: 600;
  font-size: 0.9375rem;
  white-space: nowrap;
  box-shadow:
    inset 0 0 0 1px rgb(242 166 80 / 0.45),
    0 14px 30px -12px rgb(0 0 0 / 0.65);
  transform: translate3d(-50%, 0, 0);
  transition:
    opacity 0.35s var(--ease),
    transform 0.45s var(--ease),
    visibility 0s linear 0s;
}

.fab-sticky__flame {
  width: 14px;
  height: 18px;
  fill: var(--amber);
  flex-shrink: 0;
}

.fab-sticky:hover {
  background: #2c221d;
}

.fab-sticky.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(-50%, 14px, 0);
  transition:
    opacity 0.3s var(--ease),
    transform 0.35s var(--ease),
    visibility 0s linear 0.35s;
}

@media (min-width: 900px) {
  .fab-sticky {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Modals (order summary, legal)
   -------------------------------------------------------------------------- */

.modal {
  width: min(520px, calc(100vw - 32px));
  max-height: calc(100svh - 32px);
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: var(--linen);
  color: var(--ink);
  color-scheme: light;
  box-shadow: 0 30px 80px -20px rgb(0 0 0 / 0.7);
}

.modal::backdrop {
  background: rgb(14 10 8 / 0.72);
}

.modal__inner {
  display: grid;
  gap: 16px;
  padding: clamp(24px, 5vw, 40px);
}

.modal__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.4rem);
  line-height: 1.05;
}

.modal__note,
.modal__body,
.modal__fallback {
  color: var(--ink-soft);
  font-size: 0.9375rem;
  line-height: 1.7;
}

.modal__body {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* Legal modal content — structured for readability */
.modal__body.legal-body {
  font-size: 0.875rem;
  line-height: 1.75;
}

.modal__body.legal-body p {
  margin: 0 0 1em;
}

.modal__body.legal-body p:last-child {
  margin-bottom: 0;
}

/* Section headings (numbered: "1. Title") */
.modal__body.legal-body p:has(strong:first-child) {
  margin-top: 1.75em;
  margin-bottom: 0.5em;
  padding-top: 0.75em;
  border-top: 1px solid rgb(43 33 27 / 0.12);
}

.modal__body.legal-body p:first-child:has(strong:first-child) {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
}

/* Strong text at start of paragraph = section heading */
.modal__body.legal-body strong:first-child {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.05em;
  color: var(--ink);
  display: inline-block;
  margin-bottom: 0.25em;
}

/* Lists */
.modal__body.legal-body ul,
.modal__body.legal-body ol {
  margin: 0.5em 0 1em 1.5em;
  padding: 0;
}

.modal__body.legal-body li {
  margin: 0.35em 0;
  line-height: 1.7;
}

.modal__body.legal-body ul {
  list-style: disc;
}

.modal__body.legal-body ol {
  list-style: decimal;
}

/* Tables (privacy policy) */
.modal__body.legal-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
  font-size: 0.875em;
}

.modal__body.legal-body th,
.modal__body.legal-body td {
  border: 1px solid rgb(43 33 27 / 0.18);
  padding: 0.5em 0.75em;
  text-align: left;
  vertical-align: top;
}

.modal__body.legal-body th {
  background: rgb(43 33 27 / 0.05);
  font-weight: 600;
  color: var(--ink);
}

.modal__body.legal-body tr:nth-child(even) td {
  background: rgb(43 33 27 / 0.03);
}

/* Horizontal rules as section dividers */
.modal__body.legal-body hr {
  border: none;
  border-top: 1px solid rgb(43 33 27 / 0.15);
  margin: 1.5em 0;
}

.modal__fallback a {
  color: var(--ink);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.modal__status {
  font-size: 0.9375rem;
  color: var(--ink);
}

.modal__status:empty {
  display: none;
}

.modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 6px;
}

.modal__close {
  justify-self: start;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
}

.modal__close:hover {
  color: var(--ink);
}

.confirm__list {
  border-top: 1px solid rgb(43 33 27 / 0.16);
}

.confirm__list li {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgb(43 33 27 / 0.16);
  font-variant-numeric: tabular-nums;
}

.confirm__list .qty {
  margin-right: 8px;
  color: var(--ink-soft);
}

.confirm__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.confirm__total strong {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 1.6rem;
}

/* --------------------------------------------------------------------------
   Reduced motion: steady lights and fire; JS skips snow and parallax
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .glow__flicker,
  .bulb-glow {
    animation: none;
  }

  .bulb-glow {
    opacity: 0.85;
  }

  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
  }
}
