/* ============================================
   GROUNDED — Shared Styles
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:ital,wght@0,300;0,400;0,500;0,600;1,400&family=Jost:wght@300;400;500&display=swap');

:root {
  --cream: #F2EFE6;
  --beige: #D8D1C2;
  --sage: #A5AD9A;
  --olive: #59624B;
  --earth: #7A5F44;
  --charcoal: #1C1C1C;

  --display: 'Cormorant Garamond', serif;
  --body: 'Jost', sans-serif;

  --max-width: 1180px;
  --section-pad: clamp(64px, 9vw, 128px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  font-family: var(--body);
  background: var(--cream);
  color: var(--charcoal);
  font-weight: 300;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: inherit; text-decoration: none; }

.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: clamp(20px, 5vw, 48px);
  padding-right: clamp(20px, 5vw, 48px);
}

/* ---------- Typography helpers ---------- */

.eyebrow {
  font-family: var(--display);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--olive);
  letter-spacing: 0.04em;
}

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 500;
  color: var(--charcoal);
  letter-spacing: -0.01em;
}

.label {
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--olive);
  font-weight: 500;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--body);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  padding: 15px 30px;
  border: 1px solid var(--olive);
  background: transparent;
  color: var(--olive);
  cursor: pointer;
  transition: background 0.25s ease, color 0.25s ease;
  border-radius: 1px;
}

.btn:hover, .btn:focus-visible { background: var(--olive); color: var(--cream); }

.btn-solid {
  background: var(--olive);
  color: var(--cream);
}
.btn-solid:hover, .btn-solid:focus-visible { background: var(--charcoal); border-color: var(--charcoal); }

.btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--earth);
  outline-offset: 3px;
}

/* ---------- Nav ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(242, 239, 230, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(28, 28, 28, 0.08);
}

.nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 84px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--olive);
}

.nav-logo img { height: 36px; width: auto; }

.nav-links {
  display: flex;
  gap: 36px;
  list-style: none;
  font-family: var(--body);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links a { position: relative; padding-bottom: 4px; }
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 1px;
  background: var(--olive);
  transition: width 0.25s ease;
}
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }

.nav-right { display: flex; align-items: center; gap: 24px; }

.nav-cart {
  font-family: var(--body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}

.nav-toggle { display: none; background: none; border: none; cursor: pointer; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}

/* ---------- Root motif divider ---------- */

.root-divider {
  display: flex;
  justify-content: center;
  margin: 0 auto;
  opacity: 0.55;
}
.root-divider svg { width: 140px; height: 46px; }

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

.site-footer {
  background: var(--charcoal);
  color: var(--beige);
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(242,239,230,0.12);
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
.footer-brand {
  font-family: var(--display);
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 14px;
}
.footer-tagline {
  font-style: italic;
  font-family: var(--display);
  color: var(--sage);
  font-size: 1rem;
}
.footer-col h4 {
  font-family: var(--body);
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sage);
  font-weight: 500;
  margin-bottom: 18px;
}
.footer-col ul { list-style: none; display: flex; flex-direction: column; gap: 12px; font-size: 0.88rem; }
.footer-col a:hover { color: var(--cream); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 28px;
  font-size: 0.78rem;
  color: rgba(242,239,230,0.55);
  flex-wrap: wrap;
  gap: 12px;
}

/* ---------- Newsletter ---------- */
.newsletter-form {
  display: flex;
  border-bottom: 1px solid var(--sage);
  max-width: 320px;
}
.newsletter-form input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--cream);
  font-family: var(--body);
  font-size: 0.85rem;
  padding: 8px 0;
}
.newsletter-form input::placeholder { color: rgba(242,239,230,0.45); }
.newsletter-form button {
  background: none; border: none; color: var(--sage); cursor: pointer;
  font-family: var(--body); font-size: 0.7rem; letter-spacing: 0.1em; text-transform: uppercase;
}

/* ---------- Generic section spacing ---------- */
section { padding: var(--section-pad) 0; }

/* ---------- Cart drawer ---------- */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28,28,28,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
  z-index: 90;
}
.cart-overlay.cart-open { opacity: 1; visibility: visible; }

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--cream);
  z-index: 95;
  transform: translateX(100%);
  transition: transform 0.35s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(28,28,28,0.15);
}
.cart-drawer.cart-open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 26px 28px;
  border-bottom: 1px solid rgba(28,28,28,0.1);
}
.cart-header h2 { font-size: 1.5rem; }
.cart-header button {
  background: none; border: none; cursor: pointer;
  font-size: 1.6rem; line-height: 1; color: var(--charcoal);
  font-family: var(--body); font-weight: 300;
}

.cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 28px;
}

#cart-empty {
  text-align: center;
  padding: 60px 0;
  font-family: var(--display);
  font-style: italic;
  color: var(--olive);
  font-size: 1.1rem;
}

.cart-line {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid rgba(28,28,28,0.08);
}
.cart-line-swatch {
  width: 54px;
  height: 54px;
  border-radius: 2px;
  flex-shrink: 0;
}
.cart-line-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.cart-line-name { font-size: 0.88rem; font-weight: 400; }
.cart-line-price { font-size: 0.8rem; color: var(--olive); font-family: var(--display); }
.cart-line-qty {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
}
.cart-line-qty button {
  width: 22px; height: 22px;
  border: 1px solid rgba(28,28,28,0.2);
  background: transparent;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.85rem;
  line-height: 1;
  border-radius: 50%;
}
.cart-line-qty button:hover { background: var(--olive); color: var(--cream); border-color: var(--olive); }
.cart-line-qty span { font-size: 0.85rem; min-width: 16px; text-align: center; }

.cart-line-remove {
  background: none; border: none; cursor: pointer;
  font-size: 1.1rem; color: rgba(28,28,28,0.4); line-height: 1;
}
.cart-line-remove:hover { color: var(--earth); }

.cart-footer {
  padding: 22px 28px 28px;
  border-top: 1px solid rgba(28,28,28,0.1);
}
.cart-subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
  font-family: var(--display);
}
.cart-subtotal-row span:first-child { font-size: 0.85rem; font-family: var(--body); text-transform: uppercase; letter-spacing: 0.1em; color: var(--olive); }
.cart-subtotal-row span:last-child { font-size: 1.4rem; }
.cart-footer .btn { width: 100%; justify-content: center; }
.cart-note { font-size: 0.74rem; opacity: 0.55; margin-top: 12px; text-align: center; }

.cart-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--olive);
  color: var(--cream);
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 0.65rem;
  margin-left: 6px;
}

.nav-cart-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--body);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  color: var(--charcoal);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--olive);
  color: var(--cream);
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 12px; top: 12px; }
