/* ============================================================
   GLOBAL.CSS — Night Sky Portfolio | Radhika Vashistha
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;700&family=Syne:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --bg:           #FBF9F1;
  --bg-2:         #1A1A1A;
  --bg-3:         #F2F0E6;
  --text:         #1A1A1A;
  --text-dim:     #4A4A4A;
  --text-muted:   #8A8A8A;
  --accent:       #B1C29E;
  --accent-glow:  rgba(177, 194, 158, 0.4);
  --accent2:      #F0C999;
  --accent2-glow: rgba(240, 201, 153, 0.4);
  --glass-bg:     rgba(255, 255, 255, 0.6);
  --glass-border: rgba(255, 255, 255, 0.9);
  --card-bg:      rgba(255, 255, 255, 0.7);
  --nav-h:        68px;
  --mono:         'JetBrains Mono', 'Fira Code', monospace;
  --sans:         'Inter', sans-serif;
  --display:      'Syne', sans-serif;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --trans:        all 0.3s var(--ease);
  --radius:       10px;
  --glow-sm:      0 0 12px var(--accent-glow);
  --glow-md:      0 0 28px var(--accent-glow);
  --shadow:       0 8px 30px rgba(0,0,0,0.06);
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-weight: 400;
  line-height: 1.65;
  overflow-x: hidden;
  cursor: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: 0.01em;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: none; }
ul { list-style: none; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--display);
  font-weight: 700;
  line-height: 1.15;
}

/* ── Canvas (Stars + Constellation) ────────────────────────── */
#bg-canvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ── Floating Icons Layer ───────────────────────────────────── */
#floating-icons {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.float-icon {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(10,10,20,0.6);
  backdrop-filter: blur(6px);
  font-family: var(--mono);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  transition: box-shadow 0.3s;
  user-select: none;
  pointer-events: none;
}

/* ── Custom Cursor ──────────────────────────────────────────── */
#cursor-dot {
  position: fixed;
  width: 8px; height: 8px;
  background: var(--accent);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 8px var(--accent), 0 0 18px var(--accent-glow);
  transition: transform 0.08s, width 0.2s, height 0.2s;
}

#cursor-ring {
  position: fixed;
  width: 32px; height: 32px;
  border: 1.5px solid rgba(177, 194, 158, 0.45);
  border-radius: 50%;
  pointer-events: none;
  z-index: 9998;
  transform: translate(-50%, -50%);
  transition: width 0.25s var(--ease), height 0.25s var(--ease), opacity 0.25s, border-color 0.25s;
}

body.clicking #cursor-dot  { transform: translate(-50%,-50%) scale(2); }
body.clicking #cursor-ring { width: 48px; height: 48px; opacity: 0.25; }
body.hovering #cursor-ring { width: 44px; height: 44px; border-color: var(--accent); }

/* ── Page Wrapper ───────────────────────────────────────────── */
.page-wrapper {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding-top: var(--nav-h);
  animation: pageFadeIn 0.55s var(--ease) both;
}

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

/* ── Navbar ─────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 36px;
  background: rgba(251, 249, 241, 0.8);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--glass-border);
}

.nav-logo {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: 1px;
  text-transform: uppercase;
  white-space: nowrap;
  text-shadow: 0 0 16px var(--accent-glow);
}

.nav-logo em {
  color: var(--text-dim);
  font-style: normal;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 1px;
  font-weight: 400;
}

.nav-links {
  display: flex;
  gap: 2px;
  align-items: center;
}

.nav-links a {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
  padding: 7px 12px;
  border-radius: 5px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: var(--trans);
  border: 1px solid transparent;
  white-space: nowrap;
  font-weight: 400;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  border-color: rgba(177, 194, 158, 0.28);
  background: rgba(177, 194, 158, 0.05);
  text-shadow: 0 0 10px var(--accent-glow);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  padding: 6px;
}

.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: var(--trans);
}

.nav-toggle.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* ── Section ────────────────────────────────────────────────── */
.section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 40px 100px;
}

.section-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 3px;
  text-transform: uppercase;
  margin-bottom: 12px;
  opacity: 0.8;
}

.section-title {
  font-family: var(--display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.section-title .hl { color: var(--accent); }

.section-divider {
  width: 56px; height: 2px;
  background: linear-gradient(90deg, var(--accent), transparent);
  margin-bottom: 16px;
  border-radius: 2px;
}

.section-sub {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 52px;
  max-width: 500px;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.5px;
  line-height: 1.7;
}

/* ── Scroll Reveal ──────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.visible { opacity: 1; transform: translateY(0); }
.reveal-l { opacity: 0; transform: translateX(-28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-l.visible { opacity: 1; transform: translateX(0); }
.reveal-r { opacity: 0; transform: translateX(28px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal-r.visible { opacity: 1; transform: translateX(0); }

.d1 { transition-delay: 0.1s !important; }
.d2 { transition-delay: 0.2s !important; }
.d3 { transition-delay: 0.3s !important; }
.d4 { transition-delay: 0.4s !important; }
.d5 { transition-delay: 0.5s !important; }
.d6 { transition-delay: 0.6s !important; }

/* ── Glass Card ─────────────────────────────────────────────── */
.glass-card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: var(--trans);
}

.glass-card:hover {
  border-color: rgba(177, 194, 158, 0.22);
  box-shadow: 0 0 28px rgba(177, 194, 158, 0.07), var(--shadow);
  transform: translateY(-5px);
}

/* ── Tags / Pills ───────────────────────────────────────────── */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 0.68rem;
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid rgba(177, 194, 158, 0.28);
  color: var(--accent);
  background: rgba(177, 194, 158, 0.04);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.tag.purple {
  border-color: rgba(240, 201, 153, 0.35);
  color: var(--accent2);
  background: rgba(240, 201, 153, 0.06);
}

/* ── Glow Button ────────────────────────────────────────────── */
.btn {
  font-family: var(--mono);
  font-size: 0.78rem;
  padding: 13px 30px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: transparent;
  border-radius: 6px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: var(--trans);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--accent);
  transform: translateY(100%);
  transition: transform 0.3s var(--ease);
}

.btn:hover { color: var(--bg); box-shadow: var(--glow-md); }
.btn:hover::before { transform: translateY(0); }
.btn > * { position: relative; z-index: 1; }

.btn.purple {
  border-color: var(--accent2);
  color: var(--accent2);
}
.btn.purple::before { background: var(--accent2); }
.btn.purple:hover { box-shadow: 0 0 28px var(--accent2-glow); }

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(177, 194, 158,0.25); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(177, 194, 158,0.5); }

/* ── Selection ──────────────────────────────────────────────── */
::selection { background: rgba(177, 194, 158,0.18); color: var(--text); }

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 960px) {
  .navbar { padding: 0 20px; }

  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0; right: 0;
    flex-direction: column;
    background: rgba(5, 5, 10, 0.97);
    backdrop-filter: blur(24px);
    padding: 16px;
    gap: 3px;
    border-bottom: 1px solid var(--glass-border);
    transform: translateY(-110%);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.35s;
    pointer-events: none;
    max-height: calc(100vh - var(--nav-h));
    overflow-y: auto;
  }

  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: all; }
  .nav-links a { display: block; padding: 10px 16px; font-size: 0.8rem; }
  .nav-toggle { display: flex; }
  .section { padding: 60px 20px 80px; }
}

@media (max-width: 480px) {
  .section { padding: 50px 16px 70px; }
  .section-title { font-size: 1.7rem; }
}
