/* ─── Variables ─── */
    :root {
      --bg:        #fafafa;
      --bg-subtle: #f3f3f3;
      --text:      #171717;
      --muted:     #666666;
      --border:    #e5e5e5;
      --accent:    #1d4ed8;
      --font:      Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
      --max-w:     960px;
    }

    /* ─── Reset ─── */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }
    body {
      font-family: var(--font);
      background: var(--bg);
      color: var(--text);
      font-size: 1rem;
      line-height: 1.65;
      -webkit-font-smoothing: antialiased;
    }

    /* ─── Focus ─── */
    :focus-visible {
      outline: 2px solid var(--accent);
      outline-offset: 3px;
      border-radius: 2px;
    }

    /* ─── Utility ─── */
    .wrap {
      max-width: var(--max-w);
      margin: 0 auto;
      padding: 0 1.5rem;
    }

    /* ─── Links ─── */
    a {
      color: var(--accent);
      text-decoration: none;
    }
    a:hover {
      text-decoration: underline;
    }

    /* ─── Header ─── */
    header {
      position: sticky;
      top: 0;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      z-index: 10;
    }
    header .wrap {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 1rem;
      height: 56px;
    }
    .site-name {
      font-size: 0.95rem;
      font-weight: 600;
      letter-spacing: -0.01em;
      color: var(--text);
    }
    .site-name a { color: inherit; }
    .site-name a:hover { text-decoration: none; }

    nav ul {
      list-style: none;
      display: flex;
      align-items: center;
      gap: 2rem;
    }
    nav a {
      font-size: 0.875rem;
      font-weight: 500;
      color: var(--muted);
      transition: color 0.15s;
    }
    nav a:hover { color: var(--text); text-decoration: none; }

    .nav-toggle {
      display: none;
      background: none;
      border: 1px solid var(--border);
      border-radius: 4px;
      cursor: pointer;
      padding: 0.3rem 0.55rem;
      font-size: 0.85rem;
      color: var(--muted);
      line-height: 1;
    }
    .nav-toggle:hover { color: var(--text); border-color: #ccc; }

    /* ─── Main ─── */
    main { padding-top: 0; }

    /* ─── Section ─── */
    section {
      scroll-margin-top: 72px;
      padding: 4rem 0;
      border-bottom: 1px solid var(--border);
    }
    section:last-of-type { border-bottom: none; }

    /* ─── Typography ─── */
    h1 {
      font-size: 1.75rem;
      font-weight: 700;
      letter-spacing: -0.03em;
      line-height: 1.2;
    }
    h2 {
      font-size: 0.75rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--muted);
      margin-bottom: 1.75rem;
    }
    h3 {
      font-size: 0.95rem;
      font-weight: 600;
      color: var(--text);
    }
    p {
      color: var(--muted);
      font-size: 0.925rem;
    }
    p + p { margin-top: 0.85rem; }

    /* ─── Hero ─── */
    #hero {
      padding: 4rem 0 3.5rem;
    }
    .hero-name { margin-bottom: 0.35rem; }
    .hero-tagline {
      font-size: 0.95rem;
      color: var(--muted);
      margin-bottom: 1.25rem;
    }
    .hero-body {
      max-width: 580px;
    }
    .hero-links {
      display: flex;
      flex-wrap: wrap;
      gap: 0.25rem 1.5rem;
      margin-top: 1.5rem;
      font-size: 0.875rem;
    }
    .hero-links a { color: var(--muted); }
    .hero-links a:hover { color: var(--accent); text-decoration: none; }


    /* ─── Native ASCII portrait ─── */
    .hero-layout {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 390px;
      align-items: center;
      gap: 2.75rem;
    }

    .hero-copy {
      min-width: 0;
    }

    .ascii-portrait-wrap {
      min-width: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      overflow: hidden;
    }

    .ascii-portrait {
      display: block;
      width: max-content;
      margin: 0;
      color: var(--text);
      background: transparent;
      border: 0;
      font-family: "SFMono-Regular", Menlo, Monaco, Consolas,
                   "Liberation Mono", "Courier New", monospace;
      font-size: 6.1px;
      font-weight: 500;
      line-height: 0.92;
      letter-spacing: 0;
      white-space: pre;
      font-variant-ligatures: none;
      user-select: text;
      transform: scaleX(0.80);
      transform-origin: center center;
      -webkit-font-smoothing: antialiased;
      text-rendering: geometricPrecision;
    }

    /* ─── About ─── */
    .about-body { max-width: 640px; }

    /* ─── Skills ─── */
    .skills-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 2.5rem 2rem;
    }
    .skill-group h3 {
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.1em;
      color: var(--muted);
      margin-bottom: 0.65rem;
    }
    .skill-group ul { list-style: none; }
    .skill-group li {
      font-size: 0.875rem;
      color: var(--text);
      padding: 0.22rem 0;
      border-bottom: 1px solid var(--border);
    }
    .skill-group li:last-child { border-bottom: none; }

    /* ─── Projects ─── */
    .project-list {
      display: flex;
      flex-direction: column;
    }
    article.project {
      padding: 1.5rem 0;
      border-bottom: 1px solid var(--border);
    }
    article.project:first-child { border-top: 1px solid var(--border); }
    .project-head {
      display: flex;
      align-items: baseline;
      justify-content: space-between;
      gap: 1rem;
      flex-wrap: wrap;
      margin-bottom: 0.5rem;
    }
    .project-links {
      display: flex;
      gap: 1rem;
      font-size: 0.8rem;
      flex-shrink: 0;
    }
    .project p { font-size: 0.875rem; }
    .tag-row {
      display: flex;
      flex-wrap: wrap;
      gap: 0.4rem;
      margin-top: 0.75rem;
    }
    .tag {
      font-size: 0.72rem;
      padding: 0.18rem 0.55rem;
      background: var(--bg-subtle);
      border: 1px solid var(--border);
      border-radius: 4px;
      color: var(--muted);
      font-weight: 500;
    }

    /* ─── Homelab ─── */
    .homelab-note { max-width: 600px; margin-bottom: 1.75rem; }
    .homelab-table {
      width: 100%;
      border-collapse: collapse;
      font-size: 0.875rem;
    }
    .homelab-table tr { border-bottom: 1px solid var(--border); }
    .homelab-table tr:first-child { border-top: 1px solid var(--border); }
    .homelab-table td {
      padding: 0.7rem 0;
      vertical-align: top;
    }
    .homelab-table td:first-child {
      width: 160px;
      font-weight: 600;
      color: var(--text);
      padding-right: 1.5rem;
      white-space: nowrap;
    }
    .homelab-table td:last-child { color: var(--muted); }

    /* ─── Learning ─── */
    .learning-list {
      display: flex;
      flex-wrap: wrap;
      gap: 0.5rem;
      margin-top: 0;
    }
    .learning-item {
      font-size: 0.85rem;
      padding: 0.28rem 0.7rem;
      border: 1px solid var(--border);
      border-radius: 4px;
      color: var(--muted);
      background: var(--bg);
    }

    /* ─── Contact ─── */
    .contact-note { max-width: 560px; margin-bottom: 1.75rem; }
    .contact-list {
      list-style: none;
      display: flex;
      flex-direction: column;
      gap: 0.7rem;
    }
    .contact-list li {
      display: flex;
      align-items: baseline;
      gap: 0.75rem;
      font-size: 0.9rem;
    }
    .contact-key {
      display: inline-block;
      min-width: 80px;
      font-size: 0.72rem;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.08em;
      color: var(--muted);
    }

    /* ─── Footer ─── */
    footer {
      padding: 2rem 0;
      border-top: 1px solid var(--border);
    }
    footer p {
      font-size: 0.8rem;
      color: var(--muted);
    }

    /* ─── Mobile ─── */
    @media (max-width: 620px) {
      h1 { font-size: 1.45rem; }

      .nav-toggle { display: inline-flex; align-items: center; }

      #site-nav {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        max-height: calc(100dvh - 56px);
        overflow-y: auto;
        background: var(--bg);
        border-bottom: 1px solid var(--border);
        padding: 1.25rem 1.5rem;
        display: none;
        z-index: 9;
      }
      #site-nav.open { display: block; }
      #site-nav ul {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.85rem;
      }
      #site-nav a { font-size: 1rem; }

      .hero-links {
        position: static;
        inset: auto;
        width: auto;
        padding: 0;
        border: 0;
        background: transparent;
      }


      .hero-layout {
        grid-template-columns: 1fr;
        gap: 2.25rem;
      }

      .ascii-portrait-wrap {
        width: 100%;
        justify-content: center;
        overflow: hidden;
        padding: 0.25rem 0;
      }

      .ascii-portrait {
        font-size: clamp(4.7px, 1.42vw, 5.8px);
        transform: scaleX(0.80);
      }

      .hero-links {
        display: flex;
        flex-wrap: wrap;
        gap: 0.65rem 1.2rem;
        margin-top: 1.35rem;
      }


      .skills-grid { grid-template-columns: 1fr 1fr; }

      .homelab-table td:first-child {
        width: auto;
        display: block;
        padding-bottom: 0.15rem;
      }
      .homelab-table td:last-child { display: block; padding-top: 0; }
      .homelab-table tr { display: block; padding: 0.75rem 0; }
    }

    /* ─── Reduced motion ─── */
    @media (prefers-reduced-motion: reduce) {
      html { scroll-behavior: auto; }
    }
