/* Wastafy AI — Off-white + charcoal + single electric accent.
   Coraly-inspired: editorial luxury, restrained motion, premium feel. */

:root {
  --bg: #f4f1ec;
  --bg-2: #ebe7df;
  --ink: #161513;
  --ink-2: #2a2926;
  --muted: #6f6b64;
  --rule: #1615131a;
  --rule-2: #16151333;
  --accent: #ff3d18;
  --accent-2: #ffe2d8;
  --paper: #ffffff;
  --shadow: 0 1px 0 #00000008, 0 20px 40px -20px #00000014;
  --grotesk: "Space Grotesk", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --serif: "Instrument Serif", "Times New Roman", serif;
  --ease: cubic-bezier(.2,.7,.2,1);
  --nav-h: 64px;
}

[data-theme="dark"] {
  --bg: #0c0b0a;
  --bg-2: #141312;
  --ink: #f1ede6;
  --ink-2: #d8d3ca;
  --muted: #8a857c;
  --rule: #ffffff14;
  --rule-2: #ffffff2a;
  --accent: #ff5a30;
  --accent-2: #2a1410;
  --paper: #161514;
  --shadow: 0 1px 0 #ffffff05, 0 20px 40px -20px #00000080;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--grotesk);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--accent); color: var(--paper); }

.mono { font-family: var(--mono); letter-spacing: -0.01em; }
.up { text-transform: uppercase; letter-spacing: 0.02em; }
.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 32px;
}

