/* ============================================================
   K Computing — style.css
   Dark navy glassmorphism theme, responsive, accessible
   ============================================================ */

/* --- Custom Properties --- */
:root {
  --bg-deep:    #000000;
  --bg-mid:     #080808;
  --bg-surface: #111111;
  --glass:      rgba(15, 15, 15, 0.7);
  --glass-border: rgba(212, 175, 55, 0.15);
  --glass-hover: rgba(212, 175, 55, 0.08);

  --cyan:       #d4af37;
  --cyan-dim:   #a08520;
  --magenta:    #ffcc44;
  --purple:     #c9a227;
  --gold:       #d4af37;

  --text:       #d0c8b8;
  --text-dim:   #887a60;
  --text-bright:#ffffff;

  --font-body:  'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display:'Orbitron', var(--font-body);

  --nav-h:      60px;
  --section-pad: clamp(5rem, 12vw, 10rem);
  --max-w:      1200px;

  --ease-out:   cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font-body);
  background: var(--bg-deep);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--cyan); text-decoration: none; transition: color 0.3s; }
a:hover { color: var(--text-bright); }
a:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 4px;
}

img { max-width: 100%; display: block; }

/* --- Scrollbar --- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-deep); }
::-webkit-scrollbar-thumb { background: var(--cyan-dim); border-radius: 3px; }

/* --- Glass utility --- */
.glass {
  background: var(--glass);
  backdrop-filter: blur(20px) saturate(1.4);
  -webkit-backdrop-filter: blur(20px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  transition: border-color 0.4s, box-shadow 0.4s, transform 0.4s var(--ease-spring);
}
.glass:hover {
  border-color: rgba(0, 212, 255, 0.25);
  box-shadow: 0 8px 40px rgba(0, 212, 255, 0.06);
}

/* ============================================================
   HERO
   ============================================================ */
#hero {
  --hero-bg-opacity: 1;
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-deep);
}

/* Hero background as separate layer so we can fade it with scroll */
#hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../img/atom-bg.jpg') center center / cover no-repeat;
  opacity: var(--hero-bg-opacity, 1);
  z-index: 0;
  pointer-events: none;
}

/* Gradient fade at bottom of hero — blends blue bg into black content */
#hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 35vh;
  background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 30%, rgba(0,0,0,0.85) 70%, #000000 100%);
  z-index: 2;
  pointer-events: none;
}

#atom-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

/* Intro K — big red K that appears during explosion, fades out */
.intro-k {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -55%);
  z-index: 3;
  font-family: var(--font-display);
  font-size: clamp(6rem, 15vw, 12rem);
  font-weight: 900;
  line-height: 0.75;
  padding-left: 0.05em;
  color: var(--gold);
  text-shadow: 0 0 20px var(--gold), 0 0 40px var(--gold), 0 0 80px rgba(212, 175, 55, 0.6), 0 0 120px rgba(212, 175, 55, 0.4), 0 0 200px rgba(212, 175, 55, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 1.2s ease-out;
}
.intro-k.visible {
  opacity: 1;
  transition: opacity 0.3s ease-out;
}
.intro-k.fade-out {
  opacity: 0;
  transition: opacity 1.5s ease-out;
}

.hero-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  opacity: 0;
  pointer-events: none;
}
.hero-content.visible {
  opacity: 1;
  transition: opacity 1.5s ease-out;
  pointer-events: auto;
}

/* --- Hero type --- */
.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text-bright);
}
.hero-k {
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-right: 0.08em;
}
.hero-computing { letter-spacing: 0.08em; }

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(0.75rem, 2vw, 1.1rem);
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-top: 0.25rem;
}

.hero-sub {
  font-size: clamp(0.85rem, 1.8vw, 1.05rem);
  color: var(--text-dim);
  letter-spacing: 0.12em;
  margin-top: 0.5rem;
}

