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

:root {
  --bg: #050505;
  --bg-elev: #0c0c0c;
  --bg-soft: #0a0a0a;
  --fg: #ededed;
  --fg-mid: #c8c8c8;
  --fg-dim: #6e6e6e;
  --fg-mute: #2c2c2c;
  --line: #161616;
  --line-strong: #1f1f1f;
  --red: #e63946;
  --red-glow: rgba(230, 57, 70, 0.45);
  --purple: #8b5cf6;
  --container: 980px;
  --radius: 4px;
}

html {
  background: var(--bg);
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--fg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--red);
  color: #fff;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* Navigation */
.nav {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: rgba(5, 5, 5, 0.78);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  z-index: 50;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--fg);
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
}

.logo-mark {
  width: 9px;
  height: 9px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 14px var(--red-glow);
}

.logo-text .dim {
  color: var(--fg-dim);
  font-weight: 400;
}

.nav nav {
  display: flex;
  gap: 30px;
}

.nav nav a {
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 13px;
  letter-spacing: 0.01em;
  transition: color 0.2s ease;
}

.nav nav a:hover {
  color: var(--fg);
}

/* Hero */
.hero {
  padding: 140px 0 110px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 60%;
  height: 160%;
  background: radial-gradient(closest-side, rgba(230, 57, 70, 0.07), transparent 70%);
  pointer-events: none;
}

.hero .container {
  position: relative;
}

.eyebrow {
  display: inline-block;
  color: var(--fg-dim);
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-size: 11px;
  font-weight: 500;
  margin-bottom: 28px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
}

.hero h1 {
  font-size: clamp(40px, 7.4vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.038em;
  font-weight: 600;
  margin-bottom: 28px;
  max-width: 820px;
}

.accent-red { color: var(--red); }
.accent-purple { color: var(--purple); }

.lead {
  font-size: 18px;
  color: var(--fg-dim);
  max-width: 540px;
  line-height: 1.55;
}

/* Sections */
section {
  padding: 90px 0;
  border-bottom: 1px solid var(--line);
}

.section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--fg-dim);
  font-weight: 500;
  margin-bottom: 36px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--red);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--red-glow);
}

/* Stacks */
.stack-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.stack-grid li {
  background: var(--bg-soft);
  padding: 30px 26px 36px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: background 0.25s ease;
  position: relative;
}

.stack-grid li:hover {
  background: var(--bg-elev);
}

.stack-grid li::after {
  content: '';
  position: absolute;
  left: 26px;
  bottom: 16px;
  width: 18px;
  height: 1px;
  background: var(--fg-mute);
  transition: background 0.25s ease, width 0.25s ease;
}

.stack-grid li:hover::after {
  background: var(--red);
  width: 32px;
}

.stack-grid span {
  font-size: 17px;
  font-weight: 500;
  color: var(--fg);
  letter-spacing: -0.005em;
}

.stack-grid small {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.01em;
}

/* Work / Contact */
.work p,
.contact p {
  font-size: 16px;
  color: var(--fg-mid);
  max-width: 620px;
  line-height: 1.7;
}

a.email {
  color: var(--fg);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: 1px;
  transition: color 0.2s ease;
}

a.email:hover {
  color: var(--red);
}

/* Footer */
footer {
  padding: 50px 0;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}

.copy {
  font-size: 12px;
  color: var(--fg-dim);
  letter-spacing: 0.02em;
}

.legal {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
}

.legal a {
  font-size: 12px;
  color: var(--fg-dim);
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: color 0.2s ease;
}

.legal a:hover {
  color: var(--purple);
}

/* Legal pages */
.legal-page {
  padding: 90px 0 60px;
}

.legal-page h1 {
  font-size: clamp(32px, 4.5vw, 44px);
  font-weight: 600;
  letter-spacing: -0.025em;
  margin-bottom: 14px;
}

.legal-page .updated {
  color: var(--fg-dim);
  font-size: 13px;
  margin-bottom: 56px;
  display: block;
  letter-spacing: 0.02em;
}

.legal-page h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 40px 0 14px;
  color: var(--fg);
  letter-spacing: -0.005em;
}

.legal-page h2 .num {
  color: var(--red);
  margin-right: 8px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.legal-page p,
.legal-page li {
  color: var(--fg-mid);
  font-size: 15px;
  line-height: 1.72;
  margin-bottom: 14px;
}

.legal-page ul {
  margin: 0 0 16px 22px;
}

.legal-page li {
  margin-bottom: 8px;
}

.legal-page a {
  color: var(--fg);
  text-decoration: underline;
  text-decoration-color: var(--fg-mute);
  text-underline-offset: 3px;
  transition: text-decoration-color 0.2s ease;
}

.legal-page a:hover {
  text-decoration-color: var(--red);
}

.legal-page strong {
  color: var(--fg);
  font-weight: 500;
}

.back-link {
  display: block;
  color: var(--fg-dim);
  text-decoration: none;
  font-size: 13px;
  margin-top: 60px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.back-link:hover {
  color: var(--red);
}

/* Mobile */
@media (max-width: 640px) {
  .container { padding: 0 22px; }
  .nav-inner { padding: 16px 22px; }
  .hero { padding: 90px 0 70px; }
  section { padding: 64px 0; }
  .nav nav { gap: 18px; }
  .nav nav a { font-size: 12px; }
  .footer-inner {
    flex-direction: column;
    align-items: flex-start;
  }
  .legal { gap: 12px 18px; }
  .legal-page { padding: 60px 0 40px; }
  .legal-page h1 { font-size: 28px; }
  .legal-page h2 { font-size: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
  html { scroll-behavior: auto; }
}
