@import url("https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@400;500;600;700&display=swap");

:root {
  --bg: #eef4ff;
  --bg2: #f7faff;
  --surface: rgba(255, 255, 255, 0.62);
  --surface-strong: rgba(255, 255, 255, 0.86);
  --text: #0f203f;
  --muted: #4d6388;
  --primary: #1e67d6;
  --primary-2: #25c2ff;
  --border: rgba(124, 152, 205, 0.35);
  --shadow: 0 20px 50px rgba(18, 44, 91, 0.16);
}

body.dark {
  --bg: #081022;
  --bg2: #101d34;
  --surface: rgba(18, 30, 53, 0.64);
  --surface-strong: rgba(21, 35, 62, 0.92);
  --text: #e7efff;
  --muted: #9cb3da;
  --primary: #58a6ff;
  --primary-2: #2dd8ff;
  --border: rgba(108, 145, 206, 0.28);
  --shadow: 0 20px 50px rgba(0, 0, 0, 0.42);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  background: linear-gradient(140deg, var(--bg), var(--bg2));
  min-height: 100vh;
  overflow-x: hidden;
  transition: background 0.35s ease, color 0.35s ease;
}

.scroll-progress {
  position: fixed; top: 0; left: 0; height: 4px; width: 0%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  z-index: 100;
}

nav, .nav-links { display: flex; }
nav {
  position: sticky; top: 0; z-index: 80;
  height: 12vh; align-items: center; justify-content: space-around;
  background: rgba(255,255,255,0.2); backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.logo { font-size: 1.7rem; font-weight: 700; }
.nav-links { list-style: none; gap: 1rem; align-items: center; }
a { color: var(--text); text-decoration: none; transition: 0.2s ease; }
a:hover, a.active-link { color: var(--primary); }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  width: 40px; height: 40px;
  cursor: pointer;
}

#hamburger-nav { display: none; }
.hamburger-menu { position: relative; display: inline-block; }
.hamburger-icon { display: flex; flex-direction: column; justify-content: space-between; height: 24px; width: 30px; cursor: pointer; }
.hamburger-icon span { width: 100%; height: 2px; background-color: var(--text); transition: all .3s; }
.menu-links { position: absolute; top: 100%; right: 0; width: 220px; max-height: 0; overflow: hidden; background: var(--surface-strong); border: 1px solid var(--border); border-radius: 16px; transition: all .3s; }
.menu-links a { display: block; padding: 0.8rem; text-align: center; }
.menu-links li { list-style: none; }
.menu-links.open { max-height: 300px; }
.hamburger-icon.open span:first-child { transform: rotate(45deg) translate(9px, 5px); }
.hamburger-icon.open span:nth-child(2) { opacity: 0; }
.hamburger-icon.open span:last-child { transform: rotate(-45deg) translate(9px, -5px); }

section { margin: 0 7rem; padding-top: 2.2rem; }
p { color: var(--muted); }
.title { font-size: 2.8rem; text-align: center; }
.section__text__p1 { text-align: center; letter-spacing: .13em; text-transform: uppercase; font-size: .8rem; color: var(--primary); font-weight: 700; }

#profile {
  min-height: 86vh;
  display: grid; grid-template-columns: 360px 1fr; gap: 2.4rem; align-items: center;
}
.section__pic-container {
  width: 360px; height: 360px; border-radius: 28px; overflow: hidden;
  border: 1px solid var(--border); box-shadow: var(--shadow);
}
#profile .section__pic-container {
  border: none;
  box-shadow: none;
}
.section__pic-container img { width: 100%; height: 100%; object-fit: cover; }
.section__text .title, .section__text p { text-align: left; }
.section__text__p2 { font-size: 1.4rem; font-weight: 700; color: var(--primary); }
.section__text__p3 { font-weight: 600; }

.hero-badges { display: flex; gap: .55rem; flex-wrap: wrap; margin-top: .8rem; }
.hero-badges span {
  padding: .35rem .65rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .78rem; font-weight: 700; color: var(--muted);
}

.btn-container { margin-top: 1rem; display: flex; gap: .7rem; flex-wrap: wrap; }
.btn {
  padding: .8rem 1rem; min-width: 8rem; border-radius: 14px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-weight: 700; cursor: pointer;
  transition: transform .2s ease, border .2s ease;
}
.btn:hover { transform: translateY(-2px); border-color: var(--primary); }
.btn-color-1 { background: linear-gradient(120deg, var(--primary), var(--primary-2)); color: #fff; border: none; }
.btn-color-2 { background: var(--surface-strong); }

#socials-container { display: flex; gap: .7rem; margin-top: .8rem; }
.icon { height: 2rem; cursor: pointer; }
body.dark #socials-container .icon {
  filter: brightness(0) invert(1);
}

