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

  :root {
    --bg: #0a0a08;
    --bg2: #111110;
    --bg3: #1a1a17;
    --line: rgba(255,255,255,0.08);
    --line2: rgba(255,255,255,0.15);
    --text: #f0ede6;
    --muted: #7a7870;
    --accent: #c8b89a;
    --accent2: #e8d5b7;
    --red: #c94a3a;
    --serif: 'Playfair Display', Georgia, serif;
    --mono: 'DM Mono', monospace;
    --sans: 'Instrument Sans', system-ui, sans-serif;
  }

  html { scroll-behavior: smooth; }

  body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.7;
    overflow-x: hidden;
  }

  ::selection { background: var(--accent); color: #0a0a08; }

  /* NAV */
  nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; justify-content: space-between; align-items: center;
    padding: 1.25rem 3rem;
    border-bottom: 1px solid var(--line);
    background: rgba(10,10,8,0.85);
    backdrop-filter: blur(12px);
  }
  .nav-logo {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--accent);
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }
  .nav-links { display: flex; gap: 2rem; list-style: none; }
  .nav-links a {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
  }
  .nav-links a:hover { color: var(--text); }

  /* SECTIONS */
  section { padding: 6rem 3rem; }
  .container { max-width: 1100px; margin: 0 auto; }

  /* HERO */
  #hero {
    min-height: 100vh;
    display: flex; align-items: center;
    padding-top: 8rem;
    border-bottom: 1px solid var(--line);
    position: relative;
    overflow: hidden;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: end;
    width: 100%;
  }
  .hero-left { padding-bottom: 2rem; }
  .hero-eyebrow {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.15em;
    color: var(--accent);
    text-transform: uppercase;
    margin-bottom: 1.5rem;
    display: flex; align-items: center; gap: 1rem;
  }
  .hero-eyebrow::before {
    content: '';
    display: block; width: 40px; height: 1px;
    background: var(--accent);
  }
  h1.hero-name {
    font-family: var(--serif);
    font-size: clamp(3.5rem, 6vw, 5.5rem);
    font-weight: 900;
    line-height: 1.0;
    color: var(--text);
    margin-bottom: 0.25rem;
  }
  .hero-name em {
    font-style: italic;
    color: var(--accent);
  }
  .hero-title {
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
  }
  .hero-desc {
    font-size: 15px;
    color: var(--muted);
    max-width: 420px;
    line-height: 1.8;
  }
  .hero-ctas {
    display: flex; gap: 1rem; margin-top: 2.5rem; flex-wrap: wrap;
  }
  .btn-primary {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.875rem 2rem;
    background: var(--accent);
    color: #0a0a08;
    border: none;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: background 0.2s;
  }
  .btn-primary:hover { background: var(--accent2); }
  .btn-ghost {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.875rem 2rem;
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line2);
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: border-color 0.2s, color 0.2s;
  }
  .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

  .hero-right {
    display: flex; flex-direction: column; gap: 1px;
    border-left: 1px solid var(--line);
    padding-left: 4rem;
  }
  .hero-stat {
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--line);
  }
  .hero-stat:last-child { border-bottom: none; }
  .stat-num {
    font-family: var(--serif);
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
  }
  .stat-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--muted);
    text-transform: uppercase;
    margin-top: 0.25rem;
  }

  .hero-bg-text {
    position: absolute;
    bottom: -2rem; right: -1rem;
    font-family: var(--serif);
    font-size: 18vw;
    font-weight: 900;
    font-style: italic;
    color: rgba(255,255,255,0.02);
    pointer-events: none;
    user-select: none;
    line-height: 1;
    white-space: nowrap;
  }

  /* SECTION HEADERS */
  .section-header {
    display: flex; align-items: center; gap: 1.5rem;
    margin-bottom: 4rem;
  }
  .section-num {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    color: var(--accent);
  }
  .section-line { flex: 1; height: 1px; background: var(--line); }
  .section-title {
    font-family: var(--serif);
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-weight: 700;
    color: var(--text);
    line-height: 1.1;
  }
  .section-title em { font-style: italic; color: var(--accent); }

  /* PROJECTS */
  #projects { background: var(--bg); border-bottom: 1px solid var(--line); }
  .projects-list { display: flex; flex-direction: column; gap: 0; }
  .project-item {
    display: grid;
    grid-template-columns: 80px 1fr auto;
    gap: 2rem;
    align-items: start;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--line);
    transition: background 0.2s;
    cursor: default;
  }
  .project-item:hover { background: var(--bg2); margin: 0 -3rem; padding: 2.5rem 3rem; }
  .project-item:last-child { border-bottom: none; }
  .project-index {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    padding-top: 0.25rem;
    letter-spacing: 0.1em;
  }
  .project-name {
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
    line-height: 1.2;
  }
  .project-desc { font-size: 13px; color: var(--muted); line-height: 1.7; max-width: 500px; }
  .project-tags {
    display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1rem;
  }
  .tag {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border: 1px solid var(--line2);
    color: var(--muted);
  }
  .project-link {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    text-decoration: none;
    letter-spacing: 0.08em;
    white-space: nowrap;
    padding-top: 0.25rem;
    transition: color 0.2s;
  }
  .project-link:hover { color: var(--accent2); }
  .project-featured { border-left: 2px solid var(--accent); padding-left: 2rem; }
  .featured-badge {
    font-family: var(--mono);
    font-size: 9px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
  }

  /* SKILLS */
  #skills { background: var(--bg2); border-bottom: 1px solid var(--line); }
  .skills-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
  }
  .skill-cell {
    background: var(--bg2);
    padding: 2rem;
  }
  .skill-category {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1rem;
  }
  .skill-name {
    font-family: var(--serif);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
  }
  .skill-items {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    line-height: 2;
  }

  /* EXPERIENCE */
  #experience { background: var(--bg); border-bottom: 1px solid var(--line); }
  .experience-list { display: flex; flex-direction: column; gap: 0; }
  .exp-item {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 3rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--line);
  }
  .exp-item:last-child { border-bottom: none; }
  .exp-meta {}
  .exp-period {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--accent);
    letter-spacing: 0.08em;
    margin-bottom: 0.5rem;
  }
  .exp-company {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.05em;
  }
  .exp-role {
    font-family: var(--serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.2;
  }
  .exp-desc { font-size: 13px; color: var(--muted); line-height: 1.8; }
  .exp-bullets { list-style: none; margin-top: 1rem; }
  .exp-bullets li {
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    padding: 0.25rem 0;
    padding-left: 1rem;
    position: relative;
    letter-spacing: 0.02em;
  }
  .exp-bullets li::before {
    content: '—';
    position: absolute; left: 0;
    color: var(--accent);
  }

  /* ARCHITECTURE */
  #architecture { background: var(--bg2); border-bottom: 1px solid var(--line); }
  .arch-case {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
  }
  .arch-left {}
  .arch-problem {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 0.75rem;
  }
  .arch-title {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text);
    margin-bottom: 1.5rem;
  }
  .arch-body { font-size: 13px; color: var(--muted); line-height: 1.9; }
  .arch-metrics {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    background: var(--line);
    border: 1px solid var(--line);
    margin-top: 2rem;
  }
  .arch-metric {
    background: var(--bg2);
    padding: 1.25rem;
  }
  .metric-val {
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 0.25rem;
  }
  .metric-label {
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
  }
  .arch-right {}
  .arch-diagram {
    background: var(--bg3);
    border: 1px solid var(--line);
    padding: 2rem;
    font-family: var(--mono);
    font-size: 11px;
    color: var(--muted);
    line-height: 2.2;
    white-space: pre;
    overflow-x: auto;
  }
  .arch-diagram .highlight { color: var(--accent); }
  .arch-diagram .dim { color: rgba(122,120,112,0.4); }
  .arch-diagram .green { color: #6a9a5a; }

  /* GITHUB */
  #github { background: var(--bg); border-bottom: 1px solid var(--line); }
  .github-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: start;
  }
  .github-stats { display: flex; flex-direction: column; gap: 1px; background: var(--line); border: 1px solid var(--line); }
  .gh-stat {
    background: var(--bg);
    padding: 1.25rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center;
  }
  .gh-stat-label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; color: var(--muted); text-transform: uppercase; }
  .gh-stat-val { font-family: var(--serif); font-size: 1.5rem; font-weight: 700; color: var(--text); }
  .github-activity {}
  .activity-label {
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: 1rem;
  }
  .contrib-grid {
    display: grid;
    grid-template-columns: repeat(52, 1fr);
    gap: 2px;
  }
  .contrib-cell {
    aspect-ratio: 1;
    border-radius: 1px;
  }
  .c0 { background: var(--bg3); }
  .c1 { background: #2a3a28; }
  .c2 { background: #3d5c39; }
  .c3 { background: #5a8a53; }
  .c4 { background: #7ab870; }
  .c5 { background: #9fd492; }
  .gh-langs { margin-top: 2rem; }
  .lang-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--line);
  }
  .lang-row:last-child { border-bottom: none; }
  .lang-name { font-family: var(--mono); font-size: 11px; color: var(--text); letter-spacing: 0.05em; }
  .lang-bar-wrap { flex: 1; height: 2px; background: var(--line); margin: 0 1rem; }
  .lang-bar { height: 2px; background: var(--accent); }
  .lang-pct { font-family: var(--mono); font-size: 10px; color: var(--muted); width: 36px; text-align: right; }

  /* CONTACT */
  #contact { background: var(--bg2); }
  .contact-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: start;
  }
  .contact-left {}
  .contact-big {
    font-family: var(--serif);
    font-size: clamp(2.5rem, 5vw, 4.5rem);
    font-weight: 900;
    line-height: 1.05;
    color: var(--text);
    margin-bottom: 1.5rem;
  }
  .contact-big em { font-style: italic; color: var(--accent); }
  .contact-sub { font-size: 14px; color: var(--muted); line-height: 1.8; max-width: 380px; margin-bottom: 2rem; }
  .contact-links { display: flex; flex-direction: column; gap: 0; }
  .contact-link-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    text-decoration: none;
    transition: padding-left 0.2s;
  }
  .contact-link-item:hover { padding-left: 0.5rem; }
  .contact-link-item:first-child { border-top: 1px solid var(--line); }
  .link-name { font-family: var(--serif); font-size: 1.2rem; font-weight: 700; color: var(--text); }
  .link-handle { font-family: var(--mono); font-size: 11px; color: var(--accent); letter-spacing: 0.06em; }
  .link-arrow { font-size: 1.2rem; color: var(--muted); }

  .contact-right {}
  .contact-form { display: flex; flex-direction: column; gap: 0; }
  .form-field {
    border-bottom: 1px solid var(--line);
    padding: 1.25rem 0;
  }
  .form-field label {
    display: block;
    font-family: var(--mono);
    font-size: 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.5rem;
  }
  .form-field input, .form-field textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--sans);
    font-size: 14px;
    color: var(--text);
    resize: none;
    caret-color: var(--accent);
  }
  .form-field input::placeholder, .form-field textarea::placeholder { color: var(--muted); }
  .form-field textarea { min-height: 80px; }
  .send-btn {
    margin-top: 2rem;
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 1rem 2.5rem;
    background: var(--accent);
    color: #0a0a08;
    border: none;
    cursor: pointer;
    align-self: flex-start;
    transition: background 0.2s;
  }
  .send-btn:hover { background: var(--accent2); }

  /* FOOTER */
  footer {
    border-top: 1px solid var(--line);
    padding: 2rem 3rem;
    display: flex; justify-content: space-between; align-items: center;
  }
  .footer-copy { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.06em; }
  .footer-back { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 0.08em; text-decoration: none; transition: color 0.2s; }
  .footer-back:hover { color: var(--accent); }

  /* DIVIDER */
  .divider { border: none; border-top: 1px solid var(--line); }