/*
  Theme colors — change these to re-skin the whole site.
  --primary/--secondary form the gradient used on headings, buttons, and dots.
  --accent/--accent-2 are used sparingly for highlights (eyebrow text, tags, bars).
*/
:root {
  --bg: #0f1020;
  --bg-soft: #16172c;
  --card: #1b1c34;
  --text: #f4f3fb;
  --text-dim: #b6b4d6;
  --primary: #2563eb;
  --secondary: #7c3aed;
  --accent: #f59e0b;
  --accent-2: #10b981;
  --radius: 18px;
  --max-width: 1100px;
  --shadow: 0 10px 30px rgba(0,0,0,0.35);

  /*
    Vertical rhythm. --section-y is the padding on each side of a section, so
    the gap a reader actually sees between two sections is twice this value:
    about 88px on a phone rising to 136px on a wide screen. It scales with the
    viewport, which is why no breakpoint has to override it.
  */
  --section-y: clamp(44px, 6vw, 68px);
  --section-x: 24px;
  /* Space between a section's heading block and its content. Kept tight: the
     heading and what follows are one unit, and the section padding above
     already separates them from the previous section. */
  --head-gap: clamp(18px, 2.2vw, 28px);
  /* Shared gap for the card grids, so Skills, Languages and Projects match. */
  --grid-gap: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: 'Poppins', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  position: relative;
}

/* Soft blurred color shapes fixed behind the content — purely decorative */
.blob {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.35;
  z-index: 0;
  pointer-events: none;
}
.blob-1 { width: 420px; height: 420px; background: var(--primary); top: -120px; left: -120px; }
.blob-2 { width: 500px; height: 500px; background: var(--secondary); top: 30%; right: -180px; }
.blob-3 { width: 380px; height: 380px; background: var(--accent-2); bottom: -150px; left: 20%; }

a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* Navbar — sticky bar with logo, section links, and mobile hamburger toggle */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
  background: rgba(15, 16, 32, 0.75);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.nav-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 700;
  font-size: 1.4rem;
  letter-spacing: 1px;
}
.logo span { color: var(--primary); }
.nav-links {
  display: flex;
  gap: 28px;
}
.nav-links a {
  font-weight: 500;
  color: var(--text-dim);
  transition: color 0.2s;
  position: relative;
}
.nav-links a:hover { color: var(--text); }
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
}

/* Hero — name, tagline, CTA buttons, and avatar frame at the top of the page */
.hero {
  max-width: var(--max-width);
  margin: 0 auto;
  /* Bottom padding matches --section-y so the hero-to-About gap is identical
     to every section-to-section gap below it. */
  padding: clamp(64px, 7vw, 96px) var(--section-x) var(--section-y);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  z-index: 1;
  /* No min-height: it centred the content inside a 70vh box and left ~150px
     of slack, making the hero-to-About gap twice every other gap. The hero's
     height now comes from its content and padding, like every section. */
}
.hero-content { flex: 1; max-width: 600px; }
.eyebrow {
  color: var(--accent);
  font-weight: 600;
  letter-spacing: 2px;
  text-transform: uppercase;
  font-size: 0.85rem;
  margin: 0 0 12px;
}
.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  margin: 0;
  line-height: 1.05;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.role {
  font-size: clamp(1.2rem, 3vw, 1.8rem);
  margin: 8px 0 20px;
  color: var(--text);
  font-weight: 600;
}
.hero-text {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.7;
  margin-bottom: 30px;
}
.hero-actions {
  display: flex;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.btn {
  display: inline-block;
  padding: 14px 28px;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.2s, box-shadow 0.2s;
  font-size: 0.95rem;
}
.btn:hover { transform: translateY(-3px); }
.btn-primary {
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  color: #fff;
  box-shadow: 0 8px 20px rgba(124, 58, 237, 0.4);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 2px solid rgba(255,255,255,0.25);
}
.btn-outline:hover { border-color: var(--accent); }
.socials {
  display: flex;
  gap: 14px;
}
.socials a {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  border: 1px solid rgba(255,255,255,0.08);
  transition: transform 0.2s, background 0.2s;
}
.socials a:hover {
  transform: translateY(-4px);
  background: var(--secondary);
}

.hero-visual { flex-shrink: 0; }
.avatar-frame {
  width: 260px;
  height: 260px;
  border-radius: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  padding: 6px;
  box-shadow: var(--shadow);
  /* The tile used to be an abstract "NG" monogram, where a 4deg tilt read as
     playful. With a real headshot it reads as crooked, so it sits straight.
     Restore with: transform: rotate(4deg); */
  overflow: hidden;
}
.avatar-frame picture { display: block; height: 100%; }
.avatar-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 34px;
  display: block;
}

