/* ---------- tokens ---------- */
:root {
  --bg: #121110;
  --surface: #1a1815;
  --line: #2a261f;
  --text: #ffffff;
  --muted: #b3adb8;
  --accent: #ff2ec4;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --sans: "IBM Plex Sans", -apple-system, "Segoe UI", sans-serif;
}

/* ---------- base ---------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

#bg-shader {
  position: fixed;
  inset: 0;
  z-index: -1;
}

#bg-shader canvas {
  width: 100%;
  height: 100%;
  display: block;
}

/* brighter dither layer revealed in a soft circle around the cursor */
#bg-glow {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-mask-image: radial-gradient(220px circle at var(--mx, -500px) var(--my, -500px), #000 25%, transparent 100%);
  mask-image: radial-gradient(220px circle at var(--mx, -500px) var(--my, -500px), #000 25%, transparent 100%);
}

#bg-glow.on {
  opacity: 1;
}

.wrap {
  max-width: 40rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}

a,
a:visited {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 0.25em;
  transition: color 0.15s ease, text-decoration-color 0.15s ease;
}

a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

/* keep chrome (nav, footer, list titles) consistent regardless of visited state */
nav .home,
nav .home:visited,
nav ul a,
nav ul a:visited {
  color: var(--accent);
  font-weight: 400;
}

footer a,
footer a:visited {
  color: var(--accent);
}

.projects a,
.projects a:visited,
.posts a,
.posts a:visited {
  color: var(--text);
}

.projects .desc a,
.projects .desc a:visited {
  color: var(--accent);
}

article .back,
article .back:visited {
  color: var(--muted);
  font-weight: 400;
}

/* ---------- nav ---------- */
nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 2.5rem 0 0;
  font-family: var(--mono);
  font-size: 0.8125rem;
}

nav .home {
  text-decoration: none;
  color: var(--accent);
  white-space: nowrap;
}

nav .home:hover {
  color: var(--text);
}

nav ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

nav ul a {
  text-decoration: none;
  color: var(--accent);
}

nav ul a:hover {
  color: var(--text);
}

/* ---------- mobile nav ---------- */
.menu-toggle {
  display: none;
  background: none;
  border: 0;
  padding: 0.25rem;
  color: var(--accent);
  cursor: pointer;
}

.menu-toggle svg {
  width: 22px;
  height: 22px;
  display: block;
}

.menu-toggle .icon-close {
  display: none;
}

body.no-scroll {
  overflow: hidden;
}

@media (max-width: 540px) {
  nav {
    align-items: center;
  }

  .menu-toggle {
    display: block;
    position: relative;
    z-index: 20;
  }

  nav.open .menu-toggle .icon-menu {
    display: none;
  }

  nav.open .menu-toggle .icon-close {
    display: block;
  }

  nav ul {
    display: none;
  }

  nav.open ul {
    display: flex;
    position: fixed;
    inset: 0;
    z-index: 10;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    padding-top: 7.5rem;
    background: rgba(18, 17, 16, 0.88);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
  }

  nav.open ul a {
    font-family: var(--sans);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    transition: color 0.15s ease;
  }

  nav.open ul a::before {
    content: "/";
    color: var(--accent);
    font-family: var(--mono);
    font-weight: 500;
    margin-right: 0.35rem;
  }

  nav.open ul a:hover,
  nav.open ul a:active {
    color: var(--accent);
  }

  nav.open .home {
    position: relative;
    z-index: 20;
    color: var(--text);
  }

  nav.open .menu-toggle:hover,
  .menu-toggle:hover {
    color: var(--accent);
  }
}

/* ---------- hero ---------- */
header.hero {
  padding: 4.5rem 0 1.5rem;
}