/* --- CTA Button --- */
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.75rem 2rem;
  pointer-events: auto;
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  color: var(--cyan);
  font-family: var(--font-display);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: all 0.4s var(--ease-spring);
}
.cta-btn:hover {
  background: rgba(0, 212, 255, 0.1);
  border-color: var(--cyan);
  color: var(--text-bright);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 212, 255, 0.15);
}
.cta-btn svg { transition: transform 0.3s; }
.cta-btn:hover svg { transform: translateY(3px); }

/* ============================================================
   SECTIONS — General
   ============================================================ */
.section {
  position: relative;
  padding: var(--section-pad) 1.5rem;
}
.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  font-weight: 700;
  color: var(--text-bright);
  margin-bottom: 3rem;
  letter-spacing: 0.04em;
}
.title-accent {
  color: var(--cyan);
  margin-right: 0.3em;
  font-weight: 400;
}

/* Reveal animation */
.section-inner > *, .about-text, .about-stats .stat-card,
.service-card, .tech-category, .contact-card {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.revealed > *, .revealed .about-text, .revealed .about-stats .stat-card,
.revealed .service-card, .revealed .tech-category, .revealed .contact-card {
  opacity: 1;
  transform: translateY(0);
}
/* Stagger children */
.revealed .service-card:nth-child(2),
.revealed .tech-category:nth-child(2),
.revealed .stat-card:nth-child(2),
.revealed .contact-card:nth-child(2) { transition-delay: 0.08s; }
.revealed .service-card:nth-child(3),
.revealed .tech-category:nth-child(3),
.revealed .stat-card:nth-child(3),
.revealed .contact-card:nth-child(3) { transition-delay: 0.16s; }
.revealed .service-card:nth-child(4),
.revealed .tech-category:nth-child(4),
.revealed .stat-card:nth-child(4) { transition-delay: 0.24s; }
.revealed .service-card:nth-child(5),
.revealed .tech-category:nth-child(5) { transition-delay: 0.32s; }
.revealed .service-card:nth-child(6),
.revealed .tech-category:nth-child(6) { transition-delay: 0.40s; }
.revealed .service-card:nth-child(7),
.revealed .tech-category:nth-child(7) { transition-delay: 0.48s; }
.revealed .service-card:nth-child(8) { transition-delay: 0.56s; }
.revealed .service-card:nth-child(9) { transition-delay: 0.64s; }
.revealed .service-card:nth-child(10) { transition-delay: 0.72s; }

/* --- AI Service Cards — removed green, keeping gold theme --- */

/* --- Service Card Hover Effects — shimmer sweep + glow --- */
.service-card {
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-spring), border-color 0.4s, box-shadow 0.4s;
}
.service-card::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.08),
    rgba(212, 175, 55, 0.15),
    rgba(212, 175, 55, 0.08),
    transparent
  );
  transform: skewX(-20deg);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}
.service-card:hover::before {
  opacity: 1;
  animation: shimmerSweep 0.8s ease-out forwards;
}
@keyframes shimmerSweep {
  0%   { left: -75%; }
  100% { left: 125%; }
}
.service-card:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1), 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(212, 175, 55, 0.03);
  transform: translateY(-6px) perspective(600px) rotateX(2deg);
}
.service-card:hover .service-icon {
  filter: drop-shadow(0 0 6px rgba(212, 175, 55, 0.5));
  transition: filter 0.4s;
}
.service-card:hover h3 {
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.3);
  transition: text-shadow 0.4s;
}

/* ============================================================
   ABOUT
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}
.about-text {
  padding: 2rem;
}
.about-text .lead {
  font-size: 1.15rem;
  color: var(--text-bright);
  font-weight: 500;
  margin-bottom: 1rem;
  line-height: 1.5;
}
.about-text p { margin-bottom: 1rem; color: var(--text); }
.about-text p:last-child { margin-bottom: 0; }

.about-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.stat-card {
  padding: 1.5rem;
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan), var(--purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  display: inline;
}
.stat-suffix {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  color: var(--cyan);
  display: inline;
}
.stat-text {
  font-size: 2rem;
}
.stat-label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-top: 0.5rem;
}

/* ============================================================
   SERVICES
   ============================================================ */
