@import url('https://fonts.googleapis.com/css2?family=Cal+Sans&family=Inter:wght@300;400;500;600&family=Instrument+Serif:ital@1&display=swap');

/* ═══════════════════════════════════════════════════════════
   HEBERKING — cinematic design system
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg:          #050507;
  --bg-2:        #0A0A0E;
  --surface:     rgba(255,255,255,0.025);
  --surface-2:   rgba(255,255,255,0.05);
  --line:        rgba(255,255,255,0.08);
  --line-2:      rgba(255,255,255,0.14);
  --text:        #F5F5F7;
  --text-2:      #A1A1AA;
  --text-3:      #5E5E68;
  --accent:      #8B7CFF;
  --accent-2:    #5B8CFF;
  --accent-glow: rgba(139,124,255,0.35);
  --live:        #4ADE80;

  --font-display: 'Cal Sans', 'Inter', sans-serif;
  --font:         'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif:   'Instrument Serif', Georgia, serif;

  --ease:      cubic-bezier(0.16, 1, 0.3, 1);
  --ease-film: cubic-bezier(0.76, 0, 0.24, 1);
  --r:   18px;
  --r-lg: 28px;
  --nav-h: 76px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; scrollbar-width: thin; scrollbar-color: #26262c transparent; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100dvh;
}
img, svg, video, canvas { display: block; max-width: 100%; }
a { color: inherit; }
::selection { background: var(--accent); color: #fff; }
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-thumb { background: #26262c; border-radius: 6px; }

/* ── Film layers: grain + vignette ── */
.film-grain {
  position: fixed; inset: -50%;
  width: 200%; height: 200%;
  pointer-events: none;
  z-index: 9000;
  opacity: 0.055;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 0.9s steps(6) infinite;
}
@keyframes grain {
  0%   { transform: translate(0,0); }
  20%  { transform: translate(-4%,3%); }
  40%  { transform: translate(3%,-5%); }
  60%  { transform: translate(-6%,-2%); }
  80%  { transform: translate(5%,4%); }
  100% { transform: translate(-2%,6%); }
}
.film-vignette {
  position: fixed; inset: 0;
  pointer-events: none;
  z-index: 8999;
  background: radial-gradient(ellipse 120% 90% at 50% 50%, transparent 55%, rgba(0,0,0,0.55) 100%);
}

/* ── Intro: letterbox opening ── */
.intro {
  position: fixed; inset: 0;
  z-index: 9500;
  pointer-events: none;
  display: grid;
  place-items: center;
}
.intro-bar {
  position: absolute; left: 0; right: 0;
  height: 50.5%;
  background: #000;
  animation: bar-open 1.4s var(--ease-film) 0.6s forwards;
}
.intro-bar--bot { --dir: 1; }
.intro-bar--top { top: 0; --dir: -1; }
.intro-bar--bot { bottom: 0; }
@keyframes bar-open { to { transform: translateY(calc(var(--dir) * 100%)); } }
.intro-mark {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 0.5em;
  text-transform: uppercase;
  color: var(--text);
  opacity: 0;
  animation: intro-mark 1.1s var(--ease) forwards;
}
@keyframes intro-mark {
  0%   { opacity: 0; filter: blur(8px); letter-spacing: 0.9em; }
  55%  { opacity: 1; filter: blur(0); letter-spacing: 0.5em; }
  100% { opacity: 0; filter: blur(4px); }
}
.intro.done { display: none; }
.no-intro .intro { display: none; }

/* ── Layout ── */
.container { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }
.section { position: relative; padding: 160px 0; }
.section--tight { padding: 110px 0; }
main { position: relative; z-index: 1; }

/* ── Type ── */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.98;
}
.h-xl { font-size: clamp(3rem, 8.4vw, 7.6rem); }
.h-lg { font-size: clamp(2.5rem, 5.6vw, 4.8rem); }
.h-md { font-size: clamp(2rem, 3.8vw, 3.2rem); line-height: 1.04; }
.serif { font-family: var(--font-serif); font-style: italic; font-weight: 400; letter-spacing: -0.01em; }
.muted { color: var(--text-2); }
.dim   { color: var(--text-3); }
.lead  { font-size: clamp(1.05rem, 1.4vw, 1.2rem); color: var(--text-2); line-height: 1.65; max-width: 560px; }

