/* ==========================================================================
   Tokens
   ========================================================================== */
:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --accent: #6366f1;
  --accent-2: #06b6d4;
  --accent-3: #ec4899;

  --ink: #f5f6ff;
  --ink-dim: rgba(245, 246, 255, 0.68);
  --ink-faint: rgba(245, 246, 255, 0.4);

  --glass-bg: rgba(255, 255, 255, 0.06);
  --glass-bg-strong: rgba(255, 255, 255, 0.1);
  --glass-border: rgba(255, 255, 255, 0.14);

  --radius-md: 16px;
  --radius-lg: 26px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

* , *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: auto; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: #05060f;
  color: var(--ink);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: default;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p { margin: 0; }

/* ==========================================================================
   Accessibility / utility
   ========================================================================== */
.skip-link {
  position: fixed;
  left: -999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 10px 16px;
  border-radius: 0 0 8px 0;
  z-index: 999;
}
.skip-link:focus { left: 0; }

.back-home {
  position: fixed;
  top: 20px;
  left: 20px;
  z-index: 60;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 200ms var(--ease), transform 200ms var(--ease);
}
.back-home:hover { background: var(--glass-bg-strong); transform: translateX(-3px); }

/* ==========================================================================
   Preloader
   ========================================================================== */
.preloader {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #05060f;
  transition: opacity 600ms var(--ease), visibility 600ms var(--ease);
}
.preloader span {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  border-top-color: var(--accent-2);
  animation: spin 900ms linear infinite;
}
body:not(.loading) .preloader { opacity: 0; visibility: hidden; pointer-events: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ==========================================================================
   Custom cursor (desktop / fine pointer only — enabled via JS)
   ========================================================================== */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 400;
  pointer-events: none;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity 200ms ease;
}
.cursor-dot {
  width: 7px;
  height: 7px;
  background: var(--ink);
}
.cursor-ring {
  width: 34px;
  height: 34px;
  border: 1.5px solid color-mix(in srgb, var(--accent-2) 65%, transparent);
}
body.cursor-ready .cursor-dot,
body.cursor-ready .cursor-ring { opacity: 1; }
body.cursor-ready { cursor: none; }
body.cursor-ready a, body.cursor-ready button { cursor: none; }
.cursor-ring.is-active { background: color-mix(in srgb, var(--accent-2) 16%, transparent); }

/* ==========================================================================
   Progress timeline
   ========================================================================== */
.progress-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 12px;
}
.progress-track {
  position: relative;
  width: 2px;
  height: 200px;
  background: var(--glass-border);
  border-radius: 2px;
  order: 2;
}
.progress-fill {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 0%;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), var(--accent-3));
  border-radius: 2px;
}
.progress-nav ol {
  order: 1;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.progress-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 1.5px solid var(--ink-faint);
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: all 250ms var(--ease);
}
.progress-dot:hover { border-color: var(--ink); transform: scale(1.2); }
.progress-dot.is-active {
  background: var(--accent-2);
  border-color: var(--accent-2);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent-2) 70%, transparent);
  transform: scale(1.3);
}

/* ==========================================================================
   Chapters — shared layout
   ========================================================================== */
.chapter {
  position: relative;
  min-height: 100svh;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 90px 24px;
  overflow: hidden;
}
.chapter-inner {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  text-align: center;
}
.chapter-kicker {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  color: var(--accent-2);
  margin-bottom: 18px;
}
.chapter-3d, .chapter-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.9;
}

/* ==========================================================================
   Glassmorphism + floating utilities
   ========================================================================== */
.glass-panel {
  position: relative;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 30px 70px -30px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

/* Dynamic lighting — a cursor-tracked spotlight, JS sets --mx/--my per panel */
.glass-panel::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(320px circle at var(--mx, 50%) var(--my, 50%),
    color-mix(in srgb, var(--accent-2) 22%, transparent), transparent 65%);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}
.glass-panel.is-lit::after { opacity: 1; }

