:root {
  /* Sunlit Nursery palette (A) — ported from design-mockups.css */
  --paper: #fffdf8;
  --ink: #292820;
  --ink-soft: #655e53;
  --accent: #a63f25;
  --accent-ink: #fff9ee;
  --soft: #fbf1df;
  --line: #dedbd2;
  --sc-canvas: var(--paper);
  --sc-surface: var(--soft);
  --sc-ink: var(--ink);
  --sc-ink-soft: var(--ink-soft);
  --sc-accent: var(--accent);
  --sc-accent-ink: var(--accent-ink);
  --sc-font-display: "Fraunces", Georgia, serif;
  --sc-font-text: "DM Sans", system-ui, sans-serif;
  --lodge-clay: var(--accent);
  --lodge-paper: var(--soft);
  --lodge-paper-ink: var(--ink);
  --lodge-green: var(--accent);
  --lodge-gutter: clamp(1.25rem, 4vw, 4.5rem);
  --lodge-radius: 0.5rem;
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  scroll-padding-top: 1rem;
}
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sc-font-text);
  font-size: 1.05rem;
  line-height: 1.65;
}
button, a { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.3em; }
button:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 5px; }
button:active, a:active { transform: translateY(1px); }
.skip { position: fixed; left: 1rem; top: 1rem; z-index: 100; padding: 0.65rem 0.9rem; background: var(--accent); color: var(--accent-ink); transform: translateY(-180%); transition: transform 160ms ease-out; }
.skip:focus { transform: translateY(0); }

.collection-index {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: 7.4rem;
  padding: 1.35rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  border-right: 1px solid var(--line);
  background: rgba(255,253,248,0.92);
  backdrop-filter: blur(12px);
}
.index-mark { text-decoration: none; text-align: center; line-height: 1; }
.index-mark span { display: block; font-family: var(--sc-font-display); font-size: 2rem; font-weight: 750; color: var(--accent); letter-spacing: -0.05em; }
.index-mark small { display: block; margin-top: 0.35rem; color: var(--ink-soft); font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase; }
.index-links { margin: auto 0; display: flex; flex-direction: column; align-items: center; gap: 2.2rem; }
.index-links a { writing-mode: vertical-rl; transform: rotate(180deg); text-decoration: none; color: var(--ink-soft); font-size: 0.76rem; letter-spacing: 0.08em; text-transform: uppercase; }
.index-links a:hover { color: var(--ink); }
.index-ask { border: 0; border-bottom: 1px solid currentColor; padding: 0.35rem 0; background: transparent; color: var(--accent); cursor: pointer; font-size: 0.8rem; font-weight: 600; }

main { padding-left: 7.4rem; }
.shop-label { margin: 0 0 1rem; color: var(--accent); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
h1, h2 { margin: 0; font-family: var(--sc-font-display); font-weight: 650; letter-spacing: -0.055em; line-height: 0.98; }
h1 em, h2 em { color: var(--accent); font-style: normal; font-weight: 500; }

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  align-items: center;
  background: var(--soft);
}
.hero-copy { position: relative; z-index: 6; width: min(47rem, 52vw); margin-left: var(--lodge-gutter); padding: 8rem 0 10rem; }
.hero h1 { max-width: 12ch; font-size: clamp(3.6rem, 7.2vw, 8.4rem); }
.hero-lede { max-width: 30ch; margin: 2rem 0 1.6rem; font-size: clamp(1.05rem, 1.35vw, 1.35rem); color: var(--ink-soft); }
.text-action { display: inline-flex; gap: 0.8rem; align-items: center; border: 0; border-bottom: 1px solid currentColor; padding: 0.4rem 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; }
.text-action span:last-child { font-size: 1.4rem; transition: transform 180ms ease-out; }
.text-action:hover span:last-child { transform: rotate(35deg); }
.hero-specimen { position: absolute; z-index: 4; right: clamp(-3rem, 2vw, 3rem); bottom: -9rem; width: min(46vw, 41rem); height: 98%; pointer-events: none; }
.hero-specimen > img { width: 100%; height: 100%; object-fit: contain; object-position: center bottom; filter: drop-shadow(0 2.4rem 3rem rgba(41,40,32,0.18)); }
.hero-copy, .hero-specimen { backface-visibility: hidden; }
.concept-note { position: absolute; z-index: 12; right: var(--lodge-gutter); bottom: 1.2rem; margin: 0; color: var(--ink-soft); font-size: 0.72rem; letter-spacing: 0.04em; }