.glow-text {
  background: linear-gradient(180deg, #fff 0%, #fff 40%, rgba(255,255,255,0.45) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.accent-text {
  background: linear-gradient(100deg, #C9C1FF 0%, var(--accent) 45%, var(--accent-2) 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* "(Label)" chapter markers */
.chapter {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--text-2);
  margin-bottom: 28px;
}
.chapter::before { content: '('; color: var(--text-3); margin-right: -10px; }
.chapter::after  { content: ')'; color: var(--text-3); margin-left: -10px; }
.chapter-num { font-variant-numeric: tabular-nums; color: var(--text-3); margin-right: 4px; }

.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 48px; margin-bottom: 80px; flex-wrap: wrap; }
.section-head .lead { margin-bottom: 6px; }

/* ── Pills ── */
.pill {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-size: 13px;
  color: var(--text);
}
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--live); flex-shrink: 0; }
.live-dot::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%;
  background: var(--live);
  animation: live 2s ease-out infinite;
}
@keyframes live { from { transform: scale(1); opacity: 0.7; } to { transform: scale(3); opacity: 0; } }

.tag {
  display: inline-flex; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--text-2);
  background: rgba(255,255,255,0.02);
}

/* ── Buttons ── */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  height: 52px;
  padding: 0 26px;
  border-radius: 999px;
  font-family: var(--font);
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
  overflow: hidden;
  isolation: isolate;
  transition: transform 0.5s var(--ease), box-shadow 0.5s var(--ease), background 0.3s, border-color 0.3s, color 0.3s;
}
.btn-label { position: relative; display: inline-block; overflow: hidden; }
.btn-label span { display: block; transition: transform 0.55s var(--ease); }
.btn-label span + span { position: absolute; inset: 0; transform: translateY(105%); }
.btn:hover .btn-label span:first-child { transform: translateY(-105%); }
.btn:hover .btn-label span + span { transform: translateY(0); }
.btn svg { width: 16px; height: 16px; transition: transform 0.5s var(--ease); }
.btn:hover svg { transform: translateX(3px) rotate(-45deg); }

.btn--light { background: var(--text); color: #050507; box-shadow: 0 0 0 0 rgba(255,255,255,0); }
.btn--light:hover { box-shadow: 0 10px 50px -8px rgba(255,255,255,0.35); }
.btn--ghost { background: rgba(255,255,255,0.04); color: var(--text); border: 1px solid var(--line-2); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.btn--ghost:hover { background: rgba(255,255,255,0.09); border-color: rgba(255,255,255,0.28); }
.btn--accent { background: linear-gradient(120deg, var(--accent), var(--accent-2)); color: #fff; }
.btn--accent:hover { box-shadow: 0 12px 50px -10px var(--accent-glow); }
.btn--lg { height: 60px; padding: 0 34px; font-size: 16px; }
.btn:active { transform: scale(0.97); }

.link-arrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; font-weight: 500;
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--line-2);
  padding-bottom: 4px;
  transition: border-color 0.3s, gap 0.4s var(--ease);
}
.link-arrow:hover { border-color: var(--text); gap: 12px; }

/* ── Cards ── */
.card {
  position: relative;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255,255,255,0.035), rgba(255,255,255,0.01));
  overflow: hidden;
  transition: border-color 0.5s var(--ease), transform 0.6s var(--ease);
}
.card:hover { border-color: var(--line-2); }
.spotlight::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(520px circle at var(--mx,-400px) var(--my,-400px), rgba(139,124,255,0.11), transparent 50%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 0.4s;
}
.spotlight:hover::before { opacity: 1; }
.spotlight > * { position: relative; z-index: 1; }

.hairline { height: 1px; background: linear-gradient(90deg, transparent, var(--line-2), transparent); border: 0; }

