/*
  Space / Cosmos Portfolio — Boboxon Abdirimov
  Clean, scalable, production-ready styles.
*/

:root {
  --bg: #020617;          /* deep space */
  --bg-2: #050b1f;        /* slightly lighter */
  --fg: #f8fafc;
  --muted: rgba(226, 232, 240, 0.74);
  --muted-2: rgba(226, 232, 240, 0.6);

  --accent: #a855f7;      /* neon purple */
  --accent-2: #38bdf8;    /* neon blue */
  --accent-3: #22d3ee;    /* cyan */

  --glass: rgba(255, 255, 255, 0.06);
  --glass-2: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 28px 90px rgba(0, 0, 0, 0.62);
  --radius: 22px;

  --nav-h: 74px;
  --scroll-parallax: 0px;
  --mx: 0px;
  --my: 0px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 18px); }

body {
  margin: 0;
  font-family: "Space Grotesk", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

a { color: inherit; }
svg { width: 1em; height: 1em; fill: currentColor; }
::selection { background: rgba(56, 189, 248, 0.24); color: var(--fg); }

.container {
  width: min(1100px, calc(100% - 40px));
  margin-inline: auto;
}

.section {
  position: relative;
  padding: 112px 0;
}

.muted { color: var(--muted); }

/* --------------------------------------------
   Loader
--------------------------------------------- */

.loader {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 16px;
  z-index: 100;
  background:
    radial-gradient(80% 80% at 50% 50%, rgba(56,189,248,0.08), transparent 55%),
    linear-gradient(180deg, rgba(2,6,23,0.98), rgba(2,6,23,0.9));
  backdrop-filter: blur(16px);
  transition: opacity 600ms ease, transform 600ms ease;
}

.loader.is-hidden { opacity: 0; transform: scale(1.02); pointer-events: none; }

.loader__text {
  margin: 0;
  color: var(--muted);
  font-family: "Manrope", system-ui, sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 12px;
}

.loader__orbital {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.14);
  position: relative;
  box-shadow: 0 0 40px rgba(56,189,248,0.12);
  animation: orbit-rotate 1.4s linear infinite;
}

.loader__dot {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(140deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 18px rgba(56,189,248,0.5);
}

.loader__dot:nth-child(1) { transform: translateX(33px); }
.loader__dot:nth-child(2) { transform: translateY(-33px); opacity: 0.85; }
.loader__dot:nth-child(3) { transform: translateX(-33px); opacity: 0.7; }

@keyframes orbit-rotate { to { transform: rotate(360deg); } }

/* --------------------------------------------
   Navbar
--------------------------------------------- */

.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  background: linear-gradient(180deg, rgba(2,6,23,0.92), rgba(2,6,23,0.56));
  border-bottom: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(16px);
}

.nav {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center; /* Center on desktop */
  gap: 16px;
}

.logo {
  display: none; /* Hidden */
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto; /* Push to right for better spacing */
}

.nav__link {
  text-decoration: none;
  color: var(--muted);
  font-weight: 700;
  padding: 10px 12px;
  border-radius: 12px;
  transition: background 180ms ease, transform 180ms ease, color 180ms ease;
}

.nav__link:hover {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  transform: translateY(-1px);
}

.nav__link.is-active {
  color: var(--fg);
  background: linear-gradient(120deg, rgba(168,85,247,0.16), rgba(56,189,248,0.12));
  border: 1px solid rgba(255,255,255,0.12);
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px;
  padding: 11px 12px;
  cursor: pointer;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: rgba(248,250,252,0.92);
  border-radius: 999px;
}
.nav__toggle span + span { margin-top: 6px; }

/* --------------------------------------------
   Typography / UI primitives
--------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  border-radius: 999px;
  border: 2px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: var(--fg);
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 18px; /* Bigger HI! */
}

h1, h2, h3 { margin: 0; }

h2 {
  margin-top: 10px;
  font-size: clamp(32px, 3.5vw, 46px);
  letter-spacing: -0.02em;
}

.section-head { margin-bottom: 24px; }
.body-text { margin: 12px 0 0; max-width: 72ch; color: var(--muted); }

/* --------------------------------------------
   Reveal Animation
--------------------------------------------- */

.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

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

/* --------------------------------------------
   Cards & Components
--------------------------------------------- */

.about-card {
  padding: 32px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
}

