:root {
      --ink: #0c1219;
      --paper: #e8ecf2;
      --surface: #f7f9fc;
      --card: #ffffff;
      --steel: #4d5868;
      --muted: #7d8796;
      --line: #cdd5e0;
      --line-faint: #dde4ed;
      --signal: #2563eb;
      --signal-dim: rgba(37, 99, 235, 0.08);
      --signal-glow: rgba(37, 99, 235, 0.45);
      --display: 'Bricolage Grotesque', system-ui, sans-serif;
      --body: 'Manrope', system-ui, sans-serif;
      --mono: 'DM Mono', ui-monospace, monospace;
      --ease: cubic-bezier(0.22, 1, 0.36, 1);
      --rail: 232px;
      --main: 640px;
    }

    html.dark {
      --ink: #edf1f7;
      --paper: #070b11;
      --surface: #0d1219;
      --card: #111820;
      --steel: #a3adbc;
      --muted: #6e7a8c;
      --line: #1c2634;
      --line-faint: #151d28;
      --signal: #5b8ef5;
      --signal-dim: rgba(91, 142, 245, 0.1);
      --signal-glow: rgba(91, 142, 245, 0.5);
    }

    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }

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

    body {
      font-family: var(--body);
      font-size: 15px;
      line-height: 1.65;
      color: var(--steel);
      background: var(--paper);
      min-height: 100vh;
      -webkit-font-smoothing: antialiased;
    }

    body::before {
      content: '';
      position: fixed;
      inset: 0;
      pointer-events: none;
      z-index: 0;
      opacity: 0.45;
      background-image: radial-gradient(circle, var(--line) 1px, transparent 1px);
      background-size: 24px 24px;
      mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, black, transparent);
    }

    a { color: inherit; text-decoration: none; transition: color 0.2s var(--ease); }
    a:hover { color: var(--signal); }
    a:focus-visible, button:focus-visible {
      outline: 2px solid var(--signal);
      outline-offset: 3px;
    }

    .layout {
      position: relative;
      z-index: 1;
      max-width: calc(var(--rail) + var(--main) + 100px);
      margin: 0 auto;
      padding: 40px 28px 100px;
      display: grid;
      grid-template-columns: var(--rail) 1fr;
      gap: 0 64px;
      align-items: start;
    }

  /* —— sidebar —— */
    .rail {
      position: sticky;
      top: 40px;
    }

    .rail-name {
      font-family: var(--display);
      font-size: 1.35rem;
      font-weight: 700;
      color: var(--ink);
      letter-spacing: -0.03em;
      line-height: 1.15;
      margin-bottom: 4px;
    }

    .rail-role {
      font-size: 12px;
      font-weight: 500;
      color: var(--muted);
      margin-bottom: 20px;
    }

    .status {
      display: inline-flex;
      align-items: center;
      gap: 7px;
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: 0.04em;
      text-transform: uppercase;
      color: var(--signal);
      background: var(--signal-dim);
      padding: 5px 10px;
      border-radius: 100px;
      margin-bottom: 28px;
    }

    .status::before {
      content: '';
      width: 6px;
      height: 6px;
      border-radius: 50%;
      background: var(--signal);
      box-shadow: 0 0 8px var(--signal-glow);
      animation: blink 2.4s ease-in-out infinite;
    }

    @keyframes blink {
      0%, 100% { opacity: 1; }
      50% { opacity: 0.35; }
    }

    .rail-nav {
      list-style: none;
      margin-bottom: 32px;
    }

    .rail-nav a {
      display: block;
      font-size: 13px;
      font-weight: 500;
      color: var(--muted);
      padding: 7px 0 7px 14px;
      margin-left: -14px;
      border-left: 2px solid transparent;
      transition: border-color 0.2s, color 0.2s;
    }

    .rail-nav a:hover,
    .rail-nav a.active {
      color: var(--ink);
      border-left-color: var(--signal);
    }

    .rail-links {
      font-family: var(--mono);
      font-size: 11px;
      line-height: 2;
      color: var(--muted);
    }

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

    .theme {
      margin-top: 24px;
      font-family: var(--mono);
      font-size: 11px;
      padding: 7px 12px;
      border: 1px solid var(--line);
      border-radius: 6px;
      background: var(--card);
      color: var(--muted);
      cursor: pointer;
      width: 100%;
      text-align: left;
      transition: border-color 0.2s, color 0.2s;
    }
    .theme:hover { border-color: var(--signal); color: var(--ink); }

  /* —— main —— */
    main { min-width: 0; }

    .hero { margin-bottom: 40px; }

    .trace-wrap {
      height: 88px;
      margin-bottom: 32px;
      border-radius: 12px;
      background: var(--card);
      border: 1px solid var(--line-faint);
      padding: 8px 12px;
      overflow: hidden;
    }

    .trace-wrap svg { width: 100%; height: 100%; display: block; }

    .trace-ghost {
      fill: none;
      stroke: var(--line-faint);
      stroke-width: 1;
      stroke-linecap: round;
      opacity: 0.7;
    }

    .trace-path {
      fill: none;
      stroke: var(--line);
      stroke-width: 1.5;
      stroke-linecap: round;
    }

    .trace-pulse {
      fill: var(--signal);
      filter: drop-shadow(0 0 8px var(--signal-glow));
    }

    @keyframes travel {
      0% { offset-distance: 0%; opacity: 0; }
      4% { opacity: 1; }
      96% { opacity: 1; }
      100% { offset-distance: 100%; opacity: 0; }
    }

    .pulse-dot {
      offset-path: path('M 8 58 Q 140 12, 280 46 T 560 32 T 880 52');
      animation: travel 9s var(--ease) infinite;
    }

    .hero h1 {
      font-family: var(--display);
      font-size: clamp(2.6rem, 6vw, 3.75rem);
      font-weight: 700;
      color: var(--ink);
      letter-spacing: -0.04em;
      line-height: 1;
      margin-bottom: 16px;
    }

    .hero h1 span {
      display: block;
      font-size: 0.42em;
      font-weight: 500;
      letter-spacing: 0.02em;
      color: var(--muted);
      margin-top: 10px;
    }

    .hero .lede {
      font-size: 16px;
      line-height: 1.8;
      max-width: 540px;
      margin-bottom: 24px;
    }

    .meta-chips {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
    }

    .meta-chips a {
      font-family: var(--mono);
      font-size: 11px;
      padding: 7px 12px;
      border-radius: 6px;
      border: 1px solid var(--line);
      background: var(--card);
      color: var(--muted);
      transition: border-color 0.2s, color 0.2s, transform 0.2s var(--ease);
    }

    .meta-chips a:hover {
      border-color: var(--signal);
      color: var(--ink);
      transform: translateY(-1px);
    }

  /* —— readouts —— */
    .readouts {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 12px;
      margin-bottom: 52px;
    }

    .readout {
      background: var(--card);
      border: 1px solid var(--line-faint);
      border-radius: 10px;
      padding: 18px 16px;
      transition: border-color 0.25s, box-shadow 0.25s var(--ease);
    }

    .readout:hover {
      border-color: color-mix(in srgb, var(--signal) 35%, var(--line));
      box-shadow: 0 8px 24px -12px color-mix(in srgb, var(--signal) 25%, transparent);
    }

    .readout strong {
      display: block;
      font-family: var(--display);
      font-size: 1.75rem;
      font-weight: 700;
      color: var(--ink);
      line-height: 1;
      margin-bottom: 6px;
      font-variant-numeric: tabular-nums;
    }

    .readout span {
      font-size: 12px;
      color: var(--muted);
      line-height: 1.45;
    }

  /* —— sections —— */
    .block {
      margin-bottom: 48px;
      scroll-margin-top: 48px;
    }

    .block-title {
      display: flex;
      align-items: center;
      gap: 10px;
      font-family: var(--display);
      font-size: 1rem;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 24px;
    }

    .block-title::before {
      content: '';
      width: 8px;
      height: 8px;
      border-radius: 2px;
      background: var(--signal);
      flex-shrink: 0;
    }

  /* —— timeline jobs —— */
    .timeline {
      position: relative;
      padding-left: 28px;
    }

    .timeline::before {
      content: '';
      position: absolute;
      left: 5px;
      top: 8px;
      bottom: 8px;
      width: 1px;
      background: linear-gradient(to bottom, var(--signal), var(--line) 80%);
      opacity: 0.5;
    }

    .job {
      position: relative;
      padding-bottom: 28px;
    }

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

    .job::before {
      content: '';
      position: absolute;
      left: -28px;
      top: 6px;
      width: 11px;
      height: 11px;
      border-radius: 50%;
      background: var(--card);
      border: 2px solid var(--line);
      transition: border-color 0.2s, box-shadow 0.2s;
    }

    .job:hover::before {
      border-color: var(--signal);
      box-shadow: 0 0 0 4px var(--signal-dim);
    }

    .job-card {
      background: var(--card);
      border: 1px solid var(--line-faint);
      border-radius: 10px;
      padding: 20px 22px;
      transition: border-color 0.25s var(--ease);
    }

    .job:hover .job-card { border-color: var(--line); }

    .job-head {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      flex-wrap: wrap;
      gap: 6px 12px;
      margin-bottom: 4px;
    }

    .job-head h3 {
      font-family: var(--display);
      font-size: 1.05rem;
      font-weight: 600;
      color: var(--ink);
    }

    .job-when {
      font-family: var(--mono);
      font-size: 10px;
      color: var(--muted);
    }

    .job-title {
      font-size: 12px;
      color: var(--muted);
      margin-bottom: 14px;
    }

    .job ul { list-style: none; }

    .job li {
      font-size: 14px;
      padding-left: 16px;
      position: relative;
      margin-bottom: 8px;
      line-height: 1.6;
    }

    .job li::before {
      content: '→';
      position: absolute;
      left: 0;
      font-family: var(--mono);
      font-size: 11px;
      color: var(--signal);
      opacity: 0.6;
    }

  /* —— skills chips —— */
    .skills-panel {
      background: var(--card);
      border: 1px solid var(--line-faint);
      border-radius: 10px;
      padding: 22px;
    }

    .skill-group { margin-bottom: 20px; }
    .skill-group:last-child { margin-bottom: 0; }

    .skill-label {
      font-family: var(--mono);
      font-size: 10px;
      letter-spacing: 0.08em;
      text-transform: uppercase;
      color: var(--muted);
      margin-bottom: 10px;
    }

    .chips {
      display: flex;
      flex-wrap: wrap;
      gap: 7px;
    }

    .chips span {
      font-size: 12px;
      padding: 5px 10px;
      border-radius: 5px;
      background: var(--surface);
      border: 1px solid var(--line-faint);
      color: var(--steel);
    }

  /* —— education & contact —— */
    .edu {
      background: var(--card);
      border: 1px solid var(--line-faint);
      border-radius: 10px;
      padding: 20px 22px;
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 12px;
    }

    .edu h3 {
      font-family: var(--display);
      font-size: 1rem;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 4px;
    }

    .edu-aside {
      font-family: var(--mono);
      font-size: 11px;
      color: var(--muted);
      text-align: right;
      line-height: 1.8;
    }

    .contact-panel {
      background: var(--card);
      border: 1px solid var(--line-faint);
      border-left: 3px solid var(--signal);
      border-radius: 10px;
      padding: 28px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      flex-wrap: wrap;
      gap: 20px;
    }

    .contact-panel h3 {
      font-family: var(--display);
      font-size: 1.2rem;
      font-weight: 600;
      color: var(--ink);
      margin-bottom: 6px;
    }

    .contact-panel p { font-size: 14px; max-width: 340px; }

    .btns { display: flex; gap: 10px; flex-wrap: wrap; }

    .btn {
      font-family: var(--mono);
      font-size: 12px;
      padding: 10px 16px;
      border-radius: 6px;
      border: 1px solid var(--line);
      color: var(--steel);
      transition: all 0.2s var(--ease);
    }

    .btn:hover {
      border-color: var(--signal);
      color: var(--ink);
      transform: translateY(-1px);
    }

    .btn-primary {
      background: var(--signal);
      border-color: var(--signal);
      color: #fff;
    }

    .btn-primary:hover {
      opacity: 0.92;
      color: #fff;
      box-shadow: 0 6px 20px -6px var(--signal-glow);
    }

    footer {
      margin-top: 56px;
      padding-top: 20px;
      border-top: 1px solid var(--line-faint);
      display: flex;
      justify-content: space-between;
      flex-wrap: wrap;
      gap: 8px;
      font-family: var(--mono);
      font-size: 11px;
      color: var(--muted);
    }

    .visits [data-visits] { color: var(--ink); }

    .mobile-bar {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      right: 0;
      z-index: 30;
      padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
      background: color-mix(in srgb, var(--card) 92%, transparent);
      backdrop-filter: blur(14px);
      border-top: 1px solid var(--line-faint);
      justify-content: space-around;
      gap: 4px;
    }

    .mobile-bar a {
      font-size: 11px;
      font-weight: 500;
      color: var(--muted);
      padding: 6px 8px;
    }

    .mobile-bar a.active { color: var(--signal); }

    @media (max-width: 820px) {
      .layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 24px 20px 88px;
      }

      .rail {
        position: static;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 12px 16px;
        padding-bottom: 24px;
        margin-bottom: 28px;
        border-bottom: 1px solid var(--line-faint);
      }

      .rail-name { font-size: 1.15rem; margin-bottom: 0; }
      .rail-role { margin-bottom: 0; width: 100%; }
      .status { margin-bottom: 0; order: 3; }
      .rail-nav {
        display: flex;
        flex-wrap: wrap;
        gap: 4px 14px;
        margin-bottom: 0;
        width: 100%;
        order: 4;
      }
      .rail-nav a { border-left: none; padding-left: 0; margin-left: 0; }
      .rail-links, .theme { display: none; }
      .mobile-bar { display: flex; }
      .readouts { grid-template-columns: 1fr; }
      .edu-aside { text-align: left; }
      .contact-panel { flex-direction: column; align-items: flex-start; }
    }

    @media (prefers-reduced-motion: no-preference) {
      .reveal {
        opacity: 0;
        transform: translateY(16px);
        transition: opacity 0.6s var(--ease), transform 0.6s var(--ease);
      }
      .reveal.in { opacity: 1; transform: none; }
    }

