/* Crazy Entertainment — studio site. Dark, premium, type-led. No framework. */
:root {
  --bg: #08080a;
  --bg-1: #0d0d10;
  --bg-2: #131318;
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --fg: #f2f1ee;
  --fg-mut: #9b9aa3;
  --fg-dim: #6c6b73;
  --accent: #ff4d36;        /* signature coral-red — used sparingly */
  --accent-soft: rgba(255, 77, 54, 0.14);
  --font-disp: "Space Grotesk", system-ui, sans-serif;
  --font-body: "Inter", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;
  --maxw: 1180px;
  --pad: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
::selection { background: var(--accent); color: #fff; }

/* subtle grain + a single hero glow, fixed behind everything */
body::before {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(900px 520px at 78% -8%, rgba(255, 77, 54, 0.10), transparent 60%),
    radial-gradient(700px 500px at 8% 4%, rgba(90, 120, 255, 0.06), transparent 55%);
}
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
.wrap { position: relative; z-index: 1; }
.container { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--pad); }

/* ---------- typography ---------- */
h1, h2, h3 { font-family: var(--font-disp); font-weight: 600; letter-spacing: -0.02em; line-height: 1.04; }
.mono { font-family: var(--font-mono); }
.eyebrow {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--fg-dim); display: inline-flex; align-items: center; gap: 10px;
}
.eyebrow::before { content: ""; width: 22px; height: 1px; background: var(--line-2); display: inline-block; }
.accent { color: var(--accent); }

/* ---------- nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px var(--pad);
  backdrop-filter: blur(14px); background: rgba(8, 8, 10, 0.55);
  border-bottom: 1px solid transparent; transition: border-color .3s, background .3s;
}
.nav.scrolled { border-bottom-color: var(--line); background: rgba(8, 8, 10, 0.8); }
.brand { display: flex; align-items: center; gap: 11px; font-family: var(--font-disp); font-weight: 600; letter-spacing: -0.01em; }
.brand .mk { width: 26px; height: 26px; flex: none; }
.brand small { color: var(--fg-dim); font-weight: 400; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a { font-family: var(--font-mono); font-size: 13px; color: var(--fg-mut); transition: color .2s; }
.nav-links a:hover { color: var(--fg); }
.nav-cta {
  font-family: var(--font-mono); font-size: 13px; padding: 8px 16px; border: 1px solid var(--line-2);
  border-radius: 999px; color: var(--fg) !important; transition: all .2s;
}
.nav-cta:hover { background: var(--fg); color: var(--bg) !important; border-color: var(--fg); }
.nav-burger { display: none; }

/* ---------- hero ---------- */
.hero { padding-top: clamp(140px, 22vh, 240px); padding-bottom: clamp(80px, 12vh, 150px); }
.status {
  display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12.5px;
  color: var(--fg-mut); padding: 7px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: rgba(255, 255, 255, 0.02); margin-bottom: 34px;
}
.status .dot { width: 8px; height: 8px; border-radius: 50%; background: #46d369; box-shadow: 0 0 0 4px rgba(70, 211, 105, 0.16); animation: pulse 2.4s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(70, 211, 105, 0); } }
.hero h1 { font-size: clamp(40px, 8vw, 92px); margin-bottom: 28px; max-width: 14ch; }
.hero h1 .soft { color: var(--fg-dim); }
.hero-lede { font-size: clamp(17px, 2.1vw, 21px); color: var(--fg-mut); max-width: 56ch; line-height: 1.55; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-mono); font-size: 14px;
  padding: 14px 24px; border-radius: 999px; border: 1px solid var(--line-2); transition: all .2s; cursor: pointer;
}
.btn .arr { transition: transform .25s; }
.btn:hover .arr { transform: translateX(4px); }
.btn-primary { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-ghost:hover { border-color: var(--fg); }

/* meta row under hero */
.hero-meta { display: flex; flex-wrap: wrap; gap: 40px; margin-top: 64px; padding-top: 30px; border-top: 1px solid var(--line); }
.hero-meta div { display: flex; flex-direction: column; gap: 5px; }
.hero-meta .k { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--fg-dim); }
.hero-meta .v { font-family: var(--font-disp); font-size: 16px; color: var(--fg); }

/* ---------- sections ---------- */
section { padding-block: clamp(70px, 11vh, 130px); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 56px; }
.sec-head h2 { font-size: clamp(28px, 4.6vw, 52px); }
.sec-num { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); }

