/* ═══════════════════════════════════════════
   RESET & TOKENS
═══════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  color-scheme: dark;
  --bg:        #070710;
  --bg2:       #0d0d1a;
  --surface:   rgba(255,255,255,0.05);
  --surface2:  rgba(255,255,255,0.08);
  --border:    rgba(255,255,255,0.10);
  --border2:   rgba(255,255,255,0.18);
  --text:      #f0f0f8;
  --text2:     #9ea0be;
  --accent:    #7c6af7;
  --accent2:   #a78bfa;
  --cyan:      #22d3ee;
  --green:     #4ade80;
  --danger:    #f87171;
  --danger-bg: rgba(248,113,113,0.08);
  --grad:      linear-gradient(135deg, #7c6af7 0%, #22d3ee 100%);
  --grad2:     linear-gradient(135deg, #a78bfa 0%, #38bdf8 100%);
  --glow:      0 0 40px rgba(124,106,247,0.28);
  --radius:    16px;
  --radius-lg: 24px;
  --trans:     0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }

/* ═══════════════════════════════════════════
   TYPOGRAPHY & LEGIBILITY
═══════════════════════════════════════════ */
h1, h2, h3, h4, h5, h6 {
  text-wrap: balance;
}

p, blockquote, li {
  text-wrap: pretty;
}

/* ═══════════════════════════════════════════
   ACCESSIBILITY: SKIP LINK & FOCUS RINGS
═══════════════════════════════════════════ */
.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

.skip-link {
  position: fixed;
  top: 16px;
  left: 16px;
  z-index: 3000;
  background: var(--grad);
  color: #fff;
  font-weight: 700;
  padding: 12px 22px;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6);
}

:where(a:any-link, button, input, textarea):focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

main:focus {
  outline: none;
}

/* ═══════════════════════════════════════════
   DEFERRED RENDERING BELOW THE FOLD
═══════════════════════════════════════════ */
.deferred-section {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 750px;
}

/* ═══════════════════════════════════════════
   CURSOR GLOW (Ambient Spotlight)
═══════════════════════════════════════════ */
.cursor-glow {
  position: fixed; top: 0; left: 0;
  width: 440px; height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,106,247,0.13) 0%, rgba(34,211,238,0.04) 40%, transparent 70%);
  pointer-events: none;
  z-index: 0;
  transition: opacity 0.3s;
  will-change: transform;
}

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

/* ═══════════════════════════════════════════
   GLASS UTILITY
═══════════════════════════════════════════ */
.glass {
  background: var(--surface);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

/* ═══════════════════════════════════════════
   BUTTONS
═══════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px;
  border-radius: 50px;
  font-weight: 600; font-size: 0.95rem;
  font-family: inherit;
  cursor: pointer; border: none;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans), color var(--trans);
  position: relative; overflow: hidden;
  min-block-size: 44px;
}
.btn::after {
  content: '';
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0; transition: opacity var(--trans);
}
.btn:hover::after { opacity: 1; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 24px rgba(124,106,247,0.4);
}
.btn-primary:hover { box-shadow: 0 8px 32px rgba(124,106,247,0.6); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border2);
  backdrop-filter: blur(10px);
}
.btn-ghost:hover { border-color: var(--accent2); color: var(--accent2); }

.btn-sm { padding: 8px 20px; font-size: 0.85rem; min-block-size: 38px; }
.btn-full { width: 100%; justify-content: center; }

/* ═══════════════════════════════════════════
   NAVBAR
═══════════════════════════════════════════ */
.navbar {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  padding: 16px 24px;
  transition: background var(--trans), padding var(--trans), border-color var(--trans);
}
.navbar.scrolled {
  background: rgba(7,7,16,0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
}
.nav-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 32px;
}
.nav-logo {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.5rem; font-weight: 700;
  background: var(--grad); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: auto;
  letter-spacing: -0.02em;
}
.logo-bracket { opacity: 0.75; margin-left: 2px; }

.nav-links { display: flex; gap: 32px; }
.nav-link {
  font-size: 0.92rem; font-weight: 500; color: var(--text2);
  transition: color var(--trans); position: relative;
  padding: 6px 0;
}
.nav-link::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--grad); border-radius: 2px;
  transition: width var(--trans);
}
.nav-link:hover,
.nav-link.active { color: var(--text); }
.nav-link:hover::after,
.nav-link.active::after { width: 100%; }