/* —— blog listing —— */
.blog-list { display: flex; flex-direction: column; gap: 12px; }

.blog-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  padding: 20px 22px;
  transition: border-color 0.25s var(--ease), transform 0.2s var(--ease), box-shadow 0.25s var(--ease);
}

.blog-card:hover {
  border-color: color-mix(in srgb, var(--signal) 35%, var(--line));
  color: inherit;
  transform: translateY(-1px);
  box-shadow: 0 10px 28px -14px color-mix(in srgb, var(--signal) 28%, transparent);
}

.blog-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.blog-card-meta .tag {
  color: var(--signal);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.blog-card h3 {
  font-family: var(--display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  letter-spacing: -0.02em;
  margin-bottom: 8px;
  line-height: 1.3;
}

.blog-card:hover h3 { color: var(--signal); }

.blog-card p {
  font-size: 14px;
  line-height: 1.65;
  color: var(--steel);
}

.blog-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 20px;
  background: var(--card);
  border: 1px dashed var(--line);
  border-radius: 10px;
}

.section-more {
  margin-top: 16px;
  font-family: var(--mono);
  font-size: 12px;
}

.section-more a { color: var(--signal); }

/* —— blog post reading —— */
.layout.post-layout {
  grid-template-columns: 1fr;
  max-width: 720px;
}

.post-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 36px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-faint);
}

