/* ---------- Reset & base ---------- */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --bg: #0b1220;
  --bg-alt: #0e1626;
  --surface: #131c2f;
  --surface-2: #182342;
  --border: rgba(255, 255, 255, 0.08);
  --text: #e9edf7;
  --text-dim: #8d9ab8;
  --accent: #5b8cff;
  --accent-2: #7c5cff;
  --accent-dim: #3d5a94;
  --gradient: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
  --radius: 14px;
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  --maxw: 1180px;
}

html {
  scroll-behavior: smooth;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3 {
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.section-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 110px 32px;
}

.section-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.78rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 12px;
}

section h2 {
  font-size: clamp(1.9rem, 3.2vw, 2.6rem);
  margin-bottom: 44px;
}

/* ---------- Reveal-on-scroll ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- Progress bar ---------- */
#progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: var(--gradient);
  z-index: 1000;
  transition: width 0.1s linear;
}

/* ---------- Header ---------- */
#site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: linear-gradient(180deg, rgba(6, 9, 18, 0.65) 0%, rgba(6, 9, 18, 0) 100%);
  transition: background 0.35s ease, backdrop-filter 0.35s ease;
}

#site-header.is-scrolled {
  background: rgba(11, 18, 32, 0.78);
  backdrop-filter: blur(14px);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  gap: 30px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.05rem;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  margin-right: auto;
}

#primary-nav {
  display: flex;
  align-items: center;
  gap: 34px;
}

#primary-nav a {
  font-size: 0.92rem;
  color: var(--text-dim);
  position: relative;
  transition: color 0.25s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.lang-toggle {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(11, 18, 32, 0.4);
  backdrop-filter: blur(6px);
}

.lang-btn {
  border: none;
  background: none;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 6px 12px;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.25s ease, background 0.25s ease;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.lang-btn:hover {
  color: var(--text);
}

.lang-btn.is-active {
  background: var(--gradient);
  color: var(--bg);
  text-shadow: none;
}

#primary-nav a:hover,
#primary-nav a.is-active {
  color: var(--text);
}

#primary-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -6px;
  width: 0;
  height: 2px;
  background: var(--accent);
  transition: width 0.25s ease;
}

#primary-nav a:not(.nav-cta):hover::after,
#primary-nav a.is-active::after {
  width: 100%;
}

#nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  cursor: pointer;
}

#nav-toggle span {
  display: block;
  height: 2px;
  width: 22px;
  background: var(--text);
  transition: transform 0.3s ease, opacity 0.3s ease;
  margin: 0 auto;
}

/* ---------- Hero ---------- */
#hero {
  position: relative;
  height: 100vh;
  min-height: 560px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(11, 18, 32, 0.28) 0%, rgba(11, 18, 32, 0.48) 55%, var(--bg) 100%),
    linear-gradient(100deg, rgba(9, 14, 26, 0.55) 10%, rgba(9, 14, 26, 0.1) 60%);
}

.hero-content {
  position: relative;
  z-index: 1;
  max-width: 760px;
  padding: 0 32px;
  text-align: center;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.82rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 18px;
}

#hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.2rem);
  background: linear-gradient(135deg, #ffffff 30%, #b6c6ff 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lede {
  margin: 26px auto 0;
  max-width: 560px;
  color: var(--text-dim);
  font-size: 1.08rem;
}

.hero-actions {
  margin-top: 38px;
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--gradient);
  color: var(--bg);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(91, 140, 255, 0.35);
}

.btn-ghost {
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.scroll-cue {
  position: absolute;
  bottom: 34px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-radius: 20px;
}

.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  animation: scrollCue 1.8s ease infinite;
}

@keyframes scrollCue {
  0% { opacity: 1; top: 8px; }
  70% { opacity: 0; top: 20px; }
  100% { opacity: 0; top: 20px; }
}

/* ---------- About ---------- */
#about {
  background: var(--bg-alt);
}

.about-grid {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 64px;
  align-items: center;
}

.about-media img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.about-copy {
  border-left: 2px solid var(--border);
  padding-left: 30px;
}

.about-copy .section-eyebrow {
  margin-bottom: 18px;
}

.about-copy p {
  color: var(--text-dim);
  margin-bottom: 16px;
  max-width: 52ch;
  font-size: 1.02rem;
}

.about-copy p:last-child {
  margin-bottom: 0;
}

.about-lede {
  color: var(--text);
  font-size: 1.3rem;
  line-height: 1.5;
  letter-spacing: -0.005em;
}

.fact-list {
  margin-top: 28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 28px;
}

.fact-list li {
  border-top: 1px solid var(--border);
  padding-top: 10px;
  font-size: 0.95rem;
}

.fact-list span {
  display: block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 4px;
}

