/* =========================================================
   AlkindiX — Unified Design System
   All pages share this stylesheet
========================================================= */

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

html { font-size: 16px; scroll-behavior: smooth; }

:root {
  --bg: #0b0b0b;
  --bg-elevated: #111111;
  --text: #e7e7e7;
  --muted: #9a9a9a;
  --accent: #ffffff;
  --line: rgba(255,255,255,0.1);
  --line-subtle: rgba(255,255,255,0.05);
  --card: #111;
  --radius: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --font: "Inter", sans-serif;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.65;
  padding-top: 90px;
  padding-bottom: 56px;
  opacity: 0;
  transition: opacity 0.5s ease;
  overflow-x: hidden;
}

body.loaded { opacity: 1; }

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
  z-index: 0;
}

.container {
  width: min(1100px, 92%);
  margin-inline: auto;
  position: relative;
  z-index: 1;
}

/* =========================================================
   TYPOGRAPHY
========================================================= */
h1, h2, h3 { font-weight: 600; letter-spacing: -0.02em; color: var(--accent); }
h1 { font-size: clamp(2.4rem, 6vw, 3.6rem); margin-bottom: 1rem; }
h2 { font-size: clamp(1.8rem, 4vw, 2.4rem); margin-bottom: 1rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }
p { font-size: 1rem; opacity: 0.85; max-width: 720px; margin-bottom: 1.3rem; }
p:last-child { margin-bottom: 0; }
.muted { color: var(--muted); font-size: 0.92rem; }
.section-title { margin-bottom: 3rem; text-align: center; }
.eyebrow {
  font-family: "Space Mono", monospace;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: rgba(255,255,255,0.5);
  margin-bottom: 0.75rem;
  display: block;
}

/* =========================================================
   LINKS & BUTTONS
========================================================= */
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s ease; }
a:hover { opacity: 0.75; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  border-radius: 999px;
  font-size: 0.88rem;
  font-weight: 500;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.3s var(--ease);
  font-family: var(--font);
  text-decoration: none;
}

.btn:hover {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.2);
  opacity: 1;
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}

.btn--primary:hover {
  background: #e0e0e0;
  border-color: #e0e0e0;
}

/* =========================================================
   NAVIGATION
========================================================= */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 9999;
  background: rgba(11,11,11,0.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background 0.3s ease;
}

.nav.scrolled { background: rgba(11,11,11,0.97); }

.nav__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 68px;
}

.brand {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: -0.01em;
  opacity: 1;
}

.brand:hover { opacity: 1; }

.nav__links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav__links a {
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0.65;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  position: relative;
}

.nav__links a:hover,
.nav__links a.active {
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

.nav__links a.active {
  color: var(--accent);
}

.nav__links a.nav-external {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 0.82rem;
}

.nav__links a.nav-external:hover {
  border-color: rgba(255,255,255,0.25);
}

.nav__links a.nav-social-btn {
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: 999px;
  padding: 0.38rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 500;
  opacity: 1;
  display: inline-flex;
  align-items: center;
}

.nav__links a.nav-social-btn:hover {
  background: #e0e0e0;
  opacity: 1;
}

/* Nav Dropdown */
.nav__dropdown {
  position: relative;
}

.nav__dropdown-btn {
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0.65;
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.nav__dropdown-btn:hover,
.nav__dropdown.active .nav__dropdown-btn {
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

.nav__dropdown.active .nav__dropdown-btn {
  color: var(--accent);
}

.nav__dropdown-arrow {
  transition: transform 0.2s ease;
}

.nav__dropdown.active .nav__dropdown-arrow {
  transform: rotate(180deg);
}

.nav__dropdown-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  background: rgba(11,11,11,0.97);
  backdrop-filter: blur(16px);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.4rem;
  min-width: 140px;
  flex-direction: column;
  gap: 0;
  z-index: 10000;
}

.nav__dropdown.active .nav__dropdown-menu {
  display: flex;
}

.nav__dropdown-menu a {
  color: var(--text);
  font-size: 0.88rem;
  opacity: 0.65;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.nav__dropdown-menu a:hover,
.nav__dropdown-menu a.active {
  opacity: 1;
  background: rgba(255,255,255,0.06);
}

.nav__dropdown-menu a.active {
  color: var(--accent);
}

.nav__toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0.4rem;
}

.nav__toggle span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text);
  margin: 5px 0;
  transition: all 0.3s ease;
  border-radius: 2px;
}

.nav__toggle.active span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav__toggle.active span:nth-child(2) { opacity: 0; }
.nav__toggle.active span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* =========================================================
   SECTIONS
========================================================= */
.section { padding: 6rem 0; }
.section--sm { padding: 4rem 0; }

/* =========================================================
   CARD
========================================================= */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  border-color: rgba(255,255,255,0.18);
  box-shadow: 0 8px 40px rgba(0,0,0,0.35);
}

/* =========================================================
   SCROLL REVEAL
========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}

[data-reveal].visible {
  opacity: 1;
  transform: translateY(0);
}

/* =========================================================
   FOOTER
========================================================= */
.footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}

.footer__links {
  display: flex;
  gap: 1.5rem;
}

.footer__links a {
  font-size: 0.85rem;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}

.footer__links a:hover { opacity: 1; }

.to-top {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  font-size: 0.85rem;
  opacity: 0.55;
  transition: all 0.2s ease;
}

.to-top:hover { opacity: 1; transform: translateY(-2px); }

/* =========================================================
   SCROLL PROGRESS
========================================================= */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 1px;
  background: rgba(255,255,255,0.4);
  z-index: 10001;
  transition: width 0.1s ease;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media (max-width: 768px) {
  body { padding-top: 70px; }

  .nav__inner { height: 60px; }

  .nav__links {
    position: absolute;
    top: 60px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 1rem;
    background: rgba(11,11,11,0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    display: none;
  }

  .nav__links.active { display: flex; }
  .nav__links a { width: 100%; padding: 0.65rem 0.75rem; }
  .nav__toggle { display: block; }

  .nav__dropdown { width: 100%; }
  .nav__dropdown-btn { width: 100%; padding: 0.65rem 0.75rem; justify-content: space-between; }
  .nav__dropdown-menu {
    position: static;
    border: none;
    border-radius: 0;
    padding: 0 0 0 1rem;
    background: transparent;
    backdrop-filter: none;
    min-width: unset;
  }
  .nav__dropdown.active .nav__dropdown-menu { display: flex; }
  .nav__dropdown-menu a { width: 100%; }

  .section { padding: 4rem 0; }
  .card { padding: 1.75rem; }

  .footer__inner { flex-direction: column; text-align: center; }
  .footer__links { justify-content: center; }
}

@media (max-width: 480px) {
  .container { width: 90%; }
  h1 { font-size: 2rem; }
}

/* =========================================================
   SOCIAL BAR
========================================================= */
.social-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9998;
  background: rgba(11, 11, 11, 0.92);
  backdrop-filter: blur(14px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.75rem;
  padding: 0.65rem 0;
}

.social-bar__link {
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.5);
  opacity: 1;
  transition: color 0.2s ease, transform 0.2s ease;
}

.social-bar__link:hover {
  color: rgba(255, 255, 255, 0.95);
  transform: translateY(-2px);
  opacity: 1;
}

/* =========================================================
   TYPEWRITER CURSOR
========================================================= */
.typing-cursor {
  animation: cursor-blink 0.8s step-end infinite;
}

@keyframes cursor-blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}