.magnetic { display: inline-block; will-change: transform; }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero-inner { max-width: 780px; }
.hero-headline {
  font-size: clamp(2.6rem, 8vw, 6rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.02;
  margin-bottom: 22px;
}
.hero-headline .char { display: inline-block; will-change: transform, opacity; }
.hero-sub { color: var(--ink-dim); font-size: 1.1rem; max-width: 560px; margin: 0 auto; }

.scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.scroll-hint i {
  width: 1px;
  height: 34px;
  background: linear-gradient(var(--accent-2), transparent);
  animation: scrollhint 1.8s ease infinite;
}
@keyframes scrollhint { 0% { opacity: 0; transform: scaleY(0.3); } 50% { opacity: 1; } 100% { opacity: 0; transform: scaleY(1); } }

/* ==========================================================================
   About
   ========================================================================== */
.about-inner {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 56px;
  align-items: center;
  text-align: left;
  max-width: 1080px;
}
.about-visual { position: relative; display: flex; justify-content: center; }
.morph-blob { position: absolute; inset: -10%; width: 120%; height: 120%; opacity: 0.55; filter: blur(2px); }
.about-photo {
  position: relative;
  width: min(100%, 280px);
  border-radius: var(--radius-lg);
  border: 1px solid var(--glass-border);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.about-copy { padding: 40px; }
.about-copy h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; margin-bottom: 22px; letter-spacing: -0.02em; }
.about-copy p { color: var(--ink-dim); font-size: 1rem; margin-bottom: 14px; }
.about-copy p:last-child { margin-bottom: 0; }

.split-lines .line { will-change: transform, opacity; }

/* ==========================================================================
   Journey + Projects — pinned horizontal scrub
   ========================================================================== */
.pinned-kicker { font-size: 0.9rem; }
.journey-inner, .projects-inner { max-width: 1200px; }
.journey-viewport { overflow: hidden; width: 100%; padding: 24px 0; }
.journey-track {
  display: flex;
  gap: 28px;
  width: max-content;
  padding: 0 6vw 0 0;
  will-change: transform;
}

.journey-card {
  flex: none;
  width: min(560px, 82vw);
  padding: 34px;
  text-align: left;
}
.journey-period {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent-2);
}
.journey-card h3 { font-size: 1.3rem; font-weight: 700; margin: 10px 0 4px; }
.journey-company { color: var(--ink-dim); font-size: 0.9rem; margin-bottom: 16px; }
.journey-card ul { display: grid; gap: 8px; }
.journey-card li { position: relative; padding-left: 18px; color: var(--ink-dim); font-size: 0.9rem; }
.journey-card li::before { content: ''; position: absolute; left: 0; top: 8px; width: 5px; height: 5px; border-radius: 50%; background: var(--accent-2); }

.journey-card[data-tint="0"] { border-color: color-mix(in srgb, var(--accent) 40%, var(--glass-border)); }
.journey-card[data-tint="1"] { border-color: color-mix(in srgb, var(--accent-2) 40%, var(--glass-border)); }
.journey-card[data-tint="2"] { border-color: color-mix(in srgb, var(--accent-3) 40%, var(--glass-border)); }

.project-card {
  flex: none;
  width: min(340px, 78vw);
  padding: 30px;
  text-align: left;
  transform-style: preserve-3d;
  will-change: transform;
}
.project-tag {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent-2) 14%, transparent);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 14px;
}
.project-card h3 { font-size: 1.15rem; font-weight: 700; margin-bottom: 10px; }
.project-card p { color: var(--ink-dim); font-size: 0.9rem; margin-bottom: 16px; }
.project-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.project-chips span {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink-dim);
}

/* ==========================================================================
   Skills — 3D orbit (reused pattern from the main site's hero orbit)
   ========================================================================== */