.about-card h3 {
  margin: 0 0 16px;
  font-size: 22px;
  background: linear-gradient(120deg, #ffffff, #a0c4ff);
  -webkit-background-clip: text;
  color: transparent;
}

.about-card ul {
  margin: 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.8;
}

.skill-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.skill-cloud span {
  padding: 8px 16px;
  border-radius: 12px;
  background: rgba(56,189,248,0.12);
  border: 1px solid rgba(56,189,248,0.2);
  color: #60a5fa;
  font-size: 14px;
  font-weight: 600;
}

.card {
  padding: 36px 28px;
  border-radius: 20px;
  background: linear-gradient(160deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  transition: transform 0.3s ease, border 0.3s ease;
}

.card:hover {
  transform: translateY(-4px);
  border-color: rgba(56,189,248,0.3);
}

.card-icon {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(140deg, rgba(168,85,247,0.2), rgba(56,189,248,0.15));
  margin-bottom: 20px;
}

.card-icon svg {
  width: 28px;
  height: 28px;
  color: #60a5fa;
}

.card h3 {
  margin: 0 0 12px;
  font-size: 20px;
  color: var(--fg);
}

.card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

/* --------------------------------------------
   Contact Form
--------------------------------------------- */

.contact-form {
  position: relative;
}

.contact-form label {
  display: block;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 600;
  font-size: 14px;
}

.contact-form input,
.contact-form textarea {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(255,255,255,0.04);
  color: var(--fg);
  font-family: inherit;
  font-size: 15px;
  transition: border 0.2s ease, background 0.2s ease;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: rgba(56,189,248,0.4);
  background: rgba(255,255,255,0.06);
}

.contact-form textarea {
  resize: vertical;
  min-height: 120px;
}

.form-status {
  margin-top: 16px;
  text-align: center;
  font-size: 14px;
}

.form-status.loading { color: #60a5fa; }
.form-status.error { color: #f87171; }

.form-success {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  background: rgba(2,6,23,0.92);
  backdrop-filter: blur(10px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.form-success.is-visible {
  opacity: 1;
  pointer-events: all;
}

.form-success__card {
  padding: 48px 40px;
  border-radius: 24px;
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.04));
  border: 1px solid rgba(255,255,255,0.14);
  text-align: center;
  max-width: 400px;
}

.check {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(34,211,238,0.3), rgba(56,189,248,0.2));
  display: grid;
  place-items: center;
}

.check::after {
  content: "✓";
  font-size: 36px;
  color: #22d3ee;
}

.form-success__title {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 700;
}

.form-success__sub {
  margin: 0 0 24px;
  color: var(--muted);
}

.contact-side {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.info-block h3 {
  margin: 0 0 12px;
  font-size: 18px;
}

.info-block p {
  margin: 8px 0;
  font-size: 14px;
}

.contact-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 16px;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: 14px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  text-decoration: none;
  transition: all 0.2s ease;
}

.contact-btn:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(56,189,248,0.3);
  transform: translateX(4px);
}

.contact-btn__icon {
  width: 20px;
  height: 20px;
  color: #60a5fa;
}

.contact-btn__label {
  font-weight: 600;
}

.link {
  color: #60a5fa;
  text-decoration: none;
  transition: color 0.2s ease;
}

.link:hover {
  color: #38bdf8;
  text-decoration: underline;
}

/* --------------------------------------------
   Footer
--------------------------------------------- */

.footer {
  padding: 40px 0;
  border-top: 1px solid rgba(255,255,255,0.1);
  margin-top: 80px;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

/* --------------------------------------------
   Buttons
--------------------------------------------- */

.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: 16px;
  font-weight: 800;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  transition: transform 180ms ease, box-shadow 280ms ease, background 240ms ease, border 240ms ease, filter 240ms ease;
}

.btn.small { padding: 10px 12px; border-radius: 14px; font-weight: 800; }
.btn.full { width: 100%; }

.btn.primary {
  color: #070815;
  background: linear-gradient(140deg, rgba(168,85,247,1), rgba(56,189,248,1));
  box-shadow:
    0 22px 58px rgba(56,189,248,0.22),
    0 24px 80px rgba(168,85,247,0.14),
    inset 0 1px 0 rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.14);
  overflow: hidden;
}

.btn.primary .btn__spark {
  position: absolute;
  inset: -30%;
  background: radial-gradient(50% 50% at 30% 30%, rgba(255,255,255,0.35), transparent 55%);
  transform: translateX(-20%);
  opacity: 0;
  transition: opacity 240ms ease;
}

.btn.primary:hover .btn__spark { opacity: 1; }

.btn.ghost {
  color: var(--fg);
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
}

.btn.subtle {
  color: var(--fg);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.12);
}

.btn:hover { transform: translateY(-2px); filter: saturate(1.08); }
.btn:active { transform: translateY(0px); }
.btn:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

/* --------------------------------------------
   Hero
--------------------------------------------- */

.hero {
  padding-top: calc(112px + var(--nav-h));
  padding-bottom: 120px;
}

.hero__grid {
  display: grid;
  grid-template-columns: 1fr 1fr; /* Two columns - content left, GIF right */
  gap: clamp(32px, 5vw, 64px);
  align-items: center;
}

.hero__content {
  position: relative;
}

.hero__content::before {
  content: "";
  position: absolute;
  inset: -16% -12% -14% -12%;
  z-index: -1;
  background:
    radial-gradient(circle at 20% 30%, rgba(2,6,23,0.72), transparent 62%),
    linear-gradient(120deg, rgba(2,6,23,0.78), rgba(2,6,23,0.25));
  filter: blur(10px);
}

