/* ===== DESIGN SYSTEM ===== */
    :root {
      --bg:        #050d14;
      --surface:   rgba(255,255,255,0.04);
      --glass:     rgba(255,255,255,0.07);
      --border:    rgba(0,255,180,0.18);
      --accent:    #00ffb2;
      --accent2:   #00c9ff;
      --text:      #e8f5ef;
      --muted:     rgba(232,245,239,0.5);
      --header-bg: rgba(5,13,20,0.75);
      --radius:    16px;
      --mono:      'Space Mono', monospace;
      --sans:      'Vazirmatn', sans-serif;
    }
    body.light {
      --bg:        #f0f4f8;
      --surface:   rgba(0,0,0,0.03);
      --glass:     rgba(255,255,255,0.65);
      --border:    rgba(0,180,130,0.25);
      --accent:    #00916e;
      --accent2:   #0077b6;
      --text:      #111c1a;
      --muted:     rgba(17,28,26,0.5);
      --header-bg: rgba(240,244,248,0.85);
    }

    /* ===== RESET ===== */
    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
    html { scroll-behavior: smooth; }

    body {
      font-family: var(--sans);
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      overflow-x: hidden;
      opacity: 0;
      transform: translateY(18px);
      transition: opacity 0.9s ease, transform 0.9s ease, background 0.4s, color 0.4s;
    }
    body.loaded { opacity: 1; transform: translateY(0); }

    /* ===== AMBIENT ORBS ===== */
    .orb {
      position: fixed;
      border-radius: 50%;
      filter: blur(90px);
      pointer-events: none;
      z-index: 0;
      opacity: 0.22;
    }
    .orb-1 { width: 520px; height: 520px; background: var(--accent);  top: -180px; left: -160px; }
    .orb-2 { width: 400px; height: 400px; background: var(--accent2); bottom: -120px; right: -100px; }
    .orb-3 { width: 260px; height: 260px; background: var(--accent);  top: 50%; left: 55%; opacity: 0.1; }

    /* ===== NOISE OVERLAY ===== */
    body::before {
      content: '';
      position: fixed; inset: 0;
      background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
      pointer-events: none; z-index: 1; opacity: 0.35;
    }

    /* ===== HEADER ===== */
    header {
      position: sticky; top: 0; z-index: 100;
      display: flex; align-items: center; justify-content: space-between;
      padding: 14px 32px;
      background: var(--header-bg);
      backdrop-filter: blur(18px);
      border-bottom: 1px solid var(--border);
      gap: 16px;
    }

    .logo {
      font-family: var(--mono);
      font-size: 17px;
      font-weight: 700;
      color: var(--accent);
      white-space: nowrap;
      letter-spacing: -0.5px;
    }
/* ===== LOGO ===== */
.logo img {
  height: 36px;
  width: auto;
  display: block;
}

/* dark mode (default): show dark logo, hide light logo */
.logo .logo-light { display: none; }
.logo .logo-dark  { display: block; }