.hamburger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  background: none; border: none; cursor: pointer;
  min-inline-size: 40px; min-block-size: 40px; padding: 8px;
}
.hamburger span { display: block; width: 24px; height: 2px; background: var(--text); border-radius: 2px; transition: all var(--trans); }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  display: none; flex-direction: column; gap: 0;
  background: rgba(7,7,16,0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  max-height: 0; overflow: hidden;
  border-radius: 0 0 var(--radius) var(--radius);
  transition: max-height 0.4s ease;
}
.mobile-menu.open { max-height: 300px; margin-top: 12px; border: 1px solid var(--border); }
.mob-link {
  padding: 16px 24px; font-weight: 500; font-size: 1rem; color: var(--text2);
  border-bottom: 1px solid var(--border);
  transition: color var(--trans), background var(--trans);
}
.mob-link:last-child { border-bottom: none; }
.mob-link:hover { color: var(--text); background: var(--surface); }

/* ═══════════════════════════════════════════
   ORB BACKGROUNDS
═══════════════════════════════════════════ */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none; z-index: 0;
}
.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(124,106,247,0.18) 0%, transparent 70%);
  top: -100px; left: -100px;
  animation: orbFloat 8s ease-in-out infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
.orb-2 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(34,211,238,0.12) 0%, transparent 70%);
  top: 200px; right: -80px;
  animation: orbFloat 10s ease-in-out infinite reverse;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
.orb-3 {
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(167,139,250,0.10) 0%, transparent 70%);
  bottom: 0; left: 40%;
  animation: orbFloat 12s ease-in-out infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
.orb-contact {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(124,106,247,0.12) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
}
@keyframes orbFloat {
  0%,100% { translate: 0 0; scale: 1; }
  50%      { translate: 0 -28px; scale: 1.05; }
}

/* ═══════════════════════════════════════════
   HERO
═══════════════════════════════════════════ */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 120px 24px 104px;
  overflow: hidden;
  background: radial-gradient(ellipse 80% 60% at 50% 0%, rgba(124,106,247,0.16) 0%, transparent 70%),
              var(--bg);
}
.hero-content {
  position: relative; z-index: 2;
  text-align: center; max-width: 820px;
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(74,222,128,0.1);
  border: 1px solid rgba(74,222,128,0.25);
  color: var(--green);
  padding: 6px 16px; border-radius: 50px;
  font-size: 0.82rem; font-weight: 600;
  margin-bottom: 28px;
  animation: fadeDown 0.6s ease both;
}
.badge-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}

