/* =========================================================
   AUGUST & OAK — Luxury Furniture
   Design tokens
   ========================================================= */
:root{
  /* Color palette — "Material Library" */
  --ink:            #1C1B19;   /* charcoal ink — primary dark bg */
  --ink-darker:     #131211;
  --ivory:          #F3EEE6;   /* warm ivory — primary light bg */
  --ivory-dim:      #E9E2D4;
  --walnut:         #4A2E23;   /* deep walnut */
  --walnut-light:   #6B4335;
  --brass:          #B8935F;   /* aged brass accent */
  --brass-light:    #D4B483;
  --emerald:        #2F3E36;   /* deep forest emerald */
  --stone:          #A79C8C;   /* muted stone text on dark */
  --stone-dark:     #6E655A;
  --line-on-dark:   rgba(243,238,230,.14);
  --line-on-light:  rgba(28,27,25,.12);

  /* live material accent — changed by JS */
  --accent: var(--walnut);

  /* Type */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max: 1280px;
  --gutter: clamp(20px, 4vw, 64px);
  --radius: 2px;
  --ease: cubic-bezier(.22,.61,.36,1);
}

*, *::before, *::after{ box-sizing: border-box; }
html{ scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce){
  html{ scroll-behavior: auto; }
  *{ animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

body{
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img{ max-width: 100%; display: block; }
a{ color: inherit; text-decoration: none; }
button{ font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
ul{ margin: 0; padding: 0; list-style: none; }
input{ font: inherit; }

h1, h2, h3{
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.08;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}

.visually-hidden{
  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: -999px; top: 0; background: var(--brass); color: var(--ink);
  padding: 12px 20px; z-index: 999;
}
.skip-link:focus{ left: 12px; top: 12px; }

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

.eyebrow{
  font-family: var(--font-body);
  font-size: .72rem;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 700;
  margin: 0 0 .9em;
}

.section-head{
  max-width: 640px;
  margin: 0 auto 48px;
  text-align: center;
}
.section-head h2{ font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.section-sub{ color: var(--stone-dark); font-size: 1rem; margin-top: .6em; }

section{ padding: clamp(56px, 8vw, 120px) var(--gutter); }

/* =========================================================
   Buttons
   ========================================================= */
.btn{
  display: inline-flex; align-items: center; justify-content: center;
  gap: 8px;
  padding: 15px 30px;
  font-size: .82rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease), transform .2s var(--ease);
  white-space: nowrap;
}
.btn:hover{ transform: translateY(-1px); }
.btn-primary{ background: var(--brass); color: var(--ink); }
.btn-primary:hover{ background: var(--brass-light); }
.btn-ghost{ color: var(--ivory); border-color: rgba(243,238,230,.4); }
.btn-ghost:hover{ border-color: var(--ivory); background: rgba(243,238,230,.08); }
.btn-outline{ color: var(--ink); border-color: var(--ink); }
.btn-outline:hover{ background: var(--ink); color: var(--ivory); }
.btn-block{ width: 100%; }

/* =========================================================
   Announcement + Header
   ========================================================= */
.announce{
  background: var(--ink);
  color: var(--ivory-dim);
  text-align: center;
  font-size: .76rem;
  letter-spacing: .04em;
  padding: 9px var(--gutter);
}

.site-header{
  position: sticky; top: 0; z-index: 100;
  background: rgba(243,238,230,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line-on-light);
  transition: box-shadow .3s var(--ease);
}
.site-header.is-scrolled{ box-shadow: 0 8px 24px rgba(28,27,25,.06); }

.header-inner{
  max-width: var(--max);
  margin: 0 auto;
  display: flex; align-items: center; gap: 24px;
  padding: 18px var(--gutter);
}

.logo{
  font-family: var(--font-display);
  font-size: 1.3rem;
  letter-spacing: .01em;
  white-space: nowrap;
}
.logo span{ color: var(--brass); }

.primary-nav{
  display: flex; gap: 32px;
  margin: 0 auto;
  font-size: .86rem;
  font-weight: 600;
}
.primary-nav a{ position: relative; padding: 4px 0; }
.primary-nav a::after{
  content: ''; position: absolute; left: 0; right: 100%; bottom: -2px; height: 1px;
  background: var(--brass); transition: right .25s var(--ease);
}
.primary-nav a:hover::after{ right: 0; }

.header-actions{ display: flex; align-items: center; gap: 6px; margin-left: auto; }
.icon-btn{
  position: relative;
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  transition: background .2s;
}
.icon-btn:hover{ background: var(--line-on-light); }
.cart-count{
  position: absolute; top: 2px; right: 2px;
  background: var(--brass); color: var(--ink);
  font-size: .62rem; font-weight: 800;
  width: 16px; height: 16px; border-radius: 50%;
  display: grid; place-items: center;
}

.nav-toggle{
  display: none;
  width: 40px; height: 40px;
  flex-direction: column; justify-content: center; gap: 5px;
}
.nav-toggle span{ display: block; width: 22px; height: 1.5px; background: var(--ink); transition: transform .25s, opacity .25s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1){ transform: translateY(6.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2){ opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3){ transform: translateY(-6.5px) rotate(-45deg); }

.search-panel{
  max-height: 0; overflow: hidden;
  border-top: 1px solid transparent;
  transition: max-height .3s var(--ease), border-color .3s;
}
.search-panel.is-open{ max-height: 90px; border-color: var(--line-on-light); }
.search-panel-inner{
  max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter);
  display: flex; align-items: center; gap: 12px;
}
.search-panel-inner input{
  flex: 1; border: none; background: transparent; font-size: 1rem; outline: none;
}

/* =========================================================
   Cart drawer
   ========================================================= */
.overlay{
  position: fixed; inset: 0; background: rgba(19,18,17,.5);
  opacity: 0; pointer-events: none; transition: opacity .3s var(--ease);
  z-index: 150;
}
.overlay.is-open{ opacity: 1; pointer-events: auto; }

.cart-drawer{
  position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw);
  background: var(--ivory);
  z-index: 200;
  transform: translateX(100%);
  transition: transform .35s var(--ease);
  display: flex; flex-direction: column;
  box-shadow: -20px 0 60px rgba(0,0,0,.2);
}
.cart-drawer.is-open{ transform: translateX(0); }
.cart-drawer-head{
  display: flex; align-items: center; justify-content: space-between;
  padding: 24px var(--gutter); border-bottom: 1px solid var(--line-on-light);
}
.cart-drawer-head h2{ font-size: 1.3rem; margin: 0; }
.cart-items{ flex: 1; overflow-y: auto; padding: 24px var(--gutter); }
.cart-empty{ color: var(--stone-dark); }
.cart-line{ display: flex; gap: 14px; margin-bottom: 20px; }
.cart-line img{ width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius); }
.cart-line-info{ flex: 1; }
.cart-line-info h4{ margin: 0 0 4px; font-size: .95rem; font-weight: 700; }
.cart-line-info p{ margin: 0; color: var(--stone-dark); font-size: .85rem; }
.cart-remove{ font-size: .78rem; color: var(--brass); text-decoration: underline; margin-top: 4px; }
.cart-drawer-foot{ padding: 24px var(--gutter); border-top: 1px solid var(--line-on-light); }
.cart-subtotal{ display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 16px; }

/* =========================================================
   Hero
   ========================================================= */
.hero{
  position: relative;
  min-height: 92vh;
  display: flex; align-items: flex-end;
  padding: 0;
  overflow: hidden;
  color: var(--ivory);
}
.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(0deg, rgba(19,18,17,.86) 0%, rgba(19,18,17,.35) 55%, rgba(19,18,17,.15) 100%);
}
.hero-content{
  position: relative; z-index: 2;
  max-width: 680px;
  padding: 0 var(--gutter) 88px;
}
.hero .eyebrow{ color: var(--brass-light); }
.hero h1{ font-size: clamp(2.6rem, 6.5vw, 5rem); color: var(--ivory); }
.hero-sub{ max-width: 46ch; color: var(--stone); font-size: 1.05rem; margin: 18px 0 32px; }
.hero-actions{ display: flex; gap: 16px; flex-wrap: wrap; }

.scroll-cue{
  position: absolute; right: var(--gutter); bottom: 32px; z-index: 2;
  color: var(--ivory); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase;
  display: flex; align-items: center; gap: 10px;
  writing-mode: vertical-rl;
}
.scroll-cue span{ width: 1px; height: 40px; background: var(--ivory); opacity: .6; }

/* =========================================================
   Trust strip
   ========================================================= */
.trust-strip{
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 40px var(--gutter);
  background: var(--ink);
  color: var(--ivory);
}
.trust-item{ text-align: center; display: flex; flex-direction: column; gap: 4px; }
.trust-item strong{ font-family: var(--font-display); font-size: 1.2rem; color: var(--brass-light); }
.trust-item span{ font-size: .78rem; color: var(--stone); letter-spacing: .02em; }

/* =========================================================
   Collections — asymmetric grid
   ========================================================= */
.collections-grid{
  max-width: var(--max); margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(2, minmax(220px, 1fr));
  gap: 18px;
}
.collection-card{
  position: relative; overflow: hidden; border-radius: var(--radius);
  grid-column: span 2;
}
.collection-card--large{ grid-column: span 2; grid-row: span 2; }
.collection-card--wide{ grid-column: span 2; }
.collection-card img{
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .6s var(--ease);
}
.collection-card:hover img{ transform: scale(1.06); }
.collection-card::after{
  content:''; position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(19,18,17,.75), rgba(19,18,17,0) 60%);
}
.collection-copy{
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 22px; color: var(--ivory);
}
.collection-copy span{ font-size: .72rem; color: var(--brass-light); letter-spacing: .1em; }
.collection-copy h3{ margin: 4px 0 2px; font-size: 1.5rem; color: var(--ivory); }
.collection-copy p{ margin: 0; font-size: .85rem; color: var(--stone); }

