/* ── Design tokens ─────────────────────────────────────────
   Custom properties defined on :root are available everywhere
   in the document. :root is the <html> element — the top of
   the tree. Defining here means every element can access them.
──────────────────────────────────────────────────────────── */
:root {
  --bg:      #08080d;   /* near-black background */
  --fg:      #ffffff;   /* primary text */
  --muted:   rgba(255, 255, 255, 0.6); /* secondary text */
  --accent:  #7c5cff;   /* purple — the personality colour */
  --card:    #13131a;   /* slightly lighter than bg for cards */
  --line:    rgba(255, 255, 255, 0.08); /* subtle borders */

  --font-display: 'Space Grotesk', sans-serif;
  --font-mono:    'JetBrains Mono', monospace;

  --radius-sm:  8px;
  --radius-md:  16px;
  --radius-lg:  24px;
  --radius-full: 9999px; /* pill shape */
}

/* ── Reset ──────────────────────────────────────────────────
   Browsers have their own default styles — margins on body,
   bold on h1, underlines on links. We zero them out so we
   start from a blank canvas and nothing surprises us.
──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  /* box-sizing: border-box means padding and border are
     included in an element's width. Without this, adding
     padding makes elements bigger than you intended. */
}

/* ── Base ───────────────────────────────────────────────────
   The foundational styles applied to the whole document.
──────────────────────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
  /* When a link like <a href="#about"> is clicked,
     the page scrolls smoothly instead of jumping instantly */
}

body {
  background-color: var(--bg);
  color: var(--fg);
  font-family: var(--font-display);
  line-height: 1.6;
  /* line-height controls the space between lines of text.
     1.6 means each line is 1.6x the font size in height.
     Without it text feels cramped and hard to read. */
  -webkit-font-smoothing: antialiased;
  /* Makes text render crisper on Mac/Chrome.
     Without it text can look slightly fuzzy on some screens. */
}

/* ── Fonts ──────────────────────────────────────────────────
   Space Grotesk and JetBrains Mono are Google Fonts.
   We load them from Google's servers — no download needed.
   This goes in the HTML <head>, not here.
──────────────────────────────────────────────────────────── */


/* ── Nav ────────────────────────────────────────────────────
   position: sticky keeps the nav at the top of the viewport
   as you scroll. top: 0 means it sticks to the very top.
   z-index: 100 keeps it above other elements — without this
   content would scroll over the top of it.
──────────────────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 40px;
  background-color: var(--bg);
  border-bottom: 1px solid var(--line);
}

.nav__logo {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
  font-family: var(--font-mono);
  letter-spacing: -0.04em;
}

.nav__logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
}

.nav__logo-mark {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex-shrink: 0;
}

/* Green availability dot in the corner of the tile */
.nav__logo-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid var(--bg);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.nav__logo-wordmark {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.025em;
  display: inline-flex;
  align-items: baseline;
  gap: 1px;
}

.nav__logo-dev {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.nav__links {
  display: flex;
  gap: 32px;
  list-style: none;
}

.nav__links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.2s;
  /* transition animates the change from muted to fg
     over 0.2 seconds when you hover. Without it the
     colour snaps instantly which feels cheap. */
}

.nav__links a:hover {
  color: var(--fg);
}

.nav__cta {
  padding: 10px 20px;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: var(--radius-full);
  font-size: 0.85rem;
  font-weight: 600;
  transition: opacity 0.2s;
}

.nav__cta:hover {
  opacity: 0.8;
}

/* ── Hero ───────────────────────────────────────────────────
   The hero fills the full viewport width — no max-width here.
   max-width is on .hero__content instead so the glow divs
   can extend beyond the content boundary without being clipped.
   overflow: hidden stops the glows from causing a scrollbar.
──────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 40px;
  gap: 24px;
  overflow: hidden;
}

/* Content wrapper — max-width contains the text and buttons
   position: relative and z-index: 1 keep content above
   the canvas and glow layers which sit at z-index: 0 */
.hero__content {
  position: relative;
  z-index: 1;
  max-width: 1000px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* The small code-style label above the title */
.hero__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  letter-spacing: 0.02em;
}

.hero__title {
  font-size: clamp(72px, 12vw, 180px);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.045em;
  color: var(--fg);
  margin: 0;
}

.hero__title-line {
  display: block;
}