.hero-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800; line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 24px;
  animation: fadeUp 0.7s 0.1s ease both;
}
.gradient-text {
  background: var(--grad2); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.hero-sub {
  font-size: clamp(1rem, 1.8vw, 1.15rem);
  color: var(--text2); line-height: 1.7;
  margin-bottom: 40px;
  max-width: 65ch;
  margin-inline: auto;
  animation: fadeUp 0.7s 0.2s ease both;
}
.br-desk { display: none; }
@media(min-width:640px) { .br-desk { display: inline; } }

.hero-cta {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 64px;
  animation: fadeUp 0.7s 0.3s ease both;
}

.hero-stats {
  display: flex; justify-content: center; gap: 16px; flex-wrap: wrap;
  animation: fadeUp 0.7s 0.4s ease both;
}
.stat {
  padding: 20px 32px; text-align: center; min-width: 130px;
  border-radius: var(--radius);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.stat:hover { transform: translateY(-4px); box-shadow: var(--glow); border-color: var(--border2); }
.stat-num {
  display: block;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 2.1rem; font-weight: 800;
  font-variant-numeric: tabular-nums;
  background: var(--grad); -webkit-background-clip: text;
  -webkit-text-fill-color: transparent; background-clip: text;
}
.stat-label { font-size: 0.82rem; color: var(--text2); font-weight: 500; }

.scroll-indicator {
  position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  z-index: 2;
  opacity: 0.75;
  transition: opacity var(--trans), transform var(--trans);
}
.scroll-indicator:hover {
  opacity: 1;
  transform: translateX(-50%) translateY(3px);
}
.scroll-indicator span {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text2);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.scroll-line {
  width: 1px; height: 22px;
  background: linear-gradient(to bottom, var(--accent2), transparent);
  animation: scrollPulse 2s ease infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
@keyframes scrollPulse {
  0%,100% { opacity: 1; transform: scaleY(1); }
  50%     { opacity: 0.3; transform: scaleY(0.7); }
}

@media (max-height: 780px) {
  .scroll-indicator { display: none; }
  .hero { padding-bottom: 60px; }
}

/* ═══════════════════════════════════════════
   SECTIONS
═══════════════════════════════════════════ */
.section { padding: 120px 24px; position: relative; overflow: hidden; }
.container { max-width: 1200px; margin: 0 auto; position: relative; z-index: 2; }

.section-tag {
  display: inline-block;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent2);
  border: 1px solid rgba(124,106,247,0.3);
  background: rgba(124,106,247,0.08);
  padding: 5px 14px; border-radius: 50px;
  margin-bottom: 20px;
}
.section-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800; line-height: 1.15; letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.section-sub {
  color: var(--text2); font-size: 1.05rem;
  margin-bottom: 56px; line-height: 1.7;
  max-width: 60ch;
}

/* ═══════════════════════════════════════════
   ABOUT
═══════════════════════════════════════════ */
.about { background: var(--bg2); }
.about-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px; margin-bottom: 32px;
}
.about-card {
  padding: 32px; border-radius: var(--radius-lg);
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
}
.about-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(124,106,247,0.15);
  border-color: var(--border2);
}
.about-icon {
  font-size: 1.8rem;
  width: 52px; height: 52px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 14px;
  background: rgba(124,106,247,0.1);
  border: 1px solid rgba(124,106,247,0.2);
  margin-bottom: 18px;
}
.about-card h3 { font-weight: 700; font-size: 1.12rem; margin-bottom: 10px; }
.about-card p { color: var(--text2); font-size: 0.93rem; line-height: 1.7; }

.stack-bar {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 20px 28px; border-radius: var(--radius);
}
.stack-label { font-weight: 700; font-size: 0.9rem; white-space: nowrap; color: var(--text); }
.stack-pills { display: flex; gap: 10px; flex-wrap: wrap; }
.pill {
  display: inline-block;
  padding: 6px 15px; border-radius: 50px; font-size: 0.82rem; font-weight: 600;
  background: rgba(124,106,247,0.12);
  border: 1px solid rgba(124,106,247,0.25);
  color: var(--accent2);
  transition: background var(--trans), transform var(--trans), border-color var(--trans);
}
.pill:hover { background: rgba(124,106,247,0.25); border-color: var(--accent2); transform: translateY(-2px); }

/* ═══════════════════════════════════════════
   PROJECTS
═══════════════════════════════════════════ */
.projects { background: var(--bg); }

.projects-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}
.projects-top .section-sub {
  margin-bottom: 0;
}

