/* ---------- tokens ---------- */
:root {
  --bg: #0b0d12;
  --bg-elev: #11141b;
  --bg-card: #151924;
  --border: #232838;
  --border-strong: #2e3447;
  --text: #e6e9f2;
  --text-dim: #98a0b3;
  --text-mute: #6b7388;
  --accent: #7cc4ff;
  --accent-2: #b794ff;
  --accent-glow: rgba(124, 196, 255, 0.18);
  --success: #6fdc8c;
  --radius: 12px;
  --radius-sm: 8px;
  --max: 1080px;
  --mono: ui-monospace, "JetBrains Mono", "Fira Code", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto,
          "Helvetica Neue", Arial, sans-serif;
}

/* ---------- base ---------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.hidden { display: none !important; }
.muted { color: var(--text-mute); font-size: 0.9rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 28px;
  background: rgba(11, 13, 18, 0.78);
  backdrop-filter: saturate(150%) blur(10px);
  -webkit-backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.brand:hover { text-decoration: none; }
.brand-logo {
  height: 28px;
  width: auto;
  /* logo is black on transparent; invert for dark theme */
  filter: invert(1);
}
.brand .cursor {
  color: var(--accent);
  animation: blink 1.1s steps(2, start) infinite;
}
@keyframes blink { to { visibility: hidden; } }
.nav-links {
  list-style: none;
  display: flex;
  gap: 22px;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text-dim);
}
.nav-links a:hover { color: var(--text); text-decoration: none; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 120px 28px 96px;
  overflow: hidden;
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.eyebrow {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  margin: 0 0 16px;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}
.hero h1 {
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.05;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  background: linear-gradient(180deg, #ffffff 30%, #9aa3ba 110%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
}
.lead {
  max-width: 640px;
  font-size: 1.15rem;
  color: var(--text-dim);
  margin: 0 0 32px;
}
.lead strong { color: var(--text); }

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent);
  color: #07101e;
  font-weight: 600;
}
.btn-primary:hover { background: #98d2ff; }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

.hero-links {
  display: flex;
  flex-wrap: wrap;
  gap: 22px;
}
.hero-links a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-dim);
  font-family: var(--mono);
  font-size: 0.88rem;
}
.hero-links a:hover { color: var(--accent); text-decoration: none; }

.hero-glow {
  position: absolute;
  top: -180px;
  right: -120px;
  width: 600px;
  height: 600px;
  background:
    radial-gradient(closest-side, var(--accent-glow), transparent 70%),
    radial-gradient(closest-side, rgba(183, 148, 255, 0.10), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

/* ---------- sections ---------- */
.section {
  max-width: var(--max);
  margin: 0 auto;
  padding: 80px 28px;
  border-top: 1px solid var(--border);
}
.section-head {
  margin-bottom: 36px;
}
.section-head h2 {
  font-size: 1.9rem;
  margin: 4px 0 6px;
  letter-spacing: -0.01em;
}
.section-num {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.85rem;
  letter-spacing: 1.2px;
}
.section-sub {
  color: var(--text-dim);
  margin: 0;
  max-width: 640px;
}

/* ---------- about ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 40px;
  align-items: start;
}
.about-grid p { margin: 0 0 16px; color: var(--text-dim); }
.about-grid p strong { color: var(--text); }
.about-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.about-card h3 {
  font-size: 0.78rem;
  font-family: var(--mono);
  color: var(--accent);
  letter-spacing: 1.1px;
  text-transform: uppercase;
  margin: 0 0 12px;
}
.about-card h3 + .chip-list { margin-bottom: 20px; }
.about-card h3:not(:first-child) { margin-top: 4px; }
.chip-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip-list li {
  font-family: var(--mono);
  font-size: 0.78rem;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 11px;
  color: var(--text-dim);
}

/* ---------- timeline ---------- */
.timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
  border-left: 1px solid var(--border);
  padding-left: 28px;
}
.timeline li {
  position: relative;
  padding-bottom: 28px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--bg);
}
.t-date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  margin-bottom: 4px;
  letter-spacing: 0.8px;
}
.t-date .t-note {
  color: var(--text-mute);
  font-weight: 400;
}
.t-body h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.t-org {
  color: var(--text-mute);
  font-weight: 400;
  font-size: 0.95rem;
}
.t-body p { margin: 4px 0 0; color: var(--text-dim); font-size: 0.95rem; }

