:root {
  --bg: #0a0b0d;
  --bg-elev: #111316;
  --bg-soft: #15181c;
  --border: #1f2429;
  --border-strong: #2a3036;
  --text: #e6e8eb;
  --text-dim: #9aa3ad;
  --text-faint: #6b7480;
  --accent: #7cf2c0;
  --cmd-blue: #3b78ff;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --display: "VT323", "JetBrains Mono", ui-monospace, monospace;
  --maxw: 960px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

::selection {
  background: var(--accent);
  color: var(--bg);
}

a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent);
}

code {
  font-family: var(--mono);
}

/* icons: sprite is defined once in the DOM but never rendered directly */
.sprite {
  position: absolute;
  width: 0;
  height: 0;
}

.icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(var(--border) 1px, transparent 1px),
    linear-gradient(90deg, var(--border) 1px, transparent 1px);
  background-size: 48px 48px;
  opacity: 0.25;
  mask-image: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0.6), transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, rgba(0,0,0,0.6), transparent 70%);
  pointer-events: none;
}

/* nav */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 32px;
  background: rgba(10, 11, 13, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.nav.is-scrolled {
  border-bottom-color: var(--border);
}

.nav__brand {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav__prompt {
  color: var(--accent);
}

.nav__cursor {
  color: var(--accent);
  animation: blink 1.1s steps(1) infinite;
}

.nav__name {
  color: var(--cmd-blue);
}

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

.nav__links {
  display: flex;
  gap: 28px;
  font-family: var(--mono);
  font-size: 13px;
}

.nav__links a {
  color: var(--text-dim);
  position: relative;
}

.nav__links a::before {
  content: "";
  position: absolute;
  left: 0;
  bottom: -4px;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.2s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  color: var(--text);
}

.nav__links a.is-active::before {
  width: 100%;
}

.nav__toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--border-strong);
  padding: 8px 10px;
  cursor: pointer;
  flex-direction: column;
  gap: 4px;
}

.nav__toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

/* main layout */
main {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.section {
  padding: 96px 0 32px;
  scroll-margin-top: 80px;
}

.section__header {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.section__num {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  font-weight: 500;
}

.section__title {
  font-family: var(--display);
  font-size: 36px;
  font-weight: 400;
  margin: 0;
  letter-spacing: 0.02em;
  line-height: 1;
}

/* hero */
.hero {
  padding: 120px 0 80px;
}

.hero__title {
  font-family: var(--display);
  font-size: clamp(52px, 8vw, 88px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.01em;
  margin: 0 0 24px;
}

.accent {
  color: var(--accent);
}

.hero__lede {
  font-size: 18px;
  color: var(--text-dim);
  max-width: 580px;
  margin: 0 0 36px;
}

.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 48px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  padding: 12px 20px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--accent);
  color: var(--bg);
  border-color: var(--accent);
}

.btn--primary:hover {
  background: #9af5cf;
  color: var(--bg);
}

.btn--ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}

.btn--ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.hero__meta {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  gap: 12px;
  align-items: center;
}

.hero__meta .sep {
  opacity: 0.5;
}

/* about */
.about {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 48px;
}

.about__body p {
  margin: 0 0 16px;
  color: var(--text-dim);
}

.about__body p:last-child {
  margin-bottom: 0;
}

.about__stack {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 20px;
}

.about__stack-title {
  font-family: var(--mono);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-faint);
  margin: 0 0 14px;
}

.about__stack ul {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text);
}

.about__stack li {
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
}

.about__stack li:last-child {
  border-bottom: 0;
}

.tag {
  display: inline-block;
  font-size: 11px;
  color: var(--accent);
  margin-right: 8px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* console (astro travel) */
.section--console {
  padding: 32px 0;
}

.console {
  background: #06070a;
  border: 1px solid var(--border-strong);
  overflow: hidden;
  box-shadow: 0 20px 60px -30px rgba(59, 120, 255, 0.3),
              inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.console__bar {
  display: flex;
  align-items: stretch;
  gap: 12px;
  padding-left: 14px;
  min-height: 34px;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
}

/* Windows-style caption buttons: minimize / maximize / close, top-right */
.console__controls {
  display: inline-flex;
  margin-left: auto;
}

.console__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  color: var(--text-dim);
  cursor: default;
  transition: background 0.15s ease, color 0.15s ease;
}

.console__btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.console__btn--close:hover {
  background: #e81123;
  color: #fff;
}

/* themed tooltip on the close button */
.console__btn--close {
  position: relative;
}

.console__btn--close::after {
  content: attr(data-tip);
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--accent);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  padding: 4px 8px;
  pointer-events: none;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.12s ease, transform 0.12s ease;
  z-index: 10;
}

