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

:root {
  --bg:        #0A0B0D;
  --bg2:       #0F1013;
  --bg3:       #16171B;
  --line:      rgba(255,255,255,0.07);
  --text:      #F5F5F2;
  --text-2:    rgba(245,245,242,0.6);
  --text-3:    rgba(245,245,242,0.36);
  --accent:    #FF4D55;
  --accent-2:  #FF7A80;
  --violet:    #8B7CFF;
  --radius:    16px;
  --mono:      'JetBrains Mono', 'SF Mono', monospace;
  --display:   'Bricolage Grotesque', 'Inter', sans-serif;
  --wordmark:  'Unbounded', sans-serif;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, sans-serif;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .display { font-family: var(--display); }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
.section { padding: 100px 0; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 12px; font-weight: 500; letter-spacing: 0.08em;
  color: var(--text-3);
  margin-bottom: 18px;
}
.eyebrow .n { color: var(--accent); }

.section-title {
  font-size: clamp(32px, 4.8vw, 54px);
  font-weight: 800; letter-spacing: -0.02em; line-height: 1.04;
  margin-bottom: 16px;
}
.section-sub { font-size: 16px; line-height: 1.7; color: var(--text-2); max-width: 580px; }

/* gradient shimmer for accent words */
.shimmer {
  background: linear-gradient(100deg, var(--accent) 0%, var(--accent-2) 30%, var(--violet) 55%, var(--accent) 80%);
  background-size: 250% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 5s linear infinite;
}
@keyframes shimmer { to { background-position: -250% 0; } }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.8s cubic-bezier(0.16,1,0.3,1), transform 0.8s cubic-bezier(0.16,1,0.3,1); }
.reveal.in { opacity: 1; transform: translateY(0); }

.btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 14px; font-weight: 600;
  padding: 14px 28px; border-radius: 100px;
  text-decoration: none; cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16,1,0.3,1);
  border: 1px solid transparent;
  overflow: hidden;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(110deg, transparent 20%, rgba(255,255,255,0.25) 50%, transparent 80%);
  transform: translateX(-100%);
}
.btn-primary:hover::after { animation: sheen 0.7s ease; }
@keyframes sheen { to { transform: translateX(100%); } }
.btn-primary:hover { background: var(--accent-2); transform: translateY(-2px) scale(1.02); box-shadow: 0 12px 36px rgba(255,77,85,0.35); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { color: var(--text); border-color: rgba(255,255,255,0.25); transform: translateY(-2px); }

/* scroll progress bar */
#progress {
  position: fixed; top: 0; left: 0; height: 2px; width: 0%;
  background: linear-gradient(to right, var(--accent), var(--violet));
  z-index: 300;
  transition: width 0.1s linear;
}

/* back to top */
#to-top {
  position: fixed; bottom: 24px; right: 24px; z-index: 250;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg3); border: 1px solid var(--line);
  color: var(--text-2); font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transform: translateY(10px);
  transition: all 0.3s ease;
}
#to-top.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
#to-top:hover { color: var(--text); border-color: rgba(255,255,255,0.25); transform: translateY(-2px); }

/* respect users who prefer less motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  html { scroll-behavior: auto; }
}

/* brand text selection */
::selection { background: rgba(255,77,85,0.35); color: #fff; }

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

/* nudge toast */
#toast {
  position: fixed; bottom: 24px; left: 24px; z-index: 260;
  display: flex; align-items: center; gap: 14px;
  background: var(--bg3); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 18px;
  max-width: 340px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  opacity: 0; transform: translateY(16px); pointer-events: none;
  transition: all 0.4s cubic-bezier(0.16,1,0.3,1);
}
#toast.show { opacity: 1; transform: translateY(0); pointer-events: auto; }
#toast p { font-size: 13.5px; line-height: 1.5; color: var(--text-2); }
#toast a { color: var(--accent); font-weight: 600; text-decoration: none; white-space: nowrap; }
#toast a:hover { color: var(--accent-2); }
#toast .x {
  background: none; border: none; color: var(--text-3); cursor: pointer;
  font-size: 16px; line-height: 1; padding: 2px;
}
#toast .x:hover { color: var(--text); }

/* easter egg glitch */
@keyframes glitch-flash {
  0%, 100% { filter: none; transform: none; }
  10% { filter: hue-rotate(90deg) saturate(3); transform: translateX(-6px) skewX(2deg); }
  20% { filter: invert(1); transform: translateX(5px); }
  30% { filter: hue-rotate(-120deg); transform: translateX(-3px) skewX(-1.5deg); }
  45% { filter: saturate(4) contrast(2); transform: translateX(2px); }
  60% { filter: none; transform: none; }
  70% { filter: invert(1) hue-rotate(45deg); transform: translateX(-2px); }
  80% { filter: none; transform: none; }
}
body.glitching { animation: glitch-flash 0.7s steps(2, jump-none) 1; }

/* konami: the catacombs claim the page */
body.cursed { filter: hue-rotate(-30deg) saturate(1.4) contrast(1.08); }
body.cursed::before {
  content: '';
  position: fixed; inset: 0; z-index: 9998; pointer-events: none;
  background:
    radial-gradient(ellipse 90% 90% at 50% 50%, transparent 40%, rgba(80,5,10,0.35) 100%);
  animation: cursed-breathe 4s ease-in-out infinite;
}
@keyframes cursed-breathe { 0%,100% { opacity: 0.7; } 50% { opacity: 1; } }
body.cursed .section-title, body.cursed h1 { text-shadow: 0 0 30px rgba(255,40,50,0.45); }