/* ---------- repos ---------- */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.repo-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.repo-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.repo-card a.repo-title {
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.repo-card a.repo-title:hover { color: var(--accent); text-decoration: none; }
.repo-desc {
  color: var(--text-dim);
  font-size: 0.92rem;
  flex: 1;
  margin: 0;
}
.repo-story {
  color: var(--accent);
  font-size: 0.88rem;
  font-style: italic;
  margin: 0;
  padding: 8px 0 0;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.repo-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  padding-top: 8px;
  border-top: 1px solid var(--border);
}
.repo-meta .lang-dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
  background: var(--accent);
}
.repo-pin {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 1px;
  color: var(--accent-2);
  text-transform: uppercase;
}
.repo-skeleton {
  background:
    linear-gradient(110deg, var(--bg-card) 30%, var(--bg-elev) 50%, var(--bg-card) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius);
  height: 140px;
  border: 1px solid var(--border);
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ---------- reads ---------- */
.reads-filter {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.chip-btn {
  font-family: var(--mono);
  font-size: 0.8rem;
  background: var(--bg-elev);
  color: var(--text-dim);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  transition: all 0.18s ease;
}
.chip-btn:hover { color: var(--text); border-color: var(--border-strong); }
.chip-btn.is-active {
  background: var(--accent);
  color: #07101e;
  border-color: var(--accent);
}
.reads-list {
  display: grid;
  gap: 14px;
}
.read-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 20px;
  align-items: start;
  transition: border-color 0.18s ease;
}
.read-card:hover { border-color: var(--border-strong); }
.read-type {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--accent);
  padding-top: 4px;
}
.read-type.paper   { color: #b794ff; }
.read-type.article { color: #7cc4ff; }
.read-type.code    { color: #6fdc8c; }
.read-title {
  font-size: 1.04rem;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.read-title a { color: inherit; }
.read-title a:hover { color: var(--accent); text-decoration: none; }
.read-source {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-mute);
  margin: 0 0 10px;
}
.read-source .read-date { margin-left: 8px; }
.read-note {
  margin: 0;
  color: var(--text-dim);
  font-size: 0.95rem;
  border-left: 2px solid var(--border-strong);
  padding-left: 14px;
}

/* ---------- contact ---------- */
.contact-lead {
  max-width: 640px;
  color: var(--text-dim);
  margin: 0 0 28px;
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.contact-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--text);
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}
.contact-label {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-mute);
  letter-spacing: 1.1px;
  text-transform: uppercase;
}
.contact-value {
  font-size: 1.02rem;
}

/* ---------- 404 page ---------- */
.notfound {
  max-width: var(--max);
  margin: 0 auto;
  padding: 140px 28px 100px;
  text-align: center;
}
.nf-code {
  font-family: var(--mono);
  font-size: clamp(5rem, 16vw, 9rem);
  font-weight: 700;
  line-height: 1;
  margin: 0;
  background: linear-gradient(180deg, var(--accent) 0%, var(--accent-2) 100%);
  -webkit-background-clip: text;
          background-clip: text;
  color: transparent;
  letter-spacing: -0.04em;
}
.notfound h1 {
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  margin: 16px 0 14px;
}
.nf-lead {
  color: var(--text-dim);
  max-width: 520px;
  margin: 0 auto 32px;
}
.nf-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ---------- footer ---------- */
.footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 28px 60px;
  color: var(--text-mute);
  font-size: 0.85rem;
  font-family: var(--mono);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  border-top: 1px solid var(--border);
}
.footer p { margin: 0; }

/* ---------- responsive ---------- */
@media (max-width: 720px) {
  .nav { padding: 12px 18px; }
  .nav-links { gap: 14px; }
  .hero { padding: 80px 18px 64px; }
  .section { padding: 64px 18px; }
  .about-grid { grid-template-columns: 1fr; gap: 24px; }
  .read-card { grid-template-columns: 1fr; gap: 8px; }
  .read-type { padding-top: 0; }
  .footer { padding: 32px 18px 48px; }
}

@media (max-width: 480px) {
  .nav-links li:nth-child(2),
  .nav-links li:nth-child(4) { display: none; }
}

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