:root {
  --bg: #0a0e14;
  --panel: #0f151f;
  --panel-2: #131a26;
  --border: #1e2733;
  --border-soft: #182130;
  --text: #e7edf5;
  --text-dim: #8b96a5;
  --text-faint: #5a6472;
  --amber: #ffb454;
  --cyan: #5ec8e0;
  --green: #7ee787;
  --red: #ff6b6b;
  --mono: "JetBrains Mono", monospace;
  --sans: "Inter", sans-serif;
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
}
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
  overflow-x: hidden;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--border-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--border-soft) 1px, transparent 1px);
  background-size: 64px 64px;
  opacity: 0.25;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    black 20%,
    transparent 75%
  );
}
a {
  color: inherit;
  text-decoration: none;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
section {
  position: relative;
  z-index: 1;
}

/* ---------- Header ---------- */
header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 14, 20, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  max-width: 1200px;
  margin: 0 auto;
}
.logo {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.logo .prompt {
  color: var(--green);
}
.logo .cursor {
  width: 8px;
  height: 16px;
  background: var(--amber);
  display: inline-block;
  animation: blink 1.1s step-end infinite;
}
nav ul {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 4px;
}
nav a {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
  position: relative;
  padding: 8px 14px;
  border-radius: 7px;
  transition:
    color 0.2s,
    background 0.2s;
}
nav a:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}
nav a .num {
  color: var(--text-faint);
  margin-right: 7px;
  font-size: 11px;
}
nav a::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 2px;
  height: 1.5px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
nav a:hover::after {
  transform: scaleX(1);
}
nav a.active {
  color: var(--amber);
}
nav a.active .num {
  color: var(--amber);
}
nav a.active::after {
  transform: scaleX(1);
}
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  width: 38px;
  height: 38px;
  font-family: var(--mono);
  cursor: pointer;
}

@keyframes blink {
  50% {
    opacity: 0;
  }
}

/* ---------- Hero ---------- */
.hero {
  padding: 96px 0 100px;
}
.hero-grid {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 64px;
  align-items: center;
}
.hero-copy {
  min-width: 0;
}
.terminal-frame {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--panel);
  box-shadow:
    0 30px 80px -20px rgba(0, 0, 0, 0.6),
    0 0 0 1px rgba(255, 180, 84, 0.04);
}
.terminal-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.dot.r {
  background: #ff5f56;
}
.dot.y {
  background: #ffbd2e;
}
.dot.g {
  background: #27c93f;
}
.terminal-titlebar span {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.avatar-wrap {
  padding: 36px;
  display: flex;
  justify-content: center;
}
.avatar-ring {
  width: 260px;
  max-width: 100%;
  aspect-ratio: 1/1;
  border-radius: 50%;
  padding: 6px;
  background: conic-gradient(
    from 180deg,
    var(--amber),
    var(--cyan),
    var(--green),
    var(--amber)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  transform: translateX(-20px);
}
.avatar-ring img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  display: block;
}

.hero-copy .eyebrow {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.eyebrow::before {
  content: "$";
  color: var(--text-faint);
}
.hero-copy h1 {
  font-family: var(--mono);
  font-weight: 800;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 20px;
  overflow-wrap: break-word;
}
.hero-copy h1 .accent {
  color: var(--amber);
}
.typed-line {
  font-family: var(--mono);
  font-size: clamp(16px, 2vw, 20px);
  color: var(--cyan);
  margin-bottom: 22px;
  min-height: 28px;
}
.typed-line .cursor2 {
  display: inline-block;
  width: 9px;
  height: 20px;
  background: var(--cyan);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
.hero-copy p.bio {
  color: var(--text-dim);
  max-width: 520px;
  margin-bottom: 34px;
  font-size: 15.5px;
}
.btn-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 34px;
}
.btn {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  padding: 13px 26px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: var(--amber);
  color: #0a0e14;
  border: 1px solid var(--amber);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px -8px rgba(255, 180, 84, 0.5);
}
.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-outline:hover {
  border-color: var(--cyan);
  color: var(--cyan);
  transform: translateY(-2px);
}
.social-row {
  display: flex;
  gap: 18px;
}
.social-row a {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-dim);
  transition: all 0.2s;
}
.social-row a:hover {
  color: var(--bg);
  background: var(--cyan);
  border-color: var(--cyan);
}
.social-row svg {
  width: 17px;
  height: 17px;
}

/* ---------- Section heading ---------- */
.section-head {
  margin-bottom: 52px;
}
.section-head .tag {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--green);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.section-head .tag::before {
  content: "//";
  color: var(--text-faint);
}
.section-head h2 {
  font-family: var(--mono);
  font-size: clamp(26px, 3.4vw, 36px);
  font-weight: 700;
}

/* ---------- About / Skills ---------- */
.about {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}
.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 60px;
}
.about-text p {
  color: var(--text-dim);
  margin-bottom: 16px;
  font-size: 15.5px;
}
.about-text .highlight {
  color: var(--text);
}
.stack-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px 26px;
  font-family: var(--mono);
  font-size: 13.5px;
}
.stack-box .line {
  color: var(--text-faint);
  margin-bottom: 4px;
}
.stack-box .key {
  color: var(--cyan);
}
.stack-box .val {
  color: var(--text-dim);
}
.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}
.skill-tag {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--amber);
  border: 1px solid rgba(255, 180, 84, 0.3);
  background: rgba(255, 180, 84, 0.06);
  padding: 6px 12px;
  border-radius: 6px;
}

