/* =========================================================
   DESIGN TOKENS
========================================================= */
:root {
  --bg: #2c3440; --surface: #364050; --surface-2: #3d4858;
  --ink: #e8e4dc; --ink-muted: #9aaa9e;
  --teal: #02D0CD; --teal-dark: #01b0ae;
  --border: rgba(255,255,255,0.09);
  --radius: 5px; --radius-card: 16px;
  --font-head: 'DM Serif Display', Georgia, serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.3);
  --transition: 0.2s ease;
    --color_submenu:#3d4857;
    --color_submenu_active:#5f7087;
}

body.light {
  --bg: #f2f0ec; --surface: #e8e4dd; --surface-2: #e8e4dc;
  --ink: #1a1a18; --ink-muted: #5a5a55;
  --teal: #019997; --teal-dark: #017a78;
  --border: #d4cfc6;
    --color_submenu:#e8e4dd;
      --color_submenu_active:#c5c2bc;
}

/* =========================================================
   LAYOUT UTILITY
========================================================= */
.container { max-width: 1100px; margin-inline: auto; padding-inline: 20px; }

/* =========================================================
   RESET & BASE
========================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body  { font-family: var(--font-body); background: var(--bg); color: var(--ink); font-size: 16px; line-height: 1.6; }
a     { color: inherit; text-decoration: none; }
a:hover { color: var(--teal); }
img   { display: block; max-width: 100%; }



/* =========================================================
   HERO / SITE HEADER
========================================================= */
.site-hero           { background: var(--bg); padding-block: 20px 16px;}
.hero-row            { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.site-hero h1        { font-family: var(--font-head); font-size: clamp(24px,4vw,38px); font-weight: 400; line-height: 1.1; }
.subtitle            { color: var(--teal); font-size: 12px; font-weight: 500; letter-spacing: 0.06em; margin-top: 4px; }
.hero-actions        { display: flex; align-items: center; gap: 10px; }
.hero-logo img       { width: 110px; height: 64px; border-radius: 4px; opacity: 0.85; transition: opacity var(--transition); }
.hero-logo img:hover { opacity: 1; }




/* =========================================================
   THEME TOGGLE BUTTON
========================================================= */
.theme-toggle       { display: flex; align-items: center; gap: 5px; padding: 3px 12px; background: none; border: 1px solid var(--border); border-radius: 20px; color: var(--ink-muted); font-family: var(--font-body); font-size: 11px; font-weight: 500; cursor: pointer; transition: background var(--transition), color var(--transition), border-color var(--transition); }
.theme-toggle:hover { background: var(--teal); color: #fff; border-color: var(--teal); }


/* =========================================================
   PROJECT NAV TABS
========================================================= */
.project-tabs            { background: var(--surface-2); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.project-tabs .container { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; padding-block: 3px; }
.label                   { font-size: 11px; font-weight: 600; color: var(--teal); text-transform: uppercase; letter-spacing: 0.07em; white-space: nowrap; }
.tabs-list               { list-style: none; display: flex; gap: 2px; flex-wrap: wrap; padding: 0; margin: 0; }
.tabs-list li            { position: relative; }
.tabs-list a             { display: inline-block; padding: 6px 12px; font-size: 12px; font-weight: 500; color: var(--ink-muted); border-bottom: 2px solid transparent; transition: color var(--transition), border-color var(--transition); }
.tabs-list a:hover       { color: var(--ink); border-color: var(--teal); }
.tabs-list li.current a  { color: var(--ink); font-weight: 500; border-bottom: 2px solid var(--teal); }
/* .tabs-list a.active      { color: #ff55ff; font-weight: 600; border-bottom: 2px solid #0077cc; } */


/* =========================================================
   NAV — SUBMENU
========================================================= */
.arrow {
  font-size: 0.7em;
  margin-left: 4px;
  vertical-align: middle;
}
.submenu                     { list-style: none; position: absolute; top: 110%; left: 0; padding: 6px 0; margin: 0; min-width: 200px; border-radius: 6px; box-shadow: 0 6px 18px rgba(0,0,0,0.15); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: opacity 0.25s ease, transform 0.25s ease;background:var(--color_submenu); }
.submenu li a                {   display: block;
  width: 100%;
  padding: 8px 24px;
  box-sizing: border-box;
}
.submenu li a:hover { background: var(--color_submenu_active); }
.has-submenu:hover .submenu  { opacity: 1; transform: translateY(0); pointer-events: auto; }
.submenu a.active            { background: var(--color_submenu_active); }

.submenu {
  z-index: 9999;
}

/* 2. Show submenu when toggled via JavaScript on mobile */
.has-submenu.submenu-open .submenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.has-submenu:focus-within .submenu {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
/* 3. Ensure parent creates proper stacking context when open */
.has-submenu.submenu-open {
  z-index: 10000;
}



/* =========================================================
   TOOLTIP
========================================================= */
.tooltip              { position: relative; }
.tooltiptext          { visibility: hidden; opacity: 0; position: absolute; bottom: -40px; right: 0; background: rgba(0,0,0,0.85); color: #fff; padding: 6px 10px; border-radius: 6px; font-size: 13px; white-space: nowrap; transition: opacity 0.25s; }
.tooltip:hover .tooltiptext { visibility: visible; opacity: 1; }





@media (max-width: 768px) {
   .project-tabs {
    overflow: visible; /* Allow submenu to extend outside if needed */
  }

  .tabs-list {
    position: relative;
    z-index: 9999;
  }

  .has-submenu {
    position: relative;
  }

  /* When submenu is open, highlight the parent to show it's active */
  .has-submenu.submenu-open > a {
    color: var(--teal);
    border-bottom-color: var(--teal);
  }
  footer .container { grid-template-columns: 1fr; text-align: center; }
  footer .f-left, footer .f-right { text-align: center; }
}