.inventory {
  padding: clamp(6rem, 11vw, 11rem) var(--lodge-gutter);
  background: var(--paper);
}
.inventory-head { display: grid; grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 1.1fr); gap: clamp(2rem, 7vw, 8rem); align-items: end; }
.inventory-head .shop-label { grid-column: 1 / -1; margin-bottom: -1rem; }
.inventory h2 { font-size: clamp(3.3rem, 6vw, 6.6rem); }
.inventory-head > p:last-child { max-width: 38rem; margin: 0 0 0.4rem; color: var(--ink-soft); font-size: 1.12rem; }
.inventory-tools { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-top: 2rem; }
.inventory-tools label { display: grid; gap: 0.45rem; width: min(30rem, 100%); color: var(--ink-soft); font-size: 0.76rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.inventory-tools input { min-height: 3.2rem; border: 1px solid var(--line); border-radius: 0.3rem; padding: 0.8rem 1rem; background: var(--paper); color: var(--ink); font: inherit; }
.inventory-tools p { margin: 0 0 0.8rem; color: var(--ink-soft); font-size: 0.84rem; }
.collection-tabs { display: flex; gap: 0.7rem; margin-top: 1.25rem; }
.collection-tabs button, .inventory-more, .product-open { border: 1px solid var(--line); border-radius: 99rem; padding: 0.72rem 1rem; background: transparent; color: var(--ink); cursor: pointer; font: inherit; font-weight: 600; }
.collection-tabs button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.inventory-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; margin-top: 1.4rem; background: var(--line); border: 1px solid var(--line); }
.inventory-grid[data-count="4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.inventory-empty, .inventory-fallback { grid-column: 1 / -1; margin: 0; padding: clamp(3rem, 8vw, 7rem); background: var(--paper); color: var(--ink-soft); text-align: center; }
.inventory-fallback strong { display: block; margin-bottom: 0.4rem; color: var(--ink); font-family: var(--sc-font-display); font-size: 1.3rem; }
.product-card { min-width: 0; overflow: hidden; background: var(--paper); }
.product-photo { position: relative; aspect-ratio: 4 / 5; overflow: hidden; background: var(--soft); }
.product-photo img { width: 100%; height: 100%; object-fit: cover; }
.product-photo > span { position: absolute; right: 0.7rem; bottom: 0.7rem; border-radius: 99rem; padding: 0.35rem 0.55rem; background: rgba(41,40,32,0.78); color: #fff; font-size: 0.7rem; }
.product-photo .hold-badge { position: absolute; left: 0.7rem; top: 0.7rem; right: auto; bottom: auto; background: var(--accent); color: var(--accent-ink); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.product-body { padding: 1.4rem; }
.product-kicker { display: flex; justify-content: space-between; gap: 1rem; color: var(--accent); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase; overflow-wrap: anywhere; }
.product-card h3 { margin: 0.7rem 0 0.5rem; font-family: var(--sc-font-display); font-size: 2rem; line-height: 1.05; overflow-wrap: anywhere; }
.product-card p { margin: 0.35rem 0 0; color: var(--ink-soft); font-size: 0.92rem; overflow-wrap: anywhere; }
.product-card .product-condition { color: var(--ink); }
.product-card .product-note { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 4; }
.product-open { margin-top: 1rem; }
.product-open:disabled { opacity: 0.6; cursor: not-allowed; }
.inventory-more { display: block; margin: 1.5rem auto 0; }
.inventory-more[hidden] { display: none; }

.skeleton-card { background: var(--paper); }
.skeleton-photo, .skeleton-line { background: linear-gradient(90deg, var(--soft) 25%, var(--line) 37%, var(--soft) 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; border-radius: 0.3rem; }
.skeleton-photo { aspect-ratio: 4 / 5; }
.skeleton-line { height: 0.9rem; margin: 0.9rem 1.4rem 0; }
.skeleton-line + .skeleton-line { width: 65%; }
@keyframes skeleton-shimmer { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }

.care { padding: clamp(6rem, 11vw, 11rem) var(--lodge-gutter); background: var(--soft); color: var(--ink); }
.care-head { display: grid; grid-template-columns: minmax(18rem, 0.9fr) minmax(20rem, 1.1fr); gap: clamp(2rem, 7vw, 8rem); align-items: end; }
.care-head .shop-label { grid-column: 1 / -1; margin-bottom: -1rem; }
.care h2 { font-size: clamp(3.3rem, 6vw, 6.6rem); }
.care-head > p:last-child { max-width: 40rem; margin: 0 0 0.4rem; color: var(--ink-soft); font-size: 1.1rem; }
.care-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; margin-top: clamp(3rem, 7vw, 6rem); border: 1px solid var(--line); background: var(--line); }
.care-grid article { min-width: 0; padding: clamp(1.7rem, 4vw, 3rem); background: var(--paper); }
.care-grid span { color: var(--accent); font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; }
.care-grid h3 { margin: 1rem 0 0.7rem; font-family: var(--sc-font-display); font-size: clamp(2rem, 3vw, 3rem); line-height: 1; overflow-wrap: anywhere; }
.care-grid p, .care-sources { color: var(--ink-soft); }
.care-sources { max-width: 68rem; margin: 1.5rem 0 0; font-size: 0.8rem; }
.care-sources a { color: var(--accent); }

.product-dialog { width: min(70rem, calc(100% - 2rem)); max-height: calc(100svh - 2rem); border: 0; padding: 0; background: var(--paper); color: var(--ink); }
.product-dialog::backdrop { background: rgba(41,40,32,0.55); backdrop-filter: blur(7px); }
.product-dialog .dialog-close { z-index: 3; }
.product-dialog-layout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(18rem, 0.8fr); min-width: 0; }
.product-gallery { min-width: 0; padding: 1rem; background: var(--soft); }
.product-dialog-main { display: block; width: 100%; max-height: 68svh; aspect-ratio: 4 / 5; object-fit: contain; background: var(--paper); }
.product-thumbs { display: flex; gap: 0.6rem; overflow-x: auto; padding-top: 0.7rem; }
.product-thumbs button { flex: 0 0 4.5rem; height: 4.5rem; border: 2px solid transparent; padding: 0; background: var(--paper); cursor: pointer; }
.product-thumbs button[aria-pressed="true"] { border-color: var(--accent); }
.product-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.product-dialog-copy { min-width: 0; padding: clamp(2rem, 5vw, 4rem) clamp(1.4rem, 4vw, 3rem); overflow-wrap: anywhere; }
.product-dialog-copy h2 { font-size: clamp(2.5rem, 5vw, 5rem); }
.product-dialog-copy h3 { margin: 1.5rem 0 0.25rem; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.08em; }
.product-dialog-copy p { color: var(--ink-soft); }
.product-dialog-copy .product-dialog-price { color: var(--accent); font-size: 1.4rem; font-weight: 700; }
.product-dialog-copy .hold-note { color: var(--accent); font-weight: 600; }

.hero-tag { position: absolute; right: 5%; bottom: 27%; z-index: 9; width: 13rem; height: 8rem; border: 0; padding: 0; color: var(--ink); background: transparent; perspective: 1100px; cursor: pointer; pointer-events: auto; transform: rotate(-4deg); }
.tag-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
  padding: 1.25rem 1.35rem;
  backface-visibility: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--lodge-radius);
  box-shadow: 0 1.1rem 2.2rem rgba(41,40,32,0.14), inset 0 1px rgba(255,255,255,0.6);
  transform-style: preserve-3d;
  transition: transform 520ms ease-out;
}
.tag-face::before { content: ""; position: absolute; width: 0.75rem; height: 0.75rem; border-radius: 50%; background: var(--accent); box-shadow: inset 0 0 0 0.22rem var(--soft); top: 0.7rem; left: 0.7rem; }
.tag-face b { color: var(--ink-soft); font-size: 0.67rem; letter-spacing: 0.13em; text-transform: uppercase; }
.tag-face strong { font-family: var(--sc-font-display); font-size: 1.35rem; line-height: 1.05; }
.tag-face small { font-size: 0.72rem; line-height: 1.35; }
.tag-front { transform: rotateY(0deg); }
.tag-back { transform: rotateY(180deg); background: var(--soft); }
.hero-tag.is-flipped .tag-front { transform: rotateY(-180deg); }
.hero-tag.is-flipped .tag-back { transform: rotateY(0deg); }

