/* ============================================================
   EVERLIT — Editorial Heritage Brand Site
   Design system: deep ivory + ink, serif-first, classical proportions
   ============================================================ */

:root {
  /* Editorial palette (default) */
  --ink: #1a1714;               /* near-black, warm */
  --ink-soft: #3b332c;
  --ink-muted: #76675a;
  --ivory: #f5efe4;             /* deep ivory */
  --ivory-deep: #ebe2d2;
  --ivory-paper: #faf5ea;
  --rule: #c9bda8;
  --rule-soft: #ddd1bb;
  --bronze: #8a5a2b;
  --bronze-deep: #5e3a15;
  --oxblood: #6b2022;
  --wax: #a4461e;               /* terracotta wax */
  --gold-leaf: #b48a44;
  --accent: var(--bronze);

  --bg: var(--ivory);
  --surface: var(--ivory-paper);

  /* Type */
  --serif-display: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --serif-text: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  --sans: "Inter Tight", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --script: "Italiana", "Cormorant Garamond", serif;

  /* Spacing grid */
  --pad: clamp(20px, 4vw, 56px);
  --max: 1440px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* Bolder variant — theatrical night-ink */
[data-variant="bold"] {
  --ink: #0d0b08;
  --ink-soft: #1a1612;
  --ink-muted: #6a5a48;
  --ivory: #0d0b08;
  --ivory-deep: #17120c;
  --ivory-paper: #14100a;
  --rule: #3a2f22;
  --rule-soft: #2a2218;
  --bronze: #d49455;
  --bronze-deep: #b57838;
  --oxblood: #8e2a22;
  --wax: #d06a33;
  --gold-leaf: #e6b964;
  --accent: var(--gold-leaf);
  --bg: var(--ivory);
  --surface: var(--ivory-deep);
}

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif-text);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "liga", "dlig", "kern";
  overflow-x: hidden;
}

[data-variant="bold"] body { color: #e9dfcf; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }

/* Typography scale */
.display {
  font-family: var(--serif-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 0.92;
}
.italic-accent {
  font-family: var(--serif-display);
  font-style: italic;
  font-weight: 400;
}
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-muted);
}
[data-variant="bold"] .eyebrow { color: var(--gold-leaf); }

.meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.rule {
  height: 1px;
  background: var(--rule);
  border: none;
  margin: 0;
}
.rule-soft { background: var(--rule-soft); }

/* Container */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--pad);
}

/* Scrollbar */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: var(--rule); border-radius: 10px; }

/* Selection */
::selection { background: var(--ink); color: var(--ivory-paper); }
[data-variant="bold"] ::selection { background: var(--gold-leaf); color: var(--ink); }

/* Header ============================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-soft);
}
.header-main {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 22px 0;
  gap: 24px;
}
.header-nav { display: flex; gap: 28px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; }
.header-nav button, .header-nav a { position: relative; padding: 6px 2px; transition: color .2s; }
.header-nav button:hover { color: var(--bronze); }
.header-nav button.active::after {
  content: "";
  position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: var(--ink);
}
.wordmark {
  font-family: var(--serif-display);
  font-size: 32px;
  letter-spacing: 0.18em;
  font-weight: 500;
  text-align: center;
  text-transform: uppercase;
}
.wordmark sup {
  font-size: 9px;
  font-family: var(--sans);
  letter-spacing: 0.1em;
  vertical-align: super;
  margin-left: 2px;
}
.header-tools { display: flex; justify-content: flex-end; gap: 20px; font-family: var(--sans); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; }
.header-tools button { display: inline-flex; align-items: center; gap: 8px; }
.cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--ink); color: var(--ivory-paper);
  border-radius: 10px; font-size: 10px; letter-spacing: 0.04em;
}
[data-variant="bold"] .cart-count { background: var(--gold-leaf); color: var(--ink); }

/* Footer ============================================ */
.site-footer {
  background: var(--ink);
  color: var(--ivory-paper);
  padding: 80px 0 32px;
  margin-top: 120px;
}
[data-variant="bold"] .site-footer { background: #060504; border-top: 1px solid var(--rule); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.footer-col h4 {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.24em; text-transform: uppercase;
  font-weight: 500; margin: 0 0 20px; color: rgba(255,255,255,0.6);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; font-family: var(--sans); font-size: 13px; }
.footer-col ul li { margin-bottom: 10px; }
.footer-col a:hover { color: var(--bronze); }
.footer-brand .wordmark { text-align: left; color: var(--ivory-paper); font-size: 28px; margin-bottom: 16px; }
.footer-brand p { font-family: var(--serif-text); font-style: italic; font-size: 16px; line-height: 1.5; color: rgba(255,255,255,0.7); max-width: 28ch; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 28px;
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}

