/* ===========================
   HEADER ONLY (nav + tools)
   =========================== */

/* Theme-driven glass variables */
:root[data-theme="light"]{
    --navbg: rgba(255,255,255,0.28);
    --nav-border: rgba(15,23,42,0.10);
    --nav-shine: rgba(255,255,255,0.55);
  }
  
  :root[data-theme="dark"]{
    --navbg: rgba(15,23,42,0.22);
    --nav-border: rgba(255,255,255,0.10);
    --nav-shine: rgba(255,255,255,0.14);
  }
  
  /* Wrap that can host main nav + floating tools (optional) */
  .nav-wrap{
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 92%;
    max-width: 980px;
    z-index: 1000;
  
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  /* Main nav */
  nav.site-nav{
    position: relative;
    flex: 1 1 auto;
  
    padding: 10px 16px;
    border-radius: 999px;
  
    background: var(--navbg);
    border: 1px solid var(--nav-border);
  
    backdrop-filter: blur(4px) saturate(1.25);
    -webkit-backdrop-filter: blur(4px) saturate(1.25);
  
    box-shadow:
      0 18px 40px -30px rgba(0,0,0,0.35),
      inset 0 1px 0 rgba(255,255,255,0.55);
  
    overflow: hidden;
  
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
  
  nav.site-nav::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background: linear-gradient(to bottom, var(--nav-shine), transparent 60%);
    opacity: 0.8;
  }
  nav.site-nav > *{ position: relative; }
  
  /* Left/Right layout inside nav */
  .nav-left, .nav-right{
    display: flex;
    gap: 10px;
    align-items: center;
  }
  
  .brand{
    font-weight: 900;
    color: var(--text-h);
    font-size: 0.95rem;
    letter-spacing: -0.3px;
    white-space: nowrap;
  }
  .brand .dot{ color: var(--accent); }
  
  /* Optional: hide only the long name on mobile */
  .brand-text{ display: inline; }
  
  @media (max-width: 640px){
    .brand{ display: none; }
  }
  
  /* Pills */
  .pills{
    display: flex;
    gap: 6px;
    align-items: center;
    background: var(--accent-soft);
    padding: 4px;
    border-radius: 999px;
  }
  
  .pill{
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 12px;
    border-radius: 999px;
    border: none;
    background: transparent;
    font-weight: 800;
    font-size: 0.78rem;
    color: var(--text-p);
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s, background 0.18s, color 0.18s, box-shadow 0.18s;
  }
  .pill:hover{ transform: translateY(-1px); }
  
  .pill.active{
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
  }
  
  /* Fallback active by page attribute (optional) */
  body[data-page="about"] .pill[data-nav="about"],
  body[data-page="projects"] .pill[data-nav="projects"],
  body[data-page="summary"] .pill[data-nav="summary"]{
    background: var(--accent);
    color: #fff;
    box-shadow: 0 10px 18px rgba(37, 99, 235, 0.25);
  }
  
  /* Language group */
  .lang-group{
    display: inline-flex;
    gap: 2px;
    background: var(--accent-soft);
    padding: 4px;
    border-radius: 999px;
  }
  
  .l-btn{
    border: none;
    background: none;
    padding: 6px 12px;
    border-radius: 999px;
    font-weight: 800;
    cursor: pointer;
    font-size: 0.74rem;
    color: var(--text-p);
    transition: 0.18s;
  }
  .l-btn.active{
    background: var(--accent);
    color: #fff;
  }
  
  /* Buttons (base) */
  .btn{
    background: rgba(255,255,255,0.75);
    border: 1px solid var(--border);
    color: var(--text-h);
    padding: 8px 12px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    transition: transform 0.18s, box-shadow 0.18s, background 0.18s;
  }
  
  :root[data-theme="dark"] .btn{
    background: rgba(15, 23, 42, 0.55);
  }
  
  .btn:hover{
    transform: translateY(-1px);
    box-shadow: 0 10px 20px -8px rgba(0,0,0,0.15);
  }
  
  /* Focus ring */
  .icon-btn:focus-visible,
  .btn:focus-visible,
  .pill:focus-visible,
  .l-btn:focus-visible{
    outline: 2px solid rgba(37, 99, 235, 0.45);
    outline-offset: 2px;
  }
  
  /* Theme icon button (two icons, CSS toggles visibility) */
  .btn-theme{
    padding: 8px 10px;
  }
  .btn-theme i{
    font-size: 16px;
    line-height: 1;
  }
  :root[data-theme="light"] .icon-moon{ display: none; }
  :root[data-theme="dark"]  .icon-sun{ display: none; }
  
  /* Floating tools capsule (optional) */
  .nav-tools{
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 10px;
  
    padding: 8px;
    border-radius: 999px;
  
    background: var(--navbg);
    border: 1px solid var(--nav-border);
  
    backdrop-filter: blur(4px) saturate(1.25);
    -webkit-backdrop-filter: blur(4px) saturate(1.25);
  
    box-shadow:
      0 18px 40px -30px rgba(0,0,0,0.35),
      inset 0 1px 0 rgba(255,255,255,0.55);
  
    position: relative;
    overflow: hidden;
  }
  .nav-tools::before{
    content:"";
    position:absolute;
    inset:0;
    pointer-events:none;
    background: linear-gradient(to bottom, var(--nav-shine), transparent 60%);
    opacity: 0.8;
  }
  .nav-tools > *{ position: relative; }
  
  .btn-icon{
    width: 42px;
    height: 42px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
  }
  .btn-icon i{
    font-size: 16px;
    line-height: 1;
  }
  
  /* PDF as an icon (optional, if you move PDF into .nav-tools) */
  .btn-pdf{
    background: rgba(220, 38, 38, 0.92);
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow:
      0 14px 22px -16px rgba(220, 38, 38, 0.70),
      inset 0 1px 0 rgba(255,255,255,0.35);
  }
  .btn-pdf i{
    color: #fff;
    opacity: 0.96;
  }
  
  /* Hide PDF on mobile (keep class btn-print on the PDF button) */
  @media (max-width: 640px){
    .btn-print{ display: none; }
  }
  
  /* Mobile positioning for the whole header area */
  @media (max-width: 640px){
    .nav-wrap{
      left: calc(12px + env(safe-area-inset-left));
      right: calc(12px + env(safe-area-inset-right));
      transform: none;
      width: auto;
      max-width: none;
      gap: 12px;
    }
  
    nav.site-nav{
      padding: 12px 14px;
      border-radius: 18px;
    }
  
    .nav-left{
      flex: 1;
      min-width: 0;
      flex-wrap: wrap;
      gap: 10px;
    }
  
    .pills{
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .pills::-webkit-scrollbar{ display:none; }
    .pill{ flex: 0 0 auto; }
  
    .nav-right{
      width: auto;
      margin-left: auto;
      justify-content: flex-end;
      gap: 8px;
    }
  
    .lang-group{ padding: 3px; }
    .l-btn{ padding: 6px 9px; }
  
    .nav-tools{
      padding: 6px;
      border-radius: 18px;
    }
    .btn-icon{
      width: 40px;
      height: 40px;
    }
  }
  