/* CHI Global — Editorial cream aesthetic */
:root {
  --cream: #f5f1e8;
  --cream-2: #ede6d5;
  --paper: #fffbf3;
  --ink: #1a3d2e;
  --ink-2: #0f2a1f;
  --ink-soft: #2d4a3a;
  --gold: #c89a3a;
  --gold-deep: #a87b1f;
  --terracotta: #b8543a;
  --olive: #6b7a3a;
  --rule: rgba(26, 61, 46, 0.18);
  --rule-strong: rgba(26, 61, 46, 0.4);
  --serif: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --display: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans: 'Inter Tight', 'Söhne', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* Note: Fraunces is on the avoid-list but works for editorial brand here.
   Using a less common pairing: PP Editorial New feel via Cormorant Garamond display weights. */

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

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

/* Typography */
.serif { font-family: var(--serif); }
.display { font-family: var(--display); font-weight: 300; letter-spacing: -0.02em; }
.mono { font-family: var(--mono); text-transform: uppercase; letter-spacing: 0.12em; font-size: 11px; }

h1, h2, h3, h4 { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; line-height: 1.05; text-wrap: balance; }

/* Layout */
.container { max-width: 1440px; margin: 0 auto; padding: 0 48px; }
.container-narrow { max-width: 1120px; margin: 0 auto; padding: 0 48px; }

/* Hairline rule */
.rule { height: 1px; background: var(--rule); width: 100%; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 28px;
  font-family: var(--sans); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--ink); background: var(--ink); color: var(--cream);
  cursor: pointer; text-decoration: none;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative; overflow: hidden;
}
.btn:hover { background: var(--gold-deep); border-color: var(--gold-deep); color: var(--paper); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.btn-arrow { transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.btn:hover .btn-arrow { transform: translateX(6px); }

/* Reveal animations */
.reveal { opacity: 0; transform: translateY(24px); transition: opacity 1.1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1.1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* Mask reveal for words */
.mask-line { display: block; overflow: hidden; }
.mask-inner { display: block; transform: translateY(105%); transition: transform 1.2s cubic-bezier(0.16, 1, 0.3, 1); }
.in .mask-inner { transform: translateY(0); }
.mask-line.d1 .mask-inner { transition-delay: 0.05s; }
.mask-line.d2 .mask-inner { transition-delay: 0.15s; }
.mask-line.d3 .mask-inner { transition-delay: 0.25s; }
.mask-line.d4 .mask-inner { transition-delay: 0.35s; }

/* Marquee */
@keyframes marquee {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
.marquee-track { display: flex; width: max-content; animation: marquee 60s linear infinite; }
.motion-low .marquee-track { animation-duration: 120s; }
.motion-off .marquee-track { animation: none; }

/* Subtle floating */
@keyframes float-y {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-12px); }
}
.float { animation: float-y 6s ease-in-out infinite; }

/* Grain overlay */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 100;
  opacity: 0.06; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' /%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' /%3E%3C/svg%3E");
}

/* Editorial number style */
.numeral {
  font-family: var(--display); font-weight: 200;
  font-feature-settings: 'lnum', 'tnum';
  font-size: clamp(80px, 12vw, 200px);
  line-height: 0.9; letter-spacing: -0.04em;
}

/* Counter animation */
.counter { font-variant-numeric: tabular-nums; }

/* Section spacing */
section { padding: 120px 0; position: relative; }
section.tight { padding: 80px 0; }

/* Headline sizes */
.kicker { font-family: var(--sans); font-size: 11px; font-weight: 500; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-soft); }
.h-display { font-size: clamp(56px, 9vw, 156px); line-height: 0.92; font-family: var(--display); font-weight: 200; letter-spacing: -0.03em; }
.h1 { font-size: clamp(48px, 7vw, 112px); line-height: 0.96; font-family: var(--serif); font-weight: 400; letter-spacing: -0.02em; }
.h2 { font-size: clamp(36px, 5vw, 72px); line-height: 1.02; font-family: var(--serif); font-weight: 400; }
.h3 { font-size: clamp(24px, 2.6vw, 36px); line-height: 1.15; font-family: var(--serif); font-weight: 400; }
.lede { font-family: var(--serif); font-style: italic; font-size: clamp(20px, 1.6vw, 26px); line-height: 1.4; font-weight: 400; color: var(--ink-soft); }

/* Italic emphasis */
em.swash { font-family: var(--display); font-style: italic; font-weight: 300; }

/* Cards */
.card-image { position: relative; overflow: hidden; }
.card-image img { transition: transform 1.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.card-image:hover img { transform: scale(1.06); }

/* Form input */
.field {
  width: 100%; padding: 14px 0;
  background: transparent; border: 0; border-bottom: 1px solid var(--rule-strong);
  font-family: var(--serif); font-size: 22px; color: var(--ink);
  transition: border-color 0.3s;
}
.field:focus { outline: none; border-bottom-color: var(--ink); }
.field::placeholder { color: rgba(26, 61, 46, 0.35); }

label { display: block; font-family: var(--sans); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-soft); margin-bottom: 4px; }

