/* Personal portfolio — "Engineered dark" theme.
   Dependency-free: no fonts, no frameworks. Dark, fast, accessible. */
:root {
  --bg: #0a0e16;
  --panel: rgba(255, 255, 255, 0.025);
  --panel-2: rgba(255, 255, 255, 0.045);
  --border: rgba(255, 255, 255, 0.08);
  --border-strong: rgba(255, 255, 255, 0.16);
  --ink: #e8edf6;
  --muted: #98a2b8;
  --soft: #b8c0d2;
  --accent: #818cf8; /* indigo */
  --accent-strong: #6366f1;
  --accent-2: #22d3ee; /* cyan */
  --good: #34d399;
  --grad: linear-gradient(100deg, #a5b4fc 0%, #818cf8 38%, #22d3ee 100%);
  --radius: 16px;
  --mono: ui-monospace, "SF Mono", "Cascadia Code", "JetBrains Mono", Menlo,
    Consolas, monospace;
  --max: 1000px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family:
    system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.65;
  overflow-x: hidden;
}

/* faint animated dot-grid, fading out toward the bottom */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image: radial-gradient(
    circle at center,
    rgba(255, 255, 255, 0.05) 1px,
    transparent 1.3px
  );
  background-size: 26px 26px;
  animation: gridDrift 28s linear infinite;
  -webkit-mask-image: linear-gradient(
    180deg,
    #000 0%,
    rgba(0, 0, 0, 0.18) 62%,
    transparent 100%
  );
  mask-image: linear-gradient(
    180deg,
    #000 0%,
    rgba(0, 0, 0, 0.18) 62%,
    transparent 100%
  );
}
@keyframes gridDrift {
  to {
    background-position: 26px 26px;
  }
}

/* ambient accent glow blobs */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -3;
  pointer-events: none;
  background:
    radial-gradient(
      42% 38% at 12% -2%,
      rgba(129, 140, 248, 0.2),
      transparent 70%
    ),
    radial-gradient(
      38% 32% at 88% 4%,
      rgba(34, 211, 238, 0.13),
      transparent 70%
    );
}

a {
  color: var(--accent-2);
}
::selection {
  background: rgba(129, 140, 248, 0.32);
  color: #fff;
}
:focus-visible {
  outline: 2px solid var(--accent-2);
  outline-offset: 3px;
  border-radius: 4px;
}

/* sticky nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 24px;
  background: rgba(10, 14, 22, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-name {
  font-family: var(--mono);
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.nav-name::before {
  content: "❯ ";
  color: var(--accent-2);
}
.nav-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.nav-links a {
  font-family: var(--mono);
  text-decoration: none;
  color: var(--muted);
  font-size: 0.85rem;
}
.nav-links a:hover {
  color: var(--accent-2);
}

main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
  counter-reset: sec;
}

/* hero */
.hero {
  position: relative;
  padding: 96px 0 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 52px;
}
.hero-text {
  flex: 1 1 440px;
  min-width: 0;
}
.hero-photo {
  flex: 0 0 auto;
  align-self: center;
  padding: 4px;
  border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 60px rgba(129, 140, 248, 0.22);
  transition:
    transform 0.3s ease,
    box-shadow 0.3s ease;
}
.hero-photo:hover {
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 0 80px rgba(34, 211, 238, 0.3);
}
.hero-photo img {
  display: block;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}
/* glow that follows the pointer across the whole page */
.cursor-glow {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(
      280px 280px at var(--mx, 50%) var(--my, 16%),
      rgba(129, 140, 248, 0.22),
      transparent 70%
    ),
    radial-gradient(
      600px 600px at var(--mx, 50%) var(--my, 16%),
      rgba(34, 211, 238, 0.1),
      transparent 72%
    );
}
.status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  padding: 6px 13px;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--good);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.26);
  border-radius: 999px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--good);
  box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  animation: pulse 2.2s infinite;
}
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.55);
  }
  70% {
    box-shadow: 0 0 0 9px rgba(52, 211, 153, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0);
  }
}
.eyebrow {
  font-family: var(--mono);
  text-transform: lowercase;
  letter-spacing: 0.04em;
  font-size: 0.9rem;
  color: var(--accent-2);
  margin: 0 0 10px;
}
.eyebrow::before {
  content: "// ";
  opacity: 0.6;
}
.hero h1 {
  font-size: clamp(2.6rem, 8vw, 4.6rem);
  line-height: 1.03;
  margin: 0 0 16px;
  letter-spacing: -0.035em;
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 34px rgba(129, 140, 248, 0.22));
}
.tagline {
  font-size: clamp(1.2rem, 2.6vw, 1.6rem);
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 18px;
  max-width: 660px;
}
.intro {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 640px;
  margin: 0 0 30px;
}

/* buttons */
.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.92rem;
  font-weight: 700;
  text-decoration: none;
  padding: 11px 20px;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid transparent;
  background: var(--grad);
  color: #08111b;
  transition:
    transform 0.08s ease,
    box-shadow 0.25s ease,
    border-color 0.25s ease,
    color 0.25s ease;
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 34px rgba(99, 102, 241, 0.34);
}
.btn:active {
  transform: translateY(0);
}
.btn-ghost {
  background: var(--panel);
  color: var(--ink);
  border-color: var(--border-strong);
}
.btn-ghost:hover {
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 26px rgba(129, 140, 248, 0.18);
}

