*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg: #0a0a0a;
  --text: #e4e4e7;
  --muted: #a1a1aa;
  --link: #e4e4e7;
  --link-hover: #a5e4f9;
  --border: #27272a;
  --accent: #d4d4d8;
  --glow: rgba(165, 228, 249, 0.03);
  --blue: #a5e4f9;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  padding: 4rem 3rem 5rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* --- header & nav --- */

header {
  max-width: 900px;
  margin: 0 auto 3rem;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  border-bottom: none;
  letter-spacing: -0.01em;
  transition: color 0.15s ease;
}

.name:hover {
  color: var(--blue);
}

nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}

nav a {
  font-size: 0.82rem;
  color: var(--muted);
  text-decoration: none;
  border-bottom: none;
  transition: color 0.2s ease;
}

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

nav a.active {
  color: var(--text);
  position: relative;
}

nav a.active::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--blue);
  opacity: 0.5;
}

/* --- main content --- */

main {
  max-width: 900px;
  margin: 0 auto;
}

h1 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1.5rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

h1::before {
  content: '';
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
}

h2 {
  font-size: 0.8rem;
  font-weight: 500;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2.5rem;
  margin-bottom: 1.25rem;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

h2::before {
  content: '';
  width: 5px;
  height: 5px;
  background: var(--blue);
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.6;
}

p {
  font-size: 0.92rem;
  margin-bottom: 0.75rem;
  color: var(--accent);
}

a {
  color: var(--link);
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.2s ease, color 0.2s ease;
}

a:hover {
  color: var(--blue);
  border-color: rgba(165, 228, 249, 0.3);
}

/* --- lists --- */

ul {
  list-style: none;
  padding: 0;
}

ul li {
  font-size: 0.85rem;
  padding-left: 1rem;
  position: relative;
  margin-bottom: 0.5rem;
  color: var(--accent);
}

ul li::before {
  content: '–';
  position: absolute;
  left: 0;
  color: var(--muted);
}

/* --- hr & footer --- */

hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0 1.25rem;
}

footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

footer a {
  font-size: 0.82rem;
  color: var(--muted);
  border-bottom: none;
  transition: color 0.2s ease;
}

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

/* --- compact experience list --- */

.exp-list {
  list-style: none;
  padding: 0;
}

.exp-list li {
  font-size: 0.85rem;
  color: var(--accent);
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0.5rem;
  align-items: baseline;
  flex-wrap: wrap;
}

.exp-list li:last-child {
  border-bottom: none;
}

.exp-list .exp-company {
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}

.exp-list .exp-company a {
  color: var(--text);
  border-bottom: none;
}

.exp-list .exp-company a:hover {
  color: var(--blue);
}

.exp-list .exp-arrow {
  color: var(--muted);
}

.exp-list .exp-desc {
  color: var(--muted);
  flex: 1;
}

.exp-list .exp-date {
  font-size: 0.75rem;
  color: #52525b;
  margin-left: auto;
  white-space: nowrap;
}

/* --- sections (experience, projects, writing entries) --- */

section {
  margin-bottom: 0.4rem;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid transparent;
  transition: border-color 0.25s ease, background 0.25s ease;
}

section:hover {
  border-color: rgba(165, 228, 249, 0.1);
  background: var(--glow);
}

/* --- fade-in on scroll --- */

@keyframes fadeUp {
  from { opacity: 0; }
  to { opacity: 1; }
}

section, h1, h2, hr, footer {
  animation: fadeUp 0.5s ease both;
}

.hero {
  animation: fadeUp 0.5s ease both;
  will-change: opacity;
}

section:nth-child(2) { animation-delay: 0.04s; }
section:nth-child(3) { animation-delay: 0.08s; }
section:nth-child(4) { animation-delay: 0.12s; }
section:nth-child(5) { animation-delay: 0.16s; }
section:nth-child(6) { animation-delay: 0.2s; }
section:nth-child(7) { animation-delay: 0.24s; }
section:nth-child(8) { animation-delay: 0.28s; }
section:nth-child(9) { animation-delay: 0.32s; }
section:nth-child(10) { animation-delay: 0.36s; }

.entry-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.1rem;
}

h3 {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

h3 a {
  border-bottom: none;
  position: relative;
}

h3 a::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--blue);
  transition: width 0.3s ease;
}

