/* ============================================================
   CINDER & SALT — luxury minimalist editorial, warm ivory theme
   ============================================================ */

:root {
  --bg-light: #f4ede2;
  --bg-dark: #1b1410;
  --accent: #b3401f;
  --accent-soft: #c9764f;
  --text-on-light: #1b1410;
  --text-on-light-muted: #6b5d4f;
  --text-on-dark: #f4ede2;
  --text-on-dark-muted: #cfc3b4;
  --hairline-light: rgba(27, 20, 16, 0.14);
  --hairline-dark: rgba(244, 237, 226, 0.18);

  --font-display: 'Fraunces', serif;
  --font-body: 'Switzer', sans-serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-light);
  color: var(--text-on-light);
  font-family: var(--font-body);
  overflow-x: hidden;
  width: 100%;
}

body {
  cursor: default;
}

::selection {
  background: var(--accent);
  color: var(--bg-light);
}

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

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

/* ---------------- Loader ---------------- */

#loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: var(--bg-dark);
  color: var(--text-on-dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.75rem;
  transition: opacity 0.9s var(--ease-out), visibility 0.9s;
}

#loader.loader-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loader-brand {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 2rem);
  letter-spacing: 0.08em;
  font-weight: 500;
  font-variation-settings: 'opsz' 40;
}

.loader-brand .amp {
  font-style: italic;
  color: var(--accent-soft);
  margin: 0 0.35em;
  font-weight: 400;
}

#loader-bar {
  width: 220px;
  height: 1px;
  background: var(--hairline-dark);
  position: relative;
  overflow: hidden;
}

#loader-bar-fill {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 0%;
  background: var(--text-on-dark);
  transition: width 0.25s ease-out;
}

#loader-percent {
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  color: var(--text-on-dark-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------------- Fixed header ---------------- */

.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 500;
  padding: 1.6rem 3vw;
}

.site-header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.05rem;
  letter-spacing: 0.06em;
  color: var(--text-on-dark);
  font-weight: 500;
  transition: color 0.4s var(--ease-out);
}

.site-header.on-light .logo {
  color: var(--text-on-light);
}

.logo .amp {
  font-style: italic;
  font-weight: 400;
  margin: 0 0.3em;
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 2.4rem;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.4rem;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-on-dark);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  position: relative;
  padding-bottom: 0.3em;
  transition: color 0.4s var(--ease-out);
}

.site-header.on-light .nav-links a {
  color: var(--text-on-light);
}

.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease-out);
}

.nav-links a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header-order-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.6em 1.1em;
  border: 1px solid var(--accent);
  color: var(--text-on-dark);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.header-order-icon {
  flex-shrink: 0;
  transform: translateY(-1px);
}

.header-order-btn:hover {
  background: var(--accent);
  color: var(--bg-light);
}

.site-header.on-light .header-order-btn {
  color: var(--text-on-light);
}

.header-order-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

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

  .header-order-btn {
    padding: 0.55em 0.9em;
    font-size: 0.66rem;
    letter-spacing: 0.12em;
  }
}

/* ---------------- Hero ---------------- */

.hero-standalone {
  position: fixed;
  inset: 0;
  width: 100%;
  background: var(--bg-light);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  z-index: 10;
  padding: 0 5vw;
  will-change: opacity;
}

.hero-inner {
  max-width: 62vw;
}

.hero-label {
  display: block;
  margin-bottom: 1.6rem;
}

.hero-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(2.75rem, 11vw, 11.5rem);
  line-height: 0.98;
  letter-spacing: -0.01em;
  margin: 0;
  color: var(--text-on-light);
}

.hero-heading .word {
  display: inline-block;
  overflow: hidden;
}

.hero-tagline {
  margin: 1.8rem auto 0;
  max-width: 34ch;
  font-size: clamp(0.95rem, 1.1vw, 1.15rem);
  color: var(--text-on-light-muted);
  line-height: 1.6;
}

.section-label {
  display: inline-block;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
}

.scroll-indicator {
  position: absolute;
  bottom: 2.6rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  color: var(--text-on-light-muted);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  animation: bob 2.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 8px); }
}

/* ---------------- Frame canvas ---------------- */

.canvas-wrap {
  position: fixed;
  inset: 0;
  z-index: 1;
  overflow: hidden;
  clip-path: circle(0% at 50% 50%);
  background: var(--bg-dark);
}

.canvas-wrap canvas {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  display: block;
}

#dark-overlay {
  position: fixed;
  inset: 0;
  z-index: 2;
  background: var(--bg-dark);
  opacity: 0;
  pointer-events: none;
}

/* ---------------- Marquee ---------------- */

