
    /* --- THEME VARIABLES (same system as CAD/Laboratory) --- */
    :root {
      --bg: #ffffff;
      --text: #111111;
      --muted: #555;
      --card: #f4f4f5;
      --border: #e5e7eb;
      --shadow: 0 10px 30px rgba(0,0,0,0.08);
    }

    [data-theme="dark"] {
      --bg: #0f1115;
      --text: #e5e7eb;
      --muted: #9ca3af;
      --card: #1c1f26;
      --border: #2a2f3a;
      --shadow: 0 12px 40px rgba(0,0,0,0.35);
    }

    body {
      margin: 0;
      font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
      background: var(--bg);
      color: var(--text);
    }

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

    /* --- NAV (match CAD/Laboratory) --- */
    .portfolio-header {
      position: sticky;
      top: 0;
      background: var(--bg);
      border-bottom: 1px solid var(--border);
      z-index: 100;
      backdrop-filter: saturate(140%) blur(10px);
    }

    .nav {
      max-width: 1100px;
      margin: 0 auto;
      padding: 1rem;
      display: flex;
      align-items: center;
      justify-content: space-between;
    }

    .nav-left {
      font-weight: 600;
      font-size: 1.1rem;
    }

    .nav-right {
      display: flex;
      gap: 1.5rem;
      align-items: center;
    }

    /* --- THEME TOGGLE (exact same pattern as CAD/Laboratory) --- */
    .theme-switch {
      width: 66px;
      height: 34px;
      border-radius: 999px;
      border: 1px solid var(--border);
      background: var(--card);
      position: relative;
      cursor: pointer;
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.35);
      display: inline-flex;
      align-items: center;
      padding: 4px;
    }

    .theme-knob {
      width: 26px;
      height: 26px;
      border-radius: 999px;
      background: var(--bg);
      border: 1px solid var(--border);
      box-shadow: 0 8px 18px rgba(0,0,0,0.18);
      transform: translateX(0);
      transition: transform 220ms ease;
      display: grid;
      place-items: center;
    }

    [data-theme="dark"] .theme-knob { transform: translateX(32px); }

    .icon-sun, .icon-moon { width: 18px; height: 18px; display: none; }
    [data-theme="light"] .icon-sun { display: block; }
    [data-theme="dark"]  .icon-moon { display: block; }

    .icon-sun svg { fill: #f5c518; }
    .icon-moon svg { fill: #cfd6e6; }

    .theme-switch:focus-visible {
      outline: 2px solid rgba(47,111,235,0.55);
      outline-offset: 3px;
    }

    
.portfolio-header .nav{width:100%;box-sizing:border-box;max-width:1100px;min-height:66px;line-height:1.6}.portfolio-header a{color:var(--text);text-decoration:none;font-family:system-ui,-apple-system,sans-serif}.portfolio-header .nav-right{font-size:16px}.portfolio-header .theme-switch{min-height:0;box-sizing:content-box;padding:4px;width:58px;height:26px}.portfolio-header .theme-knob{box-sizing:border-box;flex-shrink:0}.portfolio-header .icon-sun,.portfolio-header .icon-moon{line-height:0}.portfolio-header .theme-switch svg{width:18px;height:18px}
@media(max-width:600px){.portfolio-header .nav{gap:12px;padding:14px 16px;flex-wrap:wrap}.portfolio-header .nav-right{gap:16px;font-size:14px}.portfolio-header .nav-left{font-size:17px}}