.bench { background: var(--soft); color: var(--ink); }

.story { display: grid; grid-template-columns: minmax(20rem, 0.92fr) minmax(22rem, 1.08fr); align-items: center; gap: clamp(2rem, 7vw, 8rem); padding: clamp(6rem, 12vw, 12rem) var(--lodge-gutter); background: var(--paper); }
.story-copy { max-width: 42rem; margin-inline: auto; }
.story h2, .shipping h2, .counter h2, .ask-dialog h2 { font-size: clamp(3.3rem, 6vw, 6.6rem); }
.story-copy > p:not(.shop-label) { max-width: 55ch; color: var(--ink-soft); }
.story-signoff { margin-top: 2rem; color: var(--ink) !important; font-family: var(--sc-font-display); font-size: 1.5rem; line-height: 1.35; }
.story-figure { position: relative; margin: 0; overflow: hidden; background: var(--soft); border: 1px solid var(--line); border-radius: 0.75rem; }
.story-figure img { width: 100%; height: 100%; object-fit: contain; }
.story-figure figcaption { position: static; padding: 0.8rem; color: var(--ink-soft); font-size: 0.78rem; letter-spacing: 0.04em; }
.artwork-slot { display: grid; place-items: center; gap: 0.5rem; padding: 3rem 1.5rem; min-height: 16rem; text-align: center; background: var(--soft); border: 1px dashed var(--line); border-radius: 0.75rem; color: var(--ink-soft); }
.artwork-slot strong { font-family: var(--sc-font-display); font-size: 1.4rem; color: var(--ink); }