/* Shared layout for every content section (About, Skills, Languages, etc.) */
.section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: var(--section-y) var(--section-x);
  position: relative;
  z-index: 1;
}
.section-head { margin-bottom: var(--head-gap); }
.tag {
  display: inline-block;
  background: var(--card);
  color: var(--accent-2);
  padding: 6px 16px;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  margin: 0;
}

/* About — bio paragraph on top, the work-permit card below it */
.about-grid {
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.about-text {
  color: var(--text-dim);
  font-size: 1.05rem;
  line-height: 1.8;
  /* A paragraph's default 1em margin stacked on top of --head-gap and made
     the heading-to-text gap noticeably larger here than in other sections.
     The parent uses gap for spacing, so no margin is wanted at all. */
  margin: 0;
}
.info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* the highlighted item spans both columns, the rest pair up */
  gap: 16px;
}
.info-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px 22px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  border: 1px solid rgba(255,255,255,0.06);
}
/* Work permit: full width and tinted, so it's read before anything else */
.info-item--highlight {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, rgba(16,185,129,0.14), rgba(37,99,235,0.14));
  border-color: rgba(16,185,129,0.35);
}
.info-item--highlight .info-value { font-weight: 600; }
.info-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-2);
}
.info-value {
  color: var(--text);
  font-weight: 500;
  text-align: left;
  line-height: 1.5;
}

/* Skills — category cards, one per skill group (Frontend, Reporting, etc.) */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--grid-gap);
}
.skill-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 30px 24px;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}
.skill-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}
.skill-icon { font-size: 2.2rem; margin-bottom: 14px; }
.skill-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.skill-card p { color: var(--text-dim); margin: 0; font-size: 0.92rem; line-height: 1.6; }

/* Timeline — shared by the Experience and Education sections (vertical line + dots) */
.timeline {
  position: relative;
  padding-left: 30px;
  border-left: 2px solid rgba(255,255,255,0.1);
}
.timeline-item { position: relative; padding-bottom: 44px; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-dot {
  position: absolute;
  left: -38px;
  top: 4px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  box-shadow: 0 0 0 4px var(--bg);
}
.timeline-date {
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.5px;
}
.timeline-content h3 { margin: 6px 0 2px; font-size: 1.2rem; }
.timeline-org { color: var(--text-dim); font-weight: 600; margin: 0 0 10px; }
.timeline-bullets {
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-bullets li {
  color: var(--text-dim);
  line-height: 1.6;
  font-size: 0.95rem;
  padding-left: 18px;
  position: relative;
}
.timeline-bullets li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Languages — one card per language with a proficiency bar (width set inline via style.js) */
.languages-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--grid-gap);
}
.language-item {
  background: var(--card);
  border-radius: var(--radius);
  padding: 22px 24px;
  border: 1px solid rgba(255,255,255,0.06);
}
.language-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.language-name { font-weight: 700; font-size: 1.05rem; }
.language-level { color: var(--text-dim); font-size: 0.85rem; text-align: right; }
.language-bar {
  height: 8px;
  border-radius: 50px;
  background: rgba(255,255,255,0.08);
  overflow: hidden;
}
.language-fill {
  height: 100%;
  border-radius: 50px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

/* Projects — placeholder cards for now; real project data goes in content.js */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--grid-gap);
}
.project-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255,255,255,0.06);
  transition: transform 0.25s, box-shadow 0.25s;
}
.project-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow);
}
.project-thumb { height: 160px; overflow: hidden; background: var(--bg-soft); }
.project-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.project-card:hover .project-thumb img { transform: scale(1.04); }
.thumb-1 { background: linear-gradient(135deg, var(--primary), var(--secondary)); }
.thumb-2 { background: linear-gradient(135deg, var(--accent), var(--primary)); }
.thumb-3 { background: linear-gradient(135deg, var(--accent-2), var(--secondary)); }
.project-body { padding: 22px; }
.project-body h3 { margin: 0 0 8px; }
.project-body p { color: var(--text-dim); font-size: 0.92rem; line-height: 1.6; margin: 0 0 14px; }

/* Tech stack chips */
.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
}
.project-tags li {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.3px;
  color: var(--text-dim);
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 999px;
  padding: 4px 11px;
}