/* ---------- Projects ---------- */
.projects {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}
.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 26px;
}
.project-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.project-card:hover {
  transform: translateY(-4px);
  border-color: var(--cyan);
}
.project-tab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}
.project-tab .file {
  color: var(--text-dim);
}
.project-body {
  padding: 24px;
}
.project-body h3 {
  font-family: var(--mono);
  font-size: 18px;
  margin-bottom: 10px;
}
.project-body p {
  color: var(--text-dim);
  font-size: 14px;
  margin-bottom: 16px;
}
.project-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.project-stack span {
  font-size: 11px;
  font-family: var(--mono);
  color: var(--cyan);
  background: rgba(94, 200, 224, 0.08);
  border: 1px solid rgba(94, 200, 224, 0.25);
  padding: 4px 9px;
  border-radius: 5px;
}
.project-links {
  display: flex;
  gap: 18px;
}
.project-links a {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text);
  border-bottom: 1px solid var(--border-soft);
  padding-bottom: 2px;
}
.project-links a:hover {
  color: var(--amber);
  border-color: var(--amber);
}

/* ---------- Resume ---------- */
.resume {
  padding: 100px 0;
  border-top: 1px solid var(--border);
}
.resume-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
}
.resume-box h3 {
  font-family: var(--mono);
  font-size: 22px;
  margin-bottom: 8px;
}
.resume-box p {
  color: var(--text-dim);
  font-size: 14.5px;
  max-width: 420px;
}