h3 a:hover {
  color: var(--blue);
  border-color: transparent;
}

h3 a:hover::after {
  width: 100%;
}

.tag {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 400;
}

.date {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
}

.role {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.15rem;
}

/* --- projects page --- */

.links {
  font-size: 0.78rem;
  margin-top: 0.2rem;
  color: var(--muted);
}

.links a {
  color: var(--muted);
  border-bottom: none;
  transition: color 0.2s ease;
}

.links a:hover {
  color: var(--blue);
}

/* --- conference location --- */

.conf-location {
  font-size: 0.75rem;
  color: #52525b;
  margin-top: -0.4rem;
  margin-bottom: 0.5rem;
}

/* --- two-column layout (speaking + awards) --- */

.two-col {
  display: flex;
  gap: 2rem;
  align-items: flex-start;
}

.two-col .col {
  flex: 1;
  min-width: 0;
}

.two-col h2 {
  margin-top: 2.5rem;
}

/* --- homepage hero layout --- */

.hero {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
  margin-bottom: 0.5rem;
}

.hero-text {
  flex: 1;
  min-width: 0;
  max-width: 500px;
}

#viz-wrap {
  flex-shrink: 0;
  width: 320px;
  position: sticky;
  top: 2rem;
  overflow: hidden;
}

#viz {
  display: block;
  width: 320px;
  height: 340px;
  will-change: contents;
}

#viz-label {
  font-size: 0.55rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #52525b;
  margin-top: 0.4rem;
  text-align: center;
  height: 1em;
  transition: opacity 0.3s;
}

/* --- homepage current role highlight --- */

.now {
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.pulse {
  width: 6px;
  height: 6px;
  background: var(--blue);
  border-radius: 50%;
  display: inline-block;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* --- homepage static layout --- */

.page-home {
  height: 100vh;
  overflow: hidden;
  padding: 2.5rem 3rem 2rem;
  justify-content: center;
  position: relative;
}

.page-home header {
  margin-bottom: 2rem;
  position: relative;
  z-index: 2;
}

.page-home main {
  flex: 0 0 auto;
  position: relative;
  z-index: 2;
}

.page-home .hero {
  margin-bottom: 0;
}

.page-home hr {
  margin: 1.25rem 0 0.75rem;
}

.page-home footer {
  margin-bottom: 0.25rem;
}

.page-home .last-updated {
  margin-top: 0.75rem;
  margin-bottom: 0;
}

.page-home .now {
  margin-bottom: 0.75rem;
}

.page-home p {
  margin-bottom: 0.5rem;
}

/* --- homepage border art --- */

.border-canvas {
  position: fixed;
  z-index: 0;
  pointer-events: none;
  will-change: contents;
}

#border-top {
  top: 0;
  left: 0;
  width: 100vw;
  height: 150px;
}

#border-bottom {
  bottom: 0;
  left: 0;
  width: 100vw;
  height: 150px;
}

#border-left {
  top: 0;
  left: 0;
  width: 150px;
  height: 100vh;
}

#border-right {
  top: 0;
  right: 0;
  width: 150px;
  height: 100vh;
}

/* --- last updated --- */

.last-updated {
  font-size: 0.7rem;
  color: #3f3f46;
  margin-top: 2.5rem;
  text-align: center;
  letter-spacing: 0.03em;
}

/* --- body fade-in --- */

@keyframes bodyFade {
  from { opacity: 0; }
  to { opacity: 1; }
}

body {
  animation: bodyFade 0.6s ease both;
}

/* --- selection --- */

::selection {
  background: rgba(165, 228, 249, 0.15);
  color: #ffffff;
}

/* --- responsive --- */

@media (max-width: 960px) {
  body {
    padding: 2.5rem 1.25rem 3rem;
  }

  header {
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2rem;
  }

  .hero {
    flex-direction: column-reverse;
    gap: 1.5rem;
  }

  #viz-wrap {
    width: 100%;
    position: static;
  }

  #viz {
    width: 100%;
    max-width: 280px;
    height: 300px;
    margin: 0 auto;
  }

  .entry-header {
    flex-direction: column;
    gap: 0.1rem;
  }

  .two-col {
    flex-direction: column;
    gap: 0;
  }

  .border-canvas {
    display: none;
  }

  .page-home {
    height: auto;
    overflow: auto;
    padding: 2.5rem 1.25rem 3rem;
  }
}
