/* ==========================================================================
   Loom & Linen - home furnishing store, demo website
   Register: soft tactile retail. Off-white, taupe, sage, blush, deep brown.
   Typography: Marcellus (display) + Karla (interface)
   ========================================================================== */

:root {
  --shell-bg: #fdfbf7;
  --shell-2: #f5efe7;
  --paper: #ffffff;
  --brown: #3a3129;
  --brown-2: #4c4136;
  --taupe: #8d7b68;
  --sage: #a3b18a;
  --sage-2: #7d8c68;
  --blush: #d9b3a6;
  --ink: #2f2a24;
  --body: #5f564b;
  --muted: #8c8375;
  --line: #e7ded1;

  --font-display: "Marcellus", Georgia, serif;
  --font-ui: "Karla", system-ui, -apple-system, sans-serif;

  --shell: 1280px;
  --gutter: 24px;
  --r-sm: 6px;
  --r: 14px;
  --r-lg: 24px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --shadow: 0 18px 46px -24px rgba(58, 49, 41, 0.34);
}

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }

body {
  background: var(--shell-bg);
  color: var(--body);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; background: var(--shell-2); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; padding: 0; }

h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 400; line-height: 1.18; color: var(--ink); }

::selection { background: var(--sage); color: #fff; }
:focus-visible { outline: 2px solid var(--sage-2); outline-offset: 3px; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 50%; top: -80px; transform: translateX(-50%); z-index: 300; background: var(--brown); color: #fff; padding: 12px 22px; font-size: 0.85rem; transition: top 0.2s; }
.skip-link:focus { top: 0; }

.eyebrow { display: inline-block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.26em; text-transform: uppercase; color: var(--taupe); margin-bottom: 15px; }
.section-title { font-size: clamp(1.9rem, 4.2vw, 3rem); margin-bottom: 16px; }
.section-title em { font-style: italic; color: var(--sage-2); }
.lede { font-size: 1.02rem; color: var(--muted); max-width: 62ch; }

.section { padding: clamp(58px, 8vw, 104px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(32px, 4.4vw, 52px); }
.section-head.center { margin-inline: auto; text-align: center; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 22px; flex-wrap: wrap; margin-bottom: 34px; }

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

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 28px; border: 1px solid var(--brown); border-radius: var(--r-sm);
  background: var(--brown); color: #fff;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  cursor: pointer; white-space: nowrap;
  transition: background 0.3s var(--ease), color 0.3s, border-color 0.3s, transform 0.22s var(--ease);
}
.btn:hover { background: var(--brown-2); transform: translateY(-2px); }
.btn-outline { background: transparent; color: var(--brown); }
.btn-outline:hover { background: var(--brown); color: #fff; }
.btn-sage { background: var(--sage-2); border-color: var(--sage-2); }
.btn-sage:hover { background: #6d7b59; border-color: #6d7b59; }
.btn-light { background: transparent; border-color: rgba(255, 255, 255, 0.5); color: #fff; }
.btn-light:hover { background: #fff; color: var(--brown); border-color: #fff; }
.btn-sm { padding: 10px 19px; font-size: 0.68rem; }
.btn svg { width: 15px; height: 15px; }

/* ---------- Header ---------- */

.announce { background: var(--brown); color: #f1e9de; text-align: center; font-size: 0.76rem; letter-spacing: 0.1em; padding: 10px var(--gutter); }
.announce a { color: var(--blush); text-decoration: underline; text-underline-offset: 3px; }

.site-header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(253, 251, 247, 0.95);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; height: 78px; }
.nav { display: flex; align-items: center; gap: 24px; }
.nav a { font-size: 0.78rem; font-weight: 500; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink); position: relative; padding: 5px 0; }
.nav a::after { content: ""; position: absolute; left: 0; bottom: 0; width: 0; height: 1px; background: var(--taupe); transition: width 0.3s var(--ease); }
.nav a:hover::after { width: 100%; }

.logo { justify-self: center; text-align: center; }
.logo .name { font-family: var(--font-display); font-size: 1.56rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); line-height: 1; }
.logo .tag { display: block; font-size: 0.54rem; letter-spacing: 0.36em; text-transform: uppercase; color: var(--taupe); margin-top: 6px; }

.header-right { justify-self: end; display: flex; align-items: center; gap: 12px; }

.nav-toggle { display: none; width: 40px; height: 40px; border: 1px solid var(--line); background: var(--paper); cursor: pointer; position: relative; }
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  position: absolute; left: 50%; width: 18px; height: 1.5px; background: var(--ink);
  transform: translateX(-50%); transition: transform 0.3s var(--ease), background 0.2s;
}
.nav-toggle span { top: 50%; }
.nav-toggle span::before { content: ""; left: 0; transform: translateY(-6px); }
.nav-toggle span::after { content: ""; left: 0; transform: translateY(6px); }
.nav-toggle[aria-expanded="true"] span { background: transparent; }
.nav-toggle[aria-expanded="true"] span::before { transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span::after { transform: rotate(-45deg); }

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

.hero { position: relative; min-height: clamp(520px, 80vh, 760px); display: grid; align-items: center; overflow: hidden; background: var(--brown); }
.hero-media { position: absolute; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; }
.hero-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to right, rgba(58, 49, 41, 0.8) 0%, rgba(58, 49, 41, 0.45) 46%, rgba(58, 49, 41, 0.12) 78%);
}
.hero-content { position: relative; z-index: 2; max-width: 600px; padding: 80px 0; }
.hero .eyebrow { color: var(--blush); }
.hero h1 { font-size: clamp(2.3rem, 6vw, 4.2rem); color: #fff; margin-bottom: 20px; }
.hero h1 em { font-style: italic; color: var(--blush); }
.hero p { color: rgba(255, 255, 255, 0.84); font-size: 1.04rem; max-width: 48ch; margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 13px; }

/* ---------- Trust strip ---------- */

.strip { background: var(--shell-2); border-bottom: 1px solid var(--line); }
.strip ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.strip li { padding: 22px 20px; text-align: center; border-right: 1px solid var(--line); }
.strip li:last-child { border-right: 0; }
.strip strong { display: block; font-family: var(--font-display); font-size: 1rem; color: var(--ink); }
.strip span { font-size: 0.8rem; color: var(--muted); }

/* ---------- Room tabs ---------- */

.room-tabs { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; margin-bottom: 36px; }
.room-tabs button {
  padding: 11px 22px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper);
  font-size: 0.74rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--body); cursor: pointer; transition: all 0.25s var(--ease);
}
.room-tabs button:hover { border-color: var(--taupe); }
.room-tabs button[aria-selected="true"] { background: var(--brown); border-color: var(--brown); color: #fff; }

.room-panel[hidden] { display: none; }

/* ---------- Products ---------- */

.prod-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(236px, 1fr)); gap: 22px; }
.prod { display: flex; flex-direction: column; }
.prod-media { position: relative; aspect-ratio: 1 / 1.14; overflow: hidden; border-radius: var(--r); background: var(--shell-2); margin-bottom: 14px; }
.prod-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.95s var(--ease); }
.prod:hover .prod-media img { transform: scale(1.06); }
.prod .flag {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: var(--shell-bg); color: var(--brown);
  font-size: 0.62rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px;
}
.prod .swatch-row {
  position: absolute; left: 12px; bottom: 12px; z-index: 2;
  display: flex; gap: 5px; padding: 5px 7px; border-radius: 999px;
  background: rgba(253, 251, 247, 0.92);
}
.prod .swatch-row i { width: 13px; height: 13px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12); }
.prod h3 { font-size: 1.04rem; margin-bottom: 2px; }
.prod .meta { font-size: 0.8rem; color: var(--muted); margin-bottom: 7px; }
.prod .price { font-family: var(--font-display); font-size: 1.06rem; color: var(--ink); }
.prod .price s { font-size: 0.84rem; color: var(--muted); margin-left: 7px; }

