/* Palette: stone paper, bottle-green ink, walnut, brass. */
:root {
  --paper: #E6E8E2;
  --surface: #F4F5F1;
  --ink: #23302A;
  --ink-soft: #55615A;
  --walnut: #6E4128;
  --brass: #B48A3E;
  --line: #C9CEC5;

  --display: "Young Serif", Georgia, serif;
  --body: "Familjen Grotesk", system-ui, sans-serif;

  --pad: clamp(1rem, 4vw, 3.5rem);
  --max: 1320px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--surface); padding: .6rem 1rem; z-index: 50; }
.skip:focus { left: 1rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: var(--ink); color: var(--surface);
  border: 0; border-radius: 999px;
  padding: .85rem 1.5rem;
  font: 600 1rem/1 var(--body);
  text-decoration: none; cursor: pointer;
  transition: background .15s;
}
.btn:hover { background: var(--walnut); }
.btn-small { padding: .55rem 1.1rem; font-size: .925rem; }
.btn-ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--surface); }
.btn-wa { background: #1E7A4C; }
.btn-wa:hover { background: #15603B; }

/* ---------- header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .9rem var(--pad);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { font: 400 1.45rem/1 var(--display); text-decoration: none; }
.top-nav { display: flex; align-items: center; gap: clamp(.75rem, 2.5vw, 2rem); }
.top-nav > a:not(.btn) { text-decoration: none; font-weight: 500; }
.top-nav > a:not(.btn):hover { color: var(--walnut); }
@media (max-width: 560px) { .top-nav > a:not(.btn) { display: none; } }

/* ---------- hero ---------- */
.hero {
  max-width: var(--max); margin: 0 auto;
  padding: clamp(2.5rem, 7vw, 6rem) var(--pad) clamp(2rem, 5vw, 4rem);
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center;
}
.hero h1 {
  font: 400 clamp(2.6rem, 6.2vw, 5.4rem)/1.02 var(--display);
  letter-spacing: -.015em;
  margin: 0 0 1.5rem;
  max-width: 13ch;
  text-wrap: balance;
}
.hero-sub { max-width: 42ch; color: var(--ink-soft); font-size: 1.15rem; margin: 0 0 2rem; }

/* three photos leaning against each other, like pieces lined up in a showroom */
.hero-stack { position: relative; aspect-ratio: 5 / 4; }
.hero-stack .tile {
  position: absolute; overflow: hidden; border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(35, 48, 42, .55);
}
.hero-stack .tile:nth-child(1) { inset: 0 34% 18% 0; }
.hero-stack .tile:nth-child(2) { inset: 26% 0 0 46%; }
.hero-stack .tile:nth-child(3) { inset: 58% 58% 0 10%; border: 6px solid var(--paper); }
.hero-stack .tile img, .hero-stack .tile .ph { width: 100%; height: 100%; object-fit: cover; }

@media (prefers-reduced-motion: no-preference) {
  .hero-stack .tile { opacity: 0; transform: translateY(14px); animation: settle .7s cubic-bezier(.2,.7,.2,1) forwards; }
  .hero-stack .tile:nth-child(2) { animation-delay: .12s; }
  .hero-stack .tile:nth-child(3) { animation-delay: .24s; }
  @keyframes settle { to { opacity: 1; transform: none; } }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; }
  .hero-stack { max-width: 520px; width: 100%; }
}

/* ---------- category rooms (the signature element) ---------- */
.section-title { font: 400 clamp(1.6rem, 3vw, 2.3rem)/1.1 var(--display); margin: 0; }
.rooms { padding: clamp(1.5rem, 4vw, 3rem) 0; }
.rooms .section-title { max-width: var(--max); margin: 0 auto 1.25rem; padding: 0 var(--pad); }
.rooms-track::after { content: ""; flex: 0 0 1px; }
.rooms-track {
  display: flex; gap: 1rem; overflow-x: auto; scroll-snap-type: x mandatory;
  scroll-padding-inline: var(--pad);
  padding: 0 var(--pad) 1rem;
  scrollbar-width: thin; scrollbar-color: var(--line) transparent;
}
.room {
  flex: 0 0 clamp(220px, 26vw, 330px);
  position: relative; display: block; scroll-snap-align: start;
  aspect-ratio: 3 / 4.4; border-radius: 180px 180px 14px 14px; /* arched doorway */
  overflow: hidden; text-decoration: none; color: var(--surface);
  background: var(--ink);
}
.room img, .room .ph { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.room:hover img, .room:hover .ph { transform: scale(1.04); }
.room::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(20,28,24,.78) 0%, rgba(20,28,24,0) 48%); }
.room-label { position: absolute; z-index: 1; left: 1.25rem; right: 1.25rem; bottom: 1.1rem; }
.room-label strong { display: block; font: 400 1.75rem/1.1 var(--display); }
.room-label span { font-size: .95rem; opacity: .85; }
.room[aria-current="true"] { outline: 3px solid var(--brass); outline-offset: 4px; }

