/* ---------- Tokens ---------- */
:root {
  --bg: #06152a;
  --bg-2: #081a31;
  --card: #0d2238;
  --card-hover: #10283f;
  --border: rgba(120, 170, 200, 0.14);
  --border-strong: rgba(105, 195, 185, 0.45);
  --text: #e8f1f5;
  --text-dim: #9fb3c3;
  --text-mute: #7f93a5;
  --accent: #69c3b9;
  --accent-2: #3f8fa0;
  --chip: #173552;

  --font-display: "Sora", system-ui, sans-serif;
  --font-body: "Manrope", system-ui, sans-serif;

  --container: 1320px;
  --radius: 22px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 90px; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  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; margin: 0; padding: 0; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); letter-spacing: -0.02em; }
::selection { background: var(--accent); color: var(--bg); }

.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.gradient {
  background: linear-gradient(90deg, #e8f1f5 0%, #9fd8d0 40%, #69c3b9 70%, #3f8fa0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Scroll progress ---------- */
.progress {
  position: fixed; inset: 0 0 auto 0; height: 2px; z-index: 60;
  pointer-events: none;
}
.progress span {
  display: block; height: 100%; width: 100%;
  transform-origin: 0 50%; transform: scaleX(0);
  background: linear-gradient(90deg, var(--accent-2), var(--accent));
}

/* ---------- Nav ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  padding: 24px 0;
  transition: padding 0.4s var(--ease), background 0.4s var(--ease);
}
.nav.is-scrolled {
  padding: 12px 0;
  background: rgba(6, 21, 42, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; }
.logo { font-family: var(--font-display); font-weight: 700; font-size: 20px; letter-spacing: -0.03em; }
.logo span { color: var(--accent); }
.nav-links {
  display: flex; gap: 4px; padding: 6px;
  border-radius: 999px;
  background: rgba(13, 34, 56, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.nav-links a {
  padding: 8px 18px; border-radius: 999px; font-size: 15px; font-weight: 500;
  color: var(--text-dim);
  transition: color 0.25s, background 0.25s;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.is-active { color: var(--text); background: rgba(105, 195, 185, 0.14); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex; align-items: flex-end;
  padding: 140px 0 90px;
  overflow: hidden;
  isolation: isolate;
}
.hero-bg { position: absolute; inset: 0; z-index: -2; overflow: hidden; }
.hero-bg img {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 115%; max-width: none;
  object-fit: cover;
  object-position: 50% 60%;
  filter: saturate(0.85);
  transform: scale(1.06);
  will-change: transform;
  animation: heroIn 2.2s var(--ease) both;
}
/* On wide screens, enlarge the portrait so Lucian sits to the right of the title */
@media (min-aspect-ratio: 5/4) and (min-width: 900px) {
  .hero-bg img { width: 145%; height: 125%; left: -6%; object-position: 50% 57%; }
}
@keyframes heroIn {
  from { opacity: 0; transform: scale(1.14); }
  to   { opacity: 1; transform: translate3d(0, 0, 0) scale(1.06); }
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(6, 21, 42, 0.35) 0%, rgba(6, 21, 42, 0.1) 35%, rgba(6, 21, 42, 0.6) 78%, var(--bg) 100%),
    linear-gradient(90deg, rgba(6, 21, 42, 0.5) 0%, rgba(6, 21, 42, 0) 60%),
    rgba(10, 35, 70, 0.28);
}

.badge {
  display: inline-flex; align-items: center; gap: 10px;
  margin: 0 0 22px;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 15px; font-weight: 500;
  background: rgba(13, 34, 56, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.dot {
  position: relative; width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
}
.dot::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--accent);
  animation: ping 2s var(--ease) infinite;
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.8; }
  100% { transform: scale(3); opacity: 0; }
}

.hero-title {
  font-weight: 700;
  font-size: clamp(64px, 12vw, 176px);
  line-height: 0.92;
  letter-spacing: -0.045em;
  margin-left: -0.04em;
}
.hero-title .line { display: block; }

