:root {
  --bg: #0e0e10;
  --bg-alt: #131318;
  --surface: #1a1a21;
  --border: #26262f;
  --text: #ececf1;
  --text-dim: #8a8a96;
  --accent: #ff5b3a;
  --accent-soft: #ffd2c5;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --display: 'Fraunces', Georgia, serif;
  --max-w: 1180px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* Subtle film grain over everything */
.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 100;
  opacity: 0.06;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color .15s ease;
}

a:hover {
  color: var(--accent);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 2rem;
  background: rgba(14, 14, 16, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.logo {
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
}

.logo-dot {
  color: var(--accent);
}

.site-header nav {
  display: flex;
  gap: 1.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 6rem 2rem 5rem;
}

.kicker {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 1.5rem;
}

.kicker::before {
  content: "→ ";
  color: var(--accent);
}

.hero h1 {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.5rem, 7vw, 5.5rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
  margin: 0 0 2rem;
}

.hero-accent {
  font-style: italic;
  color: var(--accent);
}

.hero-muted {
  color: var(--text-dim);
}

.hero-sub {
  max-width: 38rem;
  color: var(--text-dim);
  font-size: 1rem;
  margin: 0 0 2.5rem;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  padding: 0.85rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  border: 1px solid var(--border);
  transition: all .2s ease;
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #1a0a05;
  font-weight: 500;
}

.btn-primary:hover {
  background: transparent;
  color: var(--accent);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---------- Sections ---------- */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 5rem 2rem;
}

.section-alt {
  background: var(--bg-alt);
  max-width: none;
  margin: 0;
}

.section-alt>* {
  max-width: var(--max-w);
  margin-inline: auto;
}

.section-header {
  margin-bottom: 3rem;
  position: relative;
}

.section-num {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  letter-spacing: 0.15em;
}

.section-header h2 {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0.75rem;
}

.section-header p {
  color: var(--text-dim);
  margin: 0;
  max-width: 40rem;
}

/* ---------- Projects ---------- */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
}

.project {
  background: var(--surface);
  border: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .25s ease, border-color .25s ease;
}

.project:hover {
  transform: translateY(-4px);
  border-color: var(--accent);
}

.project.featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
}

@media (max-width: 720px) {
  .project.featured {
    grid-template-columns: 1fr;
  }
}

.project-media {
  background: #000;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.project-media img,
.project-media video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}

.project:hover .project-media img,
.project:hover .project-media video {
  transform: scale(1.03);
}

.project-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.project-tags {
  font-size: 0.75rem;
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0;
}

.project-body h3 {
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  margin: 0.25rem 0 0.5rem;
  letter-spacing: -0.01em;
}

.project-body p {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.92rem;
}

.project-links {
  margin-top: auto;
  padding-top: 1rem;
  display: flex;
  gap: 1.25rem;
  font-size: 0.85rem;
}

.project-links a {
  color: var(--accent);
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
}

@media (max-width: 720px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
}

.about p {
  color: var(--text-dim);
  font-size: 1rem;
  max-width: 38rem;
}

.about h4 {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--text);
  margin: 0 0 0.75rem;
}

.tag-list,
.contact-list {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tag-list li {
  padding: 0.3rem 0.7rem;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-dim);
}

.contact-list li {
  padding: 0.25rem 0;
  font-size: 0.9rem;
}

.contact-list a {
  color: var(--text-dim);
}

.contact-list a:hover {
  color: var(--accent);
}

/* ---------- YouTube embed wrapper ---------- */
.yt-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.yt-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 2rem;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.8rem;
}

/* ---------- Mobile nav tweak ---------- */
@media (max-width: 560px) {
  .site-header {
    padding: 1rem;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
  }

  .site-header nav {
    gap: 1rem;
    font-size: 0.75rem;
  }

  .hero {
    padding: 4rem 1.25rem 3rem;
  }

  .section {
    padding: 4rem 1.25rem;
  }
}

/* ---------- Entry animation ---------- */
.hero>* {
  opacity: 0;
  transform: translateY(12px);
  animation: rise .8s ease forwards;
}

.hero .kicker {
  animation-delay: 0.05s;
}

.hero h1 {
  animation-delay: 0.15s;
}

.hero .hero-sub {
  animation-delay: 0.30s;
}

.hero .hero-cta {
  animation-delay: 0.45s;
}

@keyframes rise {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}