:root {
  --bg: #03040a;
  --bg-soft: rgba(8, 11, 20, 0.76);
  --panel: rgba(10, 13, 24, 0.72);
  --panel-border: rgba(255, 255, 255, 0.08);
  --text: rgba(255, 255, 255, 0.94);
  --muted: rgba(226, 232, 240, 0.7);
  --faint: rgba(148, 163, 184, 0.28);
  --accent: #b9d4ff;
  --accent-soft: rgba(82, 196, 255, 0.14);
  --accent-2: #7dd3fc;
  --accent-3: #a78bfa;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  background: var(--bg);
  overflow-x: hidden;
  width: 100vw;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Manrope", ui-sans-serif, system-ui, sans-serif;
  background:
    radial-gradient(circle at top, rgba(125, 211, 252, 0.08), transparent 24%),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.08), transparent 22%),
    linear-gradient(180deg, #06070d 0%, #03040a 42%, #020307 100%);
  overflow-x: hidden;
}

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

.site-shell {
  position: relative;
  isolation: isolate;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  inset: auto;
  width: 42rem;
  height: 42rem;
  border-radius: 999px;
  filter: blur(90px);
  opacity: 0.2;
  pointer-events: none;
  z-index: -2;
  transform: translate3d(0, 0, 0);
}

.ambient-one {
  top: -10rem;
  left: -12rem;
  background: rgba(125, 211, 252, 0.18);
}

.ambient-two {
  right: -12rem;
  top: 22rem;
  background: rgba(167, 139, 250, 0.16);
}

.grid-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.16;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 96%);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: 1rem 1rem 0;
  backdrop-filter: blur(18px);
}

.nav-shell {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.15rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(4, 6, 13, 0.74);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #060816;
  background: linear-gradient(180deg, #f8fafc, #b9d4ff);
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.95rem;
}

.brand-text {
  font-size: 0.98rem;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  position: relative;
  color: var(--muted);
  font-size: 0.95rem;
  transition: color 180ms ease, opacity 180ms ease;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8), transparent);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 220ms ease;
}

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

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.section {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(5rem, 10vw, 8rem) 1rem;
  scroll-margin-top: 6rem;
}

.main-flow {
  display: grid;
  gap: 2.5rem;
}

.hero {
  min-height: calc(100vh - 5rem);
  display: grid;
  align-items: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  border-radius: 2rem;
  background:
    radial-gradient(circle at 20% 25%, rgba(125, 211, 252, 0.1), transparent 26%),
    radial-gradient(circle at 80% 20%, rgba(167, 139, 250, 0.09), transparent 24%),
    radial-gradient(circle at 50% 70%, rgba(255, 255, 255, 0.05), transparent 30%);
  pointer-events: none;
  transform: translate3d(calc(var(--mouse-x, 0px) * 0.2), calc(var(--mouse-y, 0px) * 0.2), 0);
}

.hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 2rem;
}

.terminal-card {
  width: min(100%, 560px);
  border: 1px solid var(--panel-border);
  border-radius: 1.4rem;
  background: linear-gradient(180deg, rgba(12, 16, 28, 0.94), rgba(5, 7, 14, 0.88));
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(20px);
}