.hero__title {
  margin-top: 14px;
  font-size: clamp(46px, 6.4vw, 84px);
  line-height: 1.04;
  letter-spacing: -0.03em;
  background: linear-gradient(120deg, #ffffff 0%, #c7e1ff 38%, #8ad6ff 70%, #a855f7 100%);
  -webkit-background-clip: text;
  color: transparent;
  text-shadow: 0 0 30px rgba(56,189,248,0.14);
}

.hero__name {
  background: linear-gradient(120deg, #dbeafe 0%, #60a5fa 35%, #38bdf8 70%, #a855f7 100%);
  -webkit-background-clip: text;
  color: transparent;
}

.hero__roles {
  margin: 18px 0 14px;
  font-family: "Manrope", system-ui, sans-serif;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.hero__rolesLabel { color: rgba(248,250,252,0.86); }

.hero__rolesTyped {
  color: transparent;
  background: linear-gradient(120deg, rgba(56,189,248,1), rgba(168,85,247,1));
  -webkit-background-clip: text;
  text-shadow: 0 0 26px rgba(56,189,248,0.18);
  font-weight: 900;
}

.hero__cursor {
  margin-left: 4px;
  color: rgba(248,250,252,0.8);
  animation: blink 0.95s steps(2) infinite;
}

@keyframes blink { 50% { opacity: 0; } }

.hero__subtitle {
  margin: 0 0 22px;
  max-width: 60ch;
  color: var(--muted);
  font-size: 16.5px;
}

.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero__socials { display: flex; gap: 12px; margin-top: 22px; }

.icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,0.14);
  background: linear-gradient(160deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  transition: transform 180ms ease, box-shadow 240ms ease, border 240ms ease, color 240ms ease;
}

.icon svg { width: 22px; height: 22px; }
.icon:hover {
  transform: translateY(-3px);
  border-color: rgba(56,189,248,0.35);
  box-shadow: 0 14px 42px rgba(0,0,0,0.46);
  color: rgba(56,189,248,1);
}

/* --------------------------------------------
   Hero Visual (GIF)
--------------------------------------------- */

.hero__visual {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent; /* Ensure no background */
}

.hero__gif {
  width: 100%;
  max-width: 500px;
  height: auto;
  display: block; /* Remove any inline spacing */
  object-fit: contain;
  filter: brightness(1.08) contrast(1.12);
  animation: float 6s ease-in-out infinite;
  background: transparent; /* Ensure GIF itself has no background */
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

/* --------------------------------------------
   Desktop Grid Layouts
--------------------------------------------- */

.about-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 40px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  margin-top: 40px;
}

.contact-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 48px;
  margin-top: 48px;
}

.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 56px 48px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(168,85,247,0.1), rgba(56,189,248,0.08));
  border: 1px solid rgba(255,255,255,0.1);
}

/* --------------------------------------------
   Mobile Responsive
--------------------------------------------- */

@media (max-width: 768px) {
  .container {
    width: calc(100% - 32px);
  }

  .section {
    padding: 72px 0;
  }

  /* Navbar */
  .navbar {
    padding: 16px 0;
  }

  .nav {
    justify-content: flex-end; /* Keep toggle on right */
  }

  .nav__links {
    margin-left: 0; /* Reset desktop margin */
  }

  .nav__toggle {
    display: flex;
    flex-direction: column;
    z-index: 60;
  }

  .nav__links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: rgba(2, 6, 23, 0.98);
    backdrop-filter: blur(20px);
    flex-direction: column;
    gap: 8px;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.3s ease, opacity 0.3s ease;
    z-index: 55;
  }

  .nav__links.is-open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .nav__link {
    width: 100%;
    text-align: center;
    padding: 14px;
  }

  /* Hero */
  .hero {
    padding: 60px 0 80px;
  }

  .hero__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .hero__visual {
    order: -1; /* Show GIF first on mobile */
  }

  .hero__gif {
    max-width: 350px;
  }

  .hero__title {
    font-size: clamp(36px, 10vw, 54px);
    margin-top: 18px;
  }

  .eyebrow {
    font-size: 16px;
    padding: 12px 18px;
  }

  .hero__subtitle {
    font-size: 15px;
  }

  .hero__actions {
    flex-direction: column;
  }

  .hero__actions .btn {
    width: 100%;
    justify-content: center;
  }

  /* About */
  .about-grid {
    grid-template-columns: 1fr;
  }

  /* Services */
  .card-grid {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .contact-grid {
    grid-template-columns: 1fr;
  }

  /* CTA */
  .cta {
    flex-direction: column;
    text-align: center;
    gap: 24px;
  }
}

@media (max-width: 480px) {
  .hero__title {
    font-size: 32px;
  }

  .eyebrow {
    font-size: 14px;
    padding: 10px 16px;
  }

  .btn {
    font-size: 14px;
    padding: 12px 20px;
  }

  .section {
    padding: 60px 0;
  }
}

