:root {
  --primary: #6366f1;
  --primary-glow: rgba(99, 102, 241, 0.5);
  --secondary: #10b981;
  --secondary-glow: rgba(16, 185, 129, 0.5);
  --accent: #f43f5e;
  --accent-glow: rgba(244, 63, 94, 0.5);
  --bg-dark: #030712;
  --bg-card: #111827;
  --text-main: #f9fafb;
  --text-muted: #9ca3af;
  --font-display: 'Outfit', sans-serif;
  --font-sans: 'Inter', sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-dark);
  color: var(--text-main);
  font-family: var(--font-sans);
  overflow-x: hidden;
  line-height: 1.6;
}

h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* Background Gradients */
.bg-glow {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  background:
    radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15), transparent 40%),
    radial-gradient(circle at 20% 80%, rgba(16, 185, 129, 0.1), transparent 40%);
  pointer-events: none;
}

/* Navigation */
nav {
  position: fixed;
  top: 0;
  width: 100%;
  padding: 1.5rem 2rem;
  z-index: 100;
  background: rgba(3, 7, 18, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-decoration: none;
}

.logo-icon {
  width: 32px;
  height: 32px;
  background: var(--accent);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 15px var(--accent-glow);
}

.nav-links {
  display: flex;
  gap: 2.5rem;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.3s ease;
}

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

/* Hero Section */
header {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding: 8rem 2rem 4rem;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 4rem;
  align-items: center;
}

.hero-content span.badge {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  color: var(--primary);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1.5rem;
}

.hero-content h1 {
  font-size: 4.5rem;
  line-height: 1.1;
  margin-bottom: 2rem;
}

.gradient-text {
  background: linear-gradient(135deg, #60a5fa 0%, #34d399 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-content p {
  font-size: 1.25rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  max-width: 540px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 2rem;
  background: var(--text-main);
  color: var(--bg-dark);
  text-decoration: none;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

/* Robot Mascot (Upgraded) */
.mascot-container {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 1000px;
}

.robot {
  width: 180px;
  height: 220px;
  background: var(--accent);
  border-radius: 20px;
  position: relative;
  box-shadow: 0 15px 0 #9f1239, 0 20px 40px rgba(0, 0, 0, 0.4);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {

  0%,
  100% {
    transform: translateY(0) rotateX(5deg);
  }

  50% {
    transform: translateY(-20px) rotateX(-5deg);
  }
}

.robot-head {
  width: 90px;
  height: 70px;
  background: var(--accent);
  border: 4px solid #000;
  border-radius: 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.eye {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  position: relative;
}

.eye::after {
  content: '';
  position: absolute;
  width: 6px;
  height: 6px;
  background: #000;
  border-radius: 50%;
  top: 4px;
  left: 4px;
  transition: all 0.1s ease;
}

.robot-body {
  width: 120px;
  height: 90px;
  background: var(--accent);
  border: 4px solid #000;
  border-radius: 15px;
}

/* Projects Section */
.section-header {
  text-align: center;
  margin-bottom: 5rem;
}

.section-header h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.section-header p {
  color: var(--text-muted);
  font-size: 1.1rem;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 3rem;
}

.card {
  background: var(--bg-card);
  border-radius: 24px;
  padding: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), border-color 0.4s ease;
  display: flex;
  flex-direction: column;
  position: relative;
  grid-column: span 12;
  /* Default for mobile */
}

/* Wide card for desktop/web apps */
.card-wide {
  grid-column: span 8;
}

/* Narrow card for mobile apps */
.card-mobile {
  grid-column: span 4;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

@media (max-width: 1024px) {

  .card-wide,
  .card-mobile {
    grid-column: span 12;
    max-width: 100%;
  }
}

.card:hover {
  transform: translateY(-10px);
  border-color: rgba(99, 102, 241, 0.3);
}

.card-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 2rem;
  color: var(--primary);
}

.card h3 {
  font-size: 1.75rem;
  margin-bottom: 1.25rem;
}

.card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: 2rem;
  flex-grow: 1;
}

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

.tag {
  background: rgba(255, 255, 255, 0.05);
  padding: 0.4rem 0.8rem;
  border-radius: 8px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

/* Philosophy Section */
.philosophy {
  padding: 10rem 0;
}

.philosophy-card {
  background: linear-gradient(135deg, #111827 0%, #030712 100%);
  border-radius: 48px;
  padding: 5rem;
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.phil-content h2 {
  font-size: 3.5rem;
  margin-bottom: 2rem;
}

.phil-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 3rem;
}

.stat-item h4 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.stat-item span {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.1em;
}

/* Footer */
footer {
  padding: 5rem 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 4rem;
  margin-bottom: 4rem;
}

.footer-brand p {
  color: var(--text-muted);
  margin-top: 1.5rem;
  max-width: 320px;
}

.footer-col h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 2rem;
  color: var(--text-main);
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 1rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Visual Assets */
.preview-window {
  width: 100%;
  height: 480px;
  background: #0a0a0c;
  border-radius: 12px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-window-mobile {
  height: 600px;
  padding: 0;
  /* Direct fit for mobile screens */
}

.preview-window-wide {
  height: 380px;
  padding: 0;
}

.preview-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Default to cover for filled look */
  transition: transform 0.6s ease;
  opacity: 1;
  filter: contrast(1.1);
}

.image-mobile {
  object-fit: contain;
  background: #000;
}

/* Specific styling for the Amigurumi desktop screenshot to focus on the pattern/render */
.amigurumi-preview {
  object-fit: cover;
  object-position: 10% center;
  /* Focus even more on the left/center pattern studio area */
}

.card:hover .preview-image {
  transform: scale(1.02);
}

.preview-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(17, 24, 39, 0.4), transparent);
  pointer-events: none;
}

.preview-dot {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff5f56;
  box-shadow: 14px 0 0 #ffbd2e, 28px 0 0 #27c93f;
  z-index: 2;
}

/* Responsive */
@media (max-width: 1024px) {

  .hero-grid,
  .philosophy-card,
  .projects-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h1 {
    font-size: 3.5rem;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  nav {
    padding: 1rem;
  }

  .nav-links {
    display: none;
  }

  .hero-content h1 {
    font-size: 2.75rem;
  }

  .philosophy-card {
    padding: 2rem;
  }
}