/* ---------- work grid ---------- */
.work-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 16px;
  padding: 30px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg, var(--bg-1), rgba(13,13,16,0.4));
  transition: border-color .3s, transform .3s, background .3s; overflow: hidden;
}
.card::after { content: ""; position: absolute; inset: 0; border-radius: 16px; pointer-events: none; box-shadow: inset 0 1px 0 rgba(255,255,255,0.04); }
.card:hover { border-color: var(--line-2); transform: translateY(-3px); background: linear-gradient(180deg, var(--bg-2), rgba(19,19,24,0.5)); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.card-cat { font-family: var(--font-mono); font-size: 11.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--fg-dim); }
.badge {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg-mut); white-space: nowrap;
}
.badge.live { color: #46d369; border-color: rgba(70,211,105,0.35); background: rgba(70,211,105,0.08); }
.badge.beta { color: #ffc14d; border-color: rgba(255,193,77,0.3); }
.badge.dev { color: #6aa8ff; border-color: rgba(106,168,255,0.3); }
.badge.proto { color: var(--fg-mut); border-color: var(--line-2); }
.card h3 { font-size: 23px; letter-spacing: -0.015em; }
.card .tagline { color: var(--fg); font-size: 15px; margin-top: -8px; }
.card p { color: var(--fg-mut); font-size: 14.5px; line-height: 1.6; }
.chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; }
.chip { font-family: var(--font-mono); font-size: 11px; color: var(--fg-mut); padding: 4px 10px; border: 1px solid var(--line); border-radius: 6px; }
.card-links { display: flex; gap: 16px; flex-wrap: wrap; }
.card-links a { font-family: var(--font-mono); font-size: 12.5px; color: var(--accent); display: inline-flex; align-items: center; gap: 6px; }
.card-links a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- about ---------- */
.about-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: start; }
.about-lede { font-family: var(--font-disp); font-size: clamp(20px, 2.6vw, 28px); line-height: 1.4; letter-spacing: -0.01em; }
.about-lede + p { color: var(--fg-mut); margin-top: 22px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.stat { background: var(--bg-1); padding: 26px; }
.stat .n { font-family: var(--font-disp); font-size: clamp(30px, 5vw, 44px); letter-spacing: -0.03em; }
.stat .l { font-family: var(--font-mono); font-size: 12px; color: var(--fg-dim); text-transform: uppercase; letter-spacing: 0.1em; margin-top: 6px; }
.skills { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- contact ---------- */
.contact { text-align: center; }
.contact h2 { font-size: clamp(34px, 7vw, 76px); margin-bottom: 26px; }
.contact .mail { font-family: var(--font-disp); font-size: clamp(20px, 3.4vw, 34px); color: var(--fg); border-bottom: 1px solid var(--line-2); padding-bottom: 4px; transition: color .2s, border-color .2s; }
.contact .mail:hover { color: var(--accent); border-color: var(--accent); }
.contact .sub { color: var(--fg-mut); max-width: 48ch; margin: 0 auto 44px; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); padding-block: 48px; }
.foot-grid { display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.foot-links { display: flex; gap: 22px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 13px; }
.foot-links a { color: var(--fg-mut); transition: color .2s; }
.foot-links a:hover { color: var(--fg); }
.foot-fine { color: var(--fg-dim); font-family: var(--font-mono); font-size: 12.5px; line-height: 1.7; margin-top: 18px; }

/* ---------- legal / prose pages ---------- */
.legal { padding-top: clamp(130px, 18vh, 200px); padding-bottom: 100px; }
.prose { max-width: 760px; }
.prose h1 { font-size: clamp(34px, 6vw, 56px); margin-bottom: 14px; }
.prose .updated { font-family: var(--font-mono); font-size: 13px; color: var(--fg-dim); margin-bottom: 48px; }
.prose h2 { font-size: 20px; font-family: var(--font-mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--fg); margin: 40px 0 14px; }
.prose p, .prose li { color: var(--fg-mut); margin-bottom: 14px; }
.prose ul { padding-left: 20px; }
.prose a { color: var(--accent); }
.prose strong { color: var(--fg); }
.back { font-family: var(--font-mono); font-size: 13px; color: var(--fg-mut); display: inline-flex; gap: 8px; align-items: center; }
.back:hover { color: var(--fg); }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.16,1,.3,1), transform .7s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } html { scroll-behavior: auto; } .status .dot { animation: none; } }

/* ---------- responsive ---------- */
@media (max-width: 820px) {
  .nav-links { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); flex-direction: column; align-items: flex-start; justify-content: center; gap: 26px; padding: 40px; background: var(--bg-1); border-left: 1px solid var(--line); transform: translateX(100%); transition: transform .35s cubic-bezier(.16,1,.3,1); }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 17px; }
  .nav-burger { display: flex; flex-direction: column; gap: 5px; background: none; border: 0; cursor: pointer; z-index: 60; padding: 6px; }
  .nav-burger span { width: 24px; height: 2px; background: var(--fg); transition: .3s; }
  .nav-burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav-burger.open span:nth-child(2) { opacity: 0; }
  .nav-burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .work-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-meta { gap: 28px; }
}