.console__btn--close:hover::after {
  opacity: 1;
  transform: translateY(0);
}

.console__title {
  align-self: center;
  color: var(--text-dim);
}

.console__meta {
  align-self: center;
  color: var(--cmd-blue);
  letter-spacing: 0.08em;
}

.console__screen {
  display: block;
  margin: 0;
  padding: 0;
  height: clamp(260px, 38vh, 380px);
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.3;
  color: var(--cmd-blue);
  text-shadow: 0 0 8px var(--cmd-blue);
  user-select: none;
  overflow: hidden;
  background:
    radial-gradient(ellipse at center, rgba(59, 120, 255, 0.07), transparent 70%),
    #06070a;
  white-space: pre;
}

.console__credit {
  margin: 0;
  padding: 0.5rem 0.85rem;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  border-top: 1px solid rgba(59, 120, 255, 0.18);
  background: #06070a;
}

.console__credit a {
  color: var(--cmd-blue);
  text-decoration: none;
  border-bottom: 1px dotted currentColor;
}

.console__credit a:hover {
  text-shadow: 0 0 8px var(--cmd-blue);
}

/* projects */
.projects {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 16px;
}

.project {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  padding: 24px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.project:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.project__media {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 1px solid var(--border);
  margin-bottom: 16px;
  background: #06070a;
}

.project__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 16px;
}

.project__title {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 600;
  margin: 0;
  color: var(--accent);
}

.project__links {
  display: flex;
  gap: 12px;
}

.project__links a {
  color: var(--text-dim);
  display: inline-flex;
}

.project__desc {
  color: var(--text-dim);
  margin: 0 0 16px;
  font-size: 15px;
}

.project__tags {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.project__tags li {
  font-family: var(--mono);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--bg-soft);
  color: var(--text-dim);
  border: 1px solid var(--border);
}

/* timeline */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}

.timeline__item {
  position: relative;
  padding-left: 36px;
  padding-bottom: 32px;
}

.timeline__item::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 8px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--accent);
}

.timeline__item:last-child {
  padding-bottom: 0;
}

.timeline__when {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 4px;
}

.timeline__body h3 {
  font-size: 17px;
  margin: 0 0 6px;
  font-weight: 600;
}

.timeline__at {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
}

.timeline__body p {
  margin: 0;
  color: var(--text-dim);
}

.timeline__body p + p {
  margin-top: 12px;
}

/* contact */
.section--contact {
  padding-bottom: 96px;
}

.contact {
  text-align: center;
  padding: 32px 0;
}

.contact__lede {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 24px;
}

.contact__socials {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 0;
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
}

.contact__socials a {
  color: var(--text-dim);
}

/* footer */
.footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 32px;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* responsive */
@media (max-width: 720px) {
  .nav {
    padding: 14px 20px;
  }

  .nav__links {
    position: fixed;
    inset: 60px 0 auto 0;
    flex-direction: column;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--border);
    padding: 24px 20px;
    gap: 18px;
    transform: translateY(-110%);
    transition: transform 0.25s ease;
  }

  .nav__links.is-open {
    transform: translateY(0);
  }

  .nav__toggle {
    display: flex;
  }

  main {
    padding: 0 20px;
  }

  .hero {
    padding: 80px 0 60px;
  }

  .section {
    padding: 64px 0 24px;
  }

  .about {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .footer {
    padding: 24px 20px;
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  /* each screen carries its own idle message in data-idle */
  .console__screen[data-idle]::before {
    content: "  " attr(data-idle);
    display: block;
    padding: 20px;
    color: var(--text-faint);
    text-shadow: none;
  }
}