.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.service-card {
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: default;
}
.service-card:hover {
  transform: translateY(-4px);
}
.service-icon-wrap {
  width: 56px;
  height: 56px;
  margin: 0 auto 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(0,212,255,0.1), rgba(168,85,247,0.1));
  border: 1px solid rgba(0, 212, 255, 0.15);
}
.service-icon {
  width: 28px;
  height: 28px;
  stroke: var(--cyan);
}
.service-card h3 {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 0.75rem;
  letter-spacing: 0.03em;
}
.service-card p {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-dim);
}

/* ============================================================
   TECH STACK
   ============================================================ */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}
.tech-category {
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 0.5s var(--ease-spring), border-color 0.4s, box-shadow 0.4s;
}
.tech-category::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -75%;
  width: 50%;
  height: 200%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(212, 175, 55, 0.08),
    rgba(212, 175, 55, 0.15),
    rgba(212, 175, 55, 0.08),
    transparent
  );
  transform: skewX(-20deg);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  z-index: 1;
}
.tech-category:hover::before {
  opacity: 1;
  animation: shimmerSweep 0.8s ease-out forwards;
}
.tech-category:hover {
  border-color: rgba(212, 175, 55, 0.35);
  box-shadow: 0 0 20px rgba(212, 175, 55, 0.1), 0 12px 40px rgba(0, 0, 0, 0.3), inset 0 0 30px rgba(212, 175, 55, 0.03);
  transform: translateY(-6px) perspective(600px) rotateX(2deg);
}
.tech-category:hover h3 {
  text-shadow: 0 0 12px rgba(212, 175, 55, 0.4);
  transition: text-shadow 0.4s;
}
.tech-category h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.tag {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text);
  background: rgba(0, 212, 255, 0.06);
  border: 1px solid rgba(0, 212, 255, 0.12);
  border-radius: 20px;
  transition: all 0.3s;
  white-space: nowrap;
}
.tag:hover {
  background: rgba(0, 212, 255, 0.12);
  border-color: var(--cyan);
  color: var(--text-bright);
  transform: translateY(-1px);
}

/* ============================================================
   CONTACT
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  max-width: 900px;
  margin: 0 auto;
}
.contact-card {
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  cursor: default;
}
a.contact-card { cursor: pointer; }
a.contact-card:hover { color: var(--text); }
.contact-card:hover { transform: translateY(-3px); }
.contact-icon {
  width: 36px;
  height: 36px;
  stroke: var(--cyan);
}
.contact-card h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-bright);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.contact-card span {
  font-size: 0.95rem;
  color: var(--text);
}
.contact-sub {
  font-size: 0.82rem !important;
  color: var(--text-dim) !important;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.glass-nav {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  display: flex;
  gap: 0.25rem;
  padding: 0.5rem 0.75rem;
  background: rgba(6, 11, 24, 0.8);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  border: 1px solid var(--glass-border);
  border-radius: 50px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
}
.nav-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 1rem;
  border-radius: 30px;
  color: var(--text-dim);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transition: all 0.3s var(--ease-out);
}
.nav-link svg {
  width: 20px;
  height: 20px;
  stroke-width: 1.5;
  transition: stroke 0.3s;
}
.nav-link:hover {
  color: var(--text-bright);
  background: var(--glass-hover);
}
.nav-link:hover svg { stroke: var(--cyan); }
.nav-link.active {
  color: var(--cyan);
  background: rgba(0, 212, 255, 0.08);
}
.nav-link.active svg { stroke: var(--cyan); }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  padding: 2rem 1.5rem calc(var(--nav-h) + 4rem);
  text-align: center;
  border-top: 1px solid rgba(0, 212, 255, 0.06);
}
.footer-inner {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.5rem;
  font-size: 0.82rem;
  color: var(--text-dim);
}
.footer-link {
  color: var(--text-dim);
  transition: color 0.3s;
}
.footer-link:hover { color: var(--cyan); }

/* ============================================================
   INTRO OVERLAY — Just a black screen, click to begin
   ============================================================ */
