/* ============================================================
   ÉCLAT — styles.css  (oversized editorial layout)
   ============================================================ */

/* ---------- Brand constants ---------- */
:root {
  --font-serif: "Bodoni Moda", Georgia, serif;
  --font-sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --radius: 16px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

/* ---------- Light theme ---------- */
:root,
[data-theme="light"] {
  --bg: #F7F4EE;
  --surface: #FFFFFF;
  --surface-2: #ECE7DD;
  --text: #161512;
  --text-muted: rgba(22, 21, 18, 0.62);
  --accent: #9A8A68;
  --accent-soft: #B5A47F;
  --line: rgba(22, 21, 18, 0.14);
  --line-strong: rgba(22, 21, 18, 0.26);
  --nav-bg: rgba(247, 244, 238, 0.85);
}

/* ---------- Dark theme ---------- */
[data-theme="dark"] {
  --bg: #0D0D0E;
  --surface: #161617;
  --surface-2: #1E1E20;
  --text: #F4F1EA;
  --text-muted: rgba(244, 241, 234, 0.6);
  --accent: #C9B99A;
  --accent-soft: #DCCFB4;
  --line: rgba(244, 241, 234, 0.14);
  --line-strong: rgba(244, 241, 234, 0.26);
  --nav-bg: rgba(13, 13, 14, 0.82);
}

/* ---------- Reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background 0.35s var(--ease), color 0.35s var(--ease);
}

img, svg { display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }

/* ---------- Accessibility ---------- */
.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: fixed;
  left: -9999px;
  top: 0;
  z-index: 300;
  background: var(--accent);
  color: #0D0D0E;
  padding: 10px 18px;
  border-radius: 0 0 10px 0;
  font-weight: 600;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease),
              box-shadow 0.25s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn-accent { background: var(--accent); color: #0D0D0E; }
.btn-accent:hover { box-shadow: 0 16px 34px -16px var(--accent); }

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn .icon {
  width: 19px;
  height: 19px;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

.icon-sparkle-off { display: none; }
[data-glimmer="off"] .icon-sparkle { display: none; }
[data-glimmer="off"] .icon-sparkle-off { display: block; }

/* ============================================================
   MASTHEAD
   ============================================================ */
.masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px clamp(20px, 4vw, 44px);
  border-bottom: 1px solid var(--line);
  background: var(--nav-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.wordmark {
  font-family: var(--font-serif);
  font-size: 1.6rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.masthead-nav { display: flex; gap: 28px; }
.masthead-nav a {
  font-size: 0.8rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s var(--ease);
}
.masthead-nav a:hover { color: var(--text); }
.masthead-actions { display: flex; gap: 8px; }

/* ============================================================
   COVER
   ============================================================ */
.cover {
  min-height: 86vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(72px, 12vh, 128px) clamp(24px, 6vw, 96px);
  max-width: 1400px;
  margin: 0 auto;
}
.issue-label {
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}
.cover-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(3.1rem, 11.5vw, 9rem);
  line-height: 0.94;
  letter-spacing: -0.01em;
  margin-bottom: 26px;
}
.cover-title em { font-style: italic; color: var(--accent); }
.cover-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  font-weight: 300;
  color: var(--text-muted);
  max-width: 44ch;
  margin-bottom: 38px;
}
.scroll-cue {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text);
}
.scroll-cue span { transition: transform 0.25s var(--ease); }
.scroll-cue:hover span { transform: translateY(4px); }

/* ============================================================
   SECTIONS
   ============================================================ */
.section {
  max-width: 1400px;
  margin: 0 auto;
  padding: clamp(72px, 12vh, 140px) clamp(24px, 6vw, 96px);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 18px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-num {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--accent);
}
.section-head h2 {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1;
  letter-spacing: -0.01em;
  white-space: nowrap;
}
.section-rule {
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
  margin-left: 6px;
}

/* ---------- Pieces (collection) ---------- */
.pieces { display: flex; flex-direction: column; }
.piece {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(28px, 5vw, 64px);
  padding: clamp(32px, 5vw, 56px) 0;
  border-top: 1px solid var(--line);
}
.piece:last-child { border-bottom: 1px solid var(--line); }

.piece-art { color: var(--accent); width: min(220px, 62%); margin: 0 auto; }
.piece-art svg { width: 100%; height: auto; }
.piece:nth-child(even) .piece-art { order: 2; }

.piece-info { display: flex; flex-direction: column; gap: 10px; }
.piece-index {
  font-size: 0.76rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.piece-info h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1;
  letter-spacing: -0.01em;
}
.piece-caption {
  font-style: italic;
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 34ch;
}
.piece-price { font-family: var(--font-serif); font-size: 1.25rem; color: var(--accent); }

/* ---------- Craft ---------- */
.craft { max-width: 860px; }
.craft-statement {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 28px;
}
.craft-copy {
  color: var(--text-muted);
  font-size: 1.12rem;
  line-height: 1.78;
  max-width: 62ch;
  margin-bottom: 44px;
}
.dropcap::first-letter {
  font-family: var(--font-serif);
  float: left;
  font-size: 3.6em;
  line-height: 0.78;
  padding-right: 0.14em;
  color: var(--accent);
}
.craft-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 20px 56px;
}
.craft-facts li { display: flex; flex-direction: column; gap: 2px; }
.craft-facts strong { font-family: var(--font-serif); font-weight: 500; font-size: 1.35rem; }
.craft-facts span { color: var(--text-muted); font-size: 0.92rem; }