.metrics-grid { margin-top: 1rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .7rem; }
.metric-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: .85rem;
  box-shadow: var(--shadow);
}
.metric-card h3 { color: var(--primary); font-size: 1.35rem; }
.metric-card p { font-size: .8rem; }

.sre-console {
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: rgba(12, 25, 47, 0.9);
  color: #cde8ff;
  border-radius: 18px;
  padding: .9rem 1rem;
}
.console-title { color: #76c6ff; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; }
.console-line, .console-output { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .86rem; margin-top: .35rem; color: #d9f0ff; }
.prompt { color: #46e0a5; }
.cursor { animation: blink 1s step-end infinite; }
@keyframes blink { 50% { opacity: 0; } }

#about, #experience, #projects, #contact { position: relative; }
.details-container, .details-container-about, .text-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 1rem;
  box-shadow: var(--shadow);
}

/* Cinematic About Story */
#about {
  min-height: 360vh;
}

.about-story-shell {
  height: 320vh;
  margin-top: 0.8rem;
}

.about-sticky {
  position: sticky;
  top: 12vh;
  min-height: 82vh;
  padding: 1rem 0 1.4rem;
}

.about-terminal {
  margin: 0 auto 1rem;
  max-width: 760px;
  border: 1px solid rgba(0, 212, 255, 0.2);
  background: #07101d;
  border-radius: 12px;
  padding: 0.65rem 0.9rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #00ff88;
}

.about-terminal-cursor {
  color: #00ff88;
  animation: blink 1s step-end infinite;
}

.about-stats {
  margin-top: 1.1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.about-stat-card {
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 18px;
  padding: 1rem 1.1rem;
  opacity: 0;
  transform: translateY(60px);
  transition: transform 0.55s ease, opacity 0.55s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.about-stat-card h3 {
  color: var(--text);
  font-size: 1.8rem;
}

.about-stat-card p {
  margin-top: 0.28rem;
}

.about-stat-card:hover {
  transform: translateY(-8px);
  border-color: rgba(0, 212, 255, 0.75);
  box-shadow: 0 0 30px rgba(0, 153, 255, 0.2);
}

.about-operate-title {
  margin-top: 1.2rem;
  font-size: 2rem;
  text-align: left;
  min-height: 2.5rem;
  letter-spacing: -0.02em;
}

.about-operate-title .split-letter {
  opacity: 0;
  display: inline-block;
  transform: translateY(14px);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.about-pillars {
  margin-top: 0.85rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  perspective: 900px;
}

.about-pillar-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 18px;
  padding: 1rem;
  box-shadow: var(--shadow);
  transform: rotateY(-80deg) translateY(22px);
  transform-origin: left center;
  opacity: 0;
  transition: transform 0.6s cubic-bezier(0.18, 0.8, 0.15, 1), opacity 0.6s ease;
}

.about-pillar-card h3 {
  color: var(--primary);
  margin-bottom: 0.55rem;
}

.about-pillar-copy {
  line-height: 1.7;
}

.about-pillar-copy .word {
  opacity: 0.08;
  filter: blur(2px);
  transition: opacity 0.26s ease, filter 0.26s ease;
}

#about.phase-1 .about-stat-card {
  opacity: 1;
  transform: translateY(0);
}

#about.phase-1 .about-stat-card:nth-child(2) {
  transition-delay: 150ms;
}

#about.phase-2 .about-operate-title .split-letter {
  opacity: 1;
  transform: translateY(0);
}

#about.phase-3 .about-pillar-card {
  opacity: 1;
  transform: rotateY(0deg) translateY(0);
}

#about.phase-3 .about-pillar-card:nth-child(2) {
  transition-delay: 120ms;
}

#about.phase-3 .about-pillar-card:nth-child(3) {
  transition-delay: 240ms;
}

#about.phase-4 .about-pillar-copy .word {
  opacity: 1;
  filter: blur(0);
}
.reveal-sentence {
  opacity: 0;
  transform: translateY(6px);
  display: inline;
  animation: sentenceIn 0.5s ease forwards;
}
@keyframes sentenceIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.arrow { position: absolute; right: -2rem; bottom: 2rem; opacity: .6; }

#experience {
  padding-top: 0.8rem;
}

.experience-details-container {
  margin-top: 1.9rem;
}

#experience .about-containers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.35rem;
  gap: 1.25rem;
}

#experience .details-container-about,
#experience .details-container {
  padding: 1.25rem 1.3rem;
}

.details-container-about > p:first-of-type {
  margin-top: 0.4rem;
}

.details-container-about > p:last-of-type {
  margin-top: 0.6rem;
  line-height: 1.75;
}