/* === Sticky Top Nav === */
.topnav {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  width: calc(100% - 32px);
  max-width: 1280px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 10px 14px 10px 18px;
  border: 1px solid var(--rule-2);
  border-radius: 999px;
  background: color-mix(in oklab, var(--bg) 75%, transparent);
  backdrop-filter: blur(24px) saturate(140%);
  -webkit-backdrop-filter: blur(24px) saturate(140%);
  transition: background .4s var(--ease), border-color .4s var(--ease), box-shadow .4s var(--ease);
}
.topnav.scrolled {
  background: color-mix(in oklab, var(--bg) 92%, transparent);
  box-shadow: 0 8px 30px -12px #00000018;
}
.topnav-logo { display: flex; align-items: center; }
@keyframes spin { to { transform: rotate(360deg); } }
.topnav-links {
  display: flex;
  gap: 6px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.topnav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  transition: all .25s var(--ease);
}
.topnav-links a:hover { background: var(--ink); color: var(--bg); }
.topnav-right { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--ink);
  color: var(--bg);
  border: 0;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform .25s var(--ease), background .25s var(--ease);
}
.nav-cta:hover { background: var(--accent); color: #fff; transform: translateY(-1px); }
.nav-cta .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.nav-cta:hover .dot { background: #fff; }

.nav-icon-btn {
  width: 34px; height: 34px;
  border-radius: 999px;
  border: 1px solid var(--rule-2);
  background: transparent;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  transition: all .25s var(--ease);
}
.nav-icon-btn:hover { background: var(--ink); color: var(--bg); }

@media (max-width: 880px) {
  .topnav { grid-template-columns: 1fr auto; }
  .topnav-links { display: none; }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: transform .3s var(--ease), background .3s var(--ease), color .3s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--ink); }
.btn.ghost:hover { background: var(--ink); color: var(--bg); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.accent:hover { background: var(--ink); border-color: var(--ink); }
.btn .dot { width: 6px; height: 6px; background: currentColor; border-radius: 50%; }

/* === Sections === */
.section {
  padding: 140px 0;
  border-top: 1px solid var(--rule);
  position: relative;
}
.section-head {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 80px;
  margin-bottom: 64px;
}
.section-head .label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.section-head .num {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.14em;
}
.section-head h2 {
  margin: 0;
  font-size: clamp(40px, 5vw, 80px);
  line-height: 0.95;
  letter-spacing: -0.04em;
  text-transform: uppercase;
  font-weight: 500;
  max-width: 18ch;
}
.section-head h2 .it {
  font-family: var(--serif);
  font-style: italic;
  text-transform: lowercase;
  font-weight: 400;
  letter-spacing: -0.02em;
}

@media (max-width: 800px) {
  .section { padding: 64px 0; }
  .section-head { grid-template-columns: 1fr; gap: 16px; margin-bottom: 32px; }
  .section-head h2 { font-size: clamp(32px, 9vw, 48px); }
}

/* === Reveal === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1.1s cubic-bezier(.16,.84,.3,1), transform 1.1s cubic-bezier(.16,.84,.3,1);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* === Reduced motion guard === */
.no-motion .parallax-word,
.no-motion .float-loop,
.no-motion .hover-tilt { animation: none !important; transform: none !important; }

/* === Persistent oversized parallax wordmark === */
.parallax-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}
.parallax-word {
  position: absolute;
  font-family: var(--grotesk);
  font-weight: 500;
  letter-spacing: -0.06em;
  text-transform: uppercase;
  color: var(--ink);
  opacity: 0.045;
  white-space: nowrap;
  user-select: none;
  will-change: transform;
  font-size: clamp(220px, 38vw, 640px);
  line-height: 0.78;
  left: -2vw;
  top: 22vh;
  transform: translate3d(0, var(--py, 0px), 0);
}
[data-theme="dark"] .parallax-word { opacity: 0.06; }

.parallax-word-2 {
  position: absolute;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(140px, 22vw, 360px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--accent);
  opacity: 0.08;
  white-space: nowrap;
  right: -4vw;
  top: 70vh;
  user-select: none;
  will-change: transform;
  transform: translate3d(0, var(--py2, 0px), 0);
}

/* Card sections — kill internal section borders + reduce vertical padding slightly */
.card .section {
  padding: 110px 0;
  border-top: 0;
}
.card .section + .section { border-top: 1px solid var(--rule); }

@media (max-width: 800px) {
  .card .section { padding: 56px 0; }
}

/* === Card sections === */
.card-shell {
  position: relative;
  z-index: 1;
}
.card {
  position: relative;
  background: var(--paper);
  border-radius: 28px;
  margin: 0 24px 24px 24px;
  box-shadow:
    0 1px 0 #00000006,
    0 30px 60px -30px #00000018,
    0 8px 16px -8px #0000000a;
  overflow: hidden;
  isolation: isolate;
}
.card.card-flat {
  background: var(--bg-2);
  box-shadow: 0 1px 0 #00000006, 0 16px 30px -20px #00000010;
}
.card .section { border-top: 0; }
.card + .card { margin-top: 0; }
[data-theme="dark"] .card {
  background: var(--paper);
  box-shadow:
    0 1px 0 #ffffff05,
    0 40px 80px -40px #00000099,
    0 8px 16px -8px #00000060;
}

@media (max-width: 700px) {
  .card { border-radius: 22px; margin: 0 12px 16px 12px; }
}

/* === Section number overlap === */
.section-numeral {
  position: absolute;
  top: -24px;
  left: 24px;
  font-family: var(--grotesk);
  font-weight: 500;
  font-size: clamp(80px, 12vw, 180px);
  line-height: 0.85;
  letter-spacing: -0.05em;
  color: var(--accent);
  opacity: 0.95;
  pointer-events: none;
  z-index: 5;
  mix-blend-mode: multiply;
}
[data-theme="dark"] .section-numeral { mix-blend-mode: screen; opacity: 0.7; }

/* === Idle float loops === */
@keyframes floatY {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
.float-loop { animation: floatY 6s cubic-bezier(.4,0,.2,1) infinite; }
.float-loop-slow { animation: floatY 9s cubic-bezier(.4,0,.2,1) infinite; }

/* === Stagger helpers ===
   Apply to a parent .reveal — children fade in with cascading delay
   once the parent enters viewport. */
.reveal.stagger > * {
  opacity: 0;
  transform: translateY(36px);
  transition: opacity 1s cubic-bezier(.16,.84,.3,1), transform 1s cubic-bezier(.16,.84,.3,1);
}
.reveal.stagger.in > * {
  opacity: 1;
  transform: none;
}
.reveal.stagger.in > *:nth-child(1) { transition-delay: 0ms; }
.reveal.stagger.in > *:nth-child(2) { transition-delay: 90ms; }
.reveal.stagger.in > *:nth-child(3) { transition-delay: 180ms; }
.reveal.stagger.in > *:nth-child(4) { transition-delay: 270ms; }
.reveal.stagger.in > *:nth-child(5) { transition-delay: 360ms; }
.reveal.stagger.in > *:nth-child(6) { transition-delay: 450ms; }

/* === Display type === */
.display {
  font-size: clamp(56px, 11vw, 180px);
  line-height: 0.86;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  font-weight: 500;
  margin: 0;
}
.display .it { font-family: var(--serif); font-style: italic; text-transform: lowercase; font-weight: 400; letter-spacing: -0.02em; }

/* === Marquee === */
.marquee {
  overflow: hidden;
  white-space: nowrap;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 18px 0;
}
.marquee-track {
  display: inline-flex;
  gap: 64px;
  animation: scroll 40s linear infinite;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@keyframes scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }

[dir="rtl"] .marquee-track { animation-direction: reverse; }
[dir="rtl"] .section-head { grid-template-columns: 1fr 240px; }

/* === RTL nav fix === */
[dir="rtl"] .topnav { grid-template-columns: 1fr auto 1fr; }

/* === Cursor blink === */
.cursor::after {
  content: "▍";
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
  color: var(--accent);
}
@keyframes blink { 50% { opacity: 0; } }

.no-scroll::-webkit-scrollbar { display: none; }
.no-scroll { scrollbar-width: none; }

.dot-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 0 var(--accent);
  animation: pulse 2s var(--ease) infinite;
  display: inline-block;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent) 60%, transparent); }
  100% { box-shadow: 0 0 0 12px transparent; }
}