/* ---------- Contact ---------- */
.contact {
  padding: 100px 0 120px;
  border-top: 1px solid var(--border);
}
.contact-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 52px;
  text-align: center;
}
.contact-box .tag {
  justify-content: center;
}
.contact-box h2 {
  font-family: var(--mono);
  font-size: clamp(24px, 3vw, 34px);
  margin-bottom: 14px;
}
.contact-box p {
  color: var(--text-dim);
  max-width: 480px;
  margin: 0 auto 30px;
}
.contact-email {
  font-family: var(--mono);
  font-size: clamp(15px, 4.5vw, 20px);
  color: var(--amber);
  display: inline-block;
  margin-bottom: 30px;
  border-bottom: 1px solid rgba(255, 180, 84, 0.3);
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

footer {
  border-top: 1px solid var(--border);
  padding: 28px 0;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
  text-align: center;
}

/* ---------- Certificates ---------- */
.cert-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}
.cert-card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  transition:
    transform 0.2s,
    border-color 0.2s;
}
.cert-card:hover {
  transform: translateY(-4px);
  border-color: var(--amber);
}
.cert-thumb {
  position: relative;
  aspect-ratio: 4/3;
  background: var(--panel-2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}
.cert-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.cert-thumb::after {
  content: "View certificate ↗";
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 20, 0.82);
  color: var(--amber);
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cert-card:hover .cert-thumb::after {
  opacity: 1;
}
.cert-info {
  padding: 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cert-info h4 {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.35;
}
.cert-info span {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* ---------- Merged achievement card ---------- */
.achievement-card {
  display: block;
  cursor: pointer;
}
.achievement-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 0;
}
.view-cert-link {
  display: inline-block;
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--cyan);
  border-bottom: 1px solid rgba(94, 200, 224, 0.3);
}
.achievement-thumb {
  border-left: 1px solid var(--border);
  background: var(--panel-2);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 100%;
}
.achievement-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ---------- Contact modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 7, 11, 0.75);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.modal-overlay.open {
  display: flex;
  opacity: 1;
}
.modal-box {
  position: relative;
  width: 100%;
  max-width: 820px;
  max-height: 88vh;
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 44px;
  box-shadow: 0 40px 100px -20px rgba(0, 0, 0, 0.7);
  transform: translateY(12px);
  opacity: 0;
  transition:
    transform 0.25s ease,
    opacity 0.25s ease;
}
.modal-overlay.open .modal-box {
  transform: translateY(0);
  opacity: 1;
}
.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover {
  color: var(--text);
  border-color: var(--cyan);
}
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 44px;
}
.modal-left .tag {
  margin-bottom: 14px;
}
.modal-left h2 {
  font-family: var(--mono);
  font-size: 26px;
  line-height: 1.25;
  margin-bottom: 16px;
}
.modal-left p {
  color: var(--text-dim);
  font-size: 14.5px;
  margin-bottom: 22px;
}
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--green);
  border: 1px solid rgba(126, 231, 135, 0.3);
  background: rgba(126, 231, 135, 0.06);
  padding: 7px 14px;
  border-radius: 20px;
  margin-bottom: 32px;
}
.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(126, 231, 135, 0.18);
}
.modal-links-label {
  display: block;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 12px;
}
.modal-links {
  border-top: 1px solid var(--border);
  padding-top: 22px;
}
.modal-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text);
  padding: 12px 0;
  border-bottom: 1px solid var(--border-soft);
  transition: color 0.2s;
}
.modal-links a:hover {
  color: var(--amber);
}
.modal-links a span {
  color: var(--text-faint);
}
.modal-right {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.modal-right label {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-dim);
  margin-bottom: -8px;
}
.modal-right input,
.modal-right select,
.modal-right textarea {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  resize: vertical;
}
.modal-right input::placeholder,
.modal-right textarea::placeholder {
  color: var(--text-faint);
}
.modal-right input:focus,
.modal-right select:focus,
.modal-right textarea:focus {
  border-color: var(--cyan);
}
.modal-right select {
  font-family: var(--sans);
  cursor: pointer;
}

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
  nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
  }
  nav.open {
    display: block;
  }
  nav ul {
    flex-direction: column;
    padding: 20px 32px;
    gap: 18px;
  }
  .nav-toggle {
    display: block;
  }
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
  }
  .avatar-ring {
    transform: none;
  }
  .hero-copy .eyebrow,
  .typed-line {
    justify-content: center;
  }
  .btn-row,
  .social-row {
    justify-content: center;
  }
  .hero-copy p.bio {
    margin-left: auto;
    margin-right: auto;
  }
  .about-grid {
    grid-template-columns: 1fr;
  }
  .project-grid {
    grid-template-columns: 1fr;
  }
  .resume-box {
    flex-direction: column;
    text-align: center;
    justify-content: center;
  }
  .modal-grid {
    grid-template-columns: 1fr;
  }
  .modal-box {
    padding: 32px 24px;
  }
  .cert-grid {
    grid-template-columns: 1fr;
  }
  .achievement-grid {
    grid-template-columns: 1fr;
  }
  .achievement-thumb {
    border-left: none;
    border-top: 1px solid var(--border);
    aspect-ratio: 16/9;
  }
  .contact-box {
    padding: 32px 22px;
  }
}

/* ---------- Boot loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transition: opacity 0.45s ease;
}
.loader.hide {
  opacity: 0;
  pointer-events: none;
}
.loader-box {
  width: 100%;
  max-width: 480px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--panel);
  overflow: hidden;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
}
.loader-titlebar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--border);
}
.loader-titlebar span:last-child {
  margin-left: 10px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.loader-body {
  padding: 22px 20px;
  min-height: 150px;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.9;
}
.loader-line {
  color: var(--text-dim);
  white-space: pre-wrap;
}
.loader-line .prompt-sym {
  color: var(--green);
  margin-right: 8px;
}
.loader-line.output {
  color: var(--text);
  padding-left: 20px;
}
.loader-line.ok {
  color: var(--green);
}
.loader-cursor {
  display: inline-block;
  width: 8px;
  height: 14px;
  background: var(--amber);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
.loader-bar-row {
  margin-top: 6px;
  color: var(--cyan);
  font-family: var(--mono);
  font-size: 13px;
}
#loaderBar {
  letter-spacing: -1px;
}
