@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Playfair+Display:wght@600;700;800&display=swap');

  :root {
    --bg: #0d0f14;
    --bg2: #13161e;
    --bg3: #1a1e28;
    --border: #252a38;
    --accent: #4f9cf9;
    --accent2: #38d9a9;
    --accent3: #f7b731;
    --text: #e2e8f0;
    --muted: #8892a4;
    --card: #161b27;
    --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --radius: 24px;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; }
  html { scroll-behavior: smooth; scroll-padding-top: 90px; }
  body { background: var(--bg); color: var(--text); font-family: var(--font-body); font-size: 16px; line-height: 1.65; }
  h1, h2, h3 { font-family: var(--font-display); letter-spacing: 0; }
  a { color: inherit; }

  /* NAV: solid by default, transparent over the home hero until you scroll */
  nav {
    position: fixed; top: 0; width: 100%; z-index: 100;
    background: rgba(13,15,20,0.92); backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    padding: 0 2rem; height: 76px;
    display: flex; align-items: center; justify-content: space-between;
    transition: background 0.25s, border-color 0.25s, box-shadow 0.25s;
  }
  nav.over-hero { background: transparent; backdrop-filter: none; border-bottom-color: transparent; }
  nav.over-hero.scrolled { background: rgba(13,15,20,0.92); backdrop-filter: blur(12px); border-bottom-color: var(--border); box-shadow: 0 6px 24px rgba(0,0,0,0.35); }
  .nav-logo { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text); text-decoration: none; }
  .nav-links { display: flex; gap: 2.25rem; list-style: none; }
  .nav-links a { color: var(--text); text-decoration: none; font-size: 0.95rem; font-weight: 500; opacity: 0.85; transition: color 0.2s, opacity 0.2s; }
  .nav-links a:hover { color: var(--accent); opacity: 1; }
  .nav-toggle { display: none; background: none; border: 1px solid var(--border); color: var(--text); border-radius: 999px; padding: 0.4rem 1rem; font: inherit; font-size: 0.9rem; cursor: pointer; }

  /* BUTTONS: pills */
  .btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.8rem 1.75rem; border-radius: 999px; font-size: 0.95rem; font-weight: 600;
    text-decoration: none; cursor: pointer; transition: transform 0.2s, background 0.2s, border-color 0.2s, color 0.2s; border: 1.5px solid transparent;
  }
  .btn-primary { background: var(--accent); color: #0b1220; }
  .btn-primary:hover { background: #7ab4fb; transform: translateY(-1px); }
  .btn-outline { background: transparent; color: var(--text); border-color: rgba(226,232,240,0.4); }
  .btn-outline:hover { border-color: var(--accent); color: var(--accent); }

  /* HERO */
  .hero {
    min-height: 92vh; display: flex; align-items: center; padding: 130px 2rem 5rem; position: relative; overflow: hidden;
    background: radial-gradient(ellipse 70% 60% at 85% 20%, rgba(79,156,249,0.14) 0%, transparent 65%),
                radial-gradient(ellipse 50% 50% at 10% 90%, rgba(56,217,169,0.08) 0%, transparent 60%), var(--bg);
  }
  .hero-inner { max-width: 1100px; width: 100%; margin: 0 auto; }
  .hero-tag {
    display: inline-block; border: 1px solid rgba(79,156,249,0.4); color: var(--accent); border-radius: 999px;
    padding: 0.3rem 1rem; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 1.5rem;
  }
  .hero-heading { font-size: clamp(2.6rem, 6.5vw, 5rem); font-weight: 800; line-height: 1.08; max-width: 14ch; margin-bottom: 1.5rem; }
  .hero-title { font-size: 1.1rem; color: var(--text); font-weight: 500; margin-bottom: 0.75rem; }
  .hero-desc { font-size: 1.05rem; color: var(--muted); max-width: 640px; margin-bottom: 2.25rem; line-height: 1.75; }
  .hero-cta { display: flex; gap: 1rem; flex-wrap: wrap; }

  /* SECTIONS */
  section { padding: 6rem 2rem; }
  .container { max-width: 1100px; margin: 0 auto; }
  .section-head { text-align: center; margin-bottom: 3rem; }
  .section-title { font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
  .section-sub { color: var(--muted); font-size: 1.02rem; max-width: 680px; margin: 0 auto; }
  .section-label { display: none; }
  #skills, #about { background: var(--bg2); }

  /* STATS BAND */
  .stats { padding: 0 2rem; margin-top: -1.5rem; position: relative; z-index: 2; }
  .stats-panel {
    max-width: 1100px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 32px;
    padding: 2.25rem 2rem; display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1.5rem; text-align: center;
  }
  .stat-num { font-family: var(--font-display); font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; color: var(--accent); line-height: 1.1; }
  .stat-label { font-size: 0.85rem; color: var(--muted); margin-top: 0.4rem; }

  /* PROJECTS */
  .group-title { font-size: 1.6rem; font-weight: 700; margin: 3.5rem 0 1.5rem; }
  .group-title:first-of-type { margin-top: 0; }
  .projects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 1.5rem; }
  .project-card {
    background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem;
    display: flex; flex-direction: column; gap: 1rem; text-decoration: none; color: inherit;
    transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  }
  .project-card:hover { border-color: var(--accent); transform: translateY(-3px); box-shadow: 0 14px 36px rgba(0,0,0,0.35); }
  .project-header > div { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 0.7rem; }
  .project-type {
    display: inline-block; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--accent); background: rgba(79,156,249,0.1); border-radius: 999px; padding: 0.2rem 0.75rem;
  }
  .project-name { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; line-height: 1.25; }
  .project-desc { font-size: 0.92rem; color: var(--muted); line-height: 1.7; flex: 1; }
  .project-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .meta-chip {
    display: inline-flex; align-items: center; background: rgba(255,255,255,0.04); border: 1px solid var(--border);
    border-radius: 999px; padding: 0.2rem 0.7rem; font-size: 0.72rem; font-weight: 500; color: var(--muted);
  }
  .meta-chip.highlight { background: rgba(56,217,169,0.1); border-color: rgba(56,217,169,0.3); color: var(--accent2); }
  .meta-chip.users { background: rgba(79,156,249,0.1); border-color: rgba(79,156,249,0.3); color: var(--accent); }
  a.project-card .project-name::after { content: ' \2192'; color: var(--accent); opacity: 0; transition: opacity 0.2s; }
  a.project-card:hover .project-name::after { opacity: 1; }

  /* ABOUT */
  .about-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; }
  .about-text p { color: var(--muted); font-size: 1rem; margin-bottom: 1.1rem; line-height: 1.8; }
  .about-text p:last-child { margin-bottom: 0; }
  .about-highlights { display: flex; flex-direction: column; gap: 1rem; }
  .highlight-item { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 1.25rem 1.5rem; display: block; }
  .highlight-dot { display: none; }
  .highlight-item strong { font-family: var(--font-display); font-size: 1.1rem; display: block; margin-bottom: 0.3rem; }
  .highlight-item span { font-size: 0.88rem; color: var(--muted); }

  /* CONTACT */
  #contact { background: var(--bg); }
  .cta-banner {
    background: linear-gradient(135deg, #1b3a63 0%, #14283f 55%, #112331 100%); border: 1px solid rgba(79,156,249,0.25);
    border-radius: 32px; padding: 4rem 2.5rem; text-align: center;
  }
  .cta-banner h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.2; margin-bottom: 1rem; }
  .cta-banner p { color: #b9c4d6; max-width: 640px; margin: 0 auto 2rem; font-size: 1.02rem; }
  .cta-banner .hero-cta { justify-content: center; }
  .contact-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
  .contact-item { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 1.4rem 1.5rem; }
  .contact-item .k { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.35rem; }
  .contact-item .v { font-size: 0.98rem; color: var(--text); word-break: break-word; }
  .contact-item a { color: var(--accent); text-decoration: none; }
  .contact-item a:hover { text-decoration: underline; }

  /* FOOTER */
  footer { background: var(--bg2); border-top: 1px solid var(--border); padding: 3.5rem 2rem 2rem; color: var(--muted); font-size: 0.9rem; }
  .footer-grid { max-width: 1100px; margin: 0 auto; display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 2.5rem; }
  .footer-brand { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--text); margin-bottom: 0.6rem; }
  .footer-col h4 { font-family: var(--font-display); font-size: 1rem; color: var(--text); margin-bottom: 0.8rem; }
  .footer-col ul { list-style: none; }
  .footer-col li { margin-bottom: 0.45rem; }
  .footer-col a { color: var(--muted); text-decoration: none; }
  .footer-col a:hover { color: var(--accent); }
  .footer-bottom { max-width: 1100px; margin: 2.5rem auto 0; padding-top: 1.5rem; border-top: 1px solid var(--border); font-size: 0.8rem; text-align: center; }

  .divider { display: none; }
  .reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.6s ease, transform 0.6s ease; }
  .reveal.visible { opacity: 1; transform: none; }

  @media (max-width: 820px) {
    nav { padding: 0 1.25rem; height: 68px; flex-wrap: wrap; }
    .nav-toggle { display: inline-block; }
    .nav-links { display: none; width: 100%; flex-direction: column; gap: 0; padding: 0.5rem 0 1rem; background: rgba(13,15,20,0.98); }
    nav.open { height: auto; background: rgba(13,15,20,0.98); align-content: flex-start; padding-top: 14px; }
    nav.open .nav-links { display: flex; }
    .nav-links li a { display: block; padding: 0.7rem 0; }
    .hero { padding-top: 110px; min-height: auto; }
    .about-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; }
    section { padding: 4.5rem 1.25rem; }
    .stats { padding: 0 1.25rem; }
  }
  @media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }

  /* PROJECT PAGE */
  .page { max-width: 1000px; margin: 0 auto; padding: 130px 2rem 4rem; }
  .crumbs { font-size: 0.82rem; color: var(--muted); margin-bottom: 1.5rem; }
  .crumbs a { color: var(--accent); text-decoration: none; }
  .crumbs a:hover { text-decoration: underline; }
  .page-head { margin-bottom: 1.25rem; }
  .page-head > div { display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 0.8rem; }
  .page-title { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; line-height: 1.15; }
  .page .project-meta { border-top: none; padding-top: 0; margin-bottom: 1.5rem; }
  .page h2 { font-size: 1.5rem; font-weight: 700; color: var(--text); text-transform: none; letter-spacing: 0; margin: 2.5rem 0 0.9rem; }
  .page p, .page li { color: var(--muted); font-size: 1rem; line-height: 1.8; }
  .page strong { color: var(--text); }
  .page code { background: var(--bg3); border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.85em; color: var(--text); }
  .page ul { padding-left: 1.25rem; }
  .page li { margin-bottom: 0.5rem; }
  .page ul ul { margin-top: 0.5rem; }
  .filelist { list-style: none; padding: 0 !important; }
  .filelist li { margin-bottom: 0.25rem; }
  .filelist a { color: var(--accent); text-decoration: none; }
  .filelist a:hover { text-decoration: underline; }
  .works-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin-top: 1.5rem; }
  .works-list a { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 1.25rem 1.4rem; text-decoration: none; color: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; transition: border-color 0.2s, transform 0.2s; }
  .works-list a:hover { border-color: var(--accent); transform: translateY(-2px); }
  .works-list small { display: block; color: var(--muted); font-family: var(--font-body); font-weight: 500; font-size: 0.78rem; margin-top: 0.3rem; }

