/* ===== Variables ===== */
:root {
  --bg: #0a0b0f;
  --bg-card: rgba(18, 20, 28, 0.7);
  --bg-card-hover: rgba(28, 32, 44, 0.85);
  --text: #e8eaef;
  --text-muted: #8b90a0;
  --accent: #00d4aa;
  --accent-dim: rgba(0, 212, 170, 0.15);
  --accent-warm: #ff6b4a;
  --accent-warm-dim: rgba(255, 107, 74, 0.12);
  --border: rgba(255, 255, 255, 0.06);
  --font: 'Outfit', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --radius: 16px;
  --radius-lg: 24px;
  --header-h: 72px;
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  min-height: 100vh;
}

/* Subtle noise overlay */
.noise {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  opacity: 0.03;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ambient gradient orbs */
.gradient-orb {
  position: fixed;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
  z-index: 0;
}
.gradient-orb-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent) 0%, transparent 70%);
  top: -200px;
  right: -150px;
}
.gradient-orb-2 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, var(--accent-warm) 0%, transparent 70%);
  bottom: 20%;
  left: -100px;
}
.gradient-orb-3 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, #6366f1 0%, transparent 70%);
  bottom: -80px;
  right: 20%;
  opacity: 0.2;
}

/* ===== Layout ===== */
main { position: relative; z-index: 1; }
.section {
  padding: clamp(4rem, 10vw, 7rem) 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.section.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.section-inner { max-width: 100%; }
.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.75rem;
}
.section-title {
  font-size: clamp(2rem, 5vw, 3rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  line-height: 1.15;
}
.section-desc {
  color: var(--text-muted);
  font-size: 1.1rem;
  max-width: 560px;
  margin: 0 0 2.5rem;
}

/* ===== Header ===== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  background: rgba(10, 11, 15, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}
.logo-img {
  display: block;
  width: 40px;
  height: 40px;
  object-fit: contain;
  border-radius: 10px;
  flex-shrink: 0;
}
.logo-text { display: inline-block; }
.logo-accent { color: var(--accent); }
.logo-rest { opacity: 0.95; }
.nav {
  display: flex;
  gap: 2rem;
}
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s;
}
.nav a:hover { color: var(--accent); }
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.menu-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 1px;
}

/* ===== Hero ===== */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding-top: var(--header-h);
  padding-bottom: 4rem;
  padding-left: clamp(1.5rem, 6vw, 4rem);
  padding-right: clamp(1.5rem, 6vw, 4rem);
}
.hero-inner {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  padding-left: clamp(1.25rem, 4vw, 2.5rem);
  border-left: 3px solid rgba(0, 212, 170, 0.4);
}
.hero-tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  opacity: 0;
  animation: fadeUp 0.8s ease forwards;
}
.hero-title {
  font-size: clamp(3rem, 12vw, 6.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
  margin: 0 0 1.5rem;
  overflow: hidden;
}
.hero-title .line {
  display: block;
  opacity: 0;
  transform: translateY(1.2em);
  animation: fadeUp 0.9s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}
.hero-title .line:nth-child(1) { animation-delay: 0.15s; }
.hero-title .line:nth-child(2) { animation-delay: 0.3s; }
.hero-title .line:nth-child(3) { animation-delay: 0.45s; }
.hero-title .accent { color: var(--accent); }
.hero-desc {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 480px;
  margin: 0 0 2rem;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.5s forwards;
}
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 1.75rem;
  background: var(--accent);
  color: var(--bg);
  text-decoration: none;
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius);
  transition: transform 0.2s, box-shadow 0.2s;
  opacity: 0;
  animation: fadeUp 0.8s ease 0.65s forwards;
}
.cta-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(0, 212, 170, 0.35);
}
.cta-primary svg { flex-shrink: 0; }

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