.post-top a {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}

.post-top a:hover { color: var(--signal); }

.post-header { margin-bottom: 36px; }

.post-header .eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--signal);
  margin-bottom: 12px;
}

.post-header h1 {
  font-family: var(--display);
  font-size: clamp(1.85rem, 5vw, 2.6rem);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-bottom: 14px;
}

.post-header .post-lede {
  font-size: 16px;
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: 16px;
}

.post-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.prose-post {
  font-size: 15.5px;
  line-height: 1.8;
  color: var(--steel);
}

.prose-post h2 {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--ink);
  margin: 36px 0 12px;
  letter-spacing: -0.02em;
}

.prose-post h3 {
  font-family: var(--display);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--ink);
  margin: 28px 0 10px;
}

.prose-post p { margin-bottom: 16px; }

.prose-post ul, .prose-post ol {
  margin: 0 0 16px 1.2em;
}

.prose-post li { margin-bottom: 6px; }

.prose-post code {
  font-family: var(--mono);
  font-size: 0.88em;
  background: var(--signal-dim);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink);
}

.prose-post pre {
  background: var(--card);
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  padding: 16px 18px;
  overflow-x: auto;
  margin-bottom: 20px;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.6;
}

.prose-post pre code {
  background: none;
  padding: 0;
}

.prose-post blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 3px solid var(--signal);
  background: var(--signal-dim);
  border-radius: 0 8px 8px 0;
  color: var(--ink);
}

.prose-post a {
  color: var(--signal);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: color-mix(in srgb, var(--signal) 40%, transparent);
}

.prose-post a:hover { text-decoration-color: var(--signal); }

.prose-post .table-wrap {
  overflow-x: auto;
  margin: 0 0 20px;
  border: 1px solid var(--line-faint);
  border-radius: 10px;
  background: var(--card);
}

.prose-post table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

.prose-post th,
.prose-post td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line-faint);
  vertical-align: top;
}

.prose-post th {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

.prose-post tr:last-child td { border-bottom: none; }

.post-end {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--line-faint);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--mono);
  font-size: 12px;
}

@media (max-width: 820px) {
  .layout.post-layout { padding-bottom: 40px; }
}
