:root {
  --blue-deep:   #0a56b0;
  --blue-bright: #4d9fff;
  --blue-glow:   #7cd4ff;
  --ink:         #eef3fc;
  --ink-soft:    #9fb0cc;
  --ink-faint:   #5b6c8c;
  --bg:          #05070d;

  --glass-bg:     rgba(255, 255, 255, 0.045);
  --glass-bg-hi:  rgba(255, 255, 255, 0.075);
  --glass-border: rgba(148, 187, 233, 0.16);
  --line:         rgba(148, 187, 233, 0.12);

  --font-display: 'Sora', 'Segoe UI', sans-serif;
  --font-body: 'Inter', 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  --content-width: 1080px;
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--blue-bright);
  outline-offset: 3px;
  border-radius: 4px;
}

::selection {
  background: var(--blue-bright);
  color: var(--bg);
}

/* ---------- aurora background ---------- */

.aurora {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.55;
}

.aurora-a {
  width: 560px;
  height: 560px;
  top: -180px;
  left: -120px;
  background: radial-gradient(circle, var(--blue-deep), transparent 70%);
}

.aurora-b {
  width: 620px;
  height: 620px;
  top: 10%;
  right: -220px;
  background: radial-gradient(circle, var(--blue-bright), transparent 70%);
  opacity: 0.35;
}

.aurora-c {
  width: 500px;
  height: 500px;
  bottom: -160px;
  left: 20%;
  background: radial-gradient(circle, var(--blue-glow), transparent 70%);
  opacity: 0.22;
}

/* ===================================================================
   Navbar
   =================================================================== */

.navbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem clamp(1.25rem, 4vw, 3rem);
  background: rgba(5, 7, 13, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--ink);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav-links {
  display: flex;
  gap: 2rem;
}

.nav-links a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color 0.15s ease;
}

.nav-links a:hover {
  color: var(--blue-glow);
}

.nav-actions {
  display: flex;
  gap: 0.75rem;
}

/* buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1.2rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: none;
  border: 1px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
  white-space: nowrap;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--blue-bright);
  color: var(--bg);
  box-shadow: 0 6px 20px rgba(77, 159, 255, 0.35);
}

.btn-primary:hover {
  background: var(--blue-glow);
}

.btn-ghost {
  background: var(--glass-bg);
  color: var(--ink);
  border-color: var(--glass-border);
  backdrop-filter: blur(8px);
}

.btn-ghost:hover {
  border-color: var(--blue-bright);
  color: var(--blue-glow);
}

.btn-lg {
  padding: 0.8rem 1.65rem;
  font-size: 0.95rem;
}

.glow-button:hover {
  box-shadow: 0 0 24px rgba(124, 212, 255, 0.30);
}

/* ===================================================================
   Hero
   =================================================================== */

.hero {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.25rem, 4vw, 3rem) clamp(3rem, 6vw, 5rem);
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  align-items: center;
  gap: 3rem;
}

.eyebrow {
  margin: 0 0 1rem;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--blue-glow);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(3rem, 7vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, var(--ink) 40%, var(--blue-glow) 130%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  min-height: 1.6em;
  margin: 1.5rem 0 0;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}

.hero-portrait {
  display: flex;
  justify-content: center;
}

.portrait-frame {
  position: relative;
  width: min(280px, 80%);
  aspect-ratio: 1;
  border-radius: 28px;
  padding: 6px;
  background: linear-gradient(160deg, var(--blue-bright), transparent 60%, var(--blue-deep));
  box-shadow: 0 20px 60px rgba(10, 86, 176, 0.35);
}

.profile-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 24px;
  display: block;
  background: var(--bg);
}

/* ===================================================================
   Panels / sections
   =================================================================== */

main {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 clamp(1.25rem, 4vw, 3rem) 4rem;
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
}

.kicker {
  margin: 0 0 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--blue-glow);
}

.panel {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: clamp(1.75rem, 4vw, 2.75rem);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.lede {
  margin: 0;
  max-width: 68ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}

/* ---------- projects bento ---------- */

.projects-section {
  padding-top: 0.5rem;
}

.bento {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.1rem;
}

.card {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 1.75rem;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  background: var(--glass-bg-hi);
  border-color: var(--blue-bright);
  transform: translateY(-2px);
}

.card-wide {
  grid-column: span 2;
}

.card h3 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
}

.card p {
  margin: 0;
  color: var(--ink-soft);
}

.card-links {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.card-links a {
  font-size: 0.88rem;
  color: var(--blue-bright);
  text-decoration: none;
}
.card-links li {
  counter-increment: item;
  font-size: 0.88rem;
  color: var(--blue-glow);
}

.card-links li::before {
  content: counter(item, decimal-leading-zero) ". ";
}

.card-links a:hover {
  color: var(--blue-glow);
  text-decoration: underline;
}

#dots {
  grid-column: span 2;
  text-align: center;
  color: var(--ink-faint);
  letter-spacing: 0.3em;
  font-family: var(--font-mono);
}

#more {
  display: none;
  grid-column: span 2;
}

#more.expanded {
  display: block;
  animation: reveal 0.4s ease;
}

#more .card {
  max-width: calc(50% - 0.55rem);
}

@keyframes reveal {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

#readMoreBtn {
  display: block;
  margin: 1.75rem auto 0;
  padding: 0.65rem 1.5rem;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  color: var(--ink);
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

#readMoreBtn:hover {
  border-color: var(--blue-bright);
  color: var(--blue-glow);
  background: var(--glass-bg-hi);
}

/* ---------- skills ---------- */

.skill-clusters {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.75rem 2.5rem;
}

