/* ==========================================================================
   skaza.me — Starlink-themed portfolio
   Palette: deep-space navy, starlight white, SpaceX blue accent
   ========================================================================== */

:root {
  --bg: #05080f;
  --bg-raised: #0b1220;
  --border: #1c2740;
  --text: #e8edf6;
  --text-dim: #93a1b8;
  --accent: #4da3ff;        /* Starlink beam blue */
  --accent-deep: #005288;   /* SpaceX brand blue */
  --glow: rgba(77, 163, 255, 0.35);
  --radius: 14px;
  --nav-h: 64px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); }

body {
  background: var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, sans-serif;
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* --------------------------------------------------------------------------
   Background layers: starfield canvas + film grain
   -------------------------------------------------------------------------- */
#starfield {
  position: fixed;
  inset: 0;
  z-index: -2;
  display: block;
  background:
    radial-gradient(1200px 800px at 80% -10%, rgba(0, 82, 136, 0.25), transparent 60%),
    radial-gradient(900px 600px at 10% 110%, rgba(77, 163, 255, 0.10), transparent 60%),
    var(--bg);
}

.film-grain {
  position: fixed;
  inset: -50%;
  z-index: 50;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
  animation: grain 8s steps(10) infinite;
}

@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3%, 2%); }
  40% { transform: translate(2%, -3%); }
  60% { transform: translate(-2%, -2%); }
  80% { transform: translate(3%, 3%); }
}

/* --------------------------------------------------------------------------
   Cinematic intro overlay
   -------------------------------------------------------------------------- */
.cinematic-intro {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.cinematic-intro.done { opacity: 0; visibility: hidden; }

.intro-content { text-align: center; padding: 0 24px; }

.intro-line {
  opacity: 0;
  animation: introFade 0.8s ease forwards;
}

.intro-line-1 {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  animation-delay: 0.2s;
}

.intro-line-2 {
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.4em 0 0.2em;
  animation-delay: 0.9s;
}

.intro-line-3 {
  color: var(--text-dim);
  font-size: 1rem;
  letter-spacing: 0.15em;
  animation-delay: 1.5s;
}

@keyframes introFade {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */
.main-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--nav-h);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background: rgba(5, 8, 15, 0.72);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  max-width: 980px;
  margin: 0 auto;
  height: 100%;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo { display: flex; align-items: baseline; gap: 10px; }
.logo:hover { text-decoration: none; }

.logo-text {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: 0.04em;
  color: var(--text);
  text-shadow: 0 0 18px var(--glow);
}

.logo-subtitle {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.72rem;
  color: var(--text-dim);
  letter-spacing: 0.12em;
}

.nav-links { display: flex; gap: 26px; }

.nav-links a {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--text-dim);
  transition: color 0.2s ease, text-shadow 0.2s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  text-decoration: none;
  text-shadow: 0 0 14px var(--glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: 0;
  padding: 8px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */
.hero {
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: calc(var(--nav-h) + 40px) 24px 40px;
  position: relative;
}

.hero-inner {
  max-width: 980px;
  display: flex;
  align-items: center;
  gap: 56px;
}

.hero-avatar-wrap {
  position: relative;
  flex-shrink: 0;
  width: 310px;
  height: 310px;
  display: grid;
  place-items: center;
}

.hero-avatar {
  position: relative;
  z-index: 1;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
  box-shadow: 0 0 40px rgba(77, 163, 255, 0.18);
}

/* Constellation halo: satellites laser-linked around the avatar,
   beaming data onto it like a projection */
.constellation-canvas {
  position: absolute;
  inset: -65px;
  pointer-events: none;
}

/* Satellite orbiting the avatar */
.orbit-ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(77, 163, 255, 0.35);
  border-radius: 50%;
  animation: orbit 14s linear infinite;
}

.orbit-sat {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 1.2rem;
  filter: drop-shadow(0 0 6px var(--glow));
  /* counter-rotate so the emoji stays upright */
  animation: orbit-counter 14s linear infinite;
}

@keyframes orbit         { to { transform: rotate(360deg); } }
@keyframes orbit-counter { to { transform: translateX(-50%) rotate(-360deg); } }

.hero h1 {
  font-size: clamp(2.1rem, 5.5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.15;
  margin-bottom: 18px;
}

.wave { display: inline-block; animation: wave 2.4s ease-in-out infinite; transform-origin: 70% 70%; }

@keyframes wave {
  0%, 55%, 100% { transform: rotate(0); }
  60% { transform: rotate(16deg); }
  70% { transform: rotate(-8deg); }
  80% { transform: rotate(14deg); }
  90% { transform: rotate(-4deg); }
}

.hero-bio {
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1.06rem;
  margin-bottom: 20px;
}

.hero-status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 7px 16px;
  margin-bottom: 26px;
  background: rgba(11, 18, 32, 0.6);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #43d97b;
  box-shadow: 0 0 10px rgba(67, 217, 123, 0.8);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 20px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.7);
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.btn svg { width: 17px; height: 17px; fill: currentColor; }

.btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(77, 163, 255, 0.22);
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-deep), #0a70b8);
  border-color: transparent;
}

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section {
  max-width: 980px;
  margin: 0 auto;
  padding: 90px 24px;
}

