:root {
  --bg: #f0edf4;
  --bg-elevated: #faf9fc;
  --bg-header: rgba(240, 237, 244, 0.88);
  --text: #3d3846;
  --text-dim: #8e8899;
  --text-bright: #1e1a26;
  --accent: #7c5cbf;
  --accent-glow: rgba(124, 92, 191, 0.12);
  --border: #ddd8e6;
  --mono: 'SF Mono', 'Cascadia Code', 'Fira Code', 'JetBrains Mono', monospace;
  --sans: -apple-system, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.7;
  overflow-x: hidden;
}

/* paper texture */
.paper-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
}

/* subtle grid */
.grid-bg {
  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.15;
  mask-image: radial-gradient(ellipse at 50% 20%, black 5%, transparent 60%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 20%, black 5%, transparent 60%);
}

/* header */
header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: var(--bg-header);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 5%;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.header-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.header-left h1 {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-bright);
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.header-left .tagline {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--accent);
  min-height: 1.2em;
  line-height: 1.2;
}
.header-left .tagline .cursor {
  display: inline-block;
  width: 0.5em;
  height: 0.9em;
  background: var(--accent);
  margin-left: 1px;
  vertical-align: text-bottom;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* nav */
nav { display: flex; gap: 4px; }
nav a {
  font-size: 0.85rem;
  color: var(--text-dim);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}
nav a:hover { color: var(--text); background: var(--bg-elevated); }
nav a.active { color: var(--accent); background: var(--accent-glow); }

/* layout */
main {
  width: 90%;
  margin: 0 auto;
  padding: 120px 0 60px;
}

/* section */
section { margin-bottom: 48px; }
.sec-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  margin-bottom: 24px;
}
.sec-label::before { content: '// '; color: var(--text-dim); }

/* about */
.about p { color: var(--text); margin-bottom: 16px; font-size: 1rem; }

/* activity table */
.activity-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.activity-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 10px 12px;
  border-bottom: 1px solid var(--accent);
}
.activity-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
.activity-table .date {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  white-space: nowrap;
}
.activity-table .type {
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--accent);
  white-space: nowrap;
}
.activity-table a {
  font-weight: 600;
  color: var(--text-bright);
  text-decoration: none;
}
.activity-table a:hover { color: var(--accent); }
.activity-table .desc {
  color: var(--text-dim);
  font-size: 0.82rem;
  line-height: 1.6;
  display: block;
  margin-top: 2px;
}

/* spec block */
.spec {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--text-dim);
  border-left: 2px solid var(--accent);
  padding-left: 16px;
  margin-top: 24px;
  line-height: 1.9;
}
.spec .spec-key { color: var(--text); }
.spec .spec-val { color: var(--accent); }

/* cards */
.card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px 24px;
  margin-bottom: 16px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 4px 24px var(--accent-glow);
}
.card .card-title {
  font-weight: 600;
  color: var(--text-bright);
  margin-bottom: 6px;
  font-size: 0.95rem;
}
.card .card-title a { color: inherit; text-decoration: none; }
.card .card-title a:hover { color: var(--accent); }
.card .card-desc { font-size: 0.85rem; color: var(--text-dim); }
.card .card-tags {
  display: flex;
  gap: 12px;
  margin-top: 10px;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-dim);
}
.card .card-tags span::before { content: '#'; color: var(--accent); opacity: 0.5; }

/* repo pager */
.pager { display: flex; align-items: center; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.page-btn {
  font-family: var(--mono); font-size: 0.75rem; padding: 4px 10px;
  border: 1px solid var(--border); background: var(--bg-elevated); color: var(--text-dim);
  border-radius: 6px; cursor: pointer; transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.page-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); }
.page-btn.active { color: var(--accent); background: var(--accent-glow); border-color: var(--accent); }
.page-btn:disabled { opacity: 0.35; cursor: default; }
.pager-info { font-family: var(--mono); font-size: 0.75rem; color: var(--text-dim); margin-left: auto; }

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.visible { opacity: 1; transform: translateY(0); }

/* footer */
footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  font-family: var(--mono);
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
}
footer a { color: var(--accent); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* links */
a { color: var(--accent); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* hardware table */
.hw-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  margin-top: 20px;
}
.hw-table th {
  text-align: left;
  font-family: var(--mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.hw-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}
.hw-table td:first-child { font-family: var(--mono); font-size: 0.8rem; }
.hw-table .val { color: var(--accent); }

/* contact */
.contact-list { list-style: none; }
.contact-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.contact-list .icon {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--accent);
  width: 32px;
  text-align: center;
}
.contact-list .label { color: var(--text-dim); font-size: 0.85rem; }

@media (max-width: 640px) {
  header { padding: 12px 16px; height: auto; flex-direction: column; align-items: flex-start; gap: 8px; }
  nav { width: 100%; justify-content: flex-start; overflow-x: auto; }
  main { padding-top: 160px; width: 95%; }
}
