/* ============================================
   The Humbled Home — Shared Styles
   Aesthetic: editorial homestead, warm and grounded
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,300;9..144,400;9..144,500;9..144,600&family=Inter:wght@300;400;500;600&display=swap');

:root {
  --cream: #f6f1e8;
  --cream-soft: #faf6ee;
  --cream-deep: #ede4d0;
  --sage: #8a9a7b;
  --sage-deep: #6a7a5e;
  --sage-light: #c8d2bc;
  --terracotta: #c97b5d;
  --terracotta-deep: #a55c40;
  --ink: #2d2820;
  --ink-soft: #4a4339;
  --ink-mute: #786e5f;
  --line: #d9cfb9;

  --serif: 'Fraunces', 'Playfair Display', Georgia, serif;
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  --shadow-soft: 0 4px 24px rgba(45, 40, 32, 0.06);
  --shadow-card: 0 8px 32px rgba(45, 40, 32, 0.08);
  --shadow-deep: 0 16px 48px rgba(45, 40, 32, 0.12);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--sans);
  background: var(--cream);
  color: var(--ink);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
  color: var(--ink);
}

h1 { font-size: clamp(2.5rem, 6vw, 5rem); font-variation-settings: "opsz" 144; }
h2 { font-size: clamp(2rem, 4vw, 3.25rem); font-variation-settings: "opsz" 96; }
h3 { font-size: clamp(1.4rem, 2.5vw, 1.875rem); font-variation-settings: "opsz" 36; }
h4 { font-size: 1.15rem; }

p { font-size: 1.0625rem; color: var(--ink-soft); }

.eyebrow {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--terracotta);
}

.lede {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.8vw, 1.375rem);
  line-height: 1.55;
  color: var(--ink-soft);
  font-style: italic;
  font-weight: 300;
}

/* ============ LAYOUT ============ */
.container { max-width: 1240px; margin: 0 auto; padding: 0 2rem; }
.narrow { max-width: 780px; margin: 0 auto; padding: 0 2rem; }

section { padding: clamp(4rem, 8vw, 7rem) 0; }

/* ============ NAVIGATION ============ */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 232, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 1.25rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  line-height: 1;
}

.brand span { display: block; font-size: 0.65rem; letter-spacing: 0.3em; font-family: var(--sans); font-weight: 500; color: var(--terracotta); text-transform: uppercase; margin-top: 4px; }

.nav-links { display: flex; gap: 2.5rem; align-items: center; }
.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  position: relative;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--ink); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  bottom: -6px; left: 0; right: 0;
  height: 1px;
  background: var(--terracotta);
}

.cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.125rem;
  background: var(--ink);
  color: var(--cream);
  border-radius: 999px;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: background 0.2s, transform 0.2s;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
}
.cart-btn:hover { background: var(--terracotta-deep); }
.cart-btn .count {
  display: inline-block;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  background: var(--terracotta);
  color: var(--cream);
  border-radius: 999px;
  font-size: 0.6875rem;
  line-height: 18px;
  text-align: center;
  font-weight: 600;
}

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 8px; color: var(--ink); }
.menu-toggle svg { width: 24px; height: 24px; }

@media (max-width: 820px) {
  .nav-links { display: none; }
  .nav-links.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--cream);
    padding: 2rem;
    gap: 1.5rem;
    border-bottom: 1px solid var(--line);
    align-items: flex-start;
  }
  .menu-toggle { display: block; }
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  padding: 0.95rem 2rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--cream); }
.btn-primary:hover { background: var(--terracotta-deep); transform: translateY(-1px); box-shadow: var(--shadow-card); }
.btn-outline { background: transparent; color: var(--ink); border: 1px solid var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--cream); }
.btn-terracotta { background: var(--terracotta); color: var(--cream-soft); }
.btn-terracotta:hover { background: var(--terracotta-deep); }
.btn .arrow { transition: transform 0.25s; }
.btn:hover .arrow { transform: translateX(4px); }

/* ============ FOOTER ============ */
footer {
  background: var(--ink);
  color: var(--cream);
  padding: 4rem 0 2rem;
  margin-top: 4rem;
}
footer .container { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 3rem; align-items: start; }
footer h4 { color: var(--cream); font-family: var(--serif); margin-bottom: 1rem; font-size: 1.1rem; }
footer p, footer a { color: rgba(246, 241, 232, 0.7); font-size: 0.9rem; line-height: 1.8; }
footer a:hover { color: var(--terracotta); }
footer .brand { color: var(--cream); margin-bottom: 1rem; }
footer .legal { margin-top: 3rem; padding-top: 2rem; border-top: 1px solid rgba(246, 241, 232, 0.1); font-size: 0.8rem; color: rgba(246, 241, 232, 0.5); text-align: center; }
footer ul { list-style: none; }
footer ul li { margin-bottom: 0.5rem; }

