/* Aurora theme for gabemehra.com: black base, green + purple northern-lights glow. */
:root {
  --bg: #04050a;
  --bg-2: #080a12;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-hover: rgba(255, 255, 255, 0.06);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --text: #e9ebf2;
  --muted: #9ba2b8;
  --faint: #6b7189;
  --green: #3dffa3;
  --teal: #2ee6c8;
  --purple: #a66cff;
  --violet: #7b5cff;
  --magenta: #d77bff;
  --aurora: linear-gradient(100deg, var(--green) 0%, var(--teal) 35%, var(--violet) 70%, var(--magenta) 100%);
  --radius: 18px;
  --nav-h: 64px;
  --max: 1080px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  overflow-x: hidden;
}

::selection { background: rgba(166, 108, 255, 0.45); color: #fff; }

a { color: var(--green); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--magenta); }

img { max-width: 100%; display: block; }

/* ---------- Aurora sky (fixed background) ---------- */
.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(1px 1px at 12% 18%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 27% 62%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 41% 9%, rgba(255,255,255,0.5), transparent 60%),
    radial-gradient(1px 1px at 58% 44%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1px 1px at 69% 22%, rgba(255,255,255,0.55), transparent 60%),
    radial-gradient(1px 1px at 83% 71%, rgba(255,255,255,0.35), transparent 60%),
    radial-gradient(1px 1px at 91% 12%, rgba(255,255,255,0.45), transparent 60%),
    radial-gradient(1px 1px at 7% 84%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(1px 1px at 49% 91%, rgba(255,255,255,0.3), transparent 60%),
    radial-gradient(ellipse at 50% 120%, var(--bg-2), var(--bg) 70%);
}

.sky .band {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.55;
  mix-blend-mode: screen;
  will-change: transform;
}

.sky .b1 {
  width: 70vw; height: 32vh;
  left: -10vw; top: -6vh;
  background: radial-gradient(closest-side, rgba(61,255,163,0.85), rgba(46,230,200,0.25) 60%, transparent);
  animation: drift1 26s ease-in-out infinite alternate;
}
.sky .b2 {
  width: 65vw; height: 36vh;
  right: -15vw; top: 4vh;
  background: radial-gradient(closest-side, rgba(166,108,255,0.85), rgba(123,92,255,0.3) 60%, transparent);
  animation: drift2 32s ease-in-out infinite alternate;
}
.sky .b3 {
  width: 50vw; height: 26vh;
  left: 25vw; top: 14vh;
  background: radial-gradient(closest-side, rgba(46,230,200,0.55), rgba(215,123,255,0.2) 65%, transparent);
  animation: drift3 38s ease-in-out infinite alternate;
  opacity: 0.4;
}