.terminal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.95rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.terminal-dots {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dot {
  width: 0.72rem;
  height: 0.72rem;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
}

.dot-close {
  background: #ff5f57;
}

.dot-minimize {
  background: #febc2e;
}

.dot-maximize {
  background: #28c840;
}

.terminal-title {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  font-size: 0.8rem;
  color: rgba(226, 232, 240, 0.62);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.terminal-body {
  padding: 1.3rem 1.2rem 1.35rem;
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  color: rgba(248, 250, 252, 0.88);
  min-height: 12rem;
}

.terminal-output {
  display: grid;
  gap: 0.62rem;
  line-height: 1.8;
  font-size: clamp(0.93rem, 1.5vw, 1rem);
}

.terminal-line {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 1.6rem;
}

.terminal-prompt {
  color: rgba(255, 255, 255, 0.45);
}

.terminal-cursor {
  display: inline-block;
  width: 0.6ch;
  height: 1.1em;
  background: rgba(255, 255, 255, 0.85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1);
  animation: blink 1s step-end infinite;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0;
}

.eyebrow,
.contact-label {
  font-family: "IBM Plex Mono", ui-monospace, monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(226, 232, 240, 0.6);
  font-size: 0.78rem;
}

.hero-title {
  margin: 0.6rem 0 1rem;
  font-size: clamp(4rem, 10vw, 8rem);
  line-height: 0.9;
  letter-spacing: -0.06em;
  font-weight: 800;
}

.hero-subtitle {
  max-width: 36rem;
  margin: 0 auto;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  gap: 0.9rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 1.9rem;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.85rem 1.3rem;
  border-radius: 999px;
  font-weight: 600;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.button:hover {
  transform: translateY(-1px) scale(1.01);
}

.button-primary {
  color: #060816;
  background: linear-gradient(135deg, #f8fafc 0%, #cde7ff 48%, #d8c6ff 100%);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.04);
}

.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 1.1rem;
  transform: translateX(-50%);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  color: rgba(226, 232, 240, 0.65);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.scroll-hint-line {
  width: 1px;
  height: 2.6rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), transparent);
  animation: floatDown 1.8s ease-in-out infinite;
}

.section-panel {
  display: grid;
  gap: 2rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.018));
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 2rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.section-panel + .section-panel {
  margin-top: 0.5rem;
}

.section-heading h2 {
  margin: 0.55rem 0 0;
  font-size: clamp(2rem, 4.5vw, 3.9rem);
  line-height: 1;
  letter-spacing: -0.05em;
  max-width: 14ch;
}

.about-grid,
.projects-grid,
.contact-grid {
  display: grid;
  gap: 1rem;
}

.about-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.about-card,
.stat-card,
.project-card,
.contact-card {
  border-radius: 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 9, 17, 0.58);
  box-shadow: 0 14px 45px rgba(0, 0, 0, 0.18);
}

.about-card {
  padding: 1.5rem;
  color: var(--muted);
  line-height: 1.85;
  font-size: 1.03rem;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.stat-card {
  padding: 1.35rem 1.4rem;
  display: grid;
  gap: 0.55rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(125, 211, 252, 0.32), rgba(167, 139, 250, 0.22), rgba(255, 255, 255, 0.04));
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0.7;
  pointer-events: none;
}

.stat-card:nth-child(1) {
  background: linear-gradient(180deg, rgba(10, 16, 30, 0.84), rgba(7, 9, 17, 0.62));
}

.stat-card:nth-child(2) {
  background: linear-gradient(180deg, rgba(10, 14, 28, 0.84), rgba(7, 9, 17, 0.62));
}

.stat-card:nth-child(3) {
  background: linear-gradient(180deg, rgba(11, 12, 26, 0.84), rgba(7, 9, 17, 0.62));
}

.stat-icon {
  width: 2rem;
  height: 2rem;
  object-fit: contain;
  filter: drop-shadow(0 10px 24px rgba(0, 0, 0, 0.3));
}

.stat-value {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
}

.stat-label {
  color: var(--muted);
  line-height: 1.7;
}

.projects-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.project-card {
  padding: 1.9rem;
  display: grid;
  gap: 1.15rem;
  min-height: 22rem;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(13, 18, 33, 0.9), rgba(7, 9, 17, 0.74));
}

.project-card h3 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.project-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.85;
  font-size: 1.03rem;
}

.project-link {
  margin-top: auto;
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent);
  font-weight: 600;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: auto -4rem -5rem auto;
  width: 14rem;
  height: 14rem;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(125, 211, 252, 0.16), transparent 68%);
  pointer-events: none;
}

.project-card:nth-child(2)::before {
  background: radial-gradient(circle, rgba(167, 139, 250, 0.16), transparent 68%);
}

.project-card:nth-child(3)::before {
  background: radial-gradient(circle, rgba(255, 255, 255, 0.1), transparent 68%);
}

.project-link::after {
  content: "↗";
  transition: transform 180ms ease;
}

.project-link:hover::after {
  transform: translate(2px, -2px);
}

.contact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.contact-card {
  padding: 1.4rem 1.5rem;
  display: grid;
  gap: 0.55rem;
  position: relative;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.contact-card:hover,
.social-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 255, 255, 0.14);
}

.contact-value {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.6;
}

.social-row {
  display: flex;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.social-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  min-height: 2.8rem;
  padding: 0.8rem 1.1rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.social-icon {
  width: 1.1rem;
  height: 1.1rem;
  display: inline-block;
  background-color: currentColor;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  transition: background-color 180ms ease;
}

.social-icon-linkedin {
  -webkit-mask-image: url("../assets/icons/linkedin.svg");
  mask-image: url("../assets/icons/linkedin.svg");
}

.social-icon-github {
  -webkit-mask-image: url("../assets/icons/github.svg");
  mask-image: url("../assets/icons/github.svg");
}

.social-linkedin:hover {
  color: #0a66c2;
  border-color: rgba(10, 102, 194, 0.35);
  background: rgba(10, 102, 194, 0.1);
}

.social-github:hover {
  color: #111111;
  border-color: rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.9);
}