.hero__title-word {
  display: block;
  font-style: italic;
  white-space: nowrap;
  min-height: 1em;
  background: linear-gradient(120deg, #7c5cff, #22d3ee, #f59e0b, #7c5cff);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: gradient 6s ease infinite;
}

@keyframes gradient {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero__sub {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 520px;
  line-height: 1.7;
}

/* ── Buttons ─────────────────────────────────────────────────
   Two button styles — primary (filled) and ghost (outlined).
   Both share base styles via .btn, then each variant adds
   its own visual treatment. This avoids repeating padding,
   border-radius, font-size on every button.
──────────────────────────────────────────────────────────── */
.hero__actions {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  /* flex-wrap: wrap means if buttons don't fit on one line
     on a small screen they wrap to the next line instead
     of overflowing off screen. */
}

/* ── Buttons ─────────────────────────────────────────────────
   Two button styles — primary (filled) and ghost (outlined).
   Both share base styles via .btn, then each variant adds
   its own visual treatment. This avoids repeating padding,
   border-radius, font-size on every button.
──────────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  transition: opacity 0.2s, transform 0.2s;
  cursor: pointer;
  border: none;
}

.btn:hover {
  opacity: 0.85;
  transform: translateY(-2px);
  /* translateY(-2px) moves the button 2px upward on hover.
     Combined with opacity it gives a subtle lift effect.
     transform does not affect layout — it only moves the
     visual rendering, so nothing else shifts around it. */
}

.btn--primary {
  background-color: var(--accent);
  color: #fff;
}

.btn--ghost {
  background-color: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}

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

/* ── Glow layers ─────────────────────────────────────────────
   Two large blurred circles positioned absolutely at the
   edges of the hero. filter: blur() spreads the colour
   outward creating a soft ambient glow effect.
   pointer-events: none means mouse interactions pass through
   them to the content underneath.
──────────────────────────────────────────────────────────── */
.hero__glow {
  position: absolute;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
}

.hero__glow--right {
  background: radial-gradient(circle, rgba(124, 92, 255, 0.2), transparent 70%);
  right: -100px;
  top: 50%;
  transform: translateY(-50%);
  /* translateY(-50%) centres the glow vertically
     relative to the hero height */
}

.hero__glow--left {
  background: radial-gradient(circle, rgba(34, 211, 238, 0.1), transparent 70%);
  left: -100px;
  bottom: 20%;
}

/* ── Particle canvas ─────────────────────────────────────────
   The canvas sits behind all hero content using position
   absolute. It fills the entire hero section.
   pointer-events: none means mouse clicks pass straight
   through it to the elements underneath.
──────────────────────────────────────────────────────────── */
#particle-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

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

.hero__badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid;
}

.hero__badge--purple {
  background-color: rgba(124, 92, 255, 0.15);
  color: #a78bfa;
  border-color: rgba(124, 92, 255, 0.3);
}

.hero__badge--teal {
  background-color: rgba(34, 211, 238, 0.1);
  color: #22d3ee;
  border-color: rgba(34, 211, 238, 0.25);
}

.hero__badge--amber {
  background-color: rgba(251, 191, 36, 0.1);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.25);
}

/* ── About ──────────────────────────────────────────────────*/
.about {
  padding: 120px 40px;
  max-width: 1100px;
  margin: 0 auto;
  /* margin: 0 auto centres a block element horizontally.
     0 = no top/bottom margin, auto = equal left/right margin.
     Only works when the element has a defined max-width. */
}

.about__grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 80px;
  align-items: start;
  /* align-items: start means columns align to the top
     instead of stretching to equal height */
}

/* ── Photo column ───────────────────────────────────────────*/
.about__photo-wrap {
  position: relative;
  /* This is the reference point for the badge cards.
     Any position: absolute child positions itself
     relative to this element. */
}

.about__photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  /* aspect-ratio maintains proportions automatically.
     3/4 means for every 3 units of width, height is 4 units.
     Portrait photo proportions. */
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  font-weight: 800;
  color: var(--accent);
  font-family: var(--font-mono);
}

.about__badge {
  position: absolute;
  /* Removed from normal flow, positioned relative
     to .about__photo-wrap */
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--fg);
  white-space: nowrap;
  /* white-space: nowrap stops the badge text wrapping
     onto multiple lines */
}

.about__badge--tl {
  top: 20px;
  left: -16px;
  /* Positioned 20px from top of photo wrap
     and 16px outside the left edge */
}

.about__badge--br {
  bottom: 20px;
  right: -16px;
}

/* ── Content column ─────────────────────────────────────────*/
.about__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.about__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.04em;
  margin-bottom: 24px;
}

.about__bio {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 480px;
}

/* ── Facts grid ─────────────────────────────────────────────*/
.about__facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.about__fact {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px;
  transition: transform 0.3s, border-color 0.3s;
}

.about__fact:hover {
  transform: translateY(-3px) rotate(-1deg);
  border-color: rgba(124, 92, 255, 0.4);
}

.about__fact-n {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin-bottom: 4px;
}

.about__fact-l {
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Projects ───────────────────────────────────────────────*/
.projects {
  padding: 120px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.projects__header {
  margin-bottom: 60px;
}

.projects__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.projects__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

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

/* ── Project card ───────────────────────────────────────────*/
.project-card {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: transform 0.3s, border-color 0.3s;
  text-decoration: none;
  color: var(--fg);
}

.project-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.4);
}