.cluster h3 {
  margin: 0 0 0.75rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chips span {
  font-size: 0.82rem;
  color: var(--blue-glow);
  background: rgba(77, 159, 255, 0.10);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
}

/* ---------- footer ---------- */

footer {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 2rem clamp(1.25rem, 4vw, 3rem) 3rem;
  text-align: center;
  color: var(--ink-faint);
  font-size: 0.85rem;
}

/* ===================================================================
   Responsive
   =================================================================== */

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-actions {
    justify-content: center;
  }

  .hero-portrait {
    order: -1;
  }

  .nav-links {
    display: none;
  }
}

@media (max-width: 600px) {
  .bento {
    grid-template-columns: 1fr;
  }

  .card-wide {
    grid-column: span 1;
  }

  #dots,
  #more {
    grid-column: span 1;
  }

  #more .card {
    max-width: 100%;
  }

  .skill-clusters {
    grid-template-columns: 1fr;
  }

  .nav-actions .btn:last-child {
    display: none;
  }
}

/* Popup overlay */
.contact-popup {
  position: fixed;
  inset: 0;
  z-index: 9999;

  display: none;
  align-items: center;
  justify-content: center;

  padding: 1.5rem;

  background: rgba(5, 7, 13, 0.75);

  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}


/* Show popup */
.contact-popup.active {
  display: flex;
}


/* Popup container */
.contact-modal {
  position: relative;

  width: 100%;
  max-width: 560px;
  max-height: 90vh;

  overflow-y: auto;

  background: var(--glass-bg);

  border: 1px solid var(--glass-border);
  border-radius: var(--radius);

  padding: 1.75rem;

  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);

  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.45);

  animation: contactPopupIn 0.2s ease;
}


/* Popup animation */
@keyframes contactPopupIn {
  from {
    opacity: 0;
    transform: translateY(15px) scale(0.97);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}


/* Close button */
.close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;

  width: 32px;
  height: 32px;

  display: flex;
  align-items: center;
  justify-content: center;

  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;

  color: var(--ink-soft);

  font-size: 1.3rem;
  line-height: 1;

  cursor: pointer;

  transition:
    color 0.15s ease,
    border-color 0.15s ease,
    background 0.15s ease;
}

.close-btn:hover {
  color: var(--ink);
  border-color: var(--blue-bright);
  background: rgba(77, 159, 255, 0.08);
}


/* Popup heading */
.contact-modal .eyebrow {
  margin-bottom: 0.35rem;

  font-family: var(--font-mono);
  font-size: 0.78rem;

  color: var(--blue-bright);
}

.contact-modal h2 {
  margin: 0 0 0.5rem;

  color: var(--ink);

  font-size: 1.8rem;
  font-weight: 700;
}

.contact-description {
  margin: 0 0 1.5rem;

  color: var(--ink-soft);

  font-size: 0.95rem;
  line-height: 1.6;
}


/* ===================================================================
   Contact Form
   =================================================================== */

.contact-form {
  display: flex;
  flex-direction: column;

  gap: 1.35rem;

  width: 100%;
  max-width: 520px;

  background: transparent;

  border: none;
  border-radius: 0;

  padding: 0;

  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}


/* Fields */
.field {
  display: flex;
  flex-direction: column;

  gap: 0.5rem;
}

.field span {
  font-family: var(--font-mono);
  font-size: 0.78rem;

  color: var(--ink-soft);
}


/* Inputs */
.field input,
.field textarea {
  width: 100%;

  padding: 0.75rem 0.9rem;

  background: var(--surface);

  border: 1px solid var(--ink-faint);
  border-radius: 8px;

  color: var(--ink);

  font-family: var(--font-body);
  font-size: 0.95rem;

  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-soft);
  opacity: 0.75;
}


/* Input focus */
.field input:focus,
.field textarea:focus {
  outline: none;

  border-color: var(--blue-bright);

  box-shadow:
    0 0 0 3px rgba(77, 159, 255, 0.18);
}


/* ===================================================================
   Form Buttons
   =================================================================== */

.form-actions {
  display: flex;

  gap: 0.9rem;
  flex-wrap: wrap;

  margin-top: 0.25rem;
}

.form-actions .btn {
  cursor: pointer;
}

.form-actions #backbtn {
  cursor: pointer;
}


/* Send button */
.send-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  width: 100%;

  padding: 0.75rem 1rem;

  background: var(--blue-bright);
  color: #fff;

  border: 1px solid var(--blue-bright);
  border-radius: 8px;

  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.15s ease,
    transform 0.15s ease,
    box-shadow 0.15s ease;
}

.send-btn:hover {
  transform: translateY(-1px);

  box-shadow:
    0 6px 20px rgba(77, 159, 255, 0.25);
}

.send-btn:active {
  transform: translateY(0);
}


/* ===================================================================
   Status Message
   =================================================================== */

.status-message {
  min-height: 1.4em;

  margin: 0.25rem 0 0;

  font-size: 0.9rem;

  color: var(--ink-soft);
}

.status-message.is-pending {
  color: var(--ink-soft);
}

.status-message.is-success {
  color: #6fe3a3;
}

.status-message.is-error {
  color: #ff8a8a;
}


/* ===================================================================
   Mobile
   =================================================================== */

@media (max-width: 600px) {

  .contact-popup {
    padding: 1rem;
  }

  .contact-modal {
    padding: 1.4rem;

    max-height: 92vh;
  }

  .contact-modal h2 {
    font-size: 1.5rem;
  }

  .contact-description {
    font-size: 0.9rem;
  }

  .form-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .send-btn {
    width: 100%;
  }
}