/* ---------- Fabric selector ---------- */

.fabric { background: var(--brown); color: rgba(255, 255, 255, 0.76); }
.fabric h2, .fabric h3 { color: #fff; }
.fabric .lede { color: rgba(255, 255, 255, 0.72); }
.fab-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 58px); align-items: center; }
.fab-stage { position: relative; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 4 / 3.2; background: var(--brown-2); }
.fab-stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.55s var(--ease); }
.fab-stage img.is-active { opacity: 1; }
.fab-chips { display: flex; gap: 10px; flex-wrap: wrap; margin: 24px 0; }
.fab-chip {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 14px 8px 8px; border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.22); background: rgba(255, 255, 255, 0.06);
  color: #fff; font-size: 0.82rem; cursor: pointer;
  transition: all 0.25s var(--ease);
}
.fab-chip i { width: 22px; height: 22px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.fab-chip:hover { border-color: rgba(255, 255, 255, 0.45); }
.fab-chip[aria-pressed="true"] { background: #fff; color: var(--brown); border-color: #fff; font-weight: 700; }
.fab-detail { display: grid; gap: 9px; font-size: 0.92rem; }
.fab-detail div { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 8px; border-bottom: 1px dashed rgba(255, 255, 255, 0.18); }
.fab-detail dt { color: rgba(255, 255, 255, 0.64); }
.fab-detail dd { color: #fff; font-weight: 600; text-align: right; }

/* ---------- Made to measure ---------- */

.mtm { background: var(--shell-2); }
.mtm-card { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; background: var(--paper); box-shadow: var(--shadow); }
.mtm-in { padding: clamp(24px, 3.6vw, 40px); }
.mtm-in h3 { font-size: 1.34rem; margin-bottom: 7px; }
.mtm-in > p { font-size: 0.9rem; color: var(--muted); margin-bottom: 24px; }
.mtm-out { padding: clamp(24px, 3.6vw, 40px); background: var(--sage-2); color: rgba(255, 255, 255, 0.84); }
.mtm-out h3 { color: #fff; font-size: 1.22rem; margin-bottom: 20px; }
.mtm-res { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: rgba(255, 255, 255, 0.22); border-radius: var(--r); overflow: hidden; margin-bottom: 20px; }
.mtm-res div { background: var(--sage-2); padding: 18px 16px; }
.mtm-res b { display: block; font-family: var(--font-display); font-size: clamp(1.4rem, 3vw, 1.9rem); color: #fff; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mtm-res span { font-size: 0.76rem; color: rgba(255, 255, 255, 0.76); }
.mtm-lines { display: grid; gap: 8px; font-size: 0.87rem; margin-bottom: 18px; }
.mtm-lines div { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 7px; border-bottom: 1px dashed rgba(255, 255, 255, 0.24); }
.mtm-lines dd { color: #fff; font-weight: 600; font-variant-numeric: tabular-nums; }
.mtm-note { font-size: 0.76rem; color: rgba(255, 255, 255, 0.68); }

/* ---------- Care guide ---------- */

.care-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; }
.care { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 26px; transition: border-color 0.3s, transform 0.3s var(--ease); }
.care:hover { border-color: var(--sage); transform: translateY(-4px); }
.care .ico { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--shell-2); color: var(--sage-2); margin-bottom: 16px; }
.care .ico svg { width: 20px; height: 20px; }
.care h3 { font-size: 1.1rem; margin-bottom: 8px; }
.care p { font-size: 0.9rem; }

/* ---------- Reviews ---------- */

.reviews { background: var(--shell-bg); }
.rev-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 18px; }
.rev { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r); padding: 28px 26px; }
.rev .stars { color: var(--taupe); letter-spacing: 0.2em; font-size: 0.86rem; margin-bottom: 14px; }
.rev blockquote { font-family: var(--font-display); font-size: 1.1rem; line-height: 1.52; color: var(--ink); margin-bottom: 16px; }
.rev cite { font-style: normal; font-size: 0.82rem; color: var(--muted); }
.rev cite b { display: block; color: var(--ink); font-family: var(--font-ui); font-weight: 700; }

/* ---------- Visit / enquiry ---------- */

.visit { background: var(--shell-2); }
.visit-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 56px); align-items: start; }
form { display: grid; gap: 16px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field label { display: block; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink); margin-bottom: 7px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--paper); font-size: 0.95rem; transition: border-color 0.22s, box-shadow 0.22s;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--sage-2); box-shadow: 0 0 0 3px rgba(125, 140, 104, 0.16); }
.field textarea { resize: vertical; min-height: 100px; }
.form-note { font-size: 0.8rem; color: var(--muted); }
.form-status { display: none; padding: 13px 16px; border-radius: var(--r-sm); background: #eef5ea; border: 1px solid #c6dbb9; color: #3f6132; font-size: 0.9rem; }
.form-status.is-visible { display: block; }

.store { background: var(--brown); color: rgba(255, 255, 255, 0.78); border-radius: var(--r-lg); overflow: hidden; }
.store img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.store-body { padding: clamp(24px, 3.4vw, 34px); }
.store h3 { color: #fff; font-size: 1.36rem; margin-bottom: 12px; }
.store dl { display: grid; gap: 9px; font-size: 0.92rem; margin-top: 18px; }
.store dl div { display: flex; justify-content: space-between; gap: 14px; border-bottom: 1px dotted rgba(255, 255, 255, 0.2); padding-bottom: 7px; }
.store dt { color: var(--blush); }
.store dd { color: #fff; }

/* ---------- FAQ ---------- */

.faq-list { display: grid; gap: 1px; background: var(--line); border-block: 1px solid var(--line); }
.faq-item { background: var(--shell-bg); }
.faq-item summary { list-style: none; cursor: pointer; padding: 22px 50px 22px 0; font-family: var(--font-display); font-size: 1.2rem; color: var(--ink); position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; position: absolute; right: 8px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--taupe); line-height: 1; }
.faq-item[open] summary::after { content: "\2013"; }
.faq-item .answer { padding: 0 50px 24px 0; font-size: 0.95rem; }

/* ---------- Footer ---------- */

.site-footer { background: var(--brown); color: rgba(255, 255, 255, 0.6); padding: clamp(46px, 6vw, 74px) 0 26px; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(3, minmax(0, 1fr)); gap: 34px; padding-bottom: 34px; border-bottom: 1px solid rgba(255, 255, 255, 0.14); }
.footer-grid .logo { justify-self: start; text-align: left; }
.footer-grid .logo .name { color: #fff; }
.footer-grid p { font-size: 0.9rem; margin-top: 15px; max-width: 38ch; }
.footer-grid h4 { font-family: var(--font-ui); font-size: 0.66rem; font-weight: 700; letter-spacing: 0.2em; text-transform: uppercase; color: var(--blush); margin-bottom: 15px; }
.footer-grid ul { display: grid; gap: 9px; }
.footer-grid ul a { font-size: 0.9rem; transition: color 0.2s; }
.footer-grid ul a:hover { color: var(--blush); }
.footer-base { padding-top: 22px; display: flex; justify-content: space-between; gap: 14px; flex-wrap: wrap; font-size: 0.79rem; }
.footer-base a { color: var(--blush); }

.demo-ribbon { background: var(--sage-2); color: #fff; text-align: center; font-size: 0.74rem; font-weight: 600; padding: 9px var(--gutter); }
.demo-ribbon a { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Reveal ---------- */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.8s var(--ease), transform 0.8s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */

@media (max-width: 1000px) {
  .header-inner { grid-template-columns: auto 1fr auto; height: 70px; }
  .logo { justify-self: start; text-align: left; }
  .logo .name { font-size: 1.3rem; }
  .nav {
    position: fixed; inset: 70px 0 auto; z-index: 80;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--shell-bg); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 20px;
    transform: translateY(-130%); transition: transform 0.4s var(--ease);
  }
  .nav.is-open { transform: none; }
  .nav a { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav a::after { display: none; }
  .nav-toggle { display: block; }
  .fab-grid, .mtm-card, .visit-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
  .strip li { border-right: 0; border-bottom: 1px solid var(--line); }
}

@media (max-width: 600px) {
  :root { --gutter: 16px; }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .prod-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
  .prod h3 { font-size: 0.94rem; }
  .mtm-res { grid-template-columns: 1fr; }
  .hero-actions .btn { width: 100%; }
  .header-right .btn { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  .reveal { opacity: 1; transform: none; }
}


/* ==========================================================================
   Mobile header overflow fix
   The header bar only has room for the logo and the menu toggle on a phone,
   so every call-to-action is hidden there and re-rendered inside the menu.
   ========================================================================== */

.nav a.nav-cta { display: none; }

.header-inner { min-width: 0; }
.logo { min-width: 0; }

@media (max-width: 1000px) {
  /* --- Mobile header: CTA moves into the menu panel --- */
  .header-right .btn { display: none !important; }
  .nav a.nav-cta {
    display: block;
    margin-top: 16px;
    padding: 15px 20px;
    text-align: center;
    background: var(--brown);
    border: 1px solid var(--brown);
    border-radius: var(--r-sm);
    color: #fff;
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
  }
  .nav a.nav-cta::after { display: none; }

  /* The sticky header uses backdrop-filter, which makes it the containing
     block for this fixed panel. translateY() therefore measures from the
     header, not the viewport, so the slide alone cannot be trusted to push the
     menu off screen - hide it explicitly as well. */
  .nav {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease), opacity 0.25s var(--ease),
                visibility 0.25s var(--ease);
  }
  .nav.is-open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }
}