.newsletter-form { display: flex; gap: 8px; margin-top: 1rem; max-width: 360px; }
.newsletter-form input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: rgba(246, 241, 232, 0.08);
  border: 1px solid rgba(246, 241, 232, 0.15);
  border-radius: 999px;
  color: var(--cream);
  font-family: var(--sans);
  font-size: 0.875rem;
}
.newsletter-form input::placeholder { color: rgba(246, 241, 232, 0.4); }
.newsletter-form input:focus { outline: none; border-color: var(--terracotta); }
.newsletter-form button {
  padding: 0.75rem 1.25rem;
  background: var(--terracotta);
  color: var(--cream);
  border: none;
  border-radius: 999px;
  font-family: var(--sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-transform: uppercase;
}
.newsletter-form button:hover { background: var(--terracotta-deep); }

@media (max-width: 720px) {
  footer .container { grid-template-columns: 1fr; gap: 2rem; }
}

/* ============ FORM ELEMENTS ============ */
.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 0.5rem;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 0.875rem 1rem;
  background: var(--cream-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.2s;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--sage-deep);
  background: white;
}
.field textarea { resize: vertical; min-height: 140px; }

/* ============ CART DRAWER ============ */
.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  background: var(--cream-soft);
  z-index: 200;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -16px 0 48px rgba(0,0,0,0.12);
}
.cart-drawer.open { transform: translateX(0); }
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(45, 40, 32, 0.4);
  z-index: 199;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.cart-overlay.open { opacity: 1; pointer-events: auto; }

.cart-header { padding: 1.75rem 2rem; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-family: var(--serif); font-size: 1.5rem; }
.cart-close { background: none; border: none; cursor: pointer; padding: 4px; color: var(--ink-mute); }
.cart-close:hover { color: var(--ink); }

.cart-items { flex: 1; overflow-y: auto; padding: 1rem 2rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 1rem; padding: 1.25rem 0; border-bottom: 1px solid var(--line); align-items: center; }
.cart-item:last-child { border-bottom: none; }
.cart-item-img { width: 64px; height: 64px; border-radius: 4px; object-fit: cover; background: var(--cream-deep); }
.cart-item-name { font-family: var(--serif); font-size: 1rem; color: var(--ink); margin-bottom: 0.25rem; }
.cart-item-price { font-size: 0.85rem; color: var(--ink-mute); }
.cart-qty { display: inline-flex; align-items: center; gap: 0.5rem; margin-top: 0.5rem; }
.cart-qty button { width: 24px; height: 24px; border: 1px solid var(--line); background: white; border-radius: 4px; cursor: pointer; font-family: var(--sans); color: var(--ink); }
.cart-qty button:hover { border-color: var(--ink); }
.cart-qty span { font-size: 0.875rem; min-width: 20px; text-align: center; }
.cart-item-remove { background: none; border: none; color: var(--ink-mute); cursor: pointer; font-size: 0.75rem; text-decoration: underline; align-self: start; }
.cart-item-remove:hover { color: var(--terracotta); }

.cart-empty { padding: 4rem 2rem; text-align: center; color: var(--ink-mute); font-style: italic; font-family: var(--serif); }

.cart-footer { padding: 1.5rem 2rem 2rem; border-top: 1px solid var(--line); background: white; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 1.25rem; }
.cart-total span:first-child { font-size: 0.85rem; color: var(--ink-mute); text-transform: uppercase; letter-spacing: 0.1em; }
.cart-total span:last-child { font-family: var(--serif); font-size: 1.75rem; }
.cart-footer .btn { width: 100%; justify-content: center; }
.cart-footer .note { font-size: 0.75rem; color: var(--ink-mute); text-align: center; margin-top: 0.75rem; }

/* ============ DECORATIVE ============ */
.divider-leaf {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; margin: 2rem 0; color: var(--sage);
}
.divider-leaf::before, .divider-leaf::after {
  content: ''; flex: 1; height: 1px; background: var(--line); max-width: 80px;
}

/* ============ TOAST ============ */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(120%);
  background: var(--ink);
  color: var(--cream);
  padding: 0.875rem 1.5rem;
  border-radius: 999px;
  font-size: 0.875rem;
  box-shadow: var(--shadow-deep);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 300;
  font-weight: 500;
}
.toast.show { transform: translateX(-50%) translateY(0); }