.project-filters {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px;
  border-radius: 50px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: 50px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text2);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--trans);
}
.filter-btn:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.05);
}
.filter-btn.active {
  background: var(--grad);
  color: #fff;
  box-shadow: 0 4px 18px rgba(124, 106, 247, 0.35);
}
.filter-count {
  font-size: 0.72rem;
  padding: 1px 7px;
  border-radius: 50px;
  background: rgba(0, 0, 0, 0.25);
  color: inherit;
}
.live-dot-sm {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 8px var(--green);
}

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

.project-card {
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--trans), box-shadow var(--trans), border-color var(--trans);
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, rgba(255,255,255,0.06) 0%, rgba(255,255,255,0.025) 100%);
}
.project-card[hidden] {
  display: none !important;
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(124,106,247,0.2);
  border-color: rgba(124,106,247,0.4);
}
.project-card.is-live-project {
  border-color: rgba(34, 211, 238, 0.22);
}
.project-card.is-live-project:hover {
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 24px 52px rgba(34, 211, 238, 0.16), 0 12px 32px rgba(124, 106, 247, 0.18);
}

.project-media {
  width: 100%;
  position: relative; overflow: hidden;
  background: var(--bg2);
}
.vertical-media {
  aspect-ratio: 4 / 3;
  background-color: var(--bg2);
}
.vertical-media::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(7,7,16,0.75) 0%, transparent 45%);
  pointer-events: none;
}

.live-domain-pill {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 13px;
  border-radius: 50px;
  background: rgba(7, 7, 16, 0.82);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(74, 222, 128, 0.35);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
}
.live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  animation: pulse 2s infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}

.lazy-cover {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.project-card:hover .lazy-cover {
  transform: scale(1.05);
}

.media-play-badge {
  position: absolute;
  bottom: 14px; right: 14px;
  z-index: 2;
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px;
  border-radius: 50px;
  background: rgba(7, 7, 16, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.18);
  color: var(--text);
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--trans), border-color var(--trans), transform var(--trans);
}
.media-play-badge .play-icon {
  color: var(--cyan);
  font-size: 0.78rem;
}
.media-play-badge:hover {
  background: var(--accent);
  border-color: var(--accent2);
  transform: scale(1.04);
}
.media-play-badge:hover .play-icon {
  color: #fff;
}

.project-info {
  padding: 24px 26px 26px;
  flex: 1;
  display: flex; flex-direction: column; gap: 18px; justify-content: space-between;
}
.project-header {
  display: flex; flex-direction: column; gap: 10px;
}
.project-tags {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-bottom: 2px;
}
.project-tag {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 50px;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.22);
  color: var(--cyan);
}
.project-tag.tag-live {
  background: rgba(74, 222, 128, 0.12);
  border-color: rgba(74, 222, 128, 0.35);
  color: var(--green);
}
.project-title { font-family: 'Space Grotesk', sans-serif; font-size: 1.35rem; font-weight: 700; }
.project-desc { color: var(--text2); font-size: 0.92rem; line-height: 1.65; }
.project-links { display: flex; flex-direction: column; align-items: stretch; gap: 10px; }

.proj-btn {
  padding: 10px 20px; border-radius: 50px; font-size: 0.86rem; font-weight: 600;
  font-family: inherit;
  min-block-size: 42px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: all var(--trans); border: 1px solid var(--border2);
}

.live-btn {
  background: var(--grad);
  border: none;
  color: #fff;
  font-weight: 700;
  width: 100%;
  box-shadow: 0 4px 20px rgba(124, 106, 247, 0.35);
}
.live-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(34, 211, 238, 0.4);
  filter: brightness(1.06);
}

.play-btn.proj-btn {
  cursor: pointer;
  font-weight: 700;
  width: 100%;
  background: rgba(124,106,247,0.12);
  border: 1px solid rgba(124,106,247,0.35);
  color: var(--text);
}
.play-btn.proj-btn:hover {
  background: var(--grad);
  border-color: transparent;
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,106,247,0.35);
}

