/* === Design Tokens === */
:root {
  --bg: #0a0a0f;
  --bg-surface: #0d0d14;
  --bg-card: #111119;
  --text: #e0e0e8;
  --text-muted: #8888a0;
  --accent: #00d4ff;
  --accent-dim: #006880;
  --glow: 0 0 12px rgba(0, 212, 255, 0.4);
  --glow-strong: 0 0 20px rgba(0, 212, 255, 0.6), 0 0 40px rgba(0, 212, 255, 0.2);
  --font-body: 'Segoe UI', system-ui, -apple-system, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  --nav-height: 56px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-height);
}

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

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* === Nav === */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 3rem);
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.1);
}

.nav-logo {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--accent);
  text-shadow: var(--glow);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-links {
  display: none;
  list-style: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  flex-direction: column;
  gap: 0;
  background: rgba(10, 10, 15, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 212, 255, 0.15);
  padding: 0.5rem 0;
}

.nav.open .nav-links {
  display: flex;
}

.nav-links li {
  width: 100%;
}

.nav-links a {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  transition: color 0.3s, text-shadow 0.3s;
  padding: 0.75rem 1.5rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-shadow: 0 0 8px rgba(0, 212, 255, 0.5);
}

/* === Hero === */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: calc(var(--nav-height) + 2rem) 1.5rem 4rem;
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  overflow: hidden;
  pointer-events: none;
}

.hero-grid-inner {
  width: 200%;
  height: 60%;
  background:
    linear-gradient(90deg, transparent 0%, transparent calc(50% - 0.5px), rgba(0, 212, 255, 0.12) 50%, transparent calc(50% + 0.5px), transparent 100%),
    linear-gradient(0deg, transparent 0%, transparent calc(50% - 0.5px), rgba(0, 212, 255, 0.12) 50%, transparent calc(50% + 0.5px), transparent 100%);
  background-size: 80px 80px;
  transform: perspective(500px) rotateX(60deg);
  transform-origin: center bottom;
  mask-image: radial-gradient(ellipse 70% 90% at 50% 100%, black 30%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse 70% 90% at 50% 100%, black 30%, transparent 70%);
  animation: grid-breathe 6s ease-in-out infinite;
}

@keyframes grid-breathe {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.hero-content {
  position: relative;
  z-index: 1;
}

.hero-image {
  width: min(600px, 85vw);
  height: auto;
  filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4)) drop-shadow(0 0 40px rgba(0, 212, 255, 0.15));
  animation: image-pulse 4s ease-in-out infinite;
  margin-bottom: 1.5rem;
}

@keyframes image-pulse {
  0%, 100% { filter: drop-shadow(0 0 20px rgba(0, 212, 255, 0.4)) drop-shadow(0 0 40px rgba(0, 212, 255, 0.15)); }
  50% { filter: drop-shadow(0 0 30px rgba(0, 212, 255, 0.6)) drop-shadow(0 0 60px rgba(0, 212, 255, 0.25)); }
}

.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(0.9rem, 2vw, 1.1rem);
  color: var(--text-muted);
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin-bottom: 2.5rem;
}

/* === Buttons === */
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 2rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-primary {
  background: rgba(0, 212, 255, 0.1);
  color: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.2), inset 0 0 12px rgba(0, 212, 255, 0.05);
}

.btn-primary:hover {
  background: rgba(0, 212, 255, 0.18);
  box-shadow: var(--glow-strong), inset 0 0 20px rgba(0, 212, 255, 0.1);
}

.btn-outline {
  background: transparent;
  color: var(--text-muted);
  border-color: var(--text-muted);
}

.btn-outline:hover {
  color: var(--accent);
  border-color: var(--accent);
  box-shadow: var(--glow);
}

/* === Sections === */
.section {
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 3rem);
  max-width: 960px;
  margin: 0 auto;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.section.visible {
  opacity: 1;
  transform: translateY(0);
}

.section-title {
  font-family: var(--font-mono);
  font-size: clamp(1.3rem, 3vw, 1.6rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text);
  margin-bottom: 2rem;
  padding-bottom: 0.75rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 120px;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  box-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
}

/* === About === */
.about-text p {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 1.25rem;
  text-align: left;
}

.about-text p:last-child {
  margin-bottom: 0;
}

/* === Blog Promo === */
.blog-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.1);
  border-radius: 4px;
  padding: 2.5rem;
  text-align: center;
  max-width: 100%;
  margin: 0 auto;
  box-shadow: inset 0 0 30px rgba(0, 212, 255, 0.03);
  overflow: hidden;
}

.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.4);
}

.blog-card-title {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 0.75rem;
  letter-spacing: 0.05em;
}

.blog-card-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1.75rem;
}

/* === Apps Grid === */
.apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
  gap: 1.25rem;
}

.app-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid rgba(0, 212, 255, 0.08);
  border-radius: 4px;
  padding: 2rem 1.5rem;
  transition: border-color 0.3s, box-shadow 0.3s;
  overflow: hidden;
}

.app-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  box-shadow: 0 0 12px rgba(0, 212, 255, 0.5);
  opacity: 0;
  transition: opacity 0.3s;
}

.app-card:hover {
  border-color: rgba(0, 212, 255, 0.2);
  box-shadow: 0 0 20px rgba(0, 212, 255, 0.05);
}

.app-card:hover::before {
  opacity: 1;
}

.app-card-icon {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
  text-shadow: 0 0 10px rgba(0, 212, 255, 0.4);
}

.app-card-icon-svg {
  width: 48px;
  height: 48px;
  color: var(--accent);
  margin-bottom: 1rem;
  filter: drop-shadow(0 0 6px rgba(0, 212, 255, 0.4));
}

.app-card-icon-img {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  margin-bottom: 1rem;
}

.app-card-title {
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.app-card-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.5;
}

a.app-card-link {
  color: inherit;
  display: block;
}

/* === Footer === */
.footer {
  text-align: center;
  padding: 3rem 1.5rem;
  border-top: 1px solid rgba(0, 212, 255, 0.08);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* === Reduced Motion === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .section {
    opacity: 1;
    transform: none;
  }
}

/* === Hamburger === */
.nav-hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.nav-hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  box-shadow: 0 0 4px rgba(0, 212, 255, 0.4);
  transition: transform 0.3s, opacity 0.3s;
}

.nav.open .nav-hamburger span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav.open .nav-hamburger span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}

.nav.open .nav-hamburger span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* === Desktop Nav === */
@media (min-width: 1024px) {
  .nav-hamburger {
    display: none;
  }

  .nav-links {
    display: flex;
    position: static;
    flex-direction: row;
    gap: 2rem;
    background: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border-bottom: none;
    padding: 0;
  }

  .nav-links li {
    width: auto;
  }

  .nav-links a {
    display: inline;
    font-size: 0.8rem;
    padding: 0.25rem 0;
  }
}

/* === Mobile === */
@media (max-width: 600px) {
  .hero-tagline {
    letter-spacing: 0.08em;
  }

  .blog-card {
    padding: 2rem 1.5rem;
  }
}