@keyframes drift1 {
  0%   { transform: translate(0, 0) rotate(-8deg) scale(1); }
  100% { transform: translate(14vw, 6vh) rotate(6deg) scale(1.15); }
}
@keyframes drift2 {
  0%   { transform: translate(0, 0) rotate(10deg) scale(1.1); }
  100% { transform: translate(-16vw, 4vh) rotate(-6deg) scale(0.95); }
}
@keyframes drift3 {
  0%   { transform: translate(-6vw, 0) skewX(-12deg); }
  100% { transform: translate(8vw, -4vh) skewX(12deg); }
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  height: var(--nav-h);
  background: rgba(4, 5, 10, 0.6);
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--border);
}
.nav-inner {
  max-width: var(--max);
  height: 100%;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.brand {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}
.brand span {
  background: var(--aurora);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-links::-webkit-scrollbar { display: none; }
.nav-links a {
  display: block;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  white-space: nowrap;
  transition: color 0.2s, background 0.2s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-hover);
}

/* ---------- Layout ---------- */
main { max-width: var(--max); margin: 0 auto; padding: 0 24px; }

section {
  padding: 96px 0 24px;
  scroll-margin-top: calc(var(--nav-h) - 24px);
}

.section-head {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 40px;
}
.section-head .num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.9rem;
  color: var(--green);
  letter-spacing: 0.08em;
}
.section-head h2 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.section-head .rule {
  flex: 1;
  height: 1px;
  align-self: center;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* ---------- Hero ---------- */
.hero {
  min-height: calc(100vh - var(--nav-h));
  min-height: calc(100svh - var(--nav-h));
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  align-items: center;
  gap: 56px;
  padding: 48px 0 64px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
}
.eyebrow .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 12px var(--green);
}
.hero h1 {
  margin: 0 0 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(3.2rem, 9vw, 6.5rem);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.045em;
}
.hero h1 .glow {
  background: var(--aurora);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: shimmer 10s ease-in-out infinite alternate;
}
@keyframes shimmer {
  0% { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}
.hero .meta {
  color: var(--muted);
  font-size: 0.95rem;
  margin-bottom: 20px;
}
.hero .meta span + span::before {
  content: "·";
  margin: 0 10px;
  color: var(--faint);
}
.hero p.lead {
  font-size: 1.1rem;
  color: #c9cddb;
  max-width: 58ch;
  margin: 0 0 32px;
}
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  transition: border-color 0.2s, background 0.2s, transform 0.2s, color 0.2s;
}
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn:hover {
  color: var(--text);
  border-color: rgba(166, 108, 255, 0.6);
  background: var(--surface-hover);
  transform: translateY(-2px);
}
.btn.primary {
  border: none;
  background: var(--aurora);
  color: #05060b;
  font-weight: 600;
}
.btn.primary:hover { color: #05060b; box-shadow: 0 8px 30px rgba(123, 92, 255, 0.35); }

.portrait {
  position: relative;
  width: min(100%, 360px);
  aspect-ratio: 1;
  justify-self: center;
}
.portrait::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  background: conic-gradient(from 0deg, var(--green), var(--teal), var(--violet), var(--magenta), var(--green));
  animation: spin 14s linear infinite;
  filter: blur(1px);
}
.portrait::after {
  content: "";
  position: absolute;
  inset: -40px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(123, 92, 255, 0.35), rgba(61, 255, 163, 0.12) 60%, transparent);
  z-index: -1;
}
.portrait img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  border: 6px solid var(--bg);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Cards ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color 0.3s, background 0.3s, transform 0.3s;
}
.card:hover {
  border-color: var(--border-strong);
  background: var(--surface-hover);
}

.date {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--green);
  background: rgba(61, 255, 163, 0.08);
  border: 1px solid rgba(61, 255, 163, 0.22);
  white-space: nowrap;
}

h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}
h3 a { color: var(--text); }
h3 a:hover { color: var(--green); }
h3 a .arrow { display: inline-block; transition: transform 0.2s; color: var(--purple); }
h3 a:hover .arrow { transform: translate(3px, -3px); }

.org {
  color: var(--purple);
  font-weight: 500;
  font-size: 0.95rem;
  margin: 4px 0 14px;
}

.card p, .card li { color: #c3c7d6; }
.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

ul.points { margin: 0; padding: 0; list-style: none; }
ul.points li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 8px;
}
ul.points li::before {
  content: "";
  position: absolute;
  left: 2px; top: 0.7em;
  width: 7px; height: 7px;
  border-radius: 2px;
  transform: rotate(45deg);
  background: linear-gradient(135deg, var(--green), var(--purple));
}