/* Selection */
::selection { background: var(--gold); color: var(--ink); }

/* Header */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 24px 48px;
  display: flex; align-items: center; justify-content: space-between;
  mix-blend-mode: difference; color: var(--cream);
  transition: background 0.4s, color 0.4s, mix-blend-mode 0.4s;
}
.site-header a { color: inherit; text-decoration: none; }
.site-header.scrolled {
  background: var(--cream); color: var(--ink); mix-blend-mode: normal;
  border-bottom: 1px solid var(--rule);
  padding: 16px 48px;
}

.nav-link {
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 500;
}
.nav-link:hover { opacity: 0.6; }

/* Mark */
.brandmark {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display); font-weight: 300; font-size: 22px; letter-spacing: -0.01em;
}
.brandmark .seal {
  width: 32px; height: 32px; border: 1.5px solid currentColor; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--display); font-size: 13px; font-weight: 400; font-style: italic;
}

/* Video frame */
.video-frame {
  position: relative; overflow: hidden; background: var(--ink-2);
  border: 1px solid var(--rule);
}
.video-frame video, .video-frame .video-placeholder {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
.video-placeholder {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(200, 154, 58, 0.5), transparent 60%),
    radial-gradient(ellipse at 70% 60%, rgba(107, 122, 58, 0.6), transparent 60%),
    linear-gradient(135deg, #2d4a3a 0%, #0f2a1f 100%);
  display: grid; place-items: center; color: var(--cream);
}

/* Process timeline dots */
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink); display: inline-block; }

/* Accordion */
.accordion-item {
  border-top: 1px solid var(--rule);
  padding: 32px 0;
  cursor: pointer;
}
.accordion-item:last-child { border-bottom: 1px solid var(--rule); }
.accordion-q {
  display: flex; justify-content: space-between; align-items: baseline; gap: 32px;
  font-family: var(--serif); font-size: clamp(22px, 2.2vw, 32px); font-weight: 400;
}
.accordion-a {
  max-height: 0; overflow: hidden; transition: max-height 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), margin-top 0.6s;
  font-family: var(--serif); font-size: 19px; line-height: 1.5; color: var(--ink-soft);
}
.accordion-item.open .accordion-a { max-height: 400px; margin-top: 20px; }
.accordion-toggle {
  width: 32px; height: 32px; border: 1px solid var(--rule-strong); border-radius: 50%;
  display: grid; place-items: center; flex-shrink: 0;
  transition: transform 0.4s, background 0.4s;
}
.accordion-item.open .accordion-toggle { transform: rotate(45deg); background: var(--ink); color: var(--cream); }

/* Step indicator */
.step-indicator { display: flex; gap: 4px; }
.step-indicator span {
  flex: 1; height: 2px; background: var(--rule); transition: background 0.5s;
}
.step-indicator span.active { background: var(--ink); }

/* Tag chip */
.chip {
  display: inline-block; padding: 6px 12px;
  border: 1px solid var(--rule-strong); border-radius: 100px;
  font-family: var(--sans); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  cursor: pointer; transition: all 0.3s;
}
.chip:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.chip.selected { background: var(--ink); color: var(--cream); border-color: var(--ink); }

/* Underline link */
.ul-link {
  position: relative; text-decoration: none; color: inherit;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase;
  font-weight: 500;
  padding-bottom: 4px;
  border-bottom: 1px solid currentColor;
  transition: color 0.3s;
}
.ul-link:hover { color: var(--gold-deep); }

/* Ticker bar */
.ticker {
  background: var(--ink); color: var(--cream);
  padding: 14px 0; overflow: hidden; white-space: nowrap;
  border-top: 1px solid var(--ink-soft); border-bottom: 1px solid var(--ink-soft);
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 32px;
  margin-right: 32px;
  font-family: var(--sans); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase;
}
.ticker-star { color: var(--gold); }

/* Image collage gridish */
.collage { display: grid; gap: 16px; }

/* Sticky scrub */
.scrub-stage { position: relative; }

/* Cursor follower */
.cursor-dot {
  position: fixed; width: 8px; height: 8px; border-radius: 50%;
  background: var(--ink); pointer-events: none; z-index: 999;
  mix-blend-mode: difference;
  transition: width 0.3s, height 0.3s, background 0.3s;
  transform: translate(-50%, -50%);
  display: none;
}
@media (hover: hover) { .cursor-dot { display: block; } }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 42, 31, 0.75);
  backdrop-filter: blur(8px);
  display: grid; place-items: center; z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity 0.4s;
}
.modal-backdrop.open { opacity: 1; pointer-events: all; }
.modal {
  background: var(--cream); width: min(720px, calc(100vw - 32px));
  max-height: 90vh; overflow: auto;
  padding: 56px 64px;
  transform: translateY(20px); transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
  position: relative;
}
.modal-backdrop.open .modal { transform: translateY(0); }
.modal-close {
  position: absolute; top: 24px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rule-strong);
  background: transparent; cursor: pointer; display: grid; place-items: center;
}