.wa-btn {
  background: #25D366;
  color: #041f0e !important;
  font-weight: 700;
  border: none !important;
  width: 100%;
}
.wa-btn:hover {
  background: #22c35e !important;
  color: #031509 !important;
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(37, 211, 102, 0.3);
}

/* ═══════════════════════════════════════════
   NATIVE TOP-LAYER VIDEO MODAL (<dialog>)
═══════════════════════════════════════════ */
dialog.video-modal {
  margin: auto;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--text);
  width: min(92vw, 430px);
  max-height: 92dvh;
  overflow: visible;

  /* Base closed/exit state & discrete top-layer transitions */
  opacity: 0;
  transform: translateY(24px) scale(0.95);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.3s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

dialog.video-modal:modal {
  overscroll-behavior: contain;
}

dialog.video-modal::backdrop {
  background-color: rgba(4, 4, 12, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  overflow: hidden;
  overscroll-behavior: contain;
  transition-property: background-color, backdrop-filter, display, overlay;
  transition-duration: 0.3s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(dialog.video-modal[open]):where(:not([data-closing])) {
  opacity: 1;
  transform: translateY(0) scale(1);

  @starting-style {
    opacity: 0;
    transform: translateY(24px) scale(0.95);
  }

  &::backdrop {
    background-color: rgba(4, 4, 12, 0.84);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);

    @starting-style {
      background-color: rgba(4, 4, 12, 0);
      backdrop-filter: blur(0px);
      -webkit-backdrop-filter: blur(0px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  dialog.video-modal {
    transform: none;
    transition-duration: 0.1s;
  }

  @starting-style {
    dialog.video-modal[open] {
      transform: none;
    }
  }
}

.modal-content {
  position: relative;
  width: 100%;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: #0b0b18;
  border: 1px solid var(--border2);
  box-shadow: 0 24px 64px rgba(0,0,0,0.85);
  display: flex;
  flex-direction: column;
}

.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid var(--border);
}
.modal-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.close-modal {
  background: rgba(255,255,255,0.08);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 34px; height: 34px;
  font-size: 22px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: background var(--trans), transform var(--trans);
}
.close-modal:hover {
  background: rgba(248, 113, 113, 0.85);
  border-color: transparent;
  color: #fff;
  transform: scale(1.08);
}

.modal-media-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 9 / 16;
  max-height: calc(92dvh - 60px);
  background: #000;
  overflow: hidden;
}

.modal-media-wrap video {
  width: 100%; height: 100%; object-fit: cover; display: block; background: #000;
}

.modal-fallback {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 20px;
  background: #070710;
}
.modal-fallback[hidden] {
  display: none !important;
}
.modal-fallback img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  filter: brightness(0.75);
}
.modal-fallback-card {
  position: relative; z-index: 2;
  padding: 22px;
  background: rgba(7, 7, 16, 0.86);
  border: 1px solid var(--border2);
  display: flex; flex-direction: column; gap: 10px;
}
.modal-fallback-card h3 {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.35rem;
}
.modal-fallback-card p {
  font-size: 0.9rem;
  color: var(--text2);
  margin-bottom: 6px;
}

.hero-sub strong {
  color: var(--text);
  font-weight: 600;
}

/* ═══════════════════════════════════════════
   FAQ SECTION (NATIVE <details>)
═══════════════════════════════════════════ */
.faq {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.faq-container {
  max-width: 860px;
}

.faq-header {
  text-align: center;
  margin-bottom: 48px;
}

.faq-header .section-sub {
  margin-inline: auto;
  margin-bottom: 0;
}

.faq-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.faq-item {
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--trans), box-shadow var(--trans), background var(--trans);
}

.faq-item:hover,
.faq-item[open] {
  border-color: rgba(124, 106, 247, 0.35);
}

.faq-item[open] {
  background: rgba(255, 255, 255, 0.065);
  box-shadow: 0 12px 36px rgba(124, 106, 247, 0.12);
}

.faq-question {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 26px;
  cursor: pointer;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text);
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

.faq-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(124, 106, 247, 0.14);
  border: 1px solid rgba(124, 106, 247, 0.3);
  color: var(--accent2);
  font-size: 1.2rem;
  line-height: 1;
  transition: transform var(--trans), background var(--trans), color var(--trans);
}