.hero-bottom {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 40px;
  flex-wrap: wrap;
  margin-top: 56px;
}
.hero-lead { max-width: 470px; margin: 0; font-size: 19px; color: var(--text-dim); }

.stats {
  display: grid; grid-template-columns: repeat(3, minmax(130px, 1fr));
  margin: 0;
  border-radius: var(--radius);
  background: rgba(13, 34, 56, 0.55);
  border: 1px solid var(--border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow: hidden;
}
.stat { padding: 18px 26px; }
.stat + .stat { border-left: 1px solid var(--border); }
.stat dt {
  font-family: var(--font-display); font-weight: 700; font-size: 30px; line-height: 1.2;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.stat dd { margin: 2px 0 0; font-size: 13px; color: var(--text-dim); }

.scroll-hint {
  position: absolute; left: 50%; bottom: 26px; transform: translateX(-50%);
  width: 24px; height: 38px; border-radius: 14px;
  border: 1.5px solid rgba(232, 241, 245, 0.35);
}
.scroll-hint span {
  position: absolute; left: 50%; top: 8px; width: 3px; height: 8px; margin-left: -1.5px;
  border-radius: 2px; background: var(--text);
  animation: scrollHint 1.8s var(--ease) infinite;
}
@keyframes scrollHint {
  0% { transform: translateY(0); opacity: 1; }
  80% { transform: translateY(12px); opacity: 0; }
  100% { opacity: 0; }
}

/* ---------- Sections ---------- */
.section { padding: 130px 0; border-top: 1px solid rgba(120, 170, 200, 0.08); }
.section#about { border-top: 0; padding-top: 110px; }
.eyebrow {
  margin: 0 0 18px;
  font-size: 14px; font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--accent);
}
.section-title { font-size: clamp(40px, 5vw, 62px); line-height: 1.02; font-weight: 700; }
.section-lead { margin: 28px 0 0; max-width: 330px; color: var(--text-dim); }

.about-text {
  margin: 0; max-width: 1080px;
  font-family: var(--font-display); font-weight: 400;
  font-size: clamp(28px, 3.6vw, 50px); line-height: 1.38; letter-spacing: -0.02em;
}
.about-text em { font-style: normal; }
.about-text .accent { color: var(--accent); }
.about-text .muted { color: var(--text-dim); }

/* ---------- Experience timeline ---------- */
.exp-grid {
  display: grid; grid-template-columns: 340px 1fr; gap: 56px;
  align-items: start;
}
.exp-intro { position: sticky; top: 120px; }

.timeline { position: relative; display: grid; gap: 22px; padding-left: 36px; }
.timeline-line {
  position: absolute; left: 0; top: 0; bottom: 0; width: 1px;
  background: rgba(105, 195, 185, 0.16);
}
.timeline-line span {
  position: absolute; inset: 0 0 auto 0; height: 100%;
  transform-origin: top; transform: scaleY(var(--line, 0));
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px rgba(105, 195, 185, 0.5);
}

.job { position: relative; }
.job::before {
  content: ""; position: absolute; left: -41px; top: 40px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 0 4px var(--bg);
  transition: background 0.3s, box-shadow 0.3s, transform 0.3s var(--ease);
}
.job.is-current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 7px rgba(105, 195, 185, 0.3);
}
.job:hover::before, .job.is-focus::before { background: var(--accent); transform: scale(1.3); }

.card {
  position: relative;
  padding: 34px 36px;
  border-radius: var(--radius);
  background: linear-gradient(180deg, var(--card) 0%, rgba(13, 34, 56, 0.85) 100%);
  border: 1px solid var(--border);
  transition: border-color 0.4s var(--ease), box-shadow 0.4s var(--ease), transform 0.4s var(--ease), background 0.4s;
}
.card::before {
  /* soft spotlight following the cursor */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), rgba(105, 195, 185, 0.08), transparent 60%);
  opacity: 0; transition: opacity 0.4s;
}
.job:hover .card, .job.is-focus .card {
  border-color: var(--border-strong);
  box-shadow: 0 0 40px -8px rgba(105, 195, 185, 0.18);
  background: var(--card-hover);
}
.job:hover .card { transform: translateY(-2px); }
.job:hover .card::before { opacity: 1; }