.section-title {
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 42px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.section-index {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.9rem;
  color: var(--accent);
  letter-spacing: 0.2em;
}

.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border), transparent);
}

/* Experience entries */
.xp {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.55);
  padding: 26px 28px;
  margin-bottom: 22px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.xp:hover {
  transform: translateY(-3px);
  border-color: rgba(77, 163, 255, 0.5);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.4), 0 0 24px rgba(77, 163, 255, 0.08);
}

.xp-head { margin-bottom: 12px; }
.xp-head h3 { font-size: 1.2rem; font-weight: 700; }
.xp-head h3 a { color: var(--text); }
.xp-head h3 a:hover { color: var(--accent); text-decoration: none; }

.xp-badge {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent);
  border: 1px solid rgba(77, 163, 255, 0.4);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.xp-badge a { color: inherit; }

.xp-meta {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.xp-points { list-style: none; }

.xp-points li {
  color: var(--text-dim);
  padding-left: 22px;
  position: relative;
  margin-bottom: 8px;
}

.xp-points li::before {
  content: "▸";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Interest cards */
.interest-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.55);
  padding: 26px 24px;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(77, 163, 255, 0.5);
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.45), 0 0 26px rgba(77, 163, 255, 0.1);
}

.card-icon { font-size: 1.9rem; margin-bottom: 14px; filter: drop-shadow(0 0 10px var(--glow)); }
.card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 8px; }
.card p { color: var(--text-dim); font-size: 0.93rem; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); padding: 34px 24px 44px; }

.footer-inner {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-dim);
  font-size: 0.88rem;
}

/* --------------------------------------------------------------------------
   Scroll-reveal animation (fadeInUp, like the reference site's wow.js)
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }
.delay-4 { transition-delay: 0.4s; }

/* Stagger the interest cards */
.interest-grid .card:nth-child(2) { transition-delay: 0.08s; }
.interest-grid .card:nth-child(3) { transition-delay: 0.16s; }
.interest-grid .card:nth-child(4) { transition-delay: 0.24s; }
.interest-grid .card:nth-child(5) { transition-delay: 0.32s; }
.interest-grid .card:nth-child(6) { transition-delay: 0.40s; }

/* --------------------------------------------------------------------------
   Mobile
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .hero-inner { flex-direction: column; text-align: center; gap: 36px; }
  .hero-bio { margin-left: auto; margin-right: auto; }
  .hero-actions { justify-content: center; }
  .interest-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .logo-subtitle { display: none; }

  .nav-toggle { display: flex; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(5, 8, 15, 0.97);
    border-bottom: 1px solid var(--border);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .nav-links.open { max-height: 240px; }

  .nav-links a { padding: 16px 24px; border-top: 1px solid var(--border); }

  .interest-grid { grid-template-columns: 1fr; }
  .section { padding: 64px 20px; }
  .hero-avatar-wrap { width: 250px; height: 250px; }
  .hero-avatar { width: 200px; height: 200px; }
  .constellation-canvas { inset: -45px; }
  .btn { flex: 1 1 calc(50% - 12px); justify-content: center; }
  .footer-inner { flex-direction: column; text-align: center; }
}

/* --------------------------------------------------------------------------
   Accessibility: honor reduced-motion preferences
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  .film-grain,
  .orbit-ring,
  .orbit-sat,
  .wave,
  .status-dot { animation: none; }

  .reveal { opacity: 1; transform: none; transition: none; }
  .cinematic-intro { display: none; }
}