.faq-item[open] .faq-icon {
  transform: rotate(45deg);
  background: var(--grad);
  border-color: transparent;
  color: #fff;
}

.faq-answer {
  padding: 0 26px 24px;
  color: var(--text2);
  font-size: 0.94rem;
  line-height: 1.7;
}

.faq-answer strong {
  color: var(--text);
  font-weight: 600;
}

.faq-answer code {
  font-size: 0.85em;
  padding: 2px 6px;
  border-radius: 6px;
  background: rgba(124, 106, 247, 0.15);
  color: var(--accent2);
}

/* ═══════════════════════════════════════════
   CONTACT & MODERN FORM VALIDATION
═══════════════════════════════════════════ */
.contact { background: var(--bg2); }
.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px; align-items: start;
}
@media(max-width: 860px) { .contact-wrapper { grid-template-columns: 1fr; } }

.contact-form { padding: 40px; border-radius: var(--radius-lg); display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.86rem; font-weight: 600; color: var(--text); }
.form-hint { font-size: 0.78rem; color: var(--text2); }

.form-group input,
.form-group textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color var(--trans), box-shadow var(--trans), background-color var(--trans);
}

.form-group textarea {
  field-sizing: content;
  height: auto;
  width: 100%;
  min-block-size: 4lh;
  max-block-size: 10lh;
  resize: vertical;
}

.form-group input::placeholder,
.form-group textarea::placeholder { color: rgba(158,160,190,0.45); }

.form-group input:focus,
.form-group textarea:focus {
  border-color: rgba(124,106,247,0.65);
  box-shadow: 0 0 0 3px rgba(124,106,247,0.15);
}

/* Validation after user interaction (:user-invalid / :user-valid + JS fallback) */
.error-msg {
  display: none;
  color: var(--danger);
  font-size: 0.8rem;
  font-weight: 500;
  margin-top: 2px;
}

.form-group :is(input, textarea):is(:user-invalid, .user-invalid-fallback) {
  border-color: var(--danger);
  background-color: var(--danger-bg);
}

.form-group :is(input, textarea):is(:user-invalid, .user-invalid-fallback) + .error-msg {
  display: block;
}

.form-group :is(input, textarea):is(:user-valid, .user-valid-fallback) {
  border-color: rgba(74, 222, 128, 0.45);
}

.form-success {
  display: flex; align-items: center; gap: 10px;
  background: rgba(74,222,128,0.1); border: 1px solid rgba(74,222,128,0.25);
  color: var(--green); border-radius: 12px;
  padding: 14px 18px; font-weight: 600; font-size: 0.92rem;
}
.form-success[hidden] {
  display: none !important;
}

.contact-sidebar { display: flex; flex-direction: column; gap: 16px; }
.contact-card {
  display: flex; align-items: center; gap: 16px;
  padding: 20px 22px; border-radius: var(--radius);
  transition: transform var(--trans), border-color var(--trans);
}
.contact-card:hover { transform: translateY(-3px); border-color: var(--border2); }
.cc-icon { font-size: 1.5rem; display: flex; align-items: center; justify-content: center; }
.wa-icon { color: #25D366; }
.cc-info { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-label { font-size: 0.75rem; font-weight: 700; color: var(--text2); text-transform: uppercase; letter-spacing: 0.05em; }
.cc-value { font-size: 0.9rem; font-weight: 600; overflow-wrap: anywhere; }
.cc-arrow {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--surface2); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: background var(--trans), border-color var(--trans), transform var(--trans);
}
.cc-arrow:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateX(2px); }