.experience-sub-title { color: var(--primary); font-size: 1.2rem; margin-bottom: .6rem; }
.skills-toggle, .project-filters { margin: 1.5rem 0 0.55rem; display: flex; flex-wrap: wrap; gap: .55rem; }
.skill-toggle-btn, .project-filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: .42rem .8rem; font-weight: 700; cursor: pointer;
}
.skill-toggle-btn.active, .project-filter-btn.active { background: var(--primary); color: #fff; border-color: transparent; }

#experience .article-container { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .9rem 1.15rem; margin-top: 0.8rem; }
#experience article { display: flex; gap: .5rem; align-items: flex-start; }
#experience article p {
  margin-top: 0.22rem;
}
#experience .sre-dominant {
  background: linear-gradient(150deg, rgba(69,126,255,.18), rgba(49,214,255,.14));
  border-color: rgba(88,166,255,.52);
}

.experience-lab { margin-top: 1.8rem; display: grid; grid-template-columns: 1.35fr 1fr; gap: 1.15rem; }
.experience-chart-panel, .incident-game-panel {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 20px;
  padding: 1.15rem;
  box-shadow: var(--shadow);
}
.panel-header h2 { font-size: 1.15rem; }
.panel-header p { font-size: .9rem; margin-top: .2rem; }
.impact-chart { margin-top: .9rem; display: grid; gap: .6rem; }
.impact-row { display: grid; grid-template-columns: 1.4fr 2fr auto; gap: .6rem; align-items: center; }
.impact-label, .impact-value { font-size: .82rem; font-weight: 700; color: var(--muted); }
.impact-track { height: 10px; border-radius: 999px; background: rgba(108,145,206,.24); overflow: hidden; }
.impact-fill { display: block; height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, var(--primary), var(--primary-2)); transition: width 1.2s cubic-bezier(.2,.7,0,1); }
.experience-chart-panel.in-view .impact-fill { width: calc(var(--target, 0) * 1%); }

.incident-status-board { margin-top: .8rem; border: 1px solid var(--border); border-radius: 14px; padding: .8rem; background: var(--surface-strong); }
#incident-message { color: var(--text); font-weight: 600; }
.incident-stats { margin-top: .65rem; display: flex; justify-content: space-between; font-size: .84rem; font-weight: 700; color: var(--muted); }
.incident-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-top: .7rem; }
.command-btn:disabled { opacity: .45; cursor: not-allowed; }
.incident-game-panel.alert-live { box-shadow: 0 0 0 2px rgba(255,120,120,.45), var(--shadow); }

#projects { margin-top: 3.2rem; }
#projects .about-containers {
  display: grid;
  margin-top: .9rem;
  gap: 1.15rem;
  grid-template-columns: repeat(3, minmax(0,1fr));
}
.project-card { transition: transform .25s ease, box-shadow .25s ease; }
.project-card:hover { transform: translateY(-6px); box-shadow: 0 24px 46px rgba(16,43,88,.22); }
.project-img { width: 100%; height: 220px; object-fit: cover; border-radius: 14px; }
.project-title { margin-top: .7rem; }
.project-summary { font-size: .92rem; line-height: 1.5; margin-top: .35rem; }

#blog.blog-preview {
  margin-top: 3.2rem;
}

.blog-preview-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.blog-preview-card {
  background: rgba(10, 14, 26, 0.92);
  border: 1px solid rgba(0, 212, 255, 0.18);
  border-radius: 18px;
  padding: 1.05rem 1.1rem;
  box-shadow: 0 22px 44px rgba(0, 0, 0, 0.34);
}

.blog-preview-tag {
  display: inline-block;
  padding: 0.18rem 0.48rem;
  border: 1px solid rgba(0, 212, 255, 0.2);
  border-radius: 999px;
  color: #8eb5d2;
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blog-preview-card h3 {
  margin-top: 0.7rem;
  color: #e2e8f0;
  line-height: 1.3;
}

.blog-preview-card p {
  margin-top: 0.5rem;
  color: #a8b2c1;
  line-height: 1.55;
}

.blog-preview-link {
  display: inline-block;
  margin-top: 0.75rem;
  color: #00d4ff;
  font-weight: 700;
  text-decoration: none;
}

#contact { min-height: 58vh; display: flex; flex-direction: column; justify-content: center; }
.contact-info-upper-container {
  margin: 1.4rem auto; display: flex; flex-wrap: wrap; gap: .6rem;
  border: 1px solid var(--border); border-radius: 18px; background: var(--surface); padding: .6rem .8rem;
}
.contact-info-container { display: flex; align-items: center; gap: .45rem; }
.email-icon { height: 2.3rem; }

footer { margin: 0 1rem 1.7rem; padding-top: .5rem; }
footer p { text-align: center; font-size: .85rem; }

.details-container,
.metric-card,
.project-card,
.text-container,
.skills-toggle,
.project-filters,
.experience-chart-panel,
.incident-game-panel {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity .5s ease, transform .5s ease;
}
.in-view { opacity: 1; transform: translateY(0); }
.is-hidden { display: none !important; }