/* =========================================================
   Material Library (signature interactive section)
   ========================================================= */
.materials{ background: var(--ink); color: var(--ivory); }
.materials .section-sub{ color: var(--stone); }

.material-lab{
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 260px 1fr; gap: 40px;
}
.material-swatches{ display: flex; flex-direction: column; gap: 10px; }
.swatch{
  display: flex; align-items: center; gap: 14px;
  padding: 14px; border: 1px solid var(--line-on-dark); border-radius: var(--radius);
  text-align: left;
  transition: border-color .2s, background .2s;
}
.swatch:hover{ border-color: var(--brass); }
.swatch[aria-selected="true"]{ background: rgba(184,147,95,.12); border-color: var(--brass); }
.swatch-color{
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: var(--swatch);
  border: 1px solid rgba(255,255,255,.25);
}
.swatch-label{ display: flex; flex-direction: column; font-weight: 700; font-size: .92rem; }
.swatch-label em{ font-style: normal; font-weight: 500; font-size: .74rem; color: var(--stone); margin-top: 2px; }

.material-display{ display: grid; grid-template-columns: 1fr 1fr; gap: 32px; align-items: center; }
.material-display-frame{ position: relative; border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/3; }
.material-display-frame img{ width: 100%; height: 100%; object-fit: cover; transition: opacity .35s var(--ease); }
.material-tag{
  position: absolute; left: 16px; bottom: 16px;
  background: var(--accent); color: var(--ivory);
  padding: 8px 14px; font-size: .76rem; letter-spacing: .06em; text-transform: uppercase; font-weight: 700;
  border-radius: 2px;
  transition: background .3s var(--ease);
}
.material-copy h3{ color: var(--ivory); font-size: 1.6rem; margin-bottom: .4em; }
.material-copy p{ color: var(--stone); margin-bottom: 20px; }
.material-meta li{
  padding: 10px 0; border-top: 1px solid var(--line-on-dark);
  font-size: .84rem; color: var(--stone);
}