.card h3 { font-size: 26px; font-weight: 700; line-height: 1.25; padding-right: 90px; }
.company { margin: 6px 0 0; font-size: 19px; color: var(--accent); }
.meta {
  display: flex; flex-wrap: wrap; gap: 6px 26px;
  margin: 16px 0 0; font-size: 15px; color: var(--text-dim);
}
.desc { margin: 18px 0 0; max-width: 720px; color: var(--text-dim); font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.chips li {
  padding: 4px 12px; border-radius: 999px;
  background: var(--chip); color: #d6e4ec; font-size: 13px; font-weight: 500;
}
.tag-current {
  position: absolute; top: 32px; right: 32px;
  padding: 3px 12px; border-radius: 999px;
  background: var(--accent); color: #062026;
  font-size: 13px; font-weight: 600;
}

/* ---------- Skills marquee ---------- */
.skills .section-title { margin-bottom: 56px; }
.marquee {
  --gap: 18px;
  position: relative; overflow: hidden;
  padding: 6px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee + .marquee { margin-top: var(--gap); }
.marquee-track {
  display: flex; gap: var(--gap); width: max-content;
  will-change: transform;
}
.marquee-track li {
  flex: none;
  padding: 16px 34px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 600; font-size: 26px; white-space: nowrap;
  background: var(--card); border: 1px solid var(--border);
  transition: border-color 0.3s, color 0.3s, background 0.3s;
}
.marquee-track li:hover { border-color: var(--border-strong); color: var(--accent); background: var(--card-hover); }
.marquee-alt .marquee-track li {
  font-size: 20px; padding: 12px 28px;
  background: transparent; color: var(--text-dim);
}

/* ---------- Footer ---------- */
.footer { padding: 130px 0 70px; border-top: 1px solid rgba(120, 170, 200, 0.08); }
.footer-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.footer-title { font-size: clamp(48px, 7vw, 92px); line-height: 1; font-weight: 700; letter-spacing: -0.04em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 26px; border-radius: 999px;
  background: var(--accent); color: #062026; font-weight: 700;
  transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 30px -10px rgba(105, 195, 185, 0.6); }
.btn span { transition: transform 0.3s var(--ease); }
.btn:hover span { transform: translateX(4px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); box-shadow: none; }
.copyright { margin: 0; font-size: 15px; color: var(--text-dim); }

/* ---------- Reveal on scroll ---------- */
.js .reveal {
  opacity: 0; transform: translateY(28px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
  transition-delay: var(--delay, 0s);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .exp-grid { grid-template-columns: 1fr; gap: 48px; }
  .exp-intro { position: static; }
  .section-lead { max-width: 480px; }
}
@media (max-width: 720px) {
  body { font-size: 16px; }
  .nav { padding: 16px 0; }
  .nav-links a { padding: 7px 12px; font-size: 14px; }
  .nav-links a[href="#contact"] { display: none; }
  .hero { padding: 120px 0 80px; }
  .hero-bottom { margin-top: 36px; }
  .hero-lead { font-size: 17px; }
  .stats { width: 100%; grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 14px 16px; }
  .stat dt { font-size: 24px; }
  .stat dd { font-size: 12px; }
  .section { padding: 90px 0; }
  .timeline { padding-left: 26px; }
  .job::before { left: -31px; top: 32px; }
  .card { padding: 26px 22px; }
  .card h3 { font-size: 21px; padding-right: 0; }
  .tag-current { position: static; display: inline-block; margin-bottom: 12px; }
  .company { font-size: 17px; }
  .marquee-track li { font-size: 20px; padding: 12px 24px; }
  .marquee-alt .marquee-track li { font-size: 16px; padding: 10px 20px; }
  .scroll-hint { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