/* Dark section */
.dark { background: var(--ink-2); color: var(--cream); }
.dark .kicker { color: rgba(245, 241, 232, 0.6); }
.dark .lede { color: rgba(245, 241, 232, 0.7); }
.dark .rule { background: rgba(245, 241, 232, 0.15); }
.dark .accordion-item { border-color: rgba(245, 241, 232, 0.15); }
.dark .accordion-toggle { border-color: rgba(245, 241, 232, 0.3); }
.dark .accordion-a { color: rgba(245, 241, 232, 0.7); }
.dark .field { border-bottom-color: rgba(245, 241, 232, 0.3); color: var(--cream); font-family: var(--serif); }
.dark .field:focus { border-bottom-color: var(--cream); }
.dark .field::placeholder { color: rgba(245, 241, 232, 0.4); }
.dark label { color: rgba(245, 241, 232, 0.6); }
.dark .btn { background: var(--cream); color: var(--ink); border-color: var(--cream); }
.dark .btn:hover { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.dark .chip { border-color: rgba(245, 241, 232, 0.3); }
.dark .chip:hover, .dark .chip.selected { background: var(--cream); color: var(--ink); }

/* Responsive */
@media (max-width: 1024px) {
  section { padding: 96px 0; }
}

@media (max-width: 900px) {
  .container, .container-narrow { padding: 0 24px; }
  .site-header { padding: 14px 20px; }
  .site-header.scrolled { padding: 10px 20px; }
  section { padding: 72px 0; }
  .nav-desktop { display: none !important; }

  /* Universal grid stacking on mobile for all sections */
  section .container > div[style*="grid-template-columns"],
  section .container > div > div[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  section .container [style*="grid-template-columns: repeat(4"],
  section .container [style*="grid-template-columns: repeat(3"] {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px !important;
  }
  section .container [style*="grid-template-columns: repeat(4"] [class*="numeral"],
  section .container [style*="grid-template-columns: repeat(3"] [class*="numeral"] {
    font-size: clamp(48px, 14vw, 80px) !important;
  }
  section .container > div[style*="min-height: 540"],
  section .container [style*="minHeight: 540"] { min-height: auto !important; }
  section .card-image img[style*="min-height: 540"],
  section .card-image img[style*="minHeight: 540"] { min-height: 320px !important; height: 320px !important; }

  /* Hero stack */
  #top .container > div[style*="grid-template-columns: 1.2fr 1fr"],
  #top .container > div[style*="gridTemplateColumns"] { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Footer */
  footer .container > div[style*="grid-template-columns: 2fr"] { grid-template-columns: 1fr 1fr !important; gap: 32px !important; }
  .modal { padding: 32px 24px; }
  .brandmark { font-size: 18px; }
  .brandmark .seal { width: 28px; height: 28px; font-size: 12px; }
  .site-header .btn { padding: 10px 16px !important; font-size: 11px !important; }
  .site-header .btn span.btn-arrow { display: none; }

  /* Stack any 2/3/4-column grid */
  .grid-stack-mobile { grid-template-columns: 1fr !important; gap: 32px !important; }

  .field { font-size: 18px; }
  .accordion-q { font-size: 22px; gap: 16px; }
  .h-display { font-size: clamp(40px, 12vw, 72px) !important; }
  .h1 { font-size: clamp(36px, 10vw, 56px) !important; }
  .h2 { font-size: clamp(28px, 7vw, 44px) !important; }
  .h3 { font-size: clamp(20px, 5vw, 26px) !important; }
  .lede { font-size: 17px !important; }
  .numeral { font-size: clamp(56px, 18vw, 96px) !important; }
  .ticker-item { font-size: 11px; gap: 20px; margin-right: 20px; }

  .btn { padding: 14px 20px; font-size: 12px; }
}

@media (max-width: 600px) {
  .container, .container-narrow { padding: 0 20px; }
  .site-header { padding: 12px 16px; }
  section { padding: 56px 0; }
  .modal { padding: 28px 20px; max-height: 88vh; }
  .modal-close { top: 16px; right: 16px; width: 36px; height: 36px; }

  section .container [style*="grid-template-columns: repeat(4"],
  section .container [style*="grid-template-columns: repeat(3"],
  section .container [style*="grid-template-columns: repeat(2"] {
    grid-template-columns: 1fr !important;
  }
  footer .container > div[style*="grid-template-columns: 2fr"] { grid-template-columns: 1fr !important; }
  .modal [style*="grid-template-columns: 1fr 1fr"] { grid-template-columns: 1fr !important; }
  .product-hero { padding-top: 100px; padding-bottom: 40px; }
}