/* ---------- collection ---------- */
.collection { scroll-margin-top: 4.5rem; max-width: var(--max); margin: 0 auto; padding: clamp(2rem, 5vw, 4rem) var(--pad); }
.collection-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.25rem; }
.search input {
  width: min(340px, 80vw); padding: .75rem 1.1rem;
  border: 1.5px solid var(--line); border-radius: 999px; background: var(--surface);
  font: inherit; color: var(--ink);
}
.search input:focus { border-color: var(--ink); outline: none; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1.75rem; }
.chip {
  border: 1.5px solid var(--line); background: transparent; color: var(--ink);
  padding: .45rem 1rem; border-radius: 999px; font: 500 .95rem/1.2 var(--body); cursor: pointer;
}
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.status { color: var(--ink-soft); margin: 0 0 1rem; }
.status:empty { display: none; }

/* photos keep their own shape, so the grid reads like a catalogue page */
.grid { columns: 4 250px; column-gap: 1.25rem; }
.card {
  break-inside: avoid; margin: 0 0 1.75rem; display: block; width: 100%;
  background: none; border: 0; padding: 0; text-align: left; color: inherit; cursor: pointer; font: inherit;
}
.card-img { border-radius: 10px; overflow: hidden; background: var(--line); }
.card-img img { width: 100%; height: auto; transition: transform .4s ease; }
.card:hover .card-img img { transform: scale(1.03); }
.card-img .ph { aspect-ratio: 4 / 3; }
.card-body { display: flex; justify-content: space-between; gap: .75rem; padding-top: .7rem; }
.card-name { font-weight: 600; line-height: 1.3; }
.card-cat { color: var(--ink-soft); font-size: .9rem; }
.card-price { font-weight: 600; color: var(--walnut); white-space: nowrap; }
.card-count { font-size: .85rem; color: var(--ink-soft); }

/* placeholder (demo mode or missing photo): wood-grain block with initials */
.ph {
  display: grid; place-items: center; width: 100%; height: 100%;
  background:
    repeating-linear-gradient(100deg, rgba(255,255,255,.05) 0 2px, transparent 2px 11px),
    linear-gradient(135deg, var(--walnut), #8D5A35 55%, var(--brass));
  color: rgba(244,245,241,.85); font: 400 clamp(1.5rem, 4vw, 2.6rem)/1 var(--display);
}

/* ---------- product dialog ---------- */
.product {
  width: min(1080px, 94vw); max-height: 92vh; padding: 0; border: 0; border-radius: 18px;
  background: var(--surface); color: var(--ink);
  grid-template-columns: 1.25fr 1fr; overflow: hidden;
}
.product[open] { display: grid; }
.product::backdrop { background: rgba(20, 28, 24, .6); backdrop-filter: blur(3px); }
.close {
  position: absolute; top: .75rem; right: .75rem; z-index: 2;
  width: 2.5rem; height: 2.5rem; border-radius: 50%; border: 0;
  background: var(--surface); color: var(--ink); font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.product-media { background: var(--paper); display: flex; flex-direction: column; min-height: 0; }
.product-main { flex: 1; min-height: 0; display: grid; place-items: center; }
.product-main img { max-height: 70vh; width: 100%; object-fit: contain; }
.product-main .ph { aspect-ratio: 4 / 3; }
.product-thumbs { display: flex; gap: .5rem; padding: .75rem; overflow-x: auto; }
.product-thumbs:empty { display: none; }
.thumb { flex: 0 0 64px; height: 64px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.thumb img, .thumb .ph { width: 100%; height: 100%; object-fit: cover; font-size: .9rem; }
.thumb[aria-current="true"] { border-color: var(--ink); }
.product-info { padding: clamp(1.5rem, 3vw, 2.5rem); overflow-y: auto; }
.product-cat { margin: 0 0 .5rem; color: var(--ink-soft); }
.product-info h2 { font: 400 clamp(1.8rem, 3vw, 2.5rem)/1.1 var(--display); margin: 0 0 .75rem; }
.product-price { font-size: 1.35rem; font-weight: 600; color: var(--walnut); margin: 0 0 1.25rem; }
.product-price:empty { display: none; }
.product-desc { white-space: pre-line; color: var(--ink-soft); max-width: 46ch; }
.product-actions { display: flex; flex-wrap: wrap; gap: .6rem; margin-top: 1.75rem; }
@media (max-width: 760px) {
  .product[open] { grid-template-columns: 1fr; overflow-y: auto; }
  .product-main img { max-height: 52vh; }
}

/* ---------- visit + footer ---------- */
.visit {
  background: var(--ink); color: var(--surface);
  padding: clamp(3rem, 7vw, 5.5rem) var(--pad);
}
.visit h2 { font: 400 clamp(2rem, 4.5vw, 3.4rem)/1.05 var(--display); margin: 0 auto 2rem; max-width: var(--max); }
.visit-cols { max-width: var(--max); margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.visit-cols p { margin: 0; max-width: 40ch; opacity: .85; white-space: pre-line; }
.contact-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.contact-list a { color: var(--surface); text-decoration-color: var(--brass); text-underline-offset: 4px; font-size: 1.15rem; }
@media (max-width: 680px) { .visit-cols { grid-template-columns: 1fr; } }

.foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 2rem;
  padding: 1.25rem var(--pad); font-size: .9rem; color: var(--ink-soft);
}
