:root {
  --bg:        #0a0e17;
  --bg-soft:   #101624;   /* cards/panels */
  --bg-softer: #161e30;
  --line:      #1f2a44;   /* borders */
  --text:      #dbe4f5;
  --text-dim:  #8b97b0;
  --accent:    #22e4ff;   /* the cyan */
  --accent-2:  #a06bff;   /* the purple */
  --accent-3:  #ff5c87;   /* only used for the glitch effect */
  --font-main: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
  --radius: 12px;
  --max-w: 1080px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-main);
  line-height: 1.6;
  overflow-x: hidden;
  cursor: none; /* using the custom cursor instead */
}

/* normal cursor on touch devices */
@media (hover: none) {
  body { cursor: auto; }
  .cursor-dot, .cursor-ring { display: none; }
}

.mono { font-family: var(--font-mono); }

a { color: var(--accent); text-decoration: none; }

::selection { background: var(--accent); color: var(--bg); }

/* faint grid overlay in the backgorund, fades out towards the edges */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background-image:
    linear-gradient(rgba(34, 228, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 228, 255, 0.025) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}

/* ambient background: two big soft color glows drifting very slowly */
.bg-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-glow::before, .bg-glow::after {
  content: "";
  position: absolute;
  width: 55vmax; height: 55vmax;
  border-radius: 50%;
  filter: blur(90px);
  will-change: transform;
}
.bg-glow::before {
  top: -20vmax; left: -12vmax;
  background: radial-gradient(circle, rgba(34, 228, 255, 0.07), transparent 60%);
  animation: drift-a 40s ease-in-out infinite alternate;
}
.bg-glow::after {
  bottom: -25vmax; right: -15vmax;
  background: radial-gradient(circle, rgba(160, 107, 255, 0.07), transparent 60%);
  animation: drift-b 50s ease-in-out infinite alternate;
}
@keyframes drift-a {
  to { transform: translate(10vmax, 8vmax) scale(1.15); }
}
@keyframes drift-b {
  to { transform: translate(-8vmax, -10vmax) scale(1.1); }
}

/* pulses travel on the grid, so they share its edge fade-out mask */
#pulse-canvas {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, black 30%, transparent 75%);
}

main, .nav, .footer { position: relative; z-index: 2; }