/* ---------- Skills ---------- */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.skill-group {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.skill-group h3 {
  font-size: 1rem;
  margin-bottom: 18px;
  color: var(--text);
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  padding: 7px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  font-size: 0.85rem;
  color: var(--text-dim);
  transition: color 0.25s ease, border-color 0.25s ease;
}

.skill-group:hover .tag {
  color: var(--text-dim);
}

.tag:hover {
  color: var(--accent);
  border-color: var(--accent-dim);
}

/* ---------- Work / Portfolio ---------- */
#work {
  background: var(--bg-alt);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 40px;
}

.filter-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 9px 20px;
  border-radius: 999px;
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.25s ease;
}

.filter-btn:hover {
  color: var(--text);
  border-color: var(--accent-dim);
}

.filter-btn.is-active {
  background: var(--gradient);
  color: var(--bg);
  border-color: transparent;
  font-weight: 600;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}

.work-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 4 / 3;
  transition: transform 0.4s ease, box-shadow 0.4s ease, opacity 0.3s ease;
}

.work-card.is-hidden {
  display: none;
}

.work-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.work-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.work-card:hover img {
  transform: scale(1.08);
}

.work-card figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 40px 20px 18px;
  background: linear-gradient(180deg, transparent, rgba(7, 11, 21, 0.92));
  color: #fff;
}

.work-card figcaption h3 {
  font-size: 1.05rem;
}

.work-card figcaption span {
  display: block;
  margin-top: 4px;
  font-size: 0.78rem;
  color: var(--accent);
  letter-spacing: 0.03em;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: 28px;
  border-left: 2px solid var(--border);
}

.timeline li {
  position: relative;
  padding-bottom: 44px;
}

.timeline li:last-child {
  padding-bottom: 0;
}

.timeline li::before {
  content: "";
  position: absolute;
  left: -35px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.18);
}

.timeline-date {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 8px;
}

.timeline-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.timeline-body h3 .tag {
  margin-left: 8px;
  padding: 3px 10px;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}

.timeline-body p {
  color: var(--text-dim);
  max-width: 62ch;
}

.timeline li.is-current::before {
  animation: pulseDot 2s ease-in-out infinite;
}

@keyframes pulseDot {
  0%, 100% { box-shadow: 0 0 0 4px rgba(91, 140, 255, 0.18); }
  50% { box-shadow: 0 0 0 9px rgba(91, 140, 255, 0.3); }
}

/* ---------- Contact ---------- */
#contact {
  background: var(--bg-alt);
}

.contact-lede {
  color: var(--text-dim);
  max-width: 56ch;
  margin-top: -20px;
  margin-bottom: 44px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.contact-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

a.contact-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-dim);
}

.contact-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
}

.contact-value {
  font-size: 1.05rem;
  font-weight: 500;
  word-break: break-word;
}

/* ---------- Footer ---------- */
footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  padding: 30px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-dim);
  font-size: 0.88rem;
}

.footer-inner a:hover {
  color: var(--accent);
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 30px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 9, 18, 0.88);
  backdrop-filter: blur(6px);
}

.lightbox-panel {
  position: relative;
  z-index: 1;
  max-width: 980px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transform: scale(0.94);
  transition: transform 0.3s ease;
}

.lightbox.is-open .lightbox-panel {
  transform: scale(1);
}

.lightbox-media {
  width: 100%;
  max-height: 62vh;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius) var(--radius) 0 0;
  overflow: hidden;
}

.lightbox-media img,
.lightbox-media video {
  width: 100%;
  max-height: 62vh;
  object-fit: contain;
}

.lightbox-info {
  padding: 26px 30px 30px;
}

.lightbox-badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin-bottom: 10px;
}

.lightbox-info h3 {
  font-size: 1.3rem;
  margin-bottom: 10px;
}

.lightbox-info p {
  color: var(--text-dim);
  max-width: 68ch;
}

.lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(11, 18, 32, 0.7);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.lightbox-close:hover {
  background: rgba(91, 140, 255, 0.2);
  border-color: var(--accent);
}

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .about-grid {
    grid-template-columns: 1fr;
  }

  .about-media {
    max-width: 340px;
    margin: 0 auto;
  }

  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr 1fr;
  }

  .work-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .section-inner {
    padding: 80px 22px;
  }

  #primary-nav {
    position: fixed;
    top: 68px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: rgba(11, 18, 32, 0.98);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  #primary-nav.is-open {
    max-height: 320px;
    border-bottom: 1px solid var(--border);
  }

  #primary-nav a {
    width: 100%;
    padding: 16px 32px;
    border-top: 1px solid var(--border);
  }

  #nav-toggle {
    display: flex;
  }

  #nav-toggle.is-open span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  #nav-toggle.is-open span:nth-child(2) {
    opacity: 0;
  }

  #nav-toggle.is-open span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .skills-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .work-grid {
    grid-template-columns: 1fr;
  }

  .fact-list {
    grid-template-columns: 1fr;
  }
}