.shipping { padding: clamp(6rem, 12vw, 12rem) var(--lodge-gutter); background: var(--soft); color: var(--ink); }
.shipping .shop-label { color: var(--accent); }
.shipping h2 em { color: var(--accent); }
.shipping-head { max-width: 58rem; }
.shipping-ledger { margin-top: clamp(3rem, 8vw, 7rem); border-top: 1px solid var(--line); }
.shipping-ledger article { display: grid; grid-template-columns: minmax(4rem, 0.3fr) minmax(18rem, 1.7fr); gap: 2rem; padding: clamp(1.4rem, 3vw, 2.4rem) 0; border-bottom: 1px solid var(--line); }
.shipping-ledger article > span { font-family: var(--sc-font-display); font-size: 2rem; color: var(--accent); }
.shipping-ledger h3 { margin: 0 0 0.4rem; font-family: var(--sc-font-display); font-size: 1.7rem; }
.shipping-ledger p { max-width: 62ch; margin: 0; color: var(--ink-soft); }

.counter { display: flex; flex-direction: column; justify-content: space-between; padding: clamp(7rem, 13vw, 13rem) var(--lodge-gutter) 2rem; background: var(--paper); }
.counter-tag { width: min(53rem, 100%); margin: auto; }
.counter-tag > p:not(.shop-label) { max-width: 37rem; color: var(--ink-soft); font-size: 1.15rem; }
.counter-button { margin: 1.6rem 0 1rem; border: 1px solid var(--accent); border-radius: 99rem; padding: 0.9rem 1.35rem; background: var(--accent); color: var(--accent-ink); font-weight: 700; cursor: pointer; transition: transform 140ms ease-out, background-color 140ms ease-out; }
.counter-button:hover { transform: translateY(-2px); }
.counter-tag small { display: block; max-width: 38rem; color: var(--ink-soft); }
.site-footer { display: flex; justify-content: space-between; gap: 1rem; padding-top: 3rem; margin-top: 6rem; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; }
.site-footer a { color: var(--ink); text-decoration: none; }

.ask-dialog { width: min(44rem, calc(100% - 2rem)); max-height: calc(100svh - 2rem); overflow: auto; border: 1px solid var(--line); border-radius: var(--lodge-radius); padding: clamp(2rem, 6vw, 5rem); background: var(--paper); color: var(--ink); box-shadow: 0 2rem 8rem rgba(41,40,32,0.28); }
.ask-dialog::backdrop { background: rgba(41,40,32,0.5); backdrop-filter: blur(7px); }
.ask-dialog .shop-label { color: var(--accent); }
.ask-dialog h2 { max-width: 10ch; color: var(--ink); }
.ask-dialog > p:not(.shop-label):not(.dialog-note) { max-width: 52ch; }
.dialog-close { position: absolute; top: 1rem; right: 1rem; border: 0; border-bottom: 1px solid currentColor; padding: 0.2rem 0; background: transparent; cursor: pointer; }
.contact-options { margin: 2rem 0; border-top: 1px solid var(--line); }
.contact-options a { display: flex; justify-content: space-between; gap: 2rem; padding: 1rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 700; }
.contact-options span { color: var(--ink-soft); font-size: 0.86rem; font-weight: 500; }
.dialog-note { color: var(--ink-soft); font-size: 0.82rem; }