.marquee-wrap {
  position: fixed;
  top: 50%;
  left: 0;
  width: 100%;
  z-index: 4;
  transform: translateY(-50%);
  opacity: 0;
  pointer-events: none;
  white-space: nowrap;
}

.marquee-text {
  display: inline-block;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: 'opsz' 144;
  font-size: clamp(3rem, 12vw, 11rem);
  letter-spacing: -0.01em;
  color: var(--text-on-dark);
  text-transform: uppercase;
}

/* ---------------- Scroll container & sections ---------------- */

#scroll-container {
  position: relative;
  height: 850vh;
  z-index: 3;
}

.scroll-section {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  transform: translateY(-50%);
  padding: 0 5vw;
}

.section-inner {
  max-width: 40vw;
}

.align-left { padding-left: 5vw; padding-right: 55vw; }
.align-right { padding-left: 55vw; padding-right: 5vw; }
.align-left .section-inner,
.align-right .section-inner { max-width: 40vw; }

.section-heading {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 100;
  font-size: clamp(2.2rem, 4.2vw, 4.2rem);
  line-height: 1.04;
  margin: 0.7rem 0 1.1rem;
  color: var(--text-on-light);
}

.section-body {
  font-size: clamp(0.95rem, 1.05vw, 1.1rem);
  line-height: 1.65;
  color: var(--text-on-light-muted);
  max-width: 32ch;
  margin: 0;
}

.section-content {
  color: var(--text-on-light);
}

.section-content .section-heading,
.section-content .section-body {
  text-shadow: 0 2px 28px rgba(27, 20, 16, 0.5), 0 1px 3px rgba(27, 20, 16, 0.35);
}

.section-content .section-label {
  text-shadow: 0 1px 12px rgba(27, 20, 16, 0.55), 0 1px 2px rgba(27, 20, 16, 0.6);
}

/* content sections sit over the frame canvas — needs a readable veil, handled via
   #dark-overlay driven by JS; text stays on --text-on-light till overlay darkens */

.section-marquee-spacer .section-inner { opacity: 0; }

/* ---------------- Stats ---------------- */

.section-stats {
  text-align: center;
}

.stats-inner {
  max-width: 70vw;
  margin: 0 auto;
}

.section-stats .section-heading {
  color: var(--text-on-dark);
  font-size: clamp(2rem, 3.6vw, 3.6rem);
}

.section-stats .section-label {
  color: var(--accent-soft);
}

.stats-grid {
  margin-top: 3rem;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem;
}

.stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  border-left: 1px solid var(--hairline-dark);
  padding-left: 1.5rem;
}

.stat:first-child { border-left: none; padding-left: 0; }

.stat-number {
  font-family: var(--font-display);
  font-weight: 600;
  font-variation-settings: 'opsz' 100;
  font-size: clamp(2.4rem, 4.4vw, 4.4rem);
  color: var(--text-on-dark);
  line-height: 1;
}

.stat-suffix {
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-top: 0.4rem;
}

.stat-label {
  margin-top: 0.9rem;
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--text-on-dark-muted);
  max-width: 20ch;
}

/* ---------------- CTA ---------------- */

.section-cta {
  text-align: left;
}

.align-split {
  padding-left: 8vw;
  padding-right: 8vw;
}

.align-split .section-inner {
  max-width: 44vw;
}

.section-cta .section-heading,
.section-cta .section-body {
  color: var(--text-on-dark);
}

.section-cta .section-body {
  color: var(--text-on-dark-muted);
}

.section-cta .section-heading {
  font-size: clamp(2.6rem, 4.8vw, 5rem);
}

.cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 2.4rem;
  padding: 1rem 2.2rem;
  border: 1px solid var(--accent);
  color: var(--text-on-dark);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: background 0.4s var(--ease-out), color 0.4s var(--ease-out);
}

.cta-button:hover {
  background: var(--accent);
  color: var(--bg-light);
}

/* ---------------- Mobile ---------------- */

@media (max-width: 768px) {
  #scroll-container { height: 550vh; }

  .hero-inner { max-width: 88vw; }

  .align-left, .align-right, .align-split {
    padding-left: 7vw;
    padding-right: 7vw;
    text-align: center;
  }

  .align-left .section-inner,
  .align-right .section-inner,
  .align-split .section-inner {
    max-width: 90vw;
    margin: 0 auto;
  }

  .section-cta { text-align: center; }

  .marquee-text { font-size: clamp(2.5rem, 16vw, 6rem); }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 2.5rem;
  }

  .stat:nth-child(3) { border-left: none; padding-left: 0; }

  .stats-inner { max-width: 90vw; }
}
