:root{
    --bg: #10161A;
    --surface: #171F24;
    --surface-2: #1D262C;
    --border: #2A363D;
    --text: #E9EFF1;
    --text-muted: #8FA0A8;
    --text-faint: #5C6C74;
    --accent: #D9A441;
    --accent-dim: #8C7132;
    --ok: #6FAE8C;
    --font-mono: 'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  }

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

  html{ scroll-behavior: smooth; }

  body{
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  ::selection{ background: var(--accent); color: #10161A; }

  a{ color: inherit; text-decoration: none; }

  .wrap{
    max-width: 860px;
    margin: 0 auto;
    padding-left: 28px;
    padding-right: 28px;
  }
  @media (max-width: 480px){
    .wrap{ padding-left: 20px; padding-right: 20px; }
  }

  /* ---------- Nav ---------- */
  header{
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(16,22,26,0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  nav.wrap{
    display:flex;
    align-items:center;
    justify-content: space-between;
    padding-top: 16px;
    padding-bottom: 16px;
  }
  .logo{
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--text);
    display:flex;
    align-items:center;
    gap: 8px;
  }
  .logo .dot{
    width:7px; height:7px; border-radius:50%;
    background: var(--ok);
    box-shadow: 0 0 0 3px rgba(111,174,140,0.15);
  }
  .navlinks{
    display:flex;
    gap: 28px;
    font-size: 13px;
    color: var(--text-muted);
  }
  .navlinks a{ transition: color .15s ease; }
  .navlinks a:hover{ color: var(--accent); }

  .nav-toggle{
    display:none;
    width: 32px; height: 32px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    align-items:center;
    justify-content:center;
    cursor: pointer;
  }
  .nav-toggle svg{ width: 16px; height: 16px; }

  @media (max-width: 640px){
    .navlinks{
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      flex-direction: column;
      gap: 0;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      max-height: 0;
      overflow: hidden;
      transition: max-height .25s ease;
    }
    .navlinks.open{ max-height: 260px; }
    .navlinks a{
      padding: 14px 28px;
      border-top: 1px solid var(--border);
      font-size: 14px;
    }
    .nav-toggle{ display:flex; }
    nav.wrap{ position: relative; }
  }

  /* ---------- Hero ---------- */
  .hero{
    padding: 88px 0 72px;
  }
  @media (max-width: 640px){
    .hero{ padding: 64px 0 56px; }
  }
  .eyebrow{
    font-family: var(--font-mono);
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 18px;
  }
  h1{
    font-size: clamp(32px, 5vw, 46px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin-bottom: 14px;
  }
  .hero p.lede{
    font-size: 17px;
    color: var(--text-muted);
    max-width: 520px;
    margin-bottom: 36px;
  }

  .terminal{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    max-width: 560px;
    box-shadow: 0 20px 50px -20px rgba(0,0,0,0.5);
  }
  .terminal-bar{
    display:flex;
    align-items:center;
    gap: 7px;
    padding: 11px 14px;
    background: var(--surface-2);
    border-bottom: 1px solid var(--border);
    overflow: hidden;
  }
  .terminal-bar span{
    display: inline-block;
    flex-shrink: 0;
    width: 10px; height: 10px; border-radius: 50%;
    background: var(--border);
  }
  .terminal-bar .label{
    margin-left: 8px;
    font-family: var(--font-mono);
    font-size: 11px;
    line-height: 1;
    color: var(--text-faint);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .terminal-body{
    padding: 18px 20px 22px;
    font-family: var(--font-mono);
    font-size: 13.5px;
  }
  @media (max-width: 380px){
    .terminal-body{ padding: 16px 14px 18px; font-size: 12.5px; }
  }
  .terminal-body .line{ margin-bottom: 6px; color: var(--text-muted); }
  .terminal-body .prompt{ color: var(--accent); }
  .terminal-body .out{ color: var(--text); }
  .terminal-body .comment{ color: var(--text-faint); }
  .cursor{
    display:inline-block;
    width: 7px; height: 14px;
    background: var(--accent);
    vertical-align: middle;
    margin-left: 3px;
    animation: blink 1s steps(1) infinite;
  }
  @keyframes blink{ 50%{ opacity: 0; } }
  @media (prefers-reduced-motion: reduce){
    .cursor{ animation: none; }
  }

  /* ---------- Sections ---------- */
  section{ padding: 84px 0; border-top: 1px solid var(--border); }
  @media (max-width: 640px){
    section{ padding: 56px 0; }
  }
  .section-head{
    display:flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 30px;
  }
  .section-num{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
  }
  h2{
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 600;
    color: var(--text);
  }

  /* ---------- About ---------- */
  .about p{ color: var(--text-muted); max-width: 620px; margin-bottom: 14px; font-size: 15px; }
  .about strong{ color: var(--text); font-weight: 600; }

  /* ---------- Skills ---------- */
  .skills-grid{
    display:grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 40px;
  }
  @media (max-width: 640px){
    .skills-grid{ grid-template-columns: 1fr; }
  }
  .skill-group h3{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 12px;
    letter-spacing: 0.03em;
  }
  .skill-group ul{ list-style:none; }
  .skill-group li{
    font-size: 14px;
    color: var(--text-muted);
    padding: 6px 0;
    border-bottom: 1px dashed var(--border);
    display:flex;
    justify-content: space-between;
  }
  .skill-group li:last-child{ border-bottom: none; }
  .skill-group li span.tag{
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--text-faint);
  }

  /* ---------- Experience ---------- */
  .job{
    padding-bottom: 32px;
    margin-bottom: 32px;
    border-bottom: 1px solid var(--border);
  }
  .job:last-child{ border-bottom:none; margin-bottom:0; padding-bottom:0; }
  .job-head{
    display:flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
  }
  .job-title{ font-size: 16px; font-weight: 600; }
  .job-meta{
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-faint);
  }
  .job ul{ list-style:none; margin-top: 10px; }
  .job li{
    font-size: 14.5px;
    color: var(--text-muted);
    padding-left: 18px;
    position: relative;
    margin-bottom: 8px;
  }
  .job li::before{
    content: "›";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-family: var(--font-mono);
  }

  /* ---------- Projects ---------- */
  .projects{
    display: grid;
    gap: 18px;
  }
  .project-card{
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 22px 24px;
    transition: border-color .15s ease;
  }
  .project-card:hover{ border-color: var(--accent-dim); }
  .project-top{
    display:flex;
    justify-content: space-between;
    align-items: baseline;
    flex-wrap: wrap;
    margin-bottom: 8px;
    gap: 6px 12px;
  }
  .project-title{ font-size: 15.5px; font-weight: 600; }
  .project-status{
    font-family: var(--font-mono);
    font-size: 10.5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--ok);
    white-space: nowrap;
  }
  .project-card p{ font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
  .stack{
    display:flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .stack span{
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--text-muted);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 3px 9px;
    border-radius: 4px;
  }

  /* ---------- Contact ---------- */
  .contact{ text-align: left; }
  .contact p{ color: var(--text-muted); max-width: 480px; margin-bottom: 26px; font-size: 15px; }
  .contact-links{
    display:flex;
    flex-wrap: wrap;
    gap: 14px;
  }
  @media (max-width: 480px){
    .contact-links{ flex-direction: column; }
    .contact-links a{ width: 100%; }
  }
  .contact-links a{
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text);
    border: 1px solid var(--border);
    background: var(--surface);
    padding: 10px 16px;
    border-radius: 6px;
    transition: all .15s ease;
    display:flex;
    align-items:center;
    gap: 8px;
  }
  .contact-links a:hover{
    border-color: var(--accent);
    color: var(--accent);
  }

  footer{
    border-top: 1px solid var(--border);
    padding: 28px 0 40px;
  }
  footer p{
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: var(--text-faint);
  }