  :root {
    --paper: #ffffff;
    --ink: #161616;
    --slate: #6b6b6b;
    --hairline: #e3e3e3;
    --terminal: #111111;
    --terminal-text: #e8e8e8;
    --dot-empty: #d6d6d6;
    --nav-bg: rgba(255,255,255,0.88);
    --body-text: #2a2a2a;
    --faint: #c2c2c2;
    --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  }

  html[data-theme="dark"] {
    --paper: #0b0b0c;
    --ink: #f2f2f2;
    --slate: #9a9a9a;
    --hairline: #2a2a2a;
    --terminal: #000000;
    --terminal-text: #eaeaea;
    --dot-empty: #3a3a3a;
    --nav-bg: rgba(10,10,10,0.78);
    --body-text: #cfcfcf;
    --faint: #3a3a3a;
  }

  * { box-sizing: border-box; }

  html { scroll-behavior: smooth; }

  body {
    margin: 0;
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color .4s ease, color .4s ease;
  }

  a { color: inherit; }

  .wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 28px;
  }

  /* ---------- scroll progress ---------- */
  .scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 2.5px;
    width: 0%;
    background: var(--ink);
    z-index: 30;
    transition: width .08s linear, background-color .4s ease;
  }

  /* ---------- nav ---------- */
  header.nav {
    position: sticky;
    top: 0;
    z-index: 10;
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(6px);
    border-bottom: 1px solid var(--hairline);
    transition: background-color .4s ease, border-color .4s ease;
  }

  .nav-inner {
    max-width: 760px;
    margin: 0 auto;
    padding: 16px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
  }

  .logo {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.02em;
  }

  .logo span { color: var(--slate); }

  .nav-right {
    display: flex;
    align-items: center;
    gap: 22px;
  }

  nav.links {
    display: flex;
    gap: 22px;
  }

  .menu-prompt { display: none; }

  nav.links a {
    position: relative;
    font-family: var(--mono);
    font-size: 12.5px;
    text-decoration: none;
    color: var(--slate);
    letter-spacing: 0.03em;
    padding-bottom: 4px;
    transition: color .15s ease;
  }

  nav.links a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 1px;
    background: var(--ink);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
  }

  nav.links a:hover,
  nav.links a:focus-visible {
    color: var(--ink);
  }

  nav.links a:hover::after,
  nav.links a:focus-visible::after {
    transform: scaleX(1);
  }

  /* ---------- theme toggle: lightbulb + cord ---------- */
  .bulb-toggle {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0 4px;
    flex-shrink: 0;
  }

  .bulb-cord {
    display: block;
    width: 1px;
    height: 10px;
    background: var(--hairline);
    margin-top: 2px;
    transition: background-color .4s ease;
    position: relative;
  }

  @keyframes pullCord {
    0% { height: 10px; }
    40% { height: 22px; }
    70% { height: 7px; }
    100% { height: 10px; }
  }

  .bulb-toggle.pulled .bulb-cord {
    animation: pullCord .42s ease;
  }

  .bulb-bead {
    position: absolute;
    left: 50%;
    bottom: -3px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--hairline);
    transform: translateX(-50%);
    transition: background-color .4s ease;
  }

  .bulb-icon {
    width: 21px;
    height: 21px;
    color: var(--ink);
    transition: color .4s ease, filter .4s ease;
  }

  .bulb-rays {
    opacity: 1;
    transition: opacity .3s ease;
  }

  .bulb-toggle[aria-checked="true"] .bulb-icon {
    color: var(--slate);
    filter: none;
  }

  .bulb-toggle[aria-checked="true"] .bulb-rays {
    opacity: 0;
  }

  .bulb-toggle[aria-checked="false"] .bulb-icon {
    filter: drop-shadow(0 0 3px rgba(22,22,22,0.18));
  }

  html[data-theme="dark"] .bulb-toggle[aria-checked="false"] .bulb-icon {
    filter: drop-shadow(0 0 4px rgba(242,242,242,0.35));
  }

  /* ---------- language toggle ---------- */
  .lang-toggle {
    display: flex;
    align-items: center;
    font-family: var(--mono);
    font-size: 11.5px;
    font-weight: 600;
    background: none;
    border: 1px solid var(--hairline);
    border-radius: 5px;
    padding: 5px 2px;
    cursor: pointer;
    color: var(--slate);
    flex-shrink: 0;
    transition: border-color .4s ease;
  }

  .lang-toggle span {
    padding: 2px 7px;
    border-radius: 3px;
    transition: background-color .2s ease, color .2s ease;
  }

  .lang-toggle span.active {
    background: var(--ink);
    color: var(--paper);
  }

  /* ---------- mobile hamburger ---------- */
  .hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
  }

  .hamburger .ham-line {
    display: block;
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    transition: transform .3s ease, opacity .2s ease, background-color .4s ease;
  }

  .hamburger[aria-expanded="true"] .ham-line:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }
  .hamburger[aria-expanded="true"] .ham-line:nth-child(2) {
    opacity: 0;
  }
  .hamburger[aria-expanded="true"] .ham-line:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  /* ---------- hero ---------- */
  .hero {
    padding: 72px 0 48px;
  }

  .hero-top {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 28px;
  }

  .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
  }

  .hero h1 {
    font-size: 40px;
    line-height: 1.1;
    margin: 0 0 6px;
    letter-spacing: -0.02em;
    font-weight: 700;
  }

  .hero .role {
    font-family: var(--mono);
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--slate);
    font-weight: 600;
  }

  .hero p.lede {
    font-size: 17px;
    color: var(--body-text);
    max-width: 58ch;
    margin: 0 0 24px;
    transition: color .4s ease;
  }

  .cta-row {
    display: flex;
    gap: 14px;
    margin-bottom: 32px;
  }

  .btn-download {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--paper);
    background: var(--ink);
    border: 1px solid var(--ink);
    border-radius: 6px;
    padding: 10px 18px;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .3s ease, color .3s ease, border-color .3s ease, transform .15s ease;
  }

  .btn-download:hover {
    transform: translateY(-1px);
  }

  .btn-download svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }

  .btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--ink);
    background: transparent;
    border: 1px solid var(--hairline);
    border-radius: 6px;
    padding: 9px 16px;
    text-decoration: none;
    cursor: pointer;
    margin-top: 14px;
    transition: background-color .3s ease, color .3s ease, border-color .4s ease;
  }

  .btn-outline:hover {
    border-color: var(--ink);
  }

  .btn-outline svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
  }

  /* ---------- terminal signature ---------- */
  .terminal {
    position: relative;
    background: var(--terminal);
    color: var(--terminal-text);
    border-radius: 8px;
    padding: 20px 22px 22px;
    font-family: var(--mono);
    font-size: 13.5px;
    overflow: hidden;
    --mx: 50%;
    --my: 30%;
  }

  .terminal::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at var(--mx) var(--my), rgba(255,255,255,0.09), transparent 55%);
    pointer-events: none;
    transition: background .2s ease;
  }

  .terminal-bar, .terminal pre {
    position: relative;
    z-index: 1;
  }

  .terminal-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
  }

  .dot-btn {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #444;
  }

  .terminal pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .terminal .prompt { color: #8a8a8a; }
  .terminal .comment { color: #8f8f8f; }
  .terminal .str { color: #cfcfcf; }

  .caret {
    display: inline-block;
    width: 7px;
    height: 15px;
    background: var(--terminal-text);
    margin-left: 2px;
    vertical-align: -2px;
    animation: blink 1s steps(1) infinite;
  }

  @keyframes blink {
    50% { opacity: 0; }
  }

  /* ---------- sections ---------- */
  section {
    padding: 52px 0;
    border-top: 1px solid var(--hairline);
    transition: border-color .4s ease;
  }

  .eyebrow {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--slate);
    margin: 0 0 22px;
    font-weight: 600;
  }

  .eyebrow::before { content: "// "; color: var(--faint); transition: color .4s ease; }

  section p {
    font-size: 16px;
    color: var(--body-text);
    max-width: 62ch;
    transition: color .4s ease;
  }

  /* ---------- experience ---------- */
  .timeline {
    position: relative;
  }

  .role-item {
    position: relative;
    padding-left: 26px;
    padding-bottom: 34px;
    border-left: 1px solid var(--hairline);
    transition: border-color .4s ease, opacity .6s ease, transform .6s ease;
    opacity: 0;
    transform: translateY(16px);
  }

  .role-item.in {
    opacity: 1;
    transform: translateY(0);
  }

  .role-item:nth-child(1) { transition-delay: 0ms, 0ms, 0ms; }
  .role-item:nth-child(2) { transition-delay: 0ms, 110ms, 110ms; }
  .role-item:nth-child(3) { transition-delay: 0ms, 220ms, 220ms; }

  .role-item:last-child { padding-bottom: 0; }

  .role-item::before {
    content: "";
    position: absolute;
    left: -4.5px;
    top: 4px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ink);
  }

  .role-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px 16px;
  }

  .role-title {
    font-weight: 700;
    font-size: 16.5px;
  }

  .role-dates {
    font-family: var(--mono);
    font-size: 12.5px;
    color: var(--slate);
    white-space: nowrap;
  }

  .role-company {
    font-style: italic;
    color: var(--slate);
    font-size: 14.5px;
    margin: 2px 0 10px;
  }

  .role-desc {
    font-size: 15px;
    color: var(--body-text);
    max-width: 58ch;
    transition: color .4s ease;
  }

  /* ---------- workflow diagram ---------- */
  .flow-diagram {
    margin: 6px 0 32px;
  }

  .flow-diagram svg {
    width: 100%;
    height: auto;
    display: block;
  }

  .flow-node rect {
    fill: none;
    stroke: var(--hairline);
    transition: stroke .4s ease;
  }

  .flow-node text {
    fill: var(--ink);
    font-family: var(--mono);
    transition: fill .4s ease;
  }

  .flow-sub {
    fill: var(--slate) !important;
    font-size: 9.5px;
    transition: fill .4s ease;
  }

  .flow-arrow {
    stroke: var(--hairline);
    stroke-width: 1.4;
    fill: none;
    stroke-dasharray: 4 3;
    transition: stroke .4s ease;
  }

  .flow-arrow-head {
    fill: var(--slate);
    transition: fill .4s ease;
  }

  @media (prefers-reduced-motion: no-preference) {
    .flow-arrow {
      animation: flowDash 1.2s linear infinite;
    }
  }

  @keyframes flowDash {
    to { stroke-dashoffset: -14; }
  }

  .flow-diagram-mobile { display: none; }

  @media (max-width: 620px) {
    .flow-diagram-desktop { display: none; }
    .flow-diagram-mobile {
      display: flex;
      flex-direction: column;
      align-items: center;
      margin: 6px 0 28px;
    }
    .flow-mobile-item {
      border: 1px solid var(--hairline);
      border-radius: 8px;
      padding: 12px 20px;
      text-align: center;
      width: 100%;
      transition: border-color .4s ease;
    }
    .flow-mobile-item strong {
      font-family: var(--mono);
      font-size: 13px;
      display: block;
      margin-bottom: 3px;
    }
    .flow-mobile-item span {
      font-size: 11.5px;
      color: var(--slate);
      transition: color .4s ease;
    }
    .flow-mobile-arrow {
      color: var(--slate);
      font-size: 14px;
      padding: 4px 0;
      transition: color .4s ease;
    }
  }

  /* ---------- skills ---------- */
  .skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px 40px;
  }

  .skill-group { margin-bottom: 18px; }

  .skill-group h4 {
    font-family: var(--mono);
    font-size: 11.5px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--slate);
    margin: 0 0 10px;
    font-weight: 600;
    transition: color .4s ease;
  }

  .skill-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 5px 0;
    font-size: 14.5px;
  }

  .skill-dots {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--ink);
  }

  .skill-dots .empty { color: var(--dot-empty); }

  /* ---------- projects ---------- */
  .project-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
  }

  .project-card {
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 20px 20px 18px;
    transition: border-color .4s ease;
  }

  .project-card .p-name {
    font-weight: 700;
    font-size: 15.5px;
    margin-bottom: 6px;
  }

  .project-card .p-desc {
    font-size: 14px;
    color: var(--body-text);
    margin-bottom: 12px;
    transition: color .4s ease;
  }

  .project-card .p-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
  }

  .project-card .p-tags span {
    font-family: var(--mono);
    font-size: 10.5px;
    color: var(--slate);
    border: 1px solid var(--hairline);
    border-radius: 4px;
    padding: 2px 7px;
    transition: color .4s ease, border-color .4s ease;
  }

  .project-card .p-link {
    font-family: var(--mono);
    font-size: 12.5px;
    text-decoration: none;
    border-bottom: 1px solid var(--hairline);
    padding-bottom: 1px;
  }

  .project-card .p-note {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--faint);
    transition: color .4s ease;
  }

  .placeholder-note {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--faint);
    margin-top: 16px;
    transition: color .4s ease;
  }

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

  /* ---------- education ---------- */
  .edu-item {
    padding: 12px 0;
    border-bottom: 1px solid var(--hairline);
    transition: border-color .4s ease;
  }
  .edu-item:last-child { border-bottom: none; }

  .edu-title { font-weight: 600; font-size: 15px; }
  .edu-meta {
    font-size: 13px;
    color: var(--slate);
    font-style: italic;
    margin-top: 2px;
  }

  /* ---------- certification badges ---------- */
  .cert-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
  }

  .cert-badge {
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid var(--hairline);
    border-radius: 8px;
    padding: 12px 14px;
    transition: border-color .4s ease;
  }

  .cert-badge svg {
    width: 26px;
    height: 26px;
    color: var(--slate);
    flex-shrink: 0;
    transition: color .4s ease;
  }

  .cert-badge .cert-title {
    font-weight: 600;
    font-size: 13.5px;
  }

  .cert-badge .cert-meta {
    font-size: 12px;
    color: var(--slate);
    font-style: italic;
    margin-top: 1px;
    transition: color .4s ease;
  }

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

  /* ---------- contact / footer ---------- */
  footer {
    padding: 52px 0 70px;
    border-top: 1px solid var(--hairline);
    transition: border-color .4s ease;
  }

  .contact-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 6px;
  }

  .contact-list a {
    text-decoration: none;
    font-size: 15px;
    display: inline-flex;
    align-items: baseline;
    gap: 10px;
  }

  .contact-list a .k {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--slate);
    width: 64px;
    flex-shrink: 0;
  }

  .contact-list a:hover .v { text-decoration: underline; }

  .foot-note {
    margin-top: 40px;
    font-size: 12.5px;
    color: var(--slate);
    font-family: var(--mono);
    transition: color .4s ease;
  }

  /* ---------- interactive terminal ---------- */
  .iterm {
    position: relative;
    background: var(--terminal);
    color: var(--terminal-text);
    border-radius: 8px;
    padding: 16px 18px 14px;
    font-family: var(--mono);
    font-size: 13.5px;
    margin: 22px 0 8px;
  }

  .iterm-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 12px;
  }

  .iterm-out {
    max-height: 220px;
    overflow-y: auto;
    margin-bottom: 8px;
  }

  .iterm-out div { margin-bottom: 6px; white-space: pre-wrap; word-break: break-word; }
  .iterm-out .echo { color: #9a9a9a; }
  .iterm-out .resp { color: var(--terminal-text); }
  .iterm-out .err { color: #d98a8a; }
  .iterm-out .ok { color: #8fcf9f; }

  .iterm-line {
    display: flex;
    align-items: center;
    gap: 8px;
  }

  .iterm-line .prompt { color: #8a8a8a; flex-shrink: 0; }

  .iterm-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--terminal-text);
    font-family: var(--mono);
    font-size: 13.5px;
    flex: 1;
    caret-color: var(--terminal-text);
  }

  .iterm-input::placeholder { color: #5c5c5c; }

  .iterm-hint {
    font-family: var(--mono);
    font-size: 11.5px;
    color: var(--faint);
    margin-top: 10px;
    transition: color .4s ease;
  }

  /* ---------- reveal on scroll ---------- */
  .reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .6s ease, transform .6s ease;
  }
  .reveal.in {
    opacity: 1;
    transform: translateY(0);
  }

  @media (max-width: 620px) {
    .hero h1 { font-size: 32px; }
    .skills-grid { grid-template-columns: 1fr; }
    .nav-inner { padding: 14px 20px; }
    .wrap { padding: 0 20px; }

    .hamburger { display: inline-flex; }

    nav.links {
      display: none;
      position: absolute;
      top: 100%;
      left: 16px;
      right: 16px;
      margin-top: 8px;
      flex-direction: column;
      background: var(--terminal);
      border-radius: 8px;
      padding: 14px 6px 10px;
      box-shadow: 0 12px 28px rgba(0,0,0,0.28);
    }

    nav.links.open { display: flex; }

    .menu-prompt {
      display: block;
      font-family: var(--mono);
      font-size: 12px;
      color: #8a8a8a;
      padding: 0 12px 10px;
    }

    .menu-prompt .caret {
      width: 6px;
      height: 12px;
    }

    nav.links a {
      position: relative;
      font-family: var(--mono);
      font-size: 14px;
      color: var(--terminal-text);
      padding: 10px 12px;
      border-radius: 5px;
      text-transform: lowercase;
      transition: background-color .15s ease;
    }

    nav.links a::before {
      content: "▸";
      display: inline-block;
      width: 16px;
      color: #6a6a6a;
      transition: color .15s ease, transform .15s ease;
    }

    nav.links a::after {
      content: "/";
      position: static;
      display: inline;
      width: auto;
      height: auto;
      background: none;
      transform: none;
      color: #6a6a6a;
    }

    nav.links a:hover,
    nav.links a:focus-visible,
    nav.links a:active {
      background: rgba(255,255,255,0.08);
      color: #ffffff;
    }

    nav.links a:hover::before,
    nav.links a:focus-visible::before {
      color: #ffffff;
      transform: translateX(2px);
    }
  }

  @media (max-width: 420px) {
    .nav-inner { padding: 12px 16px; }
    .logo { font-size: 13px; }
  }

  @media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .reveal, .role-item { opacity: 1; transform: none; transition: none !important; }
    .caret { animation: none; }
    .scroll-progress { transition: none; }
  }