/* ── Aurora backdrop for inner page heroes ── */
.aurora { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.aurora::before, .aurora::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(90px);
}
.aurora::before {
  width: 70vw; height: 50vw; max-width: 1100px; max-height: 700px;
  left: 50%; top: -30%;
  transform: translateX(-50%);
  background: radial-gradient(closest-side, rgba(139,124,255,0.32), transparent);
  animation: aurora-a 18s ease-in-out infinite alternate;
}
.aurora::after {
  width: 40vw; height: 30vw;
  left: 62%; top: -8%;
  background: radial-gradient(closest-side, rgba(91,140,255,0.22), transparent);
  animation: aurora-b 22s ease-in-out infinite alternate;
}
@keyframes aurora-a { to { transform: translateX(-42%) scale(1.15); } }
@keyframes aurora-b { to { transform: translate(-30%, 20%) scale(0.9); } }
.aurora-floor { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(to top, var(--bg), transparent); }

/* ── Page hero (inner pages) ── */
.page-hero { position: relative; padding: calc(var(--nav-h) + 140px) 0 120px; overflow: hidden; }
.page-hero .container { position: relative; z-index: 1; }
.page-hero h1 { max-width: 14ch; margin-bottom: 32px; }

/* ── Reveal system ── */
[data-reveal] {
  transition-delay: var(--d, 0s);
}
.js [data-reveal] {
  opacity: 0;
  transform: translateY(40px);
  filter: blur(10px);
  transition: opacity 1.1s var(--ease), transform 1.1s var(--ease), filter 1.1s var(--ease);
  transition-delay: var(--d, 0s);
}
.js [data-reveal].in { opacity: 1; transform: none; filter: blur(0); }

/* word-split headings */
.split-word { display: inline-block; white-space: nowrap; }
.split-word > span { display: inline-block; }
.js .split-word > span {
  opacity: 0;
  filter: blur(12px);
  transform: translateY(0.35em);
  transition: opacity 1s var(--ease), filter 1s var(--ease), transform 1s var(--ease);
  transition-delay: calc(var(--d, 0s) + var(--i) * 0.06s);
}
[data-split].in .split-word > span, .js [data-split].in .split-word > span { opacity: 1; filter: blur(0); transform: none; }

/* scroll-scrubbed paragraph (words light up) */
[data-scrub] .scrub-w { color: var(--text-3); transition: color 0.25s linear; }
[data-scrub] .scrub-w.on { color: var(--text); }

/* ── Marquee ── */
.marquee { position: relative; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee var(--speed, 40s) linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ═══════════ NAV ═══════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--nav-h);
  display: flex; align-items: center;
  transition: transform 0.6s var(--ease), background 0.4s, backdrop-filter 0.4s;
}
.nav::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--line); opacity: 0; transition: opacity 0.4s; }
.nav.scrolled { background: rgba(5,5,7,0.6); backdrop-filter: blur(20px) saturate(160%); -webkit-backdrop-filter: blur(20px) saturate(160%); }
.nav.scrolled::after { opacity: 1; }
.nav.hidden { transform: translateY(-100%); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 32px; }

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); }
.brand-mark { width: 42px; height: 42px; margin: -4px -6px -4px -8px; flex-shrink: 0; }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 0 10px rgba(201,193,255,0.25)); }
.brand-name { font-family: var(--font-display); font-size: 19px; letter-spacing: -0.02em; }

.nav-links {
  display: flex; align-items: center; gap: 4px;
  padding: 5px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255,255,255,0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}
.nav-links a {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 8px 16px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--text-2);
  text-decoration: none;
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); background: rgba(255,255,255,0.08); }
.nav-links a svg { width: 10px; height: 10px; opacity: 0.5; }
.nav .btn { height: 44px; padding: 0 20px; font-size: 14px; }