/* ---------- Bespoke ---------- */
.bespoke { max-width: 860px; }
.bespoke-title {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
  margin-bottom: 16px;
}
.bespoke-lede { color: var(--text-muted); font-size: 1.1rem; max-width: 46ch; margin-bottom: 34px; }

.bespoke-form { max-width: 560px; display: flex; flex-direction: column; gap: 14px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.82rem; font-weight: 500; color: var(--text-muted); }
.field input,
.field textarea {
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  resize: vertical;
  transition: border-color 0.2s var(--ease);
}
.field input:focus,
.field textarea:focus { outline: none; border-color: var(--accent); }

.form-note { font-size: 0.9rem; min-height: 1.2em; }
.form-note.success { color: var(--accent); }
.form-note.error { color: #d4695c; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 48px clamp(24px, 6vw, 96px) 44px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.wordmark-lg { font-size: 2.6rem; }
.footer-line { color: var(--text-muted); font-size: 0.95rem; }
.footer-copy { font-size: 0.8rem; color: var(--text-muted); opacity: 0.7; }

/* ============================================================
   MOTION — twinkling sparkle
   ============================================================ */
.sparkles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 2;
  overflow: hidden;
}
[data-glimmer="off"] .sparkles { display: none; }

.sparkle {
  position: absolute;
  width: var(--w, 6px);
  height: var(--h, 6px);
  opacity: 0;
  animation: glint var(--dur, 4s) ease-in-out infinite;
  animation-delay: var(--delay, 0s);
}
.sparkle::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--accent);
  clip-path: polygon(50% 0%, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0% 50%, 38% 38%);
}
@keyframes glint {
  0%, 100% { transform: scale(0) rotate(0deg); opacity: 0; }
  50% { transform: scale(1) rotate(45deg); opacity: 0.95; }
}

/* ---------- Reveal on scroll ---------- */
.piece,
.craft,
.bespoke {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.piece.is-visible,
.craft.is-visible,
.bespoke.is-visible { opacity: 1; transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  .sparkles { display: none; }
  .piece, .craft, .bespoke { opacity: 1; transform: none; }
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .masthead-nav { display: none; }
  .piece { grid-template-columns: 1fr; text-align: center; }
  .piece:nth-child(even) .piece-art { order: 0; }
  .piece-art { width: 150px; }
  .piece-info { align-items: center; }
  .piece-caption { max-width: 30ch; }
  .field-row { grid-template-columns: 1fr; }
  .section-head h2 { white-space: normal; }
}