/* =========================================================
   Product Grid
   ========================================================= */
.filter-bar{
  display: flex; justify-content: center; gap: 10px; flex-wrap: wrap;
  margin-bottom: 40px;
}
.filter-btn{
  padding: 9px 20px; border: 1px solid var(--line-on-light); border-radius: 100px;
  font-size: .8rem; font-weight: 700; letter-spacing: .03em;
  transition: background .2s, color .2s, border-color .2s;
}
.filter-btn:hover{ border-color: var(--brass); }
.filter-btn.is-active{ background: var(--ink); color: var(--ivory); border-color: var(--ink); }

.product-grid{
  max-width: var(--max); margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px 22px;
}
.product-card{
  display: flex; flex-direction: column;
  opacity: 0; transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.product-card.is-visible{ opacity: 1; transform: translateY(0); }
.product-media{
  position: relative; aspect-ratio: 1/1.05; overflow: hidden; border-radius: var(--radius);
  background: var(--ivory-dim);
  margin-bottom: 14px;
}
.product-media img{ width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.product-card:hover .product-media img{ transform: scale(1.05); }
.product-tag{
  position: absolute; top: 12px; left: 12px;
  background: rgba(243,238,230,.92);
  font-size: .68rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 5px 10px; border-radius: 100px;
}
.product-add{
  position: absolute; right: 12px; bottom: 12px;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: var(--ivory);
  display: grid; place-items: center;
  opacity: 0; transform: translateY(8px);
  transition: opacity .25s var(--ease), transform .25s var(--ease), background .2s;
}
.product-card:hover .product-add{ opacity: 1; transform: translateY(0); }
.product-add:hover{ background: var(--brass); color: var(--ink); }
.product-info h3{ font-size: 1.02rem; margin: 0 0 4px; font-weight: 600; font-family: var(--font-body); }
.product-material{ font-size: .8rem; color: var(--stone-dark); margin: 0 0 8px; }
.product-price{ font-weight: 700; font-size: .95rem; }

/* =========================================================
   Craftsmanship / Story
   ========================================================= */
.story{
  display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center;
}
.story-media{ border-radius: var(--radius); overflow: hidden; aspect-ratio: 4/5; }
.story-media img{ width: 100%; height: 100%; object-fit: cover; }
.story-copy h2{ font-size: clamp(1.9rem, 3.2vw, 2.6rem); }
.story-copy p{ color: var(--stone-dark); max-width: 48ch; }
.story-stats{ display: flex; gap: 36px; margin: 28px 0 32px; }
.story-stats strong{ display: block; font-family: var(--font-display); font-size: 1.6rem; color: var(--walnut); }
.story-stats span{ font-size: .78rem; color: var(--stone-dark); }

/* =========================================================
   Press + Testimonials
   ========================================================= */
.press{ text-align: center; padding-top: 40px; padding-bottom: 40px; }
.press-label{ font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--stone-dark); margin-bottom: 24px; }
.press-logos{
  display: flex; justify-content: center; gap: clamp(20px,4vw,56px); flex-wrap: wrap;
  font-family: var(--font-display); font-size: 1.1rem; color: var(--stone-dark); opacity: .75;
}

.testimonial-grid{
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px;
}
.testimonial-grid blockquote{
  margin: 0; padding: 32px 28px; background: var(--ivory-dim); border-radius: var(--radius);
}
.testimonial-grid p{ font-family: var(--font-display); font-size: 1.1rem; line-height: 1.5; margin: 0 0 16px; }
.testimonial-grid cite{ font-style: normal; font-size: .82rem; color: var(--stone-dark); }

/* =========================================================
   Newsletter
   ========================================================= */
.newsletter{ background: var(--walnut); color: var(--ivory); text-align: center; }
.newsletter-inner{ max-width: 560px; margin: 0 auto; }
.newsletter h2{ color: var(--ivory); }
.newsletter p{ color: var(--ivory-dim); margin-bottom: 28px; }
#newsletterForm{ display: flex; gap: 10px; }
#newsletterForm input{
  flex: 1; padding: 15px 18px; border: 1px solid rgba(243,238,230,.35);
  background: rgba(243,238,230,.06); color: var(--ivory); border-radius: var(--radius);
  outline: none;
}
#newsletterForm input::placeholder{ color: var(--stone); }
.newsletter-note{ margin-top: 14px; font-size: .85rem; color: var(--brass-light); min-height: 1.2em; }