@media (hover: hover) and (pointer: fine) {
  .contact-options a:hover { color: var(--accent); }
}

@media (max-width: 900px) {
  .collection-index { inset: 0 0 auto; width: 100%; height: 4.7rem; padding: 0.7rem 1rem; flex-direction: row; justify-content: space-between; border-right: 0; border-bottom: 1px solid var(--line); }
  .index-mark { text-align: left; }
  .index-mark span { font-size: 1.45rem; }
  .index-mark small { margin-top: 0.18rem; font-size: 0.57rem; }
  .index-links { margin: 0; flex-direction: row; gap: 1rem; }
  .index-links a { display: none; writing-mode: initial; transform: none; }
  .index-ask { font-size: 0.78rem; }
  main { padding-left: 0; }
  .hero-copy { width: auto; margin: 0; padding: 8rem 1.25rem 0; }
  .hero h1 { max-width: 9ch; font-size: clamp(3.15rem, 15vw, 5.4rem); }
  .hero-lede { max-width: 24ch; margin-top: 1.2rem; }
  .hero-specimen { right: -13%; bottom: -8rem; width: 78vw; height: 70%; }
  .hero-tag { right: 8%; bottom: 24%; width: 10.5rem; height: 7.2rem; }
  .hero-tag .tag-face { padding: 1.1rem; }
  .hero-tag .tag-face strong { font-size: 1.05rem; }
  .hero-tag .tag-face small { font-size: 0.62rem; }
  .concept-note { left: 1.25rem; right: auto; bottom: 0.8rem; max-width: 17rem; }
  .inventory { padding: 7rem 1.25rem; }
  .inventory-head { grid-template-columns: 1fr; gap: 1.2rem; }
  .inventory-head .shop-label { grid-column: auto; margin-bottom: 0; }
  .inventory-grid { grid-template-columns: 1fr; }
  .inventory-grid[data-count="4"] { grid-template-columns: 1fr; }
  .inventory-tools { align-items: stretch; flex-direction: column; }
  .care { padding: 7rem 1.25rem; }
  .care-head, .care-grid, .product-dialog-layout { grid-template-columns: 1fr; }
  .care-head .shop-label { grid-column: auto; margin-bottom: 0; }
  .product-dialog-main { max-height: 52svh; }
  .story { grid-template-columns: 1fr; padding: 7rem 1.25rem; }
  .story h2, .shipping h2, .counter h2, .ask-dialog h2 { font-size: clamp(3.15rem, 13vw, 5.2rem); }
  .shipping { padding: 7rem 1.25rem; }
  .shipping-ledger article { grid-template-columns: 3rem 1fr; gap: 1rem; }
  .counter { padding: 7rem 1.25rem 1.4rem; }
  .site-footer { flex-direction: column; margin-top: 5rem; }
  .contact-options a { flex-direction: column; gap: 0.2rem; }
}

@media (max-width: 390px) {
  .hero h1 { font-size: 3rem; }
  .hero-specimen { right: -18%; width: 84vw; }
  .hero-tag { width: 9.4rem; height: 6.7rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .skip, .tag-face, .text-action span:last-child, .counter-button { transition-duration: 0.01ms; }
  .skeleton-photo, .skeleton-line { animation: none; }
}

/* Fallback for <dialog> without showModal support (older/embedded WebViews): no native
   backdrop or centering, so replicate both manually. */
dialog.dialog-fallback {
  position: fixed;
  inset: 0;
  z-index: 1000;
  margin: auto;
  max-height: 90vh;
  overflow: auto;
}
dialog.dialog-fallback::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(41,40,32,0.55);
}

/* Pipes tab empty state: Josh's glass style reference until real glass listings arrive. */
.inventory-preview { padding: 0; overflow: hidden; border-radius: 18px; }
.inventory-preview img { display: block; width: 100%; height: auto; aspect-ratio: 1408 / 768; object-fit: cover; }
.inventory-preview figcaption { padding: 1.25rem clamp(1rem, 4vw, 2rem); font-size: 1rem; line-height: 1.5; }
.inventory-preview figcaption strong { color: var(--ink); display: block; font-size: 1.2rem; margin-bottom: 0.25rem; }