.menu-btn {
  display: none;
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: rgba(255,255,255,0.04);
  color: var(--text);
  cursor: pointer;
  position: relative;
}
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 1.5px; background: currentColor; transition: transform 0.5s var(--ease), top 0.5s var(--ease); }
.menu-btn span:nth-child(1) { top: 17px; }
.menu-btn span:nth-child(2) { top: 25px; }
.menu-open .menu-btn span:nth-child(1) { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:nth-child(2) { top: 21px; transform: rotate(-45deg); }

.mobile-menu {
  position: fixed; inset: 0;
  z-index: 999;
  background: rgba(5,5,7,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  display: flex; flex-direction: column; justify-content: center;
  padding: var(--nav-h) 24px 40px;
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease-film);
}
.menu-open .mobile-menu { clip-path: inset(0 0 0 0); }
.mobile-menu a {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 11vw, 3.6rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: var(--text);
  text-decoration: none;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
}
.menu-open .mobile-menu a { opacity: 1; transform: none; }
.menu-open .mobile-menu a:nth-child(2) { transition-delay: 0.05s; }
.menu-open .mobile-menu a:nth-child(3) { transition-delay: 0.1s; }
.menu-open .mobile-menu a:nth-child(4) { transition-delay: 0.15s; }
.menu-open .mobile-menu a:nth-child(5) { transition-delay: 0.2s; }
.mobile-menu-foot { margin-top: 48px; font-size: 14px; color: var(--text-3); }

/* ═══════════ CTA BLOCK (shared) ═══════════ */
.cta {
  position: relative;
  margin: 0 auto;
  border-radius: 40px;
  border: 1px solid var(--line);
  overflow: hidden;
  text-align: center;
  padding: 140px 32px;
  background: #07070B;
}
.cta-beam {
  position: absolute; left: 50%; bottom: -60%;
  width: 140%; aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(139,124,255,0.45), rgba(91,140,255,0.15) 45%, transparent 70%);
  filter: blur(30px);
  animation: beam 8s ease-in-out infinite alternate;
  pointer-events: none;
}
.cta-ring {
  position: absolute; left: 50%; bottom: -118%;
  width: 150%; aspect-ratio: 1;
  transform: translateX(-50%);
  border-radius: 50%;
  border-top: 1px solid rgba(201,193,255,0.55);
  box-shadow: 0 -20px 80px -10px rgba(139,124,255,0.45);
  pointer-events: none;
}
@keyframes beam { to { transform: translateX(-50%) scale(1.12); opacity: 0.8; } }
.cta > *:not(.cta-beam):not(.cta-ring) { position: relative; z-index: 1; }
.cta h2 { margin: 0 auto 28px; max-width: 14ch; }
.cta .lead { margin: 0 auto 44px; }
.cta-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ═══════════ FOOTER ═══════════ */
.footer { position: relative; z-index: 1; padding: 120px 0 0; overflow: hidden; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 48px; padding-bottom: 80px; }
.footer-about p { color: var(--text-2); font-size: 14.5px; max-width: 300px; margin: 20px 0 28px; }
.footer-col h5 { font-size: 12px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-3); margin-bottom: 20px; }
.footer-col a { display: block; width: fit-content; color: var(--text-2); text-decoration: none; font-size: 14.5px; padding: 5px 0; transition: color 0.25s, transform 0.4s var(--ease); }
.footer-col a:hover { color: var(--text); transform: translateX(4px); }
.socials { display: flex; gap: 8px; }
.socials a {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--text-2);
  transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.socials a:hover { color: var(--text); border-color: var(--line-2); background: rgba(255,255,255,0.05); }
.socials svg { width: 15px; height: 15px; }
.footer-bottom { display: flex; justify-content: space-between; gap: 16px; padding: 24px 0; border-top: 1px solid var(--line); font-size: 13px; color: var(--text-3); flex-wrap: wrap; }
.footer-word {
  font-family: var(--font-display);
  font-size: clamp(4rem, 19.5vw, 19rem);
  line-height: 0.78;
  letter-spacing: -0.05em;
  text-align: center;
  margin-bottom: -0.06em;
  background: linear-gradient(180deg, rgba(255,255,255,0.14) 0%, rgba(255,255,255,0) 85%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
  user-select: none;
  pointer-events: none;
}

/* ═══════════ RESPONSIVE ═══════════ */
@media (max-width: 960px) {
  .nav-links, .nav .btn { display: none; }
  .menu-btn { display: block; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
  .section { padding: 110px 0; }
  .section-head { margin-bottom: 56px; }
}
@media (max-width: 600px) {
  :root { --nav-h: 68px; }
  .container, .nav-inner { padding: 0 16px; }
  .section { padding: 90px 0; }
  .cta { padding: 96px 20px; border-radius: 28px; }
  .page-hero { padding: calc(var(--nav-h) + 80px) 0 72px; }
  .footer { padding-top: 80px; }
  .footer-grid { gap: 36px; }
  .btn--lg { height: 56px; padding: 0 28px; }
}

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
  [data-reveal], .split-word > span { opacity: 1 !important; transform: none !important; filter: none !important; }
  .intro, .film-grain { display: none; }
}
