  :root {
    --bg: #0b0d10;
    --bg-2: #101317;
    --bg-3: #161a20;
    --line: #1f242c;
    --fg: #e6e8eb;
    --fg-dim: #9aa3ad;
    --fg-mute: #838c98;
    --accent: #7cf0b6;
    --accent-2: #5ad1ff;
    --danger: #ff7a7a;
    --radius: 14px;
    --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
    --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, Roboto, sans-serif;
  }

  * { box-sizing: border-box; }
  html, body { margin: 0; padding: 0; }

  /* Skip link — visible on focus for keyboard users */
  .skip-link {
    position: absolute;
    top: -48px;
    left: 12px;
    z-index: 1000;
    padding: 10px 16px;
    background: var(--accent);
    color: #06281a;
    font-weight: 600;
    font-size: 14px;
    border-radius: 0 0 10px 10px;
    transition: top .15s ease;
  }
  .skip-link:focus {
    top: 0;
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    color: #06281a;
  }
  html {
    scroll-behavior: smooth;
    scrollbar-gutter: stable;
  }
  body {
    background: var(--bg);
    color: var(--fg);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
  }

  /* Ambient background gradient */
  body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
      radial-gradient(60rem 40rem at 85% -10%, rgba(124, 240, 182, 0.08), transparent 60%),
      radial-gradient(50rem 35rem at -10% 20%, rgba(90, 209, 255, 0.06), transparent 60%),
      radial-gradient(40rem 30rem at 50% 120%, rgba(124, 240, 182, 0.04), transparent 60%);
    z-index: -1;
    pointer-events: none;
  }

  /* Subtle grid overlay */
  body::after {
    content: "";
    position: fixed;
    inset: 0;
    background-image:
      linear-gradient(rgba(255,255,255,0.015) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255,255,255,0.015) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse at center, black 40%, transparent 80%);
    z-index: -1;
    pointer-events: none;
  }

  a { color: var(--accent-2); text-decoration: none; transition: color .15s ease; }
  a:hover { color: var(--accent); }

  .wrap {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 32px;
  }

  /* Nav */
  nav.top {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: saturate(140%) blur(10px);
    -webkit-backdrop-filter: saturate(140%) blur(10px);
    background: rgba(11, 13, 16, 0.6);
    border-bottom: 1px solid var(--line);
  }
  nav.top .wrap {
    display: flex;
    align-items: center;
    gap: 32px;
    height: 56px;
  }
  nav.top .brand {
    font-family: var(--mono);
    font-size: 14px;
    color: var(--fg);
    letter-spacing: .02em;
  }
  nav.top .brand .dot {
    display: inline-block;
    width: 8px; height: 8px;
    border-radius: 50%;
    background: var(--accent);
    margin-right: 8px;
    box-shadow: 0 0 12px rgba(124, 240, 182, 0.7);
    animation: pulse 2.4s ease-in-out infinite;
    vertical-align: middle;
  }
  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
  }
  nav.top ul {
    display: flex;
    gap: 22px;
    list-style: none;
    padding: 0; margin: 0;
  }
  nav.top ul li { white-space: nowrap; }
  nav.top ul a {
    color: var(--fg-dim);
    font-size: 14px;
  }
  nav.top ul a:hover { color: var(--fg); }
  nav.top .lang {
    margin-left: auto;
    padding-left: 18px;
    border-left: 1px solid var(--line);
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-mute);
    letter-spacing: 0.05em;
    white-space: nowrap;
  }
  nav.top .lang a {
    color: var(--fg-dim);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1px;
  }
  nav.top .lang a:hover { color: var(--fg); }
  nav.top .lang .current { color: var(--accent); }

  /* Hero */
  header.hero {
    padding: 72px 0 40px;
    position: relative;
  }
  header.hero .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 56px;
    align-items: center;
  }
  header.hero .hero-text {
    min-width: 0;
  }
  header.hero .hero-portrait {
    margin: 0;
    justify-self: end;
  }
  header.hero .hero-portrait img {
    display: block;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--line);
    border: 1px solid rgba(124, 240, 182, 0.22);
    box-shadow:
      0 0 0 6px rgba(124, 240, 182, 0.04),
      0 24px 48px -24px rgba(0, 0, 0, 0.6);
    filter: grayscale(100%);
  }
  header.hero .badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
  }
  header.hero .tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--mono);
    font-size: 12px;
    color: var(--accent);
    border: 1px solid rgba(124, 240, 182, 0.25);
    background: rgba(124, 240, 182, 0.06);
    padding: 6px 12px;
    border-radius: 999px;
  }
  header.hero .tag svg {
    width: 14px;
    height: 14px;
  }
  header.hero .tag.tag-eth {
    color: var(--accent-2);
    border-color: rgba(90, 209, 255, 0.3);
    background: rgba(90, 209, 255, 0.07);
  }
  header.hero .tag.tag-sec {
    color: #f5c26b;
    border-color: rgba(245, 194, 107, 0.3);
    background: rgba(245, 194, 107, 0.07);
  }
  header.hero h1 {
    font-size: clamp(40px, 6vw, 64px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 16px;
    font-weight: 700;
    background: linear-gradient(180deg, #ffffff 0%, #bfc7d1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
  }
  header.hero .tagline {
    font-family: var(--mono);
    font-size: clamp(14px, 1.6vw, 16px);
    color: var(--accent);
    margin: 0 0 22px;
    letter-spacing: 0.01em;
    opacity: 0.9;
  }
  header.hero .role {
    font-size: clamp(18px, 2.2vw, 22px);
    color: var(--fg-dim);
    margin: 0 0 28px;
    max-width: 800px;
    text-wrap: pretty;
  }
  header.hero .role strong {
    color: var(--fg);
    font-weight: 600;
  }
  header.hero .cta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--line);
    background: var(--bg-2);
    color: var(--fg);
    transition: transform .1s ease, background .15s ease, border-color .15s ease;
  }
  .btn:hover {
    background: var(--bg-3);
    border-color: #2a313b;
    color: var(--fg);
    transform: translateY(-1px);
  }
  .btn.primary {
    background: var(--accent);
    color: #06281a;
    border-color: transparent;
  }
  .btn.primary:hover {
    background: #8ef3c1;
    color: #06281a;
  }
  .btn svg { width: 16px; height: 16px; }

  /* Section primitives */
  section {
    padding: 48px 0;
    border-top: 1px solid var(--line);
  }
  section h2 {
    font-size: 13px;
    font-family: var(--mono);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--fg-mute);
    margin: 0 0 28px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  section h2::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 10px rgba(124, 240, 182, 0.6);
  }

  /* About */
  .about p {
    font-size: 20px;
    line-height: 1.55;
    color: var(--fg-dim);
    max-width: 800px;
    margin: 0 0 18px;
    text-wrap: pretty;
  }
  .about p strong { color: var(--fg); font-weight: 600; }

  /* Work timeline */
  .timeline {
    display: grid;
    gap: 0;
    max-width: 800px;
  }
  .job {
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 24px;
    padding: 18px 0;
    border-bottom: 1px dashed var(--line);
    transition: background .15s ease;
  }
  .job:last-child { border-bottom: none; }
  .job:hover { background: rgba(255,255,255,0.015); }
  .job .years {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--fg-mute);
    padding-top: 2px;
  }
  .job .meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }
  .job .company {
    color: var(--fg);
    font-weight: 600;
    font-size: 16px;
  }
  .job .company a {
    color: var(--fg);
    border-bottom: 1px dotted rgba(154, 163, 173, 0.35);
    transition: color .15s ease, border-color .15s ease;
  }
  .job .company a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }
  .job .title {
    color: var(--fg-dim);
    font-size: 14px;
  }
  .job .badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent);
    border: 1px solid rgba(124, 240, 182, 0.3);
    background: rgba(124, 240, 182, 0.05);
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: 2px;
  }
  .job .badge.badge-eth {
    color: var(--accent-2);
    border-color: rgba(90, 209, 255, 0.35);
    background: rgba(90, 209, 255, 0.08);
  }
  .job.featured {
    position: relative;
    background: linear-gradient(90deg, rgba(90, 209, 255, 0.04), transparent 70%);
    border-left: 2px solid rgba(90, 209, 255, 0.4);
    padding-left: 14px;
    margin-left: -16px;
    border-radius: 4px;
  }

  /* Cards grid */
  .cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 800px;
  }

  /* Featured project card */
  .project {
    position: relative;
    background: linear-gradient(180deg, var(--bg-2), var(--bg-3));
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 28px;
    overflow: hidden;
    transition: border-color .2s ease, transform .2s ease;
  }
  .project:hover {
    border-color: rgba(124, 240, 182, 0.3);
    transform: translateY(-2px);
  }
  .project::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(124, 240, 182, 0.6), transparent);
  }
  .project .head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 10px;
  }
  .project h3 {
    font-size: 22px;
    margin: 0;
    font-weight: 700;
    letter-spacing: -0.01em;
  }
  .project h3 a { color: var(--fg); }
  .project h3 a:hover { color: var(--accent); }
  .project .lang {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-mute);
    text-transform: uppercase;
    letter-spacing: 0.1em;
  }
  .project p {
    color: var(--fg-dim);
    margin: 0 0 16px;
    max-width: 640px;
  }
  .project .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 18px;
  }
  .tag-chip {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--fg-dim);
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--line);
    padding: 3px 8px;
    border-radius: 4px;
  }
  .project .links {
    display: flex;
    gap: 14px;
    font-size: 14px;
  }
  .project .links a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--fg-dim);
  }
  .project .links a:hover { color: var(--accent); }

  /* File rows (publications / certs) */
  .files {
    display: grid;
    gap: 8px;
    max-width: 800px;
  }
  .file {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-radius: 10px;
    transition: border-color .15s ease, background .15s ease;
    color: var(--fg);
  }
  .file:hover {
    border-color: rgba(124, 240, 182, 0.3);
    background: var(--bg-3);
    color: var(--fg);
  }
  .file .icon {
    width: 36px; height: 36px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: rgba(124, 240, 182, 0.08);
    color: var(--accent);
    flex-shrink: 0;
  }
  .file .cover {
    width: 40px; height: 54px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: var(--bg-3);
  }
  .file .logo {
    width: 54px; height: 40px;
    border-radius: 4px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid var(--line);
    background: #fff;
    padding: 4px;
    box-sizing: border-box;
  }
  .file .body { flex: 1; min-width: 0; }
  .file .title {
    font-size: 15px;
    color: var(--fg);
    font-weight: 500;
  }
  .file .sub {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--fg-mute);
    margin-top: 2px;
  }
  .file .arrow {
    color: var(--fg-mute);
    transition: transform .15s ease, color .15s ease;
  }
  .file:hover .arrow {
    color: var(--accent);
    transform: translateX(2px);
  }

  /* Recommendations / testimonials */
  .quotes {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    max-width: 800px;
  }
  .quote {
    background: var(--bg-2);
    border: 1px solid var(--line);
    border-left: 3px solid var(--accent);
    border-radius: var(--radius);
    padding: 22px 26px;
    margin: 0;
  }
  .quote blockquote {
    margin: 0 0 14px;
    color: var(--fg-dim);
    font-size: 16px;
    line-height: 1.55;
  }
  .quote blockquote p { margin: 0; }
  .quote figcaption {
    font-size: 13px;
    color: var(--fg-mute);
    font-family: var(--mono);
  }
  .quote figcaption cite { font-style: normal; }
  .quote figcaption strong {
    color: var(--fg);
    font-weight: 600;
  }

  /* Footer */
  footer {
    padding: 48px 0 72px;
    border-top: 1px solid var(--line);
    color: var(--fg-mute);
    font-size: 13px;
  }
  footer .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
  }
  footer .mono {
    font-family: var(--mono);
  }
  footer a { color: var(--fg-dim); }
  footer a:hover { color: var(--accent); }

  /* Reveal on scroll */
  .reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .6s ease, transform .6s ease;
  }
  .reveal.in {
    opacity: 1;
    transform: none;
  }
  /* Tablet / narrow desktop — stack hero, shrink portrait */
  @media (max-width: 960px) {
    header.hero { padding: 32px 0 40px; }
    header.hero .wrap {
      grid-template-columns: 1fr;
      gap: 32px;
      justify-items: center;
      text-align: left;
    }
    header.hero .hero-portrait {
      order: -1;
      justify-self: center;
    }
    header.hero .hero-portrait img {
      width: 180px;
      height: 180px;
    }
  }

  /* Mobile (phones + small tablets) */
  @media (max-width: 720px) {
    .wrap { padding: 0 20px; }

    /* Nav: hide menu, keep language switcher */
    nav.top ul { display: none; }
    nav.top .lang {
      margin-left: 0;
      padding-left: 0;
      border-left: none;
    }
    nav.top .brand { font-size: 13px; }

    /* Hero */
    header.hero { padding: 24px 0 40px; }
    header.hero .wrap {
      grid-template-columns: 1fr;
      gap: 24px;
      justify-items: center;
      text-align: left;
    }
    header.hero .hero-portrait {
      order: -1;
      justify-self: center;
    }
    header.hero .hero-portrait img {
      width: 140px;
      height: 140px;
    }
    header.hero .badges { gap: 6px; margin-bottom: 20px; }
    header.hero .tag {
      font-size: 11px;
      padding: 5px 10px;
    }
    header.hero h1 {
      font-size: clamp(34px, 9.5vw, 52px);
      margin-bottom: 12px;
    }
    header.hero .tagline {
      font-size: 13px;
      margin-bottom: 18px;
    }
    header.hero .role {
      font-size: 17px;
      margin-bottom: 24px;
    }
    header.hero .cta { gap: 10px; }
    .btn {
      padding: 10px 14px;
      font-size: 13px;
    }

    /* Sections */
    section { padding: 44px 0; }
    section h2 { margin: 0 0 20px; }

    /* About */
    .about p { font-size: 16px; }

    /* Timeline */
    .job {
      grid-template-columns: 1fr;
      gap: 4px;
      padding: 14px 0;
    }
    .job .years {
      font-size: 12px;
      padding-top: 0;
    }
    .job .company { font-size: 15px; }
    .job .title { font-size: 13px; }
    .job.featured {
      margin-left: 0;
      padding-left: 12px;
    }

    /* Projects */
    .project { padding: 20px; }
    .project .head {
      flex-direction: column;
      align-items: flex-start;
      gap: 4px;
      margin-bottom: 8px;
    }
    .project h3 { font-size: 19px; }
    .project p { font-size: 15px; }

    /* File rows */
    .file {
      padding: 12px 14px;
      gap: 12px;
    }
    .file .icon {
      width: 32px; height: 32px;
    }
    .file .cover {
      width: 36px; height: 48px;
    }
    .file .logo {
      width: 48px; height: 36px;
      padding: 3px;
    }
    .file .title { font-size: 14px; }
    .file .sub { font-size: 11px; }

    /* Footer */
    footer {
      padding: 32px 0 48px;
    }
    footer .row {
      flex-direction: column;
      align-items: flex-start;
      gap: 10px;
    }
  }

  @media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    nav.top .brand .dot { animation: none; }
  }

  /* Keyboard focus — visible accent ring on any focusable element */
  a:focus-visible,
  button:focus-visible,
  .btn:focus-visible,
  .file:focus-visible,
  [tabindex]:focus-visible {
    outline: 2px solid var(--accent-2);
    outline-offset: 2px;
    border-radius: 6px;
  }
  main:focus { outline: none; }