/* sections */
.section {
  padding: 60px 0;
  scroll-margin-top: 80px;
}
.section-title {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 1.55rem;
  letter-spacing: -0.01em;
  margin: 0 0 30px;
}
.section-title::before {
  counter-increment: sec;
  content: counter(sec, decimal-leading-zero);
  font-family: var(--mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--accent-2);
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, var(--border-strong), transparent);
}

/* work grid */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
}
.project {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  backdrop-filter: blur(6px);
  transition:
    transform 0.25s ease,
    border-color 0.25s ease,
    box-shadow 0.25s ease;
}
.project::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(129, 140, 248, 0.55),
    transparent
  );
  opacity: 0;
  transition: opacity 0.3s ease;
}
.project:hover {
  transform: translateY(-4px);
  border-color: var(--border-strong);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.5),
    0 0 34px rgba(129, 140, 248, 0.09);
}
.project:hover::before {
  opacity: 1;
}
.project h3 {
  font-size: 1.18rem;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.project-blurb {
  color: var(--soft);
  margin: 0 0 16px;
  flex: 1;
}
.tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0;
  margin: 0 0 18px;
}
.tags li {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--accent);
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.22);
  padding: 4px 9px;
  border-radius: 6px;
}
.project-links {
  display: flex;
  gap: 18px;
}
.project-links a {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent-2);
}
.project-links a:hover {
  text-shadow: 0 0 14px rgba(34, 211, 238, 0.55);
}

/* about */
.about-text {
  font-size: 1.08rem;
  color: var(--soft);
  max-width: 680px;
  margin: 0 0 16px;
}
.skills-title {
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 600;
  text-transform: lowercase;
  color: var(--muted);
  margin: 28px 0 14px;
}
.skills-title::before {
  content: "// ";
  color: var(--accent-2);
  opacity: 0.7;
}
.skills {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 0;
  margin: 0;
}
.skills li {
  font-family: var(--mono);
  font-size: 0.88rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 13px;
  color: var(--ink);
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.skills li:hover {
  border-color: var(--accent);
  color: #fff;
}

/* footer */
.footer {
  max-width: var(--max);
  margin: 48px auto 0;
  padding: 28px 24px 52px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-align: center;
}

/* projects chatbot */
.chat-toggle {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 700;
  color: #08111b;
  background: var(--grad);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.35);
  transition:
    transform 0.1s ease,
    box-shadow 0.25s ease;
}
.chat-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 40px rgba(34, 211, 238, 0.4);
}
.chat-toggle-icon {
  font-size: 1.05rem;
}

.chat-panel {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 51;
  width: min(360px, calc(100vw - 32px));
  height: min(520px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: rgba(14, 19, 32, 0.94);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  transform-origin: bottom right;
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
}
.chat-panel.open {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.chat-head strong {
  display: block;
  font-size: 0.96rem;
}
.chat-sub {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--accent-2);
}
.chat-close {
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 1.1rem;
  line-height: 1;
  padding: 4px;
  cursor: pointer;
}
.chat-close:hover {
  color: #fff;
}
.chat-log {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 88%;
  padding: 9px 13px;
  border-radius: 13px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.chat-msg a {
  color: var(--accent-2);
}
.chat-msg.bot {
  align-self: flex-start;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--soft);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: linear-gradient(100deg, var(--accent-strong), #4f46e5);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.typing {
  color: var(--muted);
  letter-spacing: 2px;
}
.chat-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0 16px 10px;
}
.chat-chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--accent);
  background: rgba(129, 140, 248, 0.08);
  border: 1px solid rgba(129, 140, 248, 0.25);
  border-radius: 999px;
  padding: 5px 11px;
  cursor: pointer;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}
.chat-chip:hover {
  border-color: var(--accent);
  color: #fff;
}
.chat-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}
.chat-input {
  flex: 1;
  min-width: 0;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--ink);
  font-size: 0.92rem;
  font-family: inherit;
}
.chat-input:focus {
  outline: none;
  border-color: var(--accent);
}
.chat-send {
  background: var(--grad);
  color: #08111b;
  border: none;
  border-radius: 10px;
  padding: 0 14px;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
}
.chat-send:hover {
  filter: brightness(1.06);
}
@media (max-width: 480px) {
  .chat-toggle-label {
    display: none;
  }
  .chat-toggle {
    padding: 12px;
  }
}

/* reveal-on-scroll */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}
.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  body::before {
    animation: none;
  }
  .status-dot {
    animation: none;
  }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

@media (max-width: 760px) {
  .hero {
    flex-direction: column-reverse;
    align-items: flex-start;
    gap: 30px;
  }
  .hero-photo img {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 560px) {
  .nav {
    padding: 12px 16px;
  }
  .nav-links {
    gap: 16px;
  }
  .hero {
    padding: 64px 0 52px;
  }
  .section-title::after {
    display: none;
  }
}