.reveal {
  opacity: 0;
  transform: translateY(26px) scale(0.98);
  transition: opacity 700ms ease, transform 700ms ease;
  transition-delay: var(--delay, 0ms);
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.section-heading h2 {
  max-width: 11ch;
}

.delay-1 {
  --delay: 120ms;
}

.delay-2 {
  --delay: 220ms;
}

.delay-3 {
  --delay: 320ms;
}

.delay-4 {
  --delay: 420ms;
}

.hero.is-typed #hero-name {
  opacity: 1;
  transform: translateY(0);
}

#hero-name {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 900ms ease, transform 900ms ease;
}

.hero-ready .hero-subtitle,
.hero-ready .hero-actions,
.hero-ready .scroll-hint {
  opacity: 1;
}

.hero-subtitle,
.hero-actions,
.scroll-hint {
  opacity: 0;
  transition: opacity 700ms ease;
}

.hero-ready .hero-title {
  text-shadow: 0 0 40px rgba(125, 211, 252, 0.06);
}

.terminal-output .typed-line {
  opacity: 0;
  transform: translateY(8px);
  animation: lineIn 320ms ease forwards;
}

.terminal-output .typed-line + .typed-line {
  margin-top: 0.2rem;
}

.terminal-output .line-label {
  color: rgba(255, 255, 255, 0.48);
}

.terminal-output .line-text {
  color: rgba(248, 250, 252, 0.93);
}

.hero-ready .terminal-card {
  transform: translateY(0);
}

::selection {
  background: rgba(125, 211, 252, 0.18);
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes floatDown {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(6px); opacity: 1; }
}

@keyframes lineIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero-inner,
  .about-grid,
  .projects-grid,
  .contact-grid,
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy {
    padding-left: 0;
  }

  .hero {
    min-height: auto;
    padding-top: 4.5rem;
    padding-bottom: 7rem;
  }

  .main-flow {
    gap: 1.5rem;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 0.75rem 0;
  }

  .nav-shell {
    border-radius: 1.4rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.9rem;
  }

  .nav-links {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  .hero-title {
    font-size: clamp(2.5rem, 12vw, 3.5rem);
    word-break: break-word;
  }

  .section {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .section-panel {
    border-radius: 1.4rem;
  }

  .scroll-hint {
    bottom: 0.3rem;
  }

  .ambient {
    width: 28rem;
    height: 28rem;
    filter: blur(60px);
  }

  .ambient-one {
    top: -8rem;
    left: -8rem;
  }

  .ambient-two {
    right: -8rem;
    top: 18rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }

  .reveal,
  #hero-name,
  .hero-subtitle,
  .hero-actions,
  .scroll-hint {
    opacity: 1;
    transform: none;
  }
}

/* Email Card enhancements */
.email-card.contact-card {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  transition: transform 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 300ms ease, border-color 300ms ease;
  overflow: hidden;
}

.email-card.contact-card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 15px 50px rgba(0, 0, 0, 0.25), inset 0 0 40px rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.18);
}

.email-card.contact-card:active {
  transform: translateY(0) scale(0.98);
}

.email-card .email-info {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.email-card .email-value-group {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.copy-icon-wrapper {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: all 300ms ease;
}

.email-card:hover .copy-icon-wrapper {
  opacity: 1;
  transform: translateX(0);
}

.email-card.copied .icon-copy {
  display: none;
}

.email-card.copied .icon-check {
  display: block;
  color: #28c840;
}

.email-card.copied .copy-icon-wrapper {
  opacity: 1;
  transform: translateX(0);
}

.send-email-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  transition: all 300ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  flex-shrink: 0;
  position: relative;
  z-index: 2;
}

.send-email-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent);
  border-color: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.copy-toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, 150%);
  background: rgba(255, 255, 255, 0.95);
  color: #060816;
  padding: 0.5rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transition: all 400ms cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  z-index: 10;
  white-space: nowrap;
}

.copy-toast.show {
  transform: translate(-50%, -50%);
  opacity: 1;
}

/* Add a subtle glow on hover over the email-card */
.email-card::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, rgba(82, 196, 255, 0.2), rgba(167, 139, 250, 0.1), transparent);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.email-card:hover::before {
  opacity: 1;
}

.email-card .contact-value {
  transition: color 300ms ease;
}

.email-card:hover .contact-value {
  color: #ffffff;
}