.project-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.project-card__id {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

.project-card__status {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(124, 92, 255, 0.15);
  color: var(--accent);
}

.project-card__status--live {
  background-color: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.project-card__title {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.project-card__desc {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.7;
  flex: 1;
  /* flex: 1 makes this element grow to fill available space.
     This pushes the tags to the bottom of every card
     regardless of description length — cards stay aligned. */
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project-card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

/* ── Experience ─────────────────────────────────────────────*/
.experience {
  padding: 120px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.experience__header {
  margin-bottom: 60px;
}

.experience__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.experience__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

/* ── Timeline ───────────────────────────────────────────────*/
.experience__timeline {
  position: relative;
  padding-left: 32px;
}

.experience__timeline::before {
  /* This creates the vertical line running down the left side.
     ::before inserts a virtual element before the timeline's
     content. We stretch it to full height with absolute
     positioning. */
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background-color: var(--line);
}

.experience__item {
  position: relative;
  padding-bottom: 48px;
}

.experience__item:last-child {
  padding-bottom: 0;
  /* Remove bottom padding from the last item
     so there is no extra space at the end */
}

.experience__item::before {
  /* This creates the dot on the timeline line
     for each experience entry */
  content: "";
  position: absolute;
  left: -36px;
  /* Negative left pulls it outside the item's padding
     to sit on the vertical line */
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  /* border-radius: 50% makes a square into a circle */
  background-color: var(--accent);
  border: 2px solid var(--bg);
  /* The border gap between the dot and the line
     makes it look like the dot sits on top of the line
     rather than merging with it */
}

.experience__item-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
  gap: 16px;
}

.experience__role {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--fg);
}

.experience__company {
  font-size: 0.875rem;
  color: var(--accent);
  margin-top: 2px;
}

.experience__period {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.experience__points {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.experience__point {
  font-size: 0.875rem;
  color: var(--muted);
  line-height: 1.6;
  padding-left: 16px;
  position: relative;
}

.experience__point::before {
  /* Small arrow before each bullet point */
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
  font-family: var(--font-mono);
}

/* ── Contact ────────────────────────────────────────────────*/
.contact {
  padding: 120px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.contact__inner {
  display: flex;
  flex-direction: column;
  gap: 24px;
  max-width: 640px;
}

.contact__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
}

.contact__title {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.contact__sub {
  color: var(--muted);
  line-height: 1.8;
  font-size: 1rem;
  max-width: 480px;
}

.contact__email {
  font-size: clamp(1rem, 2.5vw, 1.4rem);
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  font-family: var(--font-mono);
  border-bottom: 1px solid rgba(124, 92, 255, 0.3);
  padding-bottom: 4px;
  align-self: flex-start;
  transition: border-color 0.2s;
}

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

.contact__socials {
  display: flex;
  gap: 16px;
}

.contact__social {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.2s;
}

.contact__social:hover {
  color: var(--fg);
}

/* ── Footer ─────────────────────────────────────────────────*/
.footer {
  padding: 32px 40px;
  border-top: 1px solid var(--line);
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
  font-family: var(--font-mono);
}

/* ── Blog ───────────────────────────────────────────────────*/
.blog {
  padding: 120px 40px;
  max-width: 1100px;
  margin: 0 auto;
}

.blog__header {
  margin-bottom: 60px;
}

.blog__tag {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.blog__title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 800;
  letter-spacing: -0.04em;
}

.blog__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 24px;
}

.blog-card {
  background-color: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: var(--fg);
  transition: transform 0.3s, border-color 0.3s;
}

.blog-card:hover {
  transform: translateY(-6px);
  border-color: rgba(124, 92, 255, 0.4);
}

.blog-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.blog-card__tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(124, 92, 255, 0.15);
  color: var(--accent);
}

.blog-card__status--coming-soon {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.blog-card__title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.4;
  flex: 1;
}

.blog-card__meta {
  display: flex;
  gap: 16px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--muted);
}

/* ── Scroll reveal animation ────────────────────────────────
   Elements start invisible and slightly below their final
   position. When JavaScript adds the visible class they
   transition to full opacity and correct position.
   transform: translateY(30px) moves them 30px down initially.
   This creates the "rising into view" effect on scroll.
──────────────────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

.project-card__status--complete {
  background-color: rgba(99, 102, 241, 0.15);
  color: #818cf8;
}

.project-card__status--planned {
  background-color: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

/* ── Responsive ─────────────────────────────────────────────
   Media queries apply styles only when the screen matches
   the condition. max-width: 768px means "apply these styles
   when the screen is 768px wide or narrower" — tablet and
   mobile devices.
──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Nav — hide links, keep logo and CTA */
  .nav {
    padding: 16px 24px;
  }

  .nav__links {
    display: none;
    /* Hidden on mobile — hamburger menu is a future addition */
  }

  /* Hero — smaller padding */
  .hero {
    padding: 0 24px;
  }

  /* About — stack columns vertically instead of side by side */
  .about {
    padding: 80px 24px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    /* Single column — photo on top, content below */
    gap: 48px;
  }

  .about__photo-wrap {
    max-width: 280px;
    margin: 0 auto;
  }

  /* Projects */
  .projects {
    padding: 80px 24px;
  }

  /* Experience */
  .experience {
    padding: 80px 24px;
  }

  .experience__item-header {
    flex-direction: column;
    gap: 4px;
  }

  /* Blog */
  .blog {
    padding: 80px 24px;
  }

  /* Contact */
  .contact {
    padding: 80px 24px;
  }

  /* Footer */
  .footer {
    padding: 24px;
  }
}