.hero h1 {
  font-family: var(--sans);
  font-size: clamp(1.75rem, 5vw, 2.375rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.hero .tagline {
  margin-top: 1rem;
  color: var(--muted);
  max-width: 32rem;
}

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

/* ---------- sections ---------- */
section {
  padding: 2.25rem 0;
  border-top: 1px solid var(--line);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
  margin-bottom: 1.5rem;
}

section p + p {
  margin-top: 1em;
}

section .note {
  color: var(--muted);
  font-size: 0.9375rem;
}

/* ---------- experience ---------- */
.xp {
  list-style: none;
}

.xp li {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1.25rem;
  padding: 1.1rem 0;
}

.xp li + li {
  border-top: 1px solid var(--line);
}

.xp .when {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  padding-top: 0.3rem;
  white-space: nowrap;
}

.xp .role {
  font-weight: 600;
}

.xp .where {
  color: var(--muted);
  font-weight: 400;
  white-space: nowrap;
}

.xp .what {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.2rem;
}

.xp .points {
  list-style: disc;
  padding-left: 1.15rem;
  margin-top: 0.4rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.xp .points li,
.xp .points li + li {
  display: list-item;
  padding: 0;
  margin-top: 0.35rem;
  border-top: none;
}

@media (max-width: 540px) {
  .xp li {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }
}

/* ---------- building list ---------- */
.projects {
  list-style: none;
}

.projects li {
  position: relative;
  padding: 1.1rem 1rem;
  margin: 0 -1rem;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.projects li:hover {
  background: var(--surface);
  transform: scale(1.02);
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 28px -10px var(--accent);
  z-index: 1;
}

@media (prefers-reduced-motion: reduce) {
  .projects li:hover {
    transform: none;
  }
}

.projects li + li {
  border-top: 1px solid var(--line);
}

.projects .top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  flex-wrap: wrap;
}

.projects a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
}

/* stretch the title link over the whole card so a click anywhere opens the project */
.projects .top a::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 10px;
}

.projects li:hover {
  cursor: pointer;
}

/* links inside a description stay individually clickable above the stretched link */
.projects .desc a {
  position: relative;
  z-index: 1;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  font-weight: 600;
}

.projects .desc a:hover {
  color: var(--text);
  text-decoration-color: var(--text);
}

.projects a:hover,
.projects li:hover .top a {
  color: var(--accent);
}

.projects .stat {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
}

.projects .desc {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-top: 0.2rem;
}

/* ---------- project page media ---------- */
.chips {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 1.75rem;
}

.chip {
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
}

.chip .n {
  font-family: var(--mono);
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent);
}

.chip .t {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

figure.media {
  margin: 2.25rem 0;
}

figure.media img,
figure.media video {
  width: 100%;
  display: block;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

figure.media figcaption {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.6rem;
}

figure.media.portrait img,
figure.media.portrait video {
  max-width: 21rem;
  margin: 0 auto;
}

figure.media.portrait figcaption {
  text-align: center;
}

.media-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  margin: 2.25rem 0;
}

.media-grid figure.media {
  margin: 0;
}

@media (max-width: 540px) {
  .media-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- embedded linkedin post ---------- */
.linkedin-embed {
  display: block;
  width: 100%;
  max-width: 504px;
  height: 670px;
  margin: 2.25rem auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

/* ---------- embedded tweets ---------- */
.tweets {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.25rem;
  margin: 2.25rem 0;
  align-items: start;
}

@media (max-width: 640px) {
  .tweets {
    grid-template-columns: 1fr;
  }
}

/* ---------- writing list ---------- */
.posts {
  list-style: none;
}

.posts li {
  padding: 0.9rem 0;
}

.posts li + li {
  border-top: 1px solid var(--line);
}

.posts a {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}

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

.posts .date {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.2rem;
}

/* ---------- blog post page ---------- */
article {
  padding: 4rem 0;
}

article .back {
  font-family: var(--mono);
  font-size: 0.8125rem;
  color: var(--muted);
  text-decoration: none;
}

article .back:hover {
  color: var(--accent);
}

article h1 {
  font-family: var(--mono);
  font-size: clamp(1.5rem, 4.5vw, 2rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.25;
  margin-top: 2.5rem;
}

article .date {
  display: block;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 0.75rem;
  margin-bottom: 2.5rem;
}

article p + p {
  margin-top: 1em;
}

article h2 {
  font-family: var(--mono);
  font-size: 1.125rem;
  font-weight: 600;
  margin: 2rem 0 0.75rem;
}

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line);
  padding: 2.5rem 0 4rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--accent);
}

footer ul {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  align-items: center;
}

footer a {
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  transition: color 0.15s ease;
}

footer a:hover {
  color: var(--text);
}

footer .social svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: currentColor;
}