/* =========================================================
   Footer
   ========================================================= */
.site-footer{ background: var(--ink); color: var(--ivory); padding: 64px var(--gutter) 0; }
.footer-grid{
  max-width: var(--max); margin: 0 auto;
  display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px;
  padding-bottom: 48px; border-bottom: 1px solid var(--line-on-dark);
}
.footer-brand p{ color: var(--stone); font-size: .88rem; max-width: 30ch; margin: 14px 0 18px; }
.footer-social{ display: flex; gap: 10px; }
.footer-social a{
  width: 34px; height: 34px; border: 1px solid var(--line-on-dark); border-radius: 50%;
  display: grid; place-items: center; font-size: .68rem; font-weight: 700;
  transition: border-color .2s, color .2s;
}
.footer-social a:hover{ border-color: var(--brass); color: var(--brass-light); }
.footer-col h3{ font-family: var(--font-body); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; color: var(--stone); margin-bottom: 16px; }
.footer-col{ display: flex; flex-direction: column; gap: 12px; font-size: .9rem; }
.footer-col a:hover{ color: var(--brass-light); }
.footer-bottom{
  max-width: var(--max); margin: 0 auto;
  display: flex; justify-content: space-between; align-items: center;
  padding: 24px 0; font-size: .8rem; color: var(--stone);
}
.footer-legal{ display: flex; gap: 20px; }

