:root {
  --bg: #0a0a0c;
  --surface: #16161a;
  --surface-hover: #1f1f25;
  --border: #26262e;
  --text: #f0f0f2;
  --text-muted: #9a9aa0;
  --accent: #ff2bb1;
  --accent-hover: #ff5cc4;
  --accent-glow: rgba(255, 43, 177, 0.35);
  --max-width: 1100px;
  --radius: 12px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

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

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

img, video {
  max-width: 100%;
  display: block;
}

/* ---------- Navigation ---------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Pad the inner content to align with the centered <main> on wide screens */
  padding: 1rem max(1.5rem, calc((100vw - var(--max-width)) / 2));
  background: rgba(10, 10, 12, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}

.nav-brand img {
  width: 32px;
  height: 32px;
  border-radius: 6px;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
}

/* ---------- Home / hero ---------- */

.hero {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 130px); /* viewport minus nav + footer */
}

.hero-logo {
  width: min(70vw, 70vh, 640px);
  aspect-ratio: 1 / 1;
  /* Crush near-black noise from the source so its rectangular frame doesn't ghost through */
  filter: contrast(1.15);
  /* Fade the rectangular edges to fully transparent before they meet the page */
  -webkit-mask-image: radial-gradient(circle, #000 60%, transparent 92%);
  mask-image: radial-gradient(circle, #000 60%, transparent 92%);
  /* Screen blend makes the video's true-black pixels invisible against any bg */
  mix-blend-mode: screen;
}

/* ---------- Page content ---------- */

main {
  flex: 1;
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.page-title {
  font-size: clamp(1.8rem, 4vw, 2.5rem);
  font-weight: 700;
  margin: 0 0 0.5rem;
  letter-spacing: -0.02em;
}

.page-subtitle {
  color: var(--text-muted);
  margin: 0 0 2.5rem;
  font-size: 1.05rem;
}

/* ---------- Project cards ---------- */

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.5rem;
}

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

.project-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent);
  box-shadow: 0 10px 30px var(--accent-glow);
}

.project-cover {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #000;
}

.project-body {
  padding: 1.25rem 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex: 1;
}

.project-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

.project-platform {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0;
}

.project-description {
  color: var(--text-muted);
  margin: 0;
  line-height: 1.55;
  font-size: 0.95rem;
  flex: 1;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.2rem;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 0.95rem;
  align-self: flex-start;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--accent-hover);
  color: #fff;
}

.btn:active {
  transform: translateY(1px);
}

/* ---------- Footer ---------- */

.footer {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer a {
  color: var(--text-muted);
  margin: 0 0.4rem;
}

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

.footer .sep {
  margin: 0 0.3rem;
  opacity: 0.5;
}

/* ---------- Mobile ---------- */

@media (max-width: 600px) {
  .nav {
    padding: 0.85rem 1rem;
  }
  .nav-links {
    gap: 1rem;
  }
  main {
    padding: 2rem 1rem;
  }
  .hero {
    padding: 1.5rem 1rem;
    min-height: calc(100vh - 120px);
  }
}

/* ---------- Legal pages ---------- */

.legal {
  max-width: 720px;
  line-height: 1.65;
  color: var(--text);
  font-size: 0.98rem;
}

.legal h2 {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 2.25rem 0 0.6rem;
  letter-spacing: -0.01em;
}

.legal h2:first-child {
  margin-top: 0;
}

.legal p {
  margin: 0 0 1rem;
  color: var(--text-muted);
}

.legal ul {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  color: var(--text-muted);
}

.legal li {
  margin-bottom: 0.4rem;
}

.legal strong {
  color: var(--text);
}

.legal code {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.05rem 0.35rem;
  font-size: 0.9em;
}

/* ---------- Reduced motion ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .hero-logo {
    /* respect user's motion preference: pause autoplay via attribute too */
  }
}