.intro-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.intro-overlay.fade-out {
  opacity: 0;
  transition: opacity 0.8s ease-out;
  pointer-events: none;
}
.intro-prompt {
  font-family: var(--font-display);
  font-size: clamp(0.8rem, 2vw, 1.1rem);
  color: var(--gold);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  animation: promptPulse 2s ease-in-out infinite;
}
@keyframes promptPulse {
  0%, 100% { opacity: 0.4; }
  50%      { opacity: 1; }
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(40px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   AUDIO TOGGLE — Thumping speaker with radiating sound waves
   ============================================================ */
.audio-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 1000;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
}
.audio-toggle.visible {
  opacity: 1;
  pointer-events: auto;
}

.speaker-pulse {
  position: relative;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* The glowing gold core — thumps when playing */
.speaker-core {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 6px var(--gold), 0 0 12px rgba(212, 175, 55, 0.4);
  z-index: 2;
  transition: transform 0.3s, box-shadow 0.3s;
}

/* Playing state — core thumps */
.audio-toggle.playing .speaker-core {
  animation: speakerThump 0.6s ease-in-out infinite;
}

@keyframes speakerThump {
  0%, 100% { transform: scale(1); box-shadow: 0 0 6px var(--gold), 0 0 12px rgba(212, 175, 55, 0.4); }
  50%      { transform: scale(1.35); box-shadow: 0 0 10px var(--gold), 0 0 20px rgba(212, 175, 55, 0.6); }
}

/* Radiating sound wave rings */
.sound-wave {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--gold);
  transform: translate(-50%, -50%) scale(1);
  opacity: 0;
  pointer-events: none;
}

/* Waves only animate when playing */
.audio-toggle.playing .sound-wave {
  animation: waveRadiate 2s ease-out infinite;
}
.audio-toggle.playing .wave-1 { animation-delay: 0s; }
.audio-toggle.playing .wave-2 { animation-delay: 0.65s; }
.audio-toggle.playing .wave-3 { animation-delay: 1.3s; }

@keyframes waveRadiate {
  0%   { transform: translate(-50%, -50%) scale(1); opacity: 0.7; }
  100% { transform: translate(-50%, -50%) scale(4.5); opacity: 0; }
}

/* Muted state — dim, no animations */
.audio-toggle:not(.playing) .speaker-core {
  background: var(--text-dim);
  box-shadow: 0 0 3px var(--text-dim);
}
.audio-toggle:not(.playing) .sound-wave {
  animation: none;
  opacity: 0;
}

/* Hover glow */
.audio-toggle:hover .speaker-core {
  box-shadow: 0 0 14px var(--gold), 0 0 28px rgba(212, 175, 55, 0.5);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .services-grid,
  .tech-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .about-grid {
    grid-template-columns: 1fr;
  }
  .services-grid,
  .tech-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .about-stats {
    grid-template-columns: 1fr 1fr;
  }
  .glass-nav {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    justify-content: space-around;
    padding: 0.4rem 0;
  }
  .nav-link {
    padding: 0.5rem 0.6rem;
    font-size: 0.6rem;
  }
  .nav-link svg { width: 18px; height: 18px; }
  .site-footer { padding-bottom: calc(70px + 3rem); }
}
@media (max-width: 480px) {
  .about-stats { grid-template-columns: 1fr 1fr; gap: 0.75rem; }
  .stat-number { font-size: 1.8rem; }
  .hero-title { font-size: 2rem; }
}

/* --- Reduced motion --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .logo-mark { animation: none; }
  .section-inner > *, .about-text, .about-stats .stat-card,
  .service-card, .tech-category, .contact-card {
    opacity: 1;
    transform: none;
  }
}