/* =========================================================
   Responsive — Tablet (≤1024px)
   ========================================================= */
@media (max-width: 1024px){
  .primary-nav{ display: none; }
  .nav-toggle{ display: flex; }
  .header-inner{ position: relative; }

  .site-header.nav-open .primary-nav{
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--ivory); border-bottom: 1px solid var(--line-on-light);
    padding: 8px var(--gutter) 20px;
  }
  .site-header.nav-open .primary-nav a{ padding: 14px 0; border-bottom: 1px solid var(--line-on-light); }

  .collections-grid{ grid-template-columns: repeat(2, 1fr); grid-template-rows: none; }
  .collection-card, .collection-card--wide{ grid-column: span 1; aspect-ratio: 1/1; }
  .collection-card--large{ grid-column: span 2; grid-row: auto; aspect-ratio: 16/9; }

  .material-lab{ grid-template-columns: 1fr; }
  .material-swatches{ flex-direction: row; flex-wrap: wrap; }
  .swatch{ flex: 1 1 45%; }
  .material-display{ grid-template-columns: 1fr; }

  .product-grid{ grid-template-columns: repeat(3, 1fr); }

  .story{ grid-template-columns: 1fr; }
  .story-media{ aspect-ratio: 16/9; }

  .testimonial-grid{ grid-template-columns: 1fr 1fr; }
  .footer-grid{ grid-template-columns: 1fr 1fr; row-gap: 32px; }
}

/* =========================================================
   Responsive — Mobile (≤640px)
   ========================================================= */
@media (max-width: 640px){
  .trust-strip{ grid-template-columns: repeat(2, 1fr); gap: 24px 12px; }
  .collections-grid{ grid-template-columns: 1fr; }
  .collection-card, .collection-card--large, .collection-card--wide{ grid-column: span 1; aspect-ratio: 4/3; }

  .swatch{ flex: 1 1 100%; }

  .product-grid{ grid-template-columns: repeat(2, 1fr); gap: 20px 14px; }

  .hero-actions{ flex-direction: column; align-items: stretch; }
  .hero-content{ padding-bottom: 64px; }
  .scroll-cue{ display: none; }

  .testimonial-grid{ grid-template-columns: 1fr; }
  .footer-grid{ grid-template-columns: 1fr; }
  .footer-bottom{ flex-direction: column; gap: 12px; text-align: center; }

  #newsletterForm{ flex-direction: column; }
}
