  :root {
    --bg: #0B0E1E;
    --surface: #12162A;
    --surface-2: #171C33;
    --surface-3: #1D2340;
    --border: rgba(255,255,255,0.08);
    --border-strong: rgba(255,255,255,0.16);
    --text-primary: #F3F4F8;
    --text-secondary: #A7ACC2;
    --text-muted: #6F7590;
    --accent-business: #1870B8;
    --accent-utilities: #2121A3;
    --accent-games: #602890;
    --status-live-bg: rgba(52,184,146,0.14);
    --status-live-text: #5FE0B8;
    --status-progress-bg: rgba(224,166,60,0.14);
    --status-progress-text: #F0BE6E;
    --status-planned-bg: rgba(111,117,144,0.18);
    --status-planned-text: #AEB3C7;
    --status-undefined-bg: rgba(208, 52, 44, 0.12);
    --status-undefined-text: #ed3930;
    --gradient: linear-gradient(135deg, #1870B8 0%, #2121A3 50%, #602890 100%);
    --gradient-nav: linear-gradient(90deg, #1870B8 0%, #2121A3 50%, #602890 100%);
    --gradient-business: linear-gradient(90deg, var(--accent-business) 0%, color-mix(in srgb, var(--accent-business) 60%, white) 100%);
    --gradient-utilities: linear-gradient(90deg, var(--accent-utilities) 0%, color-mix(in srgb, var(--accent-utilities) 60%, white) 100%);
    --gradient-games: linear-gradient(90deg, var(--accent-games) 0%, color-mix(in srgb, var(--accent-games) 60%, white) 100%);
    --font-display: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
  }

  html {
  scroll-behavior: smooth;
}

  * { box-sizing: border-box; }

  @media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

  body {
    margin: 0;
    background: var(--bg);
    color: var(--text-primary);
    font-family: var(--font-body);
    -webkit-font-smoothing: antialiased;
  }

  a { color: inherit; }

  :focus-visible {
    outline: 2px solid var(--accent-utilities);
    outline-offset: 2px;
  }

  .page {
    display: grid;
    grid-template-columns: 288px 1fr;
    gap: 72px;
    max-width: 1180px;
    margin: 0 auto;
    padding: 88px 32px 140px;
  }

  /* ---------- sidebar ---------- */

  .sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
    display: flex;
    flex-direction: column;
    gap: 30px;
    height: fit-content;
  }

  .brand-block { display: flex; flex-direction: column; gap: 14px; }

  .brand-mark-icon { width: 46px; height: 46px; display: block; }
  .brand-mark-icon img { width: 100%; height: 100%; display: block; }

  .brand-name {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 22px;
    letter-spacing: -0.01em;
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
  }

  .role {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 15px;
    color: var(--text-primary);
    margin: 8px 0 0;
  }

  .tagline {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-secondary);
    margin: 10px 0 0;
    max-width: 30ch;
  }

  .theme-switch {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    background: none;
    border: none;
    padding: 10px 4px;
    margin: -10px -4px;
    min-height: 44px;
    cursor: pointer;
    width: fit-content;
  }

  .theme-switch .icon-sun,
  .theme-switch .icon-moon {
    color: var(--text-muted);
    display: flex;
    transition: color 0.2s ease;
  }

  .theme-switch.is-dark .icon-moon { color: var(--text-primary); }
  .theme-switch.is-dark .icon-sun { color: var(--text-muted); }
  .theme-switch:not(.is-dark) .icon-sun { color: #F0BE6E; }

  .switch-track {
    position: relative;
    width: 42px;
    height: 23px;
    border-radius: 999px;
    background: var(--surface-2);
    border: 1px solid var(--border-strong);
  }

  .switch-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 17px;
    height: 17px;
    border-radius: 50%;
    background: var(--gradient);
    transition: transform 0.2s ease;
  }

  .theme-switch.is-dark .switch-thumb { transform: translateX(19px); }

  .nav {
    display: flex;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    padding: 22px 0;
  }

  .nav a {
    position: relative;
    display: flex;
    align-items: center;
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 14px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 0 8px 8px 0;
    transition: color 0.15s ease, background 0.15s ease;
  }

  .nav a:hover { color: var(--text-primary); }

  .nav a.active {
    font-weight: 700;
    color: #FFFFFF;
    background: linear-gradient(90deg, rgba(24,112,184,0.3) 0%, rgba(33,33,163,0.3) 50%, rgba(96,40,144,0.3) 100%);
  }

  .nav a.active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 3px;
    background: #1870B8;
  }

  .cta-row {
    display: flex;
    gap: 10px;
  }

  .btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--gradient) border-box;
    color: var(--gradient);
    font-family: var(--font-display);
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.15s ease;
  }

  .btn:hover {
    background: linear-gradient(var(--bg), var(--bg)) padding-box, #F3F4F8 border-box;
    transform: translateY(-2px);
  }
  .btn svg { width: 15px; height: 15px; flex-shrink: 0; }

  /* ---------- main content ---------- */

  .content { min-width: 0; }

  .about { padding-top: 4px; }

  .about h1 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 26px;
    margin: 0 0 20px;
  }

  .about p {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.75;
    color: var(--text-secondary);
    margin: 0 0 18px;
    max-width: 62ch;
  }

  .category { margin-top: 84px; }

  #business {
    --card-accent: var(--accent-business);
    --card-btn-gradient: var(--gradient-business);
  }
  #business .accent-bar {
    background: var(--accent-business);
  }
  #utilities {
    --card-accent: var(--accent-utilities);
    --card-btn-gradient: var(--gradient-utilities);
  }
  #utilities .accent-bar {
    background: var(--accent-utilities);
  }
  #games {
    --card-accent: var(--accent-games);
    --card-btn-gradient: var(--gradient-games);
  }
  #games .accent-bar {
    background: var(--accent-games);
  }

  .category-heading {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
  }

  .accent-bar {
    width: 5px;
    height: 26px;
    border-radius: 3px;
  }

  .category-heading h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 24px;
    margin: 0;
  }

  .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 320px));
    gap: 24px;
  }

  .card {
    position: relative;
    display: flex;
    flex-direction: column;
    background: radial-gradient(circle at top left, color-mix(in srgb, var(--card-accent) 22%, var(--surface)) 0%, var(--surface) 60%);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 16px 16px 18px 16px;
    overflow: hidden;
    transition: border-color 0.2s ease;
  }

  .card:hover {
    border-color: var(--border-strong);
  }

  .card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 0px 0px 0px 0px;
  }

  .card-title-row h3 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 16px;
    margin: 0;
  }

  .status-badge {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 10.5px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 999px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .status-live { background: var(--status-live-bg); color: var(--status-live-text); }
  .status-progress { background: var(--status-progress-bg); color: var(--status-progress-text); }
  .status-planned { background: var(--status-planned-bg); color: var(--status-planned-text); }
  .status-undefined { background: var(--status-undefined-bg); color: var(--status-undefined-text); }

  .card-desc {
    font-size: 13.5px;
    line-height: 1.55;
    color: var(--text-secondary);
    margin: 8px 0px 0px 0px;
    min-height: 64px;
    max-height: 64px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
    transition: max-height 0.35s ease;
  }

  .card-desc.expandable { cursor: pointer; }

  .card-desc.expanded {
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
  }

  @media (prefers-reduced-motion: reduce) {
    .card-desc { transition: none; }
  }

  .card-expand-row {
    min-height: 24px;
    margin: 4px 0px 0px 0px;
  }

  .read-more-btn {
    background: none;
    border: none;
    padding: 0px;
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .read-more-btn svg {
    width: 12px;
    height: 12px;
    transition: transform 0.2s ease;
  }

  .read-more-btn[aria-expanded="true"] svg { transform: rotate(180deg); }

  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 12px 0px 0px 0px;
  }

  .chip {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--surface-2);
    border: 1px solid var(--border);
    padding: 6px 12px;
    border-radius: 999px;
  }

  .card-links {
    display: flex;
    gap: 8px;
    margin: 12px 0px 0px 0px;
  }

  .card-links a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1.5px solid transparent;
    background: linear-gradient(var(--surface), var(--surface)) padding-box, var(--card-btn-gradient) border-box;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease;
  }

  .card-links a:hover {
    background: linear-gradient(var(--surface), var(--surface)) padding-box, #F3F4F8 border-box;
    transform: translateY(-2px);
  }

  .card-links a svg { width: 14px; height: 14px; }

  .coming-soon {
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 12px 0px 0px 0px;
    font-size: 12px;
    color: var(--text-muted);
  }

  .coming-soon svg { width: 12px; height: 12px; }

  @media (prefers-reduced-motion: reduce) {
    * { transition: none !important; }
  }

  /* ---------- mobile top bar & bottom sheet (hidden on desktop) ---------- */

  .mobile-topbar { display: none; }
  .hamburger-btn { display: none; }
  #sheet-backdrop { display: none; }
  .bottom-sheet { display: none; }
  .mobile-footer { display: none; }

  @media (max-width: 767px) {

    /* ----- layout shell ----- */
    .page {
      display: block;
      max-width: none;
      padding: 0 20px 64px;
    }

    body { padding-top: 56px; }

    .sidebar {
      position: static;
      padding-top: 32px;
      gap: 24px;
    }

    .sidebar .nav { display: none; }

    .content { padding-top: 40px; }

    .about h1 { font-size: 22px; }

    main.content section[id] { scroll-margin-top: 72px; }

    .tagline {
      max-width: none;
      font-size: 16px;
    }

    .brand-mark-icon { display: none; }

    .brand-name { font-size: 27px; }

    .category { margin-top: 56px; }

    .category-heading h2 { font-size: 20px; }

    .card-grid { grid-template-columns: 1fr; }

    /* ----- cta row: fills available width, wraps to a stack when it doesn't fit ----- */
    .cta-row { flex-wrap: wrap; }

    .cta-row .btn {
      flex: 1 1 140px;
      justify-content: center;
      min-height: 44px;
    }

    .card-links a { min-height: 44px; }

    /* ----- mobile top bar ----- */
    .mobile-topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      position: fixed;
      top: 0;
      left: 0;
      right: 0;
      height: 56px;
      padding: 0 20px;
      background: var(--surface);
      border-bottom: 1px solid var(--border);
      z-index: 40;
    }

    .mobile-logo {
      width: 32px;
      height: 32px;
      display: block;
      background: none;
      border: none;
      padding: 0;
      cursor: pointer;
    }
    .mobile-logo img { width: 100%; height: 100%; display: block; }

    .hamburger-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      background: none;
      border: none;
      color: var(--text-primary);
      cursor: pointer;
      padding: 0;
    }

    .hamburger-btn svg { width: 24px; height: 24px; }

    /* ----- bottom sheet ----- */
    #sheet-backdrop {
      display: block;
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.5);
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.2s ease;
      z-index: 50;
    }

    #sheet-backdrop.open {
      opacity: 1;
      pointer-events: auto;
    }

    .bottom-sheet {
      display: block;
      position: fixed;
      left: 0;
      right: 0;
      bottom: 0;
      background: var(--surface);
      border-top: 1px solid var(--border-strong);
      border-radius: 20px 20px 0 0;
      padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
      transform: translateY(100%);
      transition: transform 0.25s ease;
      z-index: 51;
    }

    .bottom-sheet.open { transform: translateY(0); }

    .sheet-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      margin-bottom: 16px;
    }

    .sheet-header span {
      font-family: var(--font-display);
      font-weight: 600;
      font-size: 16px;
    }

    .sheet-close-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      width: 44px;
      height: 44px;
      background: none;
      border: none;
      color: var(--text-secondary);
      cursor: pointer;
      padding: 0;
    }

    .sheet-close-btn svg { width: 20px; height: 20px; }

    .sheet-nav { border: none; padding: 0; }
    .sheet-nav a { font-size: 16px; padding: 12px 16px; }

    /* ----- mobile footer links ----- */
    .mobile-footer {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 64px;
      padding: 32px 20px calc(32px + env(safe-area-inset-bottom));
      border-top: 1px solid var(--border);
    }

    .mobile-footer .btn {
      flex: 1 1 140px;
      justify-content: center;
      min-height: 44px;
    }
  }

  /* ======================================================
     LIGHT THEME
     Everything below only applies when <html data-theme="light">.
     Base rules above stay untouched — this is an override layer,
     not a parallel copy of the whole stylesheet.
     ====================================================== */

  html[data-theme="light"] {
    --bg: #F5F6FA;
    --surface: #FFFFFF;
    --surface-2: #F0F1F6;
    --surface-3: #E7E9F2;
    --border: rgba(20,20,40,0.08);
    --border-strong: rgba(20,20,40,0.16);
    --text-primary: #1A1D2E;
    --text-secondary: #4E5470;
    --text-muted: #8A8FA3;
    --status-live-bg: rgba(15,110,86,0.10);
    --status-live-text: #0F6E56;
    --status-progress-bg: rgba(154,97,0,0.10);
    --status-progress-text: #9A6100;
    --status-planned-bg: rgba(110, 116, 144, 0.12);
    --status-planned-text: #5B5F73;
    --status-undefined-bg: rgba(208, 52, 44, 0.12);
    --status-undefined-text: #ed3930;
    --gradient-soft: linear-gradient(135deg, rgba(24,112,184,0.6) 0%, rgba(33,33,163,0.6) 50%, rgba(96,40,144,0.6) 100%);
    --gradient-mix: 60%;
    --halo-alpha: 0.40;
    --halo-blur: 16px;
    --halo-y: 3px;

    /* nav text colors — confirmed values from the nav mockup */
    --nav-text-default: #9BA0B4;
    --nav-text-hover: #1A1D2E;
    --nav-text-active: #FFFFFF;
    --nav-active-bar: #3ea1cf;
  }

  /* ----- nav ----- */

  html[data-theme="light"] .nav a { color: var(--nav-text-default); }
  html[data-theme="light"] .nav a:hover { color: var(--nav-text-hover); }

  html[data-theme="light"] .nav a.active {
    font-weight: 600;
    color: var(--nav-text-active);
    background: linear-gradient(90deg, rgba(24,112,184,1) 0%, rgba(33,33,163,1) 50%, rgba(96,40,144,1) 100%);
  }

  html[data-theme="light"] .nav a.active::before {
    background: var(--nav-active-bar);
  }

  /* ----- GitHub / LinkedIn pill buttons (sidebar + mobile footer) ----- */