/* light mode: show light logo, hide dark logo */
body.light .logo .logo-light { display: block; }
body.light .logo .logo-dark  { display: none; }
    /* ===== DESKTOP NAV ===== */
    .desktop-nav {
      display: none;
      gap: 4px;
    }
    @media (min-width: 900px) { .desktop-nav { display: flex; } }

    .desktop-nav a {
      font-family: var(--mono);
      font-size: 13px;
      color: var(--muted);
      text-decoration: none;
      padding: 7px 14px;
      border-radius: 8px;
      letter-spacing: 0.4px;
      transition: color 0.2s, background 0.2s;
      position: relative;
    }
    .desktop-nav a::after {
      content: '';
      position: absolute; bottom: 4px; left: 14px; right: 14px;
      height: 1.5px;
      background: var(--accent);
      transform: scaleX(0);
      transition: transform 0.25s ease;
    }
    .desktop-nav a:hover { color: var(--accent); }
    .desktop-nav a:hover::after { transform: scaleX(1); }

    /* ===== RIGHT CONTROLS ===== */
    .right-controls {
      display: flex; align-items: center; gap: 10px;
    }

    .ctrl-btn {
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 700;
      padding: 6px 13px;
      border-radius: 8px;
      cursor: pointer;
      border: 1.5px solid var(--border);
      background: var(--glass);
      color: var(--text);
      backdrop-filter: blur(6px);
      transition: border-color 0.2s, color 0.2s, background 0.2s;
      user-select: none;
    }
    .ctrl-btn:hover {
      border-color: var(--accent);
      color: var(--accent);
    }

    /* ===== HAMBURGER ===== */
    .hamburger {
      display: flex;
      flex-direction: column;
      justify-content: center;
      gap: 5px;
      width: 36px; height: 36px;
      cursor: pointer;
      padding: 4px;
      border-radius: 8px;
      border: 1.5px solid var(--border);
      background: var(--glass);
      transition: border-color 0.2s;
    }
    @media (min-width: 900px) { .hamburger { display: none; } }

    .hamburger span {
      display: block;
      height: 2px;
      background: var(--accent);
      border-radius: 2px;
      transition: transform 0.3s ease, opacity 0.3s ease;
    }
    .hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
    .hamburger.open span:nth-child(2) { opacity: 0; }
    .hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

    /* ===== MOBILE DRAWER ===== */
    .mobile-drawer {
      position: fixed; inset: 0; top: 61px;
      background: rgba(5,13,20,0.97);
      backdrop-filter: blur(18px);
      display: flex; flex-direction: column;
      padding: 28px 24px;
      gap: 8px;
      z-index: 99;
      transform: translateX(100%);
      transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
      border-left: 1px solid var(--border);
    }
    body.light .mobile-drawer { background: rgba(240,244,248,0.97); }
    .mobile-drawer.open { transform: translateX(0); }

    .mobile-drawer a {
      font-family: var(--mono);
      font-size: 18px;
      color: var(--text);
      text-decoration: none;
      padding: 16px 20px;
      border-radius: var(--radius);
      border: 1px solid transparent;
      transition: color 0.2s, border-color 0.2s, background 0.2s;
      letter-spacing: 0.5px;
    }
    .mobile-drawer a:hover {
      color: var(--accent);
      border-color: var(--border);
      background: var(--glass);
    }

    /* ===== PAGE WRAPPER ===== */
    main {
      position: relative; z-index: 2;
      max-width: 960px;
      margin: 56px auto;
      padding: 0 24px 80px;
    }

    /* ===== SECTION TITLES ===== */
    .section-title {
      font-family: var(--mono);
      font-size: clamp(20px, 3vw, 28px);
      font-weight: 700;
      margin-bottom: 32px;
      text-align: center;
      background: linear-gradient(90deg, var(--accent), var(--accent2));
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    h1 {
      font-family: var(--mono);
      font-size: clamp(26px, 5vw, 42px);
      text-align: center;
      margin-bottom: 48px;
      background: linear-gradient(135deg, var(--accent) 0%, var(--accent2) 100%);
      -webkit-background-clip: text;
      -webkit-text-fill-color: transparent;
      background-clip: text;
    }

    /* ===== GLASS CARD ===== */
    .glass-card {
      background: var(--glass);
      border: 1px solid var(--border);
      border-radius: var(--radius);
      backdrop-filter: blur(14px);
      padding: 36px 32px;
      margin-bottom: 40px;
      transition: background 0.4s, border-color 0.4s;
    }

    /* ===== SKILLS ===== */
    .bar { margin-bottom: 22px; }

    .bar-header {
      display: flex;
      justify-content: space-between;
      margin-bottom: 8px;
    }

    .bar-label {
      font-family: var(--mono);
      font-size: 13px;
      letter-spacing: 0.8px;
      color: var(--text);
    }
    .bar-value {
      font-family: var(--mono);
      font-size: 12px;
      color: var(--accent);
    }

    .bar-track {
      width: 100%;
      height: 6px;
      background: rgba(255,255,255,0.08);
      border-radius: 99px;
      overflow: hidden;
    }
    body.light .bar-track { background: rgba(0,0,0,0.08); }

    .bar-fill {
      height: 100%;
      background: linear-gradient(90deg, var(--accent), var(--accent2));
      border-radius: 99px;
      width: 0;
      transition: width 1.5s cubic-bezier(0.4,0,0.2,1);
    }

    /* ===== ABOUT ME ===== */
    .about-box {
      display: flex;
      gap: 36px;
      align-items: center;
      flex-wrap: wrap;
    }

    .about-photo img {
      width: 160px; height: 160px;
      border-radius: 50%;
      object-fit: cover;
      border: 2.5px solid var(--accent);
      box-shadow: 0 0 28px rgba(0,255,178,0.2);
      flex-shrink: 0;
    }

    .about-text { flex: 1; min-width: 220px; }

    .about-text h3 {
      font-family: var(--mono);
      font-size: 18px;
      color: var(--accent);
      margin-bottom: 12px;
    }

    .about-text p {
      font-size: 15px;
      line-height: 1.75;
      color: var(--muted);
    }

    .resume-links {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px;
      margin-top: 22px;
    }

    .btn-green, .btn-outline {
      font-family: var(--mono);
      font-size: 12px;
      font-weight: 700;
      padding: 11px 16px;
      border-radius: 10px;
      text-decoration: none;
      text-align: center;
      letter-spacing: 0.4px;
      transition: transform 0.2s, box-shadow 0.2s, background 0.2s;
    }
    .btn-green {
      background: var(--accent);
      color: #000;
    }
    .btn-green:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 24px rgba(0,255,178,0.3);
    }
    .btn-outline {
      background: transparent;
      border: 1.5px solid var(--accent);
      color: var(--accent);
    }
    .btn-outline:hover {
      background: var(--accent);
      color: #000;
      transform: translateY(-2px);
    }

    /* ===== CERTIFICATES ===== */
    .cert-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
      gap: 20px;
    }

    .cert-item img {
      width: 100%;
      border-radius: 12px;
      object-fit: cover;
      border: 1.5px solid var(--border);
      transition: transform 0.3s, box-shadow 0.3s;
    }
    .cert-item img:hover {
      transform: scale(1.04);
      box-shadow: 0 0 20px rgba(0,255,178,0.2);
    }

    /* ===== FOOTER ===== */
    footer {
      position: relative; z-index: 2;
      text-align: center;
      padding: 28px 20px;
      font-family: var(--mono);
      font-size: 13px;
      color: var(--muted);
      border-top: 1px solid var(--border);
    }

    /* ===== ANIMATIONS ===== */
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(24px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .glass-card {
      animation: fadeInUp 0.7s ease both;
    }
    .glass-card:nth-child(2) { animation-delay: 0.1s; }
    .glass-card:nth-child(3) { animation-delay: 0.2s; }

    /* ===== RESPONSIVE ===== */
    @media (max-width: 600px) {
      header { padding: 12px 18px; }
      .about-box { flex-direction: column; align-items: center; text-align: center; }
      .resume-links { grid-template-columns: 1fr; }
      .about-photo img { width: 130px; height: 130px; }
      main { margin: 36px auto; padding: 0 14px 60px; }
      .glass-card { padding: 24px 18px; }
    }