/* cursor */
.cursor-dot, .cursor-ring {
  position: fixed;
  top: 0; left: 0;
  pointer-events: none;
  z-index: 9999;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.cursor-dot {
  width: 6px; height: 6px;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.cursor-ring {
  width: 34px; height: 34px;
  border: 1px solid rgba(34, 228, 255, 0.5);
  transition: width .25s ease, height .25s ease, border-color .25s ease, background .25s ease;
}
.cursor-ring.is-hovering {
  width: 56px; height: 56px;
  border-color: var(--accent-2);
  background: rgba(160, 107, 255, 0.08);
}

.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0%;
  z-index: 100;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 10px var(--accent);
}

/* nav */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: rgba(10, 14, 23, 0.72);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.nav.is-scrolled { border-bottom-color: var(--line); }

.nav__logo {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  letter-spacing: .5px;
}

.nav__links { display: flex; gap: 28px; align-items: center; }
.nav__links a {
  color: var(--text-dim);
  font-size: .95rem;
  transition: color .2s ease;
}
.nav__links a:hover { color: var(--accent); }

.nav__cta {
  padding: 8px 18px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  color: var(--accent) !important;
  transition: background .2s ease, box-shadow .2s ease;
}
.nav__cta:hover {
  background: rgba(34, 228, 255, 0.1);
  box-shadow: 0 0 18px rgba(34, 228, 255, 0.35);
}

.nav__burger { display: none; }

/* hero */
.hero {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  max-width: var(--max-w);
  margin: 0 auto;
  position: relative;
}

.hero__pre { color: var(--accent); margin-bottom: 14px; font-size: 1rem; }

.hero__name {
  font-size: clamp(3rem, 9vw, 6.5rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -2px;
}

.hero__role {
  font-size: clamp(1.2rem, 3vw, 1.9rem);
  color: var(--text-dim);
  margin-top: 10px;
}

.hero__tagline {
  margin-top: 28px;
  font-size: clamp(.95rem, 2vw, 1.15rem);
  color: var(--accent-2);
  min-height: 1.6em; /* stops the layout jumping while the text scrambles */
}

.caret { animation: blink 1s step-end infinite; color: var(--accent); }
@keyframes blink { 50% { opacity: 0; } }

.hero__actions { display: flex; gap: 18px; margin-top: 44px; flex-wrap: wrap; }

.hero__scroll-hint {
  position: absolute;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  color: var(--text-dim);
  font-size: .8rem;
  letter-spacing: 3px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.hero__arrow { animation: bob 1.6s ease-in-out infinite; color: var(--accent); }
@keyframes bob { 50% { transform: translateY(7px); } }

/* glitch on hover, two clipped copies of the text offset in different colors */
.glitch { position: relative; display: inline-block; }
.glitch::before, .glitch::after {
  content: attr(data-text);
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
}
.glitch:hover::before {
  opacity: .85;
  color: var(--accent);
  animation: glitch-a .32s steps(2) infinite;
}
.glitch:hover::after {
  opacity: .85;
  color: var(--accent-3);
  animation: glitch-b .32s steps(2) infinite reverse;
}
@keyframes glitch-a {
  0%   { clip-path: inset(20% 0 60% 0); transform: translate(-4px, -2px); }
  50%  { clip-path: inset(60% 0 10% 0); transform: translate(4px, 2px); }
  100% { clip-path: inset(40% 0 40% 0); transform: translate(-2px, 1px); }
}
@keyframes glitch-b {
  0%   { clip-path: inset(50% 0 30% 0); transform: translate(4px, 2px); }
  50%  { clip-path: inset(10% 0 70% 0); transform: translate(-4px, -2px); }
  100% { clip-path: inset(30% 0 50% 0); transform: translate(2px, -1px); }
}

/* buttons */
.btn {
  display: inline-block;
  padding: 14px 30px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 1rem;
  transition: transform .15s ease, box-shadow .25s ease, background .25s ease;
  will-change: transform;
}
.btn--primary {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  color: #06090f;
  font-weight: 700;
}
.btn--primary:hover { box-shadow: 0 0 28px rgba(34, 228, 255, 0.45); }
.btn--ghost {
  border: 1px solid var(--line);
  color: var(--text);
}
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--big { padding: 18px 44px; font-size: 1.1rem; }

/* sections */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 110px 40px;
}

.section__title {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  margin-bottom: 48px;
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.section__title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--line), transparent);
  margin-left: 10px;
}
.section__num { color: var(--accent); font-size: .8em; }

/* fade in when scrolled into view, js adds is-visible */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible { opacity: 1; transform: none; }

/* about - terminal + stat cards */
.about__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 36px;
  align-items: start;
}

.terminal {
  background: #0b0f19;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.5);
}
.terminal__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
}
.terminal__dot { width: 12px; height: 12px; border-radius: 50%; }
.terminal__dot--r { background: #ff5f57; }
.terminal__dot--y { background: #febc2e; }
.terminal__dot--g { background: #28c840; }
.terminal__title { margin-left: 10px; color: var(--text-dim); font-size: .8rem; }

.terminal__body {
  padding: 22px;
  font-size: .88rem;
  min-height: 300px;
  max-height: 420px;
  overflow-y: auto;
  overflow-x: hidden;
  line-height: 1.8;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.terminal__body .t-out { overflow-wrap: anywhere; }
.terminal__body .t-prompt { color: var(--accent); }
.terminal__body .t-cmd    { color: var(--text); }
.terminal__body .t-out    { color: var(--text-dim); display: block; }
.terminal__body .t-hint   { font-style: italic; opacity: .6; }

/* the live prompt once the intro script finishes */
.t-input-line { display: flex; align-items: baseline; }
.t-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text);
  font: inherit;
  caret-color: var(--accent);
  padding: 0;
}

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.stat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 20px;
  text-align: center;
  transition: border-color .25s ease, transform .25s ease;
}
.stat:hover { border-color: var(--accent); transform: translateY(-4px); }
.stat__value {
  font-family: var(--font-mono);
  font-size: 2.2rem;
  font-weight: 700;
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat__label { color: var(--text-dim); font-size: .85rem; margin-top: 6px; }

/* skills */
.skills__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 24px;
}

.skill-group {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  transition: border-color .25s ease;
}
.skill-group:hover { border-color: var(--accent-2); }
.skill-group__title {
  font-size: 1.05rem;
  margin-bottom: 22px;
  color: var(--accent);
  font-family: var(--font-mono);
}

.skill {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: .92rem;
  margin-bottom: 12px;
}
.skill__marker { color: var(--accent); }

/* project cards */
.projects__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.card {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 30px;
  overflow: hidden;
  transform-style: preserve-3d;
  transition: border-color .25s ease, box-shadow .25s ease;
  will-change: transform;
}
.card:hover {
  border-color: var(--accent);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 0 30px rgba(34, 228, 255, 0.08);
}

/* the light spot that follows the mouse, js sets left/top */
.card__glare {
  position: absolute;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(34, 228, 255, 0.14), transparent 65%);
  pointer-events: none;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: opacity .3s ease;
}
.card:hover .card__glare { opacity: 1; }