/* Buttons ============================================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 16px 32px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--ivory-paper);
  transition: all 0.28s var(--ease);
  cursor: pointer;
}
.btn:hover { background: transparent; color: var(--ink); }
[data-variant="bold"] .btn { background: var(--gold-leaf); color: var(--ink); border-color: var(--gold-leaf); }
[data-variant="bold"] .btn:hover { background: transparent; color: var(--gold-leaf); }

.btn-ghost {
  background: transparent; color: var(--ink); border-color: var(--ink);
}
.btn-ghost:hover { background: var(--ink); color: var(--ivory-paper); }
[data-variant="bold"] .btn-ghost { color: var(--gold-leaf); border-color: var(--gold-leaf); background: transparent; }
[data-variant="bold"] .btn-ghost:hover { background: var(--gold-leaf); color: var(--ink); }

.btn-link {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  padding: 6px 0; border-bottom: 1px solid currentColor;
  display: inline-flex; align-items: center; gap: 10px;
}
.btn-link:hover { color: var(--bronze); }

/* Utility */
.stack > * + * { margin-top: var(--gap, 1rem); }
.flex { display: flex; }
.fig-caption {
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--ink-muted);
}

/* Section scaffolding */
section { padding: 100px 0; position: relative; }
.section-title {
  font-size: clamp(48px, 6vw, 88px);
  font-family: var(--serif-display);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: -0.02em;
  margin: 0 0 0.3em;
}
.section-intro {
  font-size: clamp(18px, 1.6vw, 22px);
  font-style: italic;
  color: var(--ink-soft);
  max-width: 52ch;
  line-height: 1.5;
}
[data-variant="bold"] .section-intro { color: #c8bca6; }

/* Page transitions */
.page-enter {
  animation: pageEnter .5s var(--ease) both;
}
@keyframes pageEnter {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Product card */
.product-card {
  position: relative;
  cursor: pointer;
  display: flex; flex-direction: column;
}
.product-card-img {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--ivory-deep);
  overflow: hidden;
}
.product-card-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 1.2s var(--ease), filter .5s var(--ease);
}
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-meta {
  padding: 18px 2px 0;
  display: flex; justify-content: space-between; align-items: baseline;
}
.product-card-name {
  font-family: var(--serif-display); font-size: 20px; font-weight: 400;
}
.product-card-name small { font-style: italic; color: var(--ink-muted); font-size: 14px; margin-left: 6px; }
.product-card-price { font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; }
.product-card-tag {
  position: absolute; top: 14px; left: 14px;
  font-family: var(--sans); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
  background: var(--ivory-paper); padding: 5px 10px; color: var(--ink);
}
[data-variant="bold"] .product-card-tag { background: var(--gold-leaf); color: var(--ink); }

/* Tweaks panel */
.tweaks-panel {
  position: fixed; right: 24px; bottom: 24px; z-index: 200;
  background: var(--ivory-paper); color: var(--ink);
  border: 1px solid var(--rule); padding: 20px; width: 280px;
  font-family: var(--sans); font-size: 12px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
}
[data-variant="bold"] .tweaks-panel { background: #1a1510; color: #e9dfcf; border-color: var(--rule); }
.tweaks-panel h4 {
  margin: 0 0 12px; font-size: 11px; letter-spacing: 0.2em;
  text-transform: uppercase; font-weight: 600;
}
.tweaks-row { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.tweak-swatch {
  flex: 1; min-width: 60px; padding: 10px; border: 1px solid var(--rule);
  background: var(--ivory); color: var(--ink);
  text-align: center; letter-spacing: 0.14em; text-transform: uppercase;
  font-size: 10px; cursor: pointer;
}
.tweak-swatch.active { background: var(--ink); color: var(--ivory-paper); border-color: var(--ink); }
[data-variant="bold"] .tweak-swatch { background: #24190f; color: #e9dfcf; }
[data-variant="bold"] .tweak-swatch.active { background: var(--gold-leaf); color: var(--ink); border-color: var(--gold-leaf); }

/* Forms */
input, select, textarea {
  font-family: var(--serif-text); font-size: 16px;
  background: transparent; color: inherit;
  border: none; border-bottom: 1px solid var(--rule);
  padding: 10px 0; outline: none; width: 100%;
  transition: border-color .2s;
}
input:focus, select:focus, textarea:focus { border-bottom-color: var(--ink); }
label {
  display: block; font-family: var(--sans); font-size: 10px; letter-spacing: 0.2em;
  text-transform: uppercase; color: var(--ink-muted); margin-bottom: 6px;
}

/* Responsive base */
@media (max-width: 860px) {
  .header-nav { display: none; }
  .wordmark { font-size: 22px; }
  section { padding: 64px 0; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

/* Editorial card on home */
.editorial-card { border: none; padding: 0; }
.editorial-card:hover img { transform: scale(1.04); }
.editorial-card:hover { outline: 1px solid var(--ink); outline-offset: -1px; }

@keyframes fadeIn { from { opacity: 0.4; } to { opacity: 1; } }