.project-links { display: flex; flex-wrap: wrap; gap: 18px; }
.project-link { color: var(--accent-2); font-weight: 600; font-size: 0.9rem; }
.project-link:hover { color: var(--accent); }
/* The demo is the primary action, so it gets the underline the repo link doesn't */
.project-link--demo { text-decoration: underline; text-underline-offset: 4px; }

/* Contact — direct details + message form (submits via the relay set in content.js) */
.contact-wrap {
  display: flex;
  gap: clamp(32px, 4vw, 48px);
  flex-wrap: wrap;
}
.contact-info {
  flex: 1;
  min-width: 260px;
}
.contact-text {
  color: var(--text-dim);
  line-height: 1.8;
  font-size: 1.05rem;
  margin: 0 0 26px;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin: 0 0 20px;
  padding: 0;
}
.contact-details li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 20px;
  border: 1px solid rgba(255,255,255,0.06);
  flex-wrap: wrap;
}
.detail-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--accent-2);
}
.contact-details a,
.contact-details span:last-child {
  color: var(--text);
  font-weight: 500;
}
.contact-details a:hover { color: var(--accent); }
.contact-refs {
  color: var(--text-dim);
  font-size: 0.85rem;
  font-style: italic;
  margin: 0;
}
.contact-form {
  flex: 2;
  min-width: 280px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.form-row input { flex: 1; min-width: 200px; }
.contact-form input,
.contact-form textarea {
  background: var(--card);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 12px;
  padding: 14px 18px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  resize: vertical;
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--secondary);
}
.contact-form button { align-self: flex-start; }
.contact-form button:disabled { opacity: 0.6; cursor: progress; }
.form-note {
  color: var(--text-dim);
  font-size: 0.9rem;
  margin: 0;
  min-height: 1.2em;
}
.form-note.is-success { color: var(--accent-2); }
.form-note.is-error { color: #f87171; }

/* Off-screen rather than display:none — bots skip fields that aren't rendered */
.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Scroll reveal — script.js sets the hidden state inline, then adds .in-view */
.section.in-view {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* Footer */
.footer {
  text-align: center;
  padding: clamp(28px, 4vw, 40px) var(--section-x);
  margin-top: var(--section-y);
  border-top: 1px solid rgba(255,255,255,0.06);
  color: var(--text-dim);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* Responsive breakpoints */
@media (max-width: 820px) {
  /* Below tablet width: collapse the nav into a hamburger menu, stack the hero, and drop the personal-details grid to a single column */
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .nav-links.open {
    display: flex;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-soft);
    flex-direction: column;
    padding: 20px 24px;
    gap: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
  /*
    On a phone the hero has to fit one screen, photo included — otherwise the
    portrait is cut in half on landing. Everything below is tightened just
    enough to bring the photo above the fold on a 393x730 viewport.
  */
  .hero {
    flex-direction: column;
    text-align: center;
    padding-top: 16px;
    gap: 16px;
  }
  .hero-actions, .socials { justify-content: center; }
  .eyebrow { margin-bottom: 8px; }
  .role { margin: 6px 0 10px; }
  .hero-text { font-size: 1rem; margin-bottom: 16px; }
  .hero-actions { margin-bottom: 16px; }
  .avatar-frame { width: 140px; height: 140px; border-radius: 30px; }
  .avatar-photo { border-radius: 26px; }
  .contact-details li { flex-direction: column; align-items: flex-start; text-align: left; }
  .info-grid { grid-template-columns: 1fr; }
}

/*
  Short phone screens (iPhone SE, older Androids). The limiting dimension here
  is height, not width, so this keys off height: the hero is compressed a
  little further only where it actually has to be, leaving taller phones with
  the roomier layout above.
*/
@media (max-width: 820px) and (max-height: 700px) {
  .hero { gap: 12px; padding-top: 12px; }
  .hero-text { font-size: 0.94rem; line-height: 1.55; margin-bottom: 12px; }
  .hero-actions { margin-bottom: 12px; }
  .role { margin: 4px 0 8px; }
  .avatar-frame { width: 118px; height: 118px; border-radius: 26px; }
  .avatar-photo { border-radius: 22px; }
}

@media (min-width: 821px) and (max-width: 1000px) {
  /* Tablet range: personal-details grid drops from 3 columns to 2 before the mobile breakpoint kicks in */
  .info-grid { grid-template-columns: repeat(2, 1fr); }
}