html[data-theme="light"] .btn {
  background: linear-gradient(var(--bg), var(--bg)) padding-box, var(--gradient) border-box;
  border-color: transparent;
  color: #FFFFFF;
  box-shadow: 0 var(--halo-y) var(--halo-blur) color-mix(in srgb, color-mix(in srgb, rgba(126, 66, 154, 0.7) var(--gradient-mix), white) calc(var(--halo-alpha) * 100%), transparent);
  transition: transform 0.2s ease;
}

html[data-theme="light"] .btn .btn-text {
  background: var(--gradient);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

html[data-theme="light"] .btn svg {
  color: rgba(24,112,184,1);
}

html[data-theme="light"] .btn:hover {
  background: var(--gradient);
  border: 1.5px solid #dcd1e9;
  color: var(--text-primary);
  transform: translateY(-2px);
}

html[data-theme="light"] .btn:hover .btn-text {
  color: #FFFFFF;
}

html[data-theme="light"] .btn:hover svg {
  color: #FFFFFF;
}


  /* ----- project cards ----- */

  html[data-theme="light"] .card {
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--card-accent) 16%, transparent);
    box-shadow:
      0 1px 3px rgba(30, 20, 60, 0.05),
      0 12px 32px color-mix(in srgb, var(--card-accent) 12%, transparent);
  }

  html[data-theme="light"] .card:hover {
    border-color: color-mix(in srgb, var(--card-accent) 30%, transparent);
  }

  html[data-theme="light"] .chip {
    color: var(--card-accent);
    background: color-mix(in srgb, var(--card-accent) 8%, white);
    border-color: color-mix(in srgb, var(--card-accent) 16%, transparent);
  }

html[data-theme="light"] .card-links a {
  padding: 8px 16px;
  border: none;
  outline: 1.5px solid transparent;
  outline-offset: -1.5px;
  background: color-mix(in srgb, var(--card-accent) 85%, white);
  box-shadow: 0 var(--halo-y) var(--halo-blur) color-mix(in srgb, color-mix(in srgb, var(--card-accent) var(--gradient-mix), white) calc(var(--halo-alpha) * 100%), transparent);
  color: #FFFFFF;
  transition: transform 0.2s ease;  
}

html[data-theme="light"] .card-links a:hover {
  background: linear-gradient(90deg, color-mix(in srgb, var(--card-accent) 85%, white) 0%, color-mix(in srgb, var(--card-accent) var(--gradient-mix), white) 100%);
  box-shadow: 0 var(--halo-y) var(--halo-blur) color-mix(in srgb, color-mix(in srgb, var(--card-accent) var(--gradient-mix), white) calc(var(--halo-alpha) * 100%), transparent);
  transform: translateY(-2px);
}