/* ---------- Timeline ---------- */
.timeline {
  /* --line-x: centre of the vertical line, measured from the timeline's left edge.
     Line and dots are both centred on it, so they always stay aligned. */
  --line-x: 8px;
  --pad: 36px;
  position: relative;
  padding-left: var(--pad);
}
.timeline::before {
  content: "";
  position: absolute;
  left: var(--line-x); top: 8px; bottom: 8px;
  width: 2px;
  transform: translateX(-50%);
  background: linear-gradient(180deg, var(--green), var(--violet) 55%, rgba(166, 108, 255, 0.05));
  border-radius: 2px;
}
.timeline .item { position: relative; margin-bottom: 24px; }
.timeline .item::before {
  content: "";
  position: absolute;
  /* the card's 1px border shifts its positioning origin, so subtract it */
  left: calc(var(--line-x) - var(--pad) - 1px); top: 32px;
  width: 16px; height: 16px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: var(--bg);
  border: 3px solid var(--green);
  box-shadow: 0 0 14px rgba(61, 255, 163, 0.6);
}
.timeline .item:nth-child(n+3)::before {
  border-color: var(--purple);
  box-shadow: 0 0 14px rgba(166, 108, 255, 0.6);
}
.item-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- Projects ---------- */
.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}
.projects .card { display: flex; flex-direction: column; }
.projects .card.wide { grid-column: 1 / -1; }
.projects .card:hover { transform: translateY(-3px); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 14px; }
.tag {
  font-size: 0.75rem;
  padding: 2px 10px;
  border-radius: 999px;
  color: #d9c6ff;
  background: rgba(166, 108, 255, 0.1);
  border: 1px solid rgba(166, 108, 255, 0.25);
}
.shot {
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
}
.shot img { width: 100%; height: auto; }
.video {
  margin-top: 12px;
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 500;
  font-size: 0.92rem;
  margin-top: 4px;
}
.note { font-size: 0.9rem; color: var(--muted) !important; }
.card-foot { margin-top: auto; padding-top: 4px; }

/* ---------- Education ---------- */
.edu { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; }
.course-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.course {
  font-size: 0.82rem;
  padding: 5px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: #c3c7d6;
}
.course b { color: var(--green); font-weight: 600; margin-right: 4px; }
.kv { color: #c3c7d6; margin: 0; }
.kv span { color: var(--faint); }

/* ---------- Skills ---------- */
.skills { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.skills .card.wide { grid-column: 1 / -1; }
.skills .card.span2 { grid-column: span 2; }
.skill-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  font-size: 0.9rem;
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chip i { font-size: 1.25rem; color: var(--green); }
.chip:hover { border-color: rgba(61, 255, 163, 0.5); box-shadow: 0 0 18px rgba(61, 255, 163, 0.15); }
.chips.purple .chip:hover { border-color: rgba(166, 108, 255, 0.55); box-shadow: 0 0 18px rgba(166, 108, 255, 0.18); }

/* ---------- Interests ---------- */
.interests { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.interests .icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  font-size: 1.3rem;
  background: linear-gradient(135deg, rgba(61, 255, 163, 0.18), rgba(166, 108, 255, 0.18));
  border: 1px solid var(--border-strong);
}

/* ---------- Footer ---------- */
footer {
  max-width: var(--max);
  margin: 96px auto 0;
  padding: 32px 24px 48px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--faint);
  font-size: 0.9rem;
}
footer a { color: var(--muted); }

/* ---------- Reveal on scroll (only when JS is running) ---------- */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 40px; padding-top: 32px; min-height: auto; }
  .portrait { width: min(70vw, 260px); justify-self: start; order: -1; }
  .projects, .edu, .skills, .interests { grid-template-columns: 1fr; }
  .skills .card.span2 { grid-column: auto; }
}
@media (max-width: 640px) {
  .nav-inner { padding: 0 16px; gap: 12px; }
  .brand { display: none; }
  main { padding: 0 16px; }
  section { padding-top: 72px; }
  .card { padding: 22px 20px; }
  .timeline { --line-x: 7px; --pad: 26px; }
  .timeline .item::before { width: 14px; height: 14px; }
  footer { padding: 28px 16px 40px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .sky .band, .hero h1 .glow, .portrait::before { animation: none; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
}