.card__icon { font-size: 2rem; }
.card__title { font-size: 1.25rem; margin: 14px 0 10px; }
.card__desc { color: var(--text-dim); font-size: .92rem; }

.card__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.card__tag {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--accent);
  background: rgba(34, 228, 255, 0.08);
  border: 1px solid rgba(34, 228, 255, 0.25);
  padding: 4px 10px;
  border-radius: 20px;
}

.card__link {
  display: inline-block;
  margin-top: 18px;
  font-family: var(--font-mono);
  font-size: .85rem;
}
.card__link:hover { text-decoration: underline; }

/* experience timeline */
.timeline {
  position: relative;
  padding-left: 34px;
}
.timeline::before {
  content: "";
  position: absolute;
  left: 8px; top: 6px; bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2), transparent);
}

.tl-item { position: relative; padding-bottom: 46px; }
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  /* the dot on the line */
  content: "";
  position: absolute;
  left: -33px; top: 7px;
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
  box-shadow: 0 0 10px var(--accent);
}

.tl-item__period {
  font-family: var(--font-mono);
  font-size: .8rem;
  color: var(--accent);
  letter-spacing: 1px;
}
.tl-item__title { font-size: 1.25rem; margin-top: 6px; }
.tl-item__place { color: var(--accent-2); font-size: .95rem; }
.tl-item__points { margin-top: 12px; padding-left: 18px; color: var(--text-dim); font-size: .92rem; }
.tl-item__points li { margin-bottom: 5px; }

/* contact + footer */
.section--contact { text-align: center; padding-bottom: 140px; }
.contact__heading { font-size: clamp(1.8rem, 5vw, 3rem); margin-bottom: 18px; }
.contact__blurb {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 auto 40px;
}
.contact__links {
  display: flex;
  justify-content: center;
  gap: 26px;
  margin-top: 34px;
}
.contact__links a {
  font-family: var(--font-mono);
  color: var(--text-dim);
  transition: color .2s ease;
}
.contact__links a:hover { color: var(--accent); }

.footer {
  text-align: center;
  padding: 30px;
  color: var(--text-dim);
  font-size: .78rem;
  border-top: 1px solid var(--line);
}

/* mobile */
@media (max-width: 860px) {
  .about__grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .nav { padding: 14px 20px; }
  .nav__links {
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 23, 0.97);
    flex-direction: column;
    justify-content: center;
    gap: 34px;
    font-size: 1.3rem;
    transform: translateX(100%);
    transition: transform .3s ease;
  }
  .nav__links.is-open { transform: none; }

  .nav__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 60;
    padding: 6px;
  }
  .nav__burger span {
    width: 24px; height: 2px;
    background: var(--text);
    transition: transform .3s ease, opacity .3s ease;
  }
  .nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .nav__burger.is-open span:nth-child(2) { opacity: 0; }
  .nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  .section { padding: 80px 20px; }
  .hero { padding: 0 20px; }
}

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