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

  :root {
    --bg: #ffffff;
    --surface: #f7f7f5;
    --surface2: #efefeb;
    --border: rgba(0,0,0,0.08);
    --border2: rgba(0,0,0,0.16);
    --text: #1a1a18;
    --muted: #6b6b65;
    --accent: #2d5a3d;
    --accent-light: #3d7a54;
    --accent-bg: #eef4f0;
    --mono: 'DM Mono', monospace;
    --sans: 'Syne', sans-serif;
  }

  html { scroll-behavior: smooth; }

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

  /* ── NAV ── */
  nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 3rem;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
  }

  .nav-logo {
    font-family: var(--sans);
    font-weight: 800;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    color: var(--accent);
  }

  .nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
  }

  .nav-links a {
    color: var(--muted);
    text-decoration: none;
    font-size: 13px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    transition: color 0.15s;
  }

  .nav-links a:hover { color: var(--accent); }

  .nav-resume {
    padding: 0.45rem 1rem;
    font-size: 12px;
    border-radius: 4px;
    margin-left: 1rem;
  }

  /* ── HERO ── */
  .hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 10rem 3rem 4rem;
    position: relative;
    overflow: hidden;
  }

  .hero-grid-bg {
    position: absolute;
    inset: 0;
    background-image:
      linear-gradient(rgba(45,90,61,0.07) 1px, transparent 1px),
      linear-gradient(90deg, rgba(45,90,61,0.07) 1px, transparent 1px);
    background-size: 60px 60px;
    mask-image: radial-gradient(ellipse 80% 60% at 50% 50%, black 30%, transparent 100%);
    pointer-events: none;
  }

  .hero-tag {
    font-size: 12px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .hero-tag::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 1px;
    background: var(--accent);
  }

  h1 {
    font-family: var(--sans);
    font-size: clamp(3rem, 7vw, 6rem);
    font-weight: 800;
    line-height: 1.0;
    letter-spacing: -0.03em;
    max-width: 14ch;
    margin-bottom: 1.5rem;
  }

  h1 .line2 {
    color: transparent;
    -webkit-text-stroke: 1px rgba(26,26,24,0.2);
  }

  .hero-desc {
    max-width: 44ch;
    color: var(--muted);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 2.5rem;
  }

  .hero-cta {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    z-index: 1;
  }

  .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 4px;
    font-family: var(--mono);
    font-size: 13px;
    letter-spacing: 0.04em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.15s;
  }

  .btn-primary {
    background: var(--accent);
    color: #ffffff;
    font-weight: 500;
    border: 1px solid var(--accent);
  }

  .btn-primary:hover {
    background: transparent;
    color: var(--accent);
  }

  .btn-ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border2);
  }

  .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  .hero-stats {
    display: flex;
    gap: 3rem;
    margin-top: 5rem;
    padding-top: 3rem;
    border-top: 1px solid var(--border);
  }

  .stat-num {
    font-family: var(--sans);
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1;
  }

  .stat-label {
    font-size: 12px;
    color: var(--muted);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin-top: 4px;
  }

  /* ── SECTIONS ── */
  section {
    padding: 6rem 3rem;
    position: relative;
    scroll-margin-top: 80px;
  }

  .section-label {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
  }

  h2 {
    font-family: var(--sans);
    font-size: clamp(1.8rem, 3.5vw, 2.5rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 3rem;
  }

  /* ── ABOUT ── */
  .about-grid {
    display: grid;
    grid-template-columns: 200px 1fr 1fr;
    gap: 3.5rem;
    align-items: start;
  }

  .about-photo-col { display: flex; flex-direction: column; gap: 1rem; }

  .photo-frame {
    width: 100%;
    aspect-ratio: 3/4;
    border: 1px solid var(--border2);
    border-radius: 6px;
    overflow: hidden;
    background: var(--surface2);
    position: relative;
  }

  .photo-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }


  .about-text p {
    color: var(--muted);
    margin-bottom: 1.25rem;
    line-height: 1.9;
  }

  .about-text p strong { color: var(--accent); font-weight: 500; }

  .skills-group {
    margin-bottom: 2rem;
  }

  .skills-group-label {
    font-size: 11px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent);
    margin-bottom: 0.75rem;
  }

  .skill-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }

  .tag {
    display: inline-block;
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border2);
    border-radius: 2px;
    color: var(--muted);
    letter-spacing: 0.03em;
    transition: all 0.2s;
  }

  .tag:hover {
    border-color: var(--accent);
    color: var(--accent);
  }

  /* ── PROJECTS ── */
  #projects { background: var(--bg); }

  .projects-list {
    max-width: 780px;
    display: flex;
    flex-direction: column;
  }

  .project-item {
    padding: 2rem 0;
    border-bottom: 1px solid var(--border);
  }

  .project-item:first-child { border-top: 1px solid var(--border); }