/* FLOWCHARTS */
  .flow { overflow-x: auto; margin-top: 0.5rem; }
  .flow svg { display: block; width: 100%; min-width: 620px; height: auto; }
  .flow rect { fill: var(--card); stroke: var(--border); stroke-width: 1.5; }
  .flow .in rect { stroke: var(--accent); fill: rgba(79,156,249,0.08); }
  .flow .out rect { stroke: var(--accent2); fill: rgba(56,217,169,0.08); }
  .flow .store rect { stroke: var(--accent3); fill: rgba(247,183,49,0.08); }
  .flow text { fill: var(--text); font-size: 13px; font-family: inherit; text-anchor: middle; }
  .flow text.rowlabel { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; text-anchor: start; }
  .flow .edge { stroke: var(--muted); stroke-width: 1.6; fill: none; }
  .flow marker path { fill: var(--muted); }
  .flow-key { font-size: 0.78rem !important; margin-top: 0.5rem; }
  .flow-key i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin: 0 0.3rem 0 0.9rem; border: 1.5px solid var(--border); vertical-align: -1px; }
  .flow-key i:first-child { margin-left: 0; }
  .flow-key .k-in { border-color: var(--accent); }
  .flow-key .k-out { border-color: var(--accent2); }
  .flow-key .k-store { border-color: var(--accent3); }
  .flow .opt rect { stroke-dasharray: 5 4; }
  .flow text.edgelabel { font-size: 10.5px; fill: var(--muted); font-style: italic; }
  .flow-key .k-opt { border-style: dashed; }
  .flow text.edgelabel, .flow text.rowlabel { paint-order: stroke; stroke: var(--bg); stroke-width: 6px; stroke-linejoin: round; }

  .prose h2 { font-size: 1rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin: 2rem 0 0.75rem; }
  .prose h3 { font-size: 0.95rem; margin: 1.25rem 0 0.5rem; }
  .prose p, .prose li { color: var(--muted); font-size: 0.95rem; line-height: 1.75; }
  .prose p { margin-bottom: 0.75rem; }
  .prose ul, .prose ol { padding-left: 1.25rem; margin-bottom: 0.75rem; }
  .prose li { margin-bottom: 0.4rem; }
  .prose code { background: var(--bg3); border-radius: 4px; padding: 0.1rem 0.35rem; font-size: 0.85em; color: var(--text); }
  .prose strong { color: var(--text); }
  .prose table { border-collapse: collapse; width: 100%; margin: 0.5rem 0 1.25rem; font-size: 0.85rem; display: block; overflow-x: auto; }
  .prose th, .prose td { border: 1px solid var(--border); padding: 0.4rem 0.6rem; text-align: left; color: var(--muted); vertical-align: top; }
  .prose th { color: var(--text); background: var(--bg3); }
  .prose a { color: var(--accent); }

  /* SKILLS TABLE */
  .skills-wrap { border: 1px solid var(--border); border-radius: 20px; background: var(--card); overflow-x: auto; }
  .skills-table { width: 100%; min-width: 680px; border-collapse: collapse; }
  .skills-table th, .skills-table td { padding: 1.05rem 1.5rem; text-align: left; vertical-align: middle; }
  .skills-table thead th { font-size: 0.72rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
  .skills-table tbody tr { border-top: 1px solid var(--border); }
  .skills-table tbody th { font-size: 0.95rem; font-weight: 700; color: var(--text); width: 24%; }
  .skills-table td.tools { font-size: 0.9rem; color: var(--muted); line-height: 1.5; }
  .skills-table .role { text-align: center; width: 1%; white-space: nowrap; padding-left: 1.1rem; padding-right: 1.1rem; }
  .ck { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; }
  .ck svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
  .ck-de { background: rgba(56,217,169,0.14); color: var(--accent2); }
  .ck-gis { background: rgba(167,139,250,0.16); color: #a78bfa; }
  .dash { color: var(--muted); }
  .sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  @media (max-width: 700px) { .skills-table th, .skills-table td { padding: 0.85rem 1rem; } }