/* ===== About ===== */
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
}
.about-card {
  padding: 1.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.about-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 212, 170, 0.2);
  transform: translateY(-4px);
}
.about-icon {
  font-size: 1.5rem;
  color: var(--accent);
  margin-bottom: 1rem;
  opacity: 0.9;
}
.about-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.about-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ===== Games ===== */
.games-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
}
.game-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  min-height: 320px;
  transition: transform 0.3s, box-shadow 0.3s;
}
.game-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}
.game-card-bg {
  position: absolute;
  inset: 0;
  opacity: 0.4;
  transition: opacity 0.4s;
}
.game-card[data-game="puppy"] .game-card-bg {
  background: linear-gradient(135deg, #0d9488 0%, #0f766e 50%, #134e4a 100%);
}
.game-card[data-game="tidal"] .game-card-bg {
  background: linear-gradient(135deg, #1e3a5f 0%, #0c4a6e 50%, #0e7490 100%);
}
.game-card[data-game="dots"] .game-card-bg {
  background: linear-gradient(135deg, #312e81 0%, #1d4ed8 45%, #06b6d4 100%);
}
.game-card[data-game="brain-peace"] .game-card-bg {
  background: linear-gradient(135deg, #4338ca 0%, #7c3aed 50%, #c026d3 100%);
}
.game-card:hover .game-card-bg { opacity: 0.55; }
.game-card-content {
  position: relative;
  padding: 2rem;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background: linear-gradient(to top, rgba(10, 11, 15, 0.95) 0%, rgba(10, 11, 15, 0.4) 50%, transparent 100%);
}
.game-badge {
  display: inline-block;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  background: var(--accent-dim);
  color: var(--accent);
  border-radius: 999px;
  margin-bottom: 1rem;
}
.game-card h3 {
  font-size: 1.6rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.game-card p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  flex-grow: 1;
}
.game-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1.25rem;
}
.play-web {
  display: inline-flex;
  align-items: center;
  padding: 0.6rem 1.1rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: background 0.2s, border-color 0.2s, color 0.2s;
}
.play-web:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}
.play-badge {
  display: inline-block;
  transition: transform 0.2s, opacity 0.2s;
}
.play-badge:hover {
  transform: scale(1.05);
  opacity: 0.95;
}
.play-badge img {
  display: block;
  height: 52px;
  width: auto;
  max-width: 180px;
}

/* ===== Projects ===== */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}
.project-card {
  padding: 2rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  transition: background 0.3s, border-color 0.3s, transform 0.3s;
}
.project-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(255, 107, 74, 0.15);
  transform: translateY(-4px);
}
.featured-project {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(255, 107, 74, 0.28), transparent 52%),
    radial-gradient(ellipse at 0% 100%, rgba(99, 102, 241, 0.24), transparent 55%),
    linear-gradient(135deg, rgba(0, 212, 170, 0.16), rgba(18, 20, 28, 0.88) 58%);
  border-color: rgba(0, 212, 170, 0.3);
  box-shadow: 0 12px 36px rgba(0, 212, 170, 0.08);
}
.featured-project:hover {
  background:
    radial-gradient(ellipse at 100% 0%, rgba(255, 107, 74, 0.36), transparent 52%),
    radial-gradient(ellipse at 0% 100%, rgba(99, 102, 241, 0.3), transparent 55%),
    linear-gradient(135deg, rgba(0, 212, 170, 0.22), rgba(28, 32, 44, 0.92) 58%);
  border-color: rgba(0, 212, 170, 0.55);
}
.featured-project .project-number {
  color: var(--accent);
  opacity: 0.9;
}
.featured-project h3 {
  font-size: 1.45rem;
}
.featured-project p {
  margin-bottom: 1.25rem;
}
.featured-project-link {
  background: linear-gradient(100deg, var(--accent), #62e6c4);
  border-color: transparent;
  color: #071410;
}
.featured-project-link:hover {
  background: linear-gradient(100deg, #62e6c4, #a1f1de);
  border-color: transparent;
  color: #071410;
}
.project-number {
  font-family: var(--font-mono);
  font-size: 2rem;
  font-weight: 500;
  color: var(--accent-warm);
  opacity: 0.6;
  margin-bottom: 0.75rem;
}
.project-card h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
}
.project-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}
.project-card .play-web { margin-top: 1rem; }

/* ===== Contact ===== */
.contact {
  padding-bottom: 4rem;
}
.contact-inner {
  text-align: center;
}
.contact-inner .section-title { margin-bottom: 0.5rem; }
.contact-inner p {
  color: var(--text-muted);
  margin: 0 0 1.5rem;
}
.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}
.contact-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1.25rem;
  border: 1px solid rgba(0, 212, 170, 0.3);
  border-radius: var(--radius);
  transition: background 0.2s, border-color 0.2s;
}
.contact-link:hover {
  background: var(--accent-dim);
  border-color: var(--accent);
}

/* ===== Footer ===== */
.footer {
  padding: 2rem 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.9rem;
}
.logo-inline { color: var(--accent); font-weight: 600; }
.footer-copy { margin: 0.5rem 0 0; opacity: 0.8; }
.footer-copy a {
  color: var(--text-muted);
  margin-left: 0.5rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
  transition: color 0.2s;
}
.footer-copy a:hover { color: var(--accent); }

/* ===== Privacy policy ===== */
.policy-page {
  position: relative;
  z-index: 1;
  max-width: 900px;
  margin: 0 auto;
  padding: calc(var(--header-h) + 4rem) 1.5rem 5rem;
}
.policy-heading { margin-bottom: 2.5rem; }
.policy-heading .section-label { margin-bottom: 0.75rem; }
.policy-updated {
  color: var(--text-muted);
  font-size: 0.95rem;
}
.policy-content {
  padding: clamp(1.5rem, 5vw, 3rem);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.policy-content section + section { margin-top: 2rem; }
.policy-content h2 {
  margin: 0 0 0.65rem;
  font-size: 1.35rem;
  line-height: 1.3;
}
.policy-content p,
.policy-content li {
  color: var(--text-muted);
}
.policy-content p { margin: 0.5rem 0; }
.policy-content ul { padding-left: 1.4rem; }
.policy-content a { color: var(--accent); }

/* ===== Mobile ===== */
@media (max-width: 768px) {
  .nav {
    position: fixed;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 1.5rem;
    background: rgba(10, 11, 15, 0.98);
    border-bottom: 1px solid var(--border);
    gap: 1rem;
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0.3s;
  }
  .nav.is-open {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .menu-toggle { display: flex; }
  .hero-title { font-size: clamp(2.5rem, 11vw, 4rem); }
  .games-grid { grid-template-columns: 1fr; }
}