.project-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

  .project-title {
    font-family: var(--sans);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
  }

  .project-links {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.project-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  text-decoration: none;
  line-height: 1;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.project-link svg {
  display: block;
  width: 18px;
  height: 18px;
}

.project-link:hover {
  opacity: 0.65;
  transform: translateY(-1px);
}

.project-status {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

  .project-link:hover { opacity: 0.7; }

  .project-date {
    font-size: 12.5px;
    color: var(--muted);
    margin-bottom: 0.75rem;
  }

  .project-stack {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.85rem;
  }

  .stack-chip {
    font-size: 11.5px;
    padding: 3px 10px;
    background: transparent;
    border: 1px solid var(--border2);
    border-radius: 100px;
    color: var(--text);
    letter-spacing: 0.01em;
  }

  .project-desc {
    color: var(--text);
    font-size: 14px;
    line-height: 1.75;
  }

  .project-desc strong {
    font-weight: 600;
    color: var(--text);
  }

  .project-status {
    font-size: 12.5px;
    color: var(--accent);
    font-weight: 500;
  }

  /* ── CONTACT ── */
  #contact { background: var(--surface); }

  .contact-inner {
    max-width: 600px;
  }

  .contact-inner p {
    color: var(--muted);
    margin-bottom: 2.5rem;
    line-height: 1.8;
  }

  .contact-links {
    display: flex;
    flex-direction: column;
    gap: 1px;
    border: 1px solid var(--border);
    border-radius: 6px;
    overflow: hidden;
  }

  .contact-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    background: var(--bg);
    text-decoration: none;
    transition: background 0.15s;
  }

  .contact-row:hover { background: var(--surface2); }

  .contact-row-left {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .contact-type {
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
    min-width: 70px;
  }

  .contact-value {
    color: var(--text);
    font-size: 14px;
  }

  .contact-arrow {
    color: var(--muted);
    font-size: 16px;
    transition: transform 0.15s, color 0.15s;
  }

  .contact-row:hover .contact-arrow {
    transform: translateX(4px);
    color: var(--accent);
  }

  /* ── GITHUB CONTRIBUTION GRAPH ── */
  .gh-graph-wrap {
  min-width: max-content;
  }
  .gh-section {
    background: var(--surface);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 2.5rem 3rem;
  }
  .gh-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .gh-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
  }
  .gh-title svg { width: 15px; height: 15px; fill: var(--accent); flex-shrink: 0; }
  .gh-summary { font-size: 12px; color: var(--muted); }
  .gh-summary strong { color: var(--text); font-weight: 500; }
  .gh-scroll-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .gh-scroll-wrap::-webkit-scrollbar { height: 4px; }
  .gh-scroll-wrap::-webkit-scrollbar-track { background: transparent; }
  .gh-scroll-wrap::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 2px; }
  .gh-inner { display: flex; flex-direction: column; gap: 4px; min-width: max-content; }
  .gh-month-labels { display: flex; gap: 0; padding-left: 28px; margin-bottom: 2px; }
  .gh-month-label { font-size: 10px; color: var(--muted); letter-spacing: 0.04em; }
  .gh-graph-row { display: flex; gap: 4px; align-items: flex-start; }
  .gh-day-labels { display: flex; flex-direction: column; gap: 3px; margin-right: 4px; flex-shrink: 0; }
  .gh-day-label { font-size: 9px; color: var(--muted); height: 11px; line-height: 11px; width: 20px; text-align: right; }
  .gh-graph-wrap { display: flex; gap: 3px; }
  .gh-week { display: flex; flex-direction: column; gap: 3px; flex-shrink: 0; }
  .gh-cell {
    width: 11px; height: 11px;
    border-radius: 2px;
    background: #e8ede9;
    transition: opacity 0.1s;
    cursor: default;
  }
  .gh-cell[data-level="1"] { background: #9fc9a9; }
  .gh-cell[data-level="2"] { background: #5aaa72; }
  .gh-cell[data-level="3"] { background: #2d7a47; }
  .gh-cell[data-level="4"] { background: #1a5c33; }
  .gh-cell:hover { opacity: 0.75; }
  .gh-footer { display: flex; align-items: center; justify-content: flex-end; gap: 6px; margin-top: 0.75rem; font-size: 11px; color: var(--muted); }
  .gh-legend { display: flex; align-items: center; gap: 3px; }
  .gh-legend-cell { width: 10px; height: 10px; border-radius: 2px; }

  /* ── FOOTER ── */
  footer {
    padding: 2rem 3rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: 0.04em;
  }
 .footer-socials {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.footer-socials a {
  display: inline-flex;
  color: var(--muted);
  opacity: 0.7;
  text-decoration: none !important;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.footer-socials svg {
  vertical-align: middle;
}

.footer-socials a:hover {
  opacity: 1;
  color: var(--text);
}

  /* ── AVAILABILITY BADGE ── */
  .avail-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(45,90,61,0.3);
    border-radius: 100px;
    font-size: 12px;
    color: var(--accent);
    margin-bottom: 2rem;
    background: var(--accent-bg);
  }

  .avail-dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--accent);
    animation: pulse 2s ease-in-out infinite;
  }

  @keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
  }

  /* ── ANIMATIONS ── */
  .fade-in { opacity: 1; transform: none; }
  .delay-1, .delay-2, .delay-3, .delay-4, .delay-5 {}

  /* ── RESPONSIVE ── */
  @media (max-width: 768px) {
    nav { padding: 1rem 1.5rem; }
    .nav-links { gap: 1.25rem; }
    section { padding: 4rem 1.5rem; }
    .hero { padding: 7rem 1.5rem 3rem; }
    .about-grid { grid-template-columns: 1fr; gap: 2.5rem; }
    .gh-section { padding: 2rem 1.5rem; }
    .hero-stats { gap: 2rem; }
    footer { flex-direction: column; gap: 0.5rem; }
    .projects-grid { margin: 0; }
  }




  /* ============================================================
     DARK MODE
     ============================================================ */
  [data-theme="dark"] {
    --bg: #0d0f0e;
    --surface: #141715;
    --surface2: #1c201d;
    --border: rgba(255,255,255,0.09);
    --border2: rgba(255,255,255,0.18);
    --text: #e8e9e6;
    --muted: #979b95;
    --accent: #6cc98a;
    --accent-light: #8ad9a3;
    --accent-bg: rgba(108,201,138,0.10);
  }

  [data-theme="dark"] nav { background: rgba(13,15,14,0.85); }
  [data-theme="dark"] h1 .line2 { -webkit-text-stroke: 1px rgba(232,233,230,0.22); }
  [data-theme="dark"] .btn-primary { color: #0d0f0e; }
  [data-theme="dark"] .btn-primary:hover { color: var(--accent); }
  [data-theme="dark"] .hero-grid-bg {
    background-image:
      linear-gradient(rgba(108,201,138,0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(108,201,138,0.06) 1px, transparent 1px);
  }
  [data-theme="dark"] .gh-cell { background: #1b241f; }
  [data-theme="dark"] .gh-cell[data-level="1"] { background: #24503a; }
  [data-theme="dark"] .gh-cell[data-level="2"] { background: #2f7a4f; }
  [data-theme="dark"] .gh-cell[data-level="3"] { background: #45a86a; }
  [data-theme="dark"] .gh-cell[data-level="4"] { background: #6cc98a; }
  [data-theme="dark"] .gh-legend-cell:first-child { background: #1b241f !important; }

  /* smooth theme swap */
  body, nav, section, footer, .gh-section, .contact-row, .contact-links,
  .tag, .stack-chip, .btn, .nav-icon-btn, .dock, .dock-item {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
  }

  /* ============================================================
     NAV ACTIONS (search + theme toggle)
     ============================================================ */
  .nav-actions { display: flex; align-items: center; gap: 0.75rem; }
  .nav-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 34px; height: 34px;
    border: 1px solid var(--border2);
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
  }
  .nav-icon-btn:hover { color: var(--accent); border-color: var(--accent); }
  .nav-icon-btn svg { width: 16px; height: 16px; display: block; }

  /* ============================================================
     CUSTOM CURSOR
     ============================================================ */
  @media (hover: hover) and (pointer: fine) {
    .has-custom-cursor, .has-custom-cursor * { cursor: none !important; }
  }
  .cursor-dot, .cursor-ring {
    position: fixed; top: 0; left: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    will-change: left, top;
  }
  .cursor-dot {
    width: 6px; height: 6px;
    background: var(--accent);
    transition: opacity 0.2s ease;
  }
  .cursor-ring {
    width: 34px; height: 34px;
    border: 1.5px solid var(--accent);
    opacity: 0.6;
    transition: width 0.25s ease, height 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
  }
  .cursor-ring.is-hovering { width: 54px; height: 54px; opacity: 1; background: var(--accent-bg); }
  .cursor-dot.is-hovering { opacity: 0; }

  /* ============================================================
     SECTION SEARCH
     ============================================================ */
  .search-overlay {
    position: fixed; inset: 0;
    z-index: 1000;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding-top: 15vh;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(4px);
  }
  .search-overlay.open { display: flex; }
  .search-box {
    width: min(520px, 90vw);
    background: var(--bg);
    border: 1px solid var(--border2);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
  }
  .search-input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: none;
    border-bottom: 1px solid var(--border);
    background: transparent;
    color: var(--text);
    font-family: var(--mono);
    font-size: 15px;
    outline: none;
  }
  .search-input::placeholder { color: var(--muted); }
  .search-results { list-style: none; max-height: 320px; overflow-y: auto; }
  .search-result {
    padding: 0.8rem 1.25rem;
    display: flex; align-items: center; justify-content: space-between;
    cursor: pointer;
    color: var(--text);
    font-size: 14px;
  }
  .search-result:hover, .search-result.active { background: var(--surface2); color: var(--accent); }
  .search-result .sr-hint {
    font-size: 11px; color: var(--muted);
    text-transform: uppercase; letter-spacing: 0.06em;
  }
  .search-empty { padding: 1rem 1.25rem; color: var(--muted); font-size: 13px; }

  /* ============================================================
     SOCIAL DOCK
     ============================================================ */
  .dock {
    display: inline-flex; align-items: flex-end; gap: 10px;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: var(--surface);
    background: color-mix(in srgb, var(--surface) 82%, transparent);
    backdrop-filter: blur(12px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
  }
  /* dock magnify is handled in script.js */
  .dock-item {
    position: relative;
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px;
    border-radius: 14px;
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--muted);
    text-decoration: none;
    transform-origin: center bottom;
    transition: transform 0.25s cubic-bezier(.34,1.56,.64,1), color 0.2s, border-color 0.2s;
  }
  .dock-item:hover { transform: translateY(-10px) scale(1.4); color: var(--accent); border-color: var(--accent); }
  .dock-item svg { width: 22px; height: 22px; display: block; }
  .dock-tip {
    position: absolute; top: -34px; left: 50%;
    transform: translateX(-50%) translateY(6px);
    background: var(--text); color: var(--bg);
    font-size: 11px; font-family: var(--mono);
    padding: 4px 8px; border-radius: 6px;
    white-space: nowrap; opacity: 0; pointer-events: none;
    transition: opacity 0.2s, transform 0.2s;
  }
  .dock-item:hover .dock-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

  @media (max-width: 768px) {
    .dock { gap: 8px; padding: 8px 10px; }
    .dock-item { width: 38px; height: 38px; }
    .dock-item svg { width: 19px; height: 19px; }
  }

  /* ============================================================
     REDUCED MOTION
     ============================================================ */
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
      animation-duration: 0.001ms !important;
      animation-iteration-count: 1 !important;
      transition-duration: 0.001ms !important;
      scroll-behavior: auto !important;
    }
  }

  /* ============================================================
     HERO TITLE + CENTERED HERO + TYPEWRITER
     ============================================================ */

  /* Lift all hero content above the grid background */
  .hero > *:not(.hero-grid-bg):not(.hero-grid-glow) { position: relative; z-index: 1; }

  /* Center the hero block */
  .hero { align-items: center; text-align: center; }
  .hero-cta { justify-content: center; }
  .hero-stats { justify-content: center; }

  /* Title (replaces the old green hero-tag) */
  .hero-title {
    font-family: var(--sans);
    font-size: clamp(2rem, 5vw, 3.4rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    color: var(--text);
    max-width: none;
    margin-bottom: 1.25rem;
    min-height: 1.1em;
  }

  /* Typewriter line */
  .hero-desc {
    margin-left: auto;
    margin-right: auto;
    min-height: 5.4em;   /* reserve space so nothing jumps while typing */
  }

  .typewriter-caret {
    display: inline-block;
    width: 0.07em;
    min-width: 2px;
    height: 1.05em;
    background: var(--accent);
    margin-left: 3px;
    vertical-align: text-bottom;
    animation: caret-blink 1s step-end infinite;
  }

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

  .glitch-char {
    color: var(--accent);
    opacity: 0.75;
  }

  @media (max-width: 768px) {
    .hero-desc { min-height: 8.5em; }
  }

  /* ============================================================
     INTERACTIVE GRID  (cursor spotlight over the hero grid)
     ============================================================ */
  .hero-grid-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.4s ease;

    /* same 60px lattice as .hero-grid-bg, but brighter */
    background-image:
      linear-gradient(rgba(45,90,61,0.40) 1px, transparent 1px),
      linear-gradient(90deg, rgba(45,90,61,0.40) 1px, transparent 1px);
    background-size: 60px 60px;

    /* only visible in a circle around the cursor */
    --gx: -999px;
    --gy: -999px;
    -webkit-mask-image: radial-gradient(circle var(--gr, 190px) at var(--gx) var(--gy), #000 0%, rgba(0,0,0,0.35) 45%, transparent 70%);
    mask-image: radial-gradient(circle var(--gr, 190px) at var(--gx) var(--gy), #000 0%, rgba(0,0,0,0.35) 45%, transparent 70%);
  }

  [data-theme="dark"] .hero-grid-glow {
    background-image:
      linear-gradient(rgba(108,201,138,0.55) 1px, transparent 1px),
      linear-gradient(90deg, rgba(108,201,138,0.55) 1px, transparent 1px);
  }

  .hero.grid-live .hero-grid-glow { opacity: 1; }

  @media (prefers-reduced-motion: reduce) {
    .hero-grid-glow { display: none; }
  }