.availability-badge {
  display: flex; align-items: center; gap: 14px;
  padding: 20px 22px; border-radius: var(--radius);
}
.badge-dot.pulse {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--green); flex-shrink: 0;
  animation: pulse 2s infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
.availability-badge strong { font-size: 0.95rem; }
.availability-badge p { font-size: 0.82rem; color: var(--text2); margin-top: 2px; }

@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(74,222,128,0.5); }
  70%      { box-shadow: 0 0 0 8px rgba(74,222,128,0); }
}

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
.footer {
  padding: 36px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.footer-inner {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px;
}
.footer-copy { font-size: 0.86rem; color: var(--text2); }
.footer-links { display: flex; gap: 24px; }
.footer-link { font-size: 0.86rem; color: var(--text2); transition: color var(--trans); padding: 4px 0; }
.footer-link:hover { color: var(--accent2); }

/* ═══════════════════════════════════════════
   WHATSAPP FLOAT
═══════════════════════════════════════════ */
.wa-float {
  position: fixed; bottom: 28px; right: 28px; z-index: 999;
  width: 58px; height: 58px; border-radius: 50%;
  background: #25D366;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 20px rgba(37,211,102,0.45);
  transition: transform var(--trans), box-shadow var(--trans);
  animation: bouncein 0.6s 0.6s cubic-bezier(0.34,1.56,0.64,1) both;
}
.wa-float::before {
  content: '';
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, #25D366 0%, #22d3ee 35%, #7c6af7 65%, transparent 80%);
  border-radius: 50%;
  filter: blur(14px);
  z-index: -1;
  opacity: 0.55;
  animation: auroraRotate 5s linear infinite;
  @media (prefers-reduced-motion: reduce) { animation: none; }
}
@keyframes auroraRotate {
  0%   { transform: scale(1) rotate(0deg); opacity: 0.45; }
  50%  { transform: scale(1.16) rotate(180deg); opacity: 0.75; }
  100% { transform: scale(1) rotate(360deg); opacity: 0.45; }
}
.wa-float:hover { transform: scale(1.1) translateY(-3px); box-shadow: 0 8px 32px rgba(37,211,102,0.6); }
@keyframes bouncein { from{opacity:0;transform:scale(0)} to{opacity:1;transform:scale(1)} }

/* ═══════════════════════════════════════════
   REVEAL ANIMATIONS
═══════════════════════════════════════════ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s ease, transform 0.65s ease;
  @media (prefers-reduced-motion: reduce) {
    opacity: 1;
    transform: none;
    transition: none;
  }
}
.reveal.visible { opacity: 1; transform: translateY(0); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════ */
@media(max-width: 1024px) {
  .hero-title { font-size: clamp(2.5rem, 5vw, 4rem); }
  .projects-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-wrapper { grid-template-columns: 1fr; }
  .section { padding: 90px 24px; }
}

@media(max-width: 768px) {
  .noise { display: none; }
  .orb { display: none; }
  .nav-links, .navbar .nav-cta { display: none; }
  .hamburger { display: flex; }
  .mobile-menu { display: flex; }
  .hero-stats { gap: 10px; }
  .stat { padding: 16px 20px; min-width: 96px; }
  .stat-num { font-size: 1.6rem; }
  .about-grid { grid-template-columns: 1fr; }
  .projects-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .contact-form { padding: 26px 22px; }
  .footer-inner { flex-direction: column; text-align: center; }
  .section { padding: 72px 20px; }
}

@media(max-width: 560px) {
  .hero-title { font-size: 2.25rem; }
  .stat { min-width: 88px; padding: 14px 16px; flex: 1; }
  .stat-num { font-size: 1.45rem; }
  .hero-cta { flex-direction: column; width: 100%; gap: 12px; }
  .hero-cta .btn { width: 100%; }
  .wa-float { width: 52px; height: 52px; bottom: 20px; right: 20px; }
  .projects-grid { grid-template-columns: 1fr; gap: 22px; }
}