.skills-inner h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); font-weight: 700; max-width: 640px; margin: 0 auto 10px; letter-spacing: -0.02em; }
.skills-orbit-wrap { position: relative; width: min(100%, 520px); height: 420px; margin: 30px auto 0; }
.skills-orbit { position: absolute; inset: 0; pointer-events: none; }

.skill-orbit-word {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 7px 14px 7px 11px;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(135deg, color-mix(in srgb, var(--tag-color, var(--accent)) 24%, rgba(255,255,255,0.05)), rgba(255,255,255,0.04));
  border: 1px solid color-mix(in srgb, var(--tag-color, var(--accent)) 55%, var(--glass-border));
  box-shadow: 0 10px 26px -12px rgba(0,0,0,0.6);
  will-change: transform, opacity;
}
.skill-orbit-word::before {
  content: '';
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--tag-color, var(--accent));
  box-shadow: 0 0 8px color-mix(in srgb, var(--tag-color, var(--accent)) 85%, transparent);
}

.skills-fallback {
  max-width: 720px;
  margin: 30px auto 0;
  color: var(--ink-faint);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.9;
}

/* ==========================================================================
   Certifications
   ========================================================================== */
.cert-panel {
  display: flex;
  align-items: center;
  gap: 34px;
  padding: 40px 46px;
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
}
.cert-morph { width: 84px; height: 84px; flex: none; }
.cert-copy h3 { font-size: 1.05rem; font-weight: 700; margin-top: 14px; }
.cert-copy h3:first-child { margin-top: 0; }
.cert-copy p { color: var(--ink-dim); font-size: 0.88rem; margin-top: 2px; }

/* ==========================================================================
   Contact
   ========================================================================== */
.contact-headline { font-size: clamp(2rem, 5.5vw, 3.6rem); max-width: 760px; margin: 0 auto 18px; }
.contact-floats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 44px 0 36px;
}
.float-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 24px;
  min-width: 200px;
  text-align: left;
}
.float-label { font-family: var(--font-mono); font-size: 0.72rem; color: var(--accent-2); text-transform: uppercase; letter-spacing: 0.06em; }
.float-value { font-size: 0.95rem; font-weight: 600; }

.btn-cta {
  display: inline-block;
  padding: 16px 38px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 20px 50px -18px color-mix(in srgb, var(--accent) 70%, transparent);
}
.contact-footnote { margin-top: 26px; color: var(--ink-faint); font-size: 0.86rem; }
.contact-footnote a { color: var(--accent-2); text-decoration: underline; text-underline-offset: 3px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .about-inner { grid-template-columns: 1fr; text-align: center; }
  .about-copy { text-align: left; }
  .progress-nav { right: 12px; }
  .progress-track { height: 140px; }
  .progress-nav ol { gap: 14px; }
}

@media (max-width: 640px) {
  .chapter { padding: 70px 16px; }
  .progress-nav { display: none; }
  .cert-panel { flex-direction: column; text-align: center; padding: 32px 24px; }
}

/* ==========================================================================
   Fallback mode — reduced motion, touch devices, or narrow viewports.
   JS adds .no-enhance to <body> and skips ScrollSmoother/pin/3D/canvas.
   Content stacks normally and still reads perfectly well.
   ========================================================================== */
body.no-enhance .chapter-3d,
body.no-enhance .chapter-canvas { display: none; }

body.no-enhance .journey-viewport,
body.no-enhance .projects-inner .journey-viewport { overflow: visible; }

body.no-enhance .journey-track {
  display: grid;
  width: 100%;
  gap: 22px;
}
body.no-enhance .journey-card,
body.no-enhance .project-card { width: 100%; }

body.no-enhance .progress-track,
body.no-enhance .cursor-dot,
body.no-enhance .cursor-ring { display: none; }

body.no-enhance .chapter { min-height: auto; padding: 64px 20px; }

body.no-enhance .fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 700ms ease, transform 700ms ease;
}
body.no-enhance .fade-in.is-visible { opacity: 1; transform: translateY(0); }

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