/* =====================================================================
   PORTFOLIO — style.css
   Dark minimal developer portfolio
   Accent: #5B8DEF (cold slate-blue)
   Fonts: JetBrains Mono (display) · Inter (body)
   ===================================================================== */

/* ── RESET & ROOT ──────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* Colors */
  --bg:          #0d0d0f;        /* near-black background */
  --bg-alt:      #111215;        /* slightly lighter, for alternate sections */
  --surface:     #18191d;        /* card / elevated surfaces */
  --border:      #25262b;        /* subtle borders */
  --text:        #e8e8ea;        /* primary text */
  --text-muted:  #6c6d72;        /* secondary / muted text */
  --accent:      #5B8DEF;        /* cold slate-blue */
  --accent-dim:  rgba(91,141,239,0.12);

  /* Theme variables */
  --hero-grad-start: #ffffff;
  --hero-grad-end: #9bafc8;
  --nav-bg: rgba(13,13,15,0.92);
  --border-accent: rgba(91,141,239,0.2);

  /* Typography scale */
  --font-display: 'JetBrains Mono', monospace;
  --font-body:    'Inter', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  2rem;
  --text-4xl:  3rem;
  --text-hero: clamp(3.5rem, 10vw, 7.5rem);

  /* Spacing */
  --section-pad: clamp(5rem, 10vw, 9rem);
  --container:   1100px;
  --nav-h:       64px;

  /* Transitions */
  --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

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

ul {
  list-style: none;
}

/* ── UTILITY ───────────────────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section {
  padding-block: var(--section-pad);
}

.section-alt {
  background-color: var(--bg-alt);
}

/* Section headings */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 3rem;
  position: relative;
  display: inline-block;
}

/* Blue underline accent under section titles */
.section-title::after {
  content: '';
  display: block;
  width: 2.5rem;
  height: 2px;
  background: var(--accent);
  margin-top: 0.5rem;
}

/* ── FADE-UP ANIMATION ─────────────────────────────────────────────── */
/* Elements start invisible; script.js adds .visible when in viewport */
.fade-up {
  opacity: 0;
  transform: translateY(28px);
  transition:
    opacity  0.6s var(--ease) var(--delay, 0s),
    transform 0.6s var(--ease) var(--delay, 0s);
}

.fade-up.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Respect user preference for reduced motion */
@media (prefers-reduced-motion: reduce) {
  .fade-up {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ── NAVIGATION ────────────────────────────────────────────────────── */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  /* starts transparent; script.js adds .scrolled for solid bg */
  transition: background-color 0.3s var(--ease), box-shadow 0.3s var(--ease);
}

.navbar.scrolled {
  background-color: var(--nav-bg, rgba(13,13,15,0.92));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--border);
}

.nav-inner {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo / brand mark */
.nav-logo {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.02em;
  transition: opacity 0.2s;
}

.nav-logo:hover {
  opacity: 0.75;
}

/* Desktop nav links */
.nav-links {
  display: flex;
  gap: 2.25rem;
  align-items: center;
}

.nav-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.02em;
  transition: color 0.2s;
  position: relative;
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.25s var(--ease);
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
}

.nav-link:hover::after,
.nav-link.active::after {
  width: 100%;
}

/* Hamburger button */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.3s var(--ease), opacity 0.3s;
}

/* Hamburger → X when open */
.hamburger.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* ── HERO ──────────────────────────────────────────────────────────── */
#hero {
  min-height: 100svh;
  display: flex;
  align-items: center;
  padding-top: calc(var(--nav-h) + 2rem);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4rem;
  align-items: center;
}

/* Eyebrow */
.hero-eyebrow {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
}

/* Large name — the signature typographic moment */
.hero-name {
  font-family: var(--font-display);
  font-size: var(--text-hero);
  font-weight: 700;
  line-height: 0.9;
  letter-spacing: -0.04em;
  margin-bottom: 1.25rem;
  /* Very subtle gradient on the name for depth */
  background: linear-gradient(135deg, var(--hero-grad-start, #ffffff) 60%, var(--hero-grad-end, #9bafc8));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-title {
  font-size: var(--text-xl);
  font-weight: 300;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.hero-intro {
  max-width: 48ch;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
  line-height: 1.8;
}

/* CTA buttons */
.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.7em 1.6em;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  border-radius: 4px;
  transition: all 0.22s var(--ease);
  cursor: pointer;
  border: 1px solid transparent;
  letter-spacing: 0.02em;
}

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

.btn-primary:hover {
  background: #7aa5f5;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(91,141,239,0.3);
}

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

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

/* Profile image placeholder */
.hero-image-wrap {
  flex-shrink: 0;
}

.profile-img-placeholder {
  width: clamp(200px, 22vw, 300px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  /* Replace this whole element with an <img> tag */
}

.hero-image-wrap img {
    width: 400px;
    height: 400px;
    border-radius: 150%;
    object-fit: cover;
}
.placeholder-icon {
  font-size: 3.5rem;
  opacity: 0.3;
}

.placeholder-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* Actual photo (once replaced) */
.profile-img-placeholder img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* ── ABOUT ─────────────────────────────────────────────────────────── */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: start;
}

.about-bio p {
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.85;
}

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

/* Meta blocks (education, skills) */
.meta-block {
  margin-bottom: 2rem;
}

.meta-block:last-child {
  margin-bottom: 0;
}

.meta-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}

.meta-value {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: 0.15rem;
}

.meta-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Skill tags */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.skill-tag {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  padding: 0.3em 0.8em;
  border-radius: 3px;
  background: var(--accent-dim);
  color: var(--accent);
  border: 1px solid var(--border-accent, rgba(91,141,239,0.2));
  letter-spacing: 0.04em;
}

/* ── PROJECTS ──────────────────────────────────────────────────────── */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.project-card:hover {
  border-color: rgba(91,141,239,0.35);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
}

/* Image placeholder */
.project-img-placeholder {
  height: 180px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  color: var(--text-muted);
  /* Replace with: <img src="screenshot.png" alt="Project name" /> */
}
.project-img-placeholder img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.project-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 0.6rem;
  letter-spacing: -0.01em;
}

.project-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1rem;
}

.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1.25rem;
}

.stack-tag {
  font-family: var(--font-display);
  font-size: 0.7rem;
  padding: 0.25em 0.65em;
  border-radius: 3px;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

.project-link {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--accent);
  transition: opacity 0.2s, letter-spacing 0.2s;
  align-self: flex-start;
}

.project-link:hover {
  opacity: 0.75;
  letter-spacing: 0.04em;
}

/* ── TIMELINE ──────────────────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 2rem;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  padding-bottom: 3rem;
}

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

/* Dot on the line */
.timeline-dot {
  position: absolute;
  left: calc(-2rem - 4px);   /* centres on the 1px border-left line */
  top: 6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 1px var(--accent);
}

.timeline-date {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.35rem;
}

.timeline-role {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.timeline-org {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.timeline-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  max-width: 60ch;
  line-height: 1.75;
}

/* ── CONTACT ───────────────────────────────────────────────────────── */
.contact-wrap {
  text-align: center;
}

.contact-sub {
  color: var(--text-muted);
  max-width: 46ch;
  margin-inline: auto;
  margin-bottom: 3rem;
  font-size: var(--text-lg);
  line-height: 1.7;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.25rem;
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1.75rem 2rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-width: 160px;
  transition: border-color 0.25s, transform 0.25s var(--ease), box-shadow 0.25s;
}

.contact-item:hover {
  border-color: rgba(91,141,239,0.4);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4);
}

.contact-icon {
  width: 2rem;
  height: 2rem;
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
}

.contact-icon svg {
  width: 100%;
  height: 100%;
}

.contact-label {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text);
}

/* ── FOOTER ────────────────────────────────────────────────────────── */
.footer {
  padding-block: 2rem;
  text-align: center;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

/* ── RESPONSIVE — TABLET (≤ 900px) ────────────────────────────────── */
@media (max-width: 900px) {

  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-image-wrap {
    order: -1;    /* photo above text on tablet/mobile */
    display: flex;
    justify-content: center;
  }

  .hero-intro {
    margin-inline: auto;
  }

  .hero-actions {
    justify-content: center;
  }

  .about-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

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

/* ── RESPONSIVE — MOBILE (≤ 640px) ────────────────────────────────── */
@media (max-width: 640px) {

  /* Show hamburger, hide desktop links */
  .hamburger {
    display: flex;
  }

  .nav-links {
    /* Off-screen by default */
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    background: var(--bg);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    font-size: var(--text-lg);
    transform: translateX(100%);
    transition: transform 0.35s var(--ease);
    pointer-events: none;
  }

  .nav-links.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .section-title {
    font-size: var(--text-2xl);
  }

  .timeline {
    padding-left: 1.5rem;
  }

  .contact-links {
    flex-direction: column;
    align-items: center;
  }

  .contact-item {
    width: 100%;
    max-width: 320px;
  }
}

/* ── LIGHT THEME VARIABLES ────────────────────────────────────────── */
[data-theme="light"] {
  --bg:          #f5f6f9;
  --bg-alt:      #ffffff;
  --surface:     #ffffff;
  --border:      #e2e4e9;
  --text:        #121316;
  --text-muted:  #686a73;
  --accent:      #3b71db;
  --accent-dim:  rgba(59,113,219,0.1);
  --hero-grad-start: #121316;
  --hero-grad-end: #4b5a75;
  --nav-bg: rgba(245,246,249,0.92);
  --border-accent: rgba(59,113,219,0.15);
}

/* ── FEATURE 1: THEME TOGGLE ──────────────────────────────────────── */
.theme-toggle {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s var(--ease), transform 0.25s var(--ease);
  border-radius: 50%;
  outline: none;
  margin-left: auto;
  margin-right: 1rem;
}

.theme-toggle:hover {
  color: var(--text);
  transform: scale(1.1);
}

.theme-toggle:active {
  transform: scale(0.95);
}

.theme-toggle-icon {
  transition: transform 0.5s var(--ease);
}

.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

.theme-toggle .sun-icon {
  display: none;
}

.theme-toggle .moon-icon {
  display: block;
}

[data-theme="light"] .theme-toggle .sun-icon {
  display: block;
}

[data-theme="light"] .theme-toggle .moon-icon {
  display: none;
}

.theme-transition,
.theme-transition * {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease !important;
}

@media (min-width: 641px) {
  .nav-links {
    margin-left: auto;
  }
  .theme-toggle {
    margin-left: 1.5rem;
    margin-right: 0;
  }
}

/* ── FEATURE 2: FLOATING EASTER EGG ───────────────────────────────── */
.easter-egg {
  position: fixed;
  z-index: 9999;
  width: 60px;
  height: 60px;
  cursor: pointer;
  pointer-events: auto;
  user-select: none;
  filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
  transition: transform 0.2s ease-out;
  left: 0;
  top: 0;
  will-change: transform;
}

.easter-egg:active {
  transform: scale(0.9);
}

.easter-egg-tooltip {
  position: absolute;
  bottom: 70px;
  left: 50%;
  transform: translateX(-50%) scale(0.8);
  background: var(--surface);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--border);
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s var(--ease), transform 0.2s var(--ease);
}

.easter-egg-tooltip.show {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}
