/* ══════════════════════════════════════════════════════════
   portfolio.css — page-specific styles extracted from the inline
   <style> blocks of portfolio.html.
   Loaded where the last inline block was, preserving cascade.
   ══════════════════════════════════════════════════════════ */

/* These tokens were declared before style.css and lost to it. Kept inside a
   low-priority layer so they still lose, without dropping declarations. */
@layer page-legacy {
	:root {
		--bg: #0a0a0a;
		--text: #d0d3cd;
		--g: #647661;
		--gd: #232922;
	}
}


/* body::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/runway_w6hatu.jpg');
      filter: blur(4px) !important;
    } */
    /* 
    body.bg-all::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.87), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/runway_w6hatu.jpg');
      filter: blur(6px);
    }

    body.bg-aero::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/drone_w6xodu.jpg');
      filter: blur(4px);
    }

    body.bg-astro::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/space_wtbm5n.jpg');
      filter: blur(2px);
    }

    body.bg-robotics::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/robotics_pxkhlb.jpg');
      filter: blur(6px);
    }

    body.bg-general::before {
      background-image: linear-gradient(rgba(0, 0, 0, 0.85), rgba(0, 0, 0, 0.8)), url('https://res.cloudinary.com/dvklf4dm6/image/upload/c_scale,w_800,q_auto,f_auto/v1779252214/general_zakwqu.jpg');
      filter: blur(6px);
    } */

    p {
      color: var(--dimtitle);
    }

    /* @media (min-width: 1051px) {
      #sb {
        display: revert !important;
      }
    } */



    /* 1. Hide the short title globally by default */
    .ec-title-short {
      display: none;
    }

    /* 2. In tile mode, hide the regular title ONLY if it is immediately followed by a short title */
    .card-stack.tile-mode .ec-title:has(+ .ec-title-short) {
      display: none;
    }

    /* 3. In tile mode, reveal the short title and match the existing tile-mode typography */
    .card-stack.tile-mode .ec-title-short {
      display: block;
      font-size: clamp(15px, 1.2vw, 25px);
      font-weight: 900;
      color: var(--dimtitle);
      text-transform: uppercase;
      line-height: 1.1;
      margin-bottom: 4px;
      transition: color 0.2s ease;
    }

    /* 4. Ensure the short title scales down on mobile just like the regular title */
    @media (max-width: 800px) {
      .card-stack.tile-mode .ec-title-short {
        font-size: 13px;
      }
    }


















    /* Hide category badges by default (list views) so they only appear in tile-mode */
    .badge.cat-badge {
      display: none !important;
    }

    /* 1. Hide original skill badges in tile mode */
    .card-stack.tile-mode .brow .badge:not(.cat-badge) {
      display: none !important;
    }

    /* 2. Show the new category badges in tile mode and add hover states */
    .card-stack.tile-mode .brow .badge.cat-badge {
      display: inline-flex !important;
      cursor: pointer;
      transition: all 0.2s ease;

      background: var(--badge);
      color: var(--bg);
    }

    .card-stack.tile-mode .brow .badge.cat-badge:hover {
      /* background: var(--badge);
  color: var(--bg); */
      transform: translateY(-2px);
    }

    /* 3. Hide the category badges inside the lightbox/expanded view so the normal skills show */
    .ec-card.open .brow .badge.cat-badge,
    #card-lb-content .ec-card .brow .badge.cat-badge {
      display: none !important;
    }

/* ══ OVERRIDE DEFAULT SECTION HEADERS TO MATCH BLOG STYLE ── */
    /* .sh {
      max-width: 100%;
    } */

    .sh h2 {
      /* font-size: 16px !important; */
      /* font-size: clamp(12px, 0.9vw, 18px) !important; */
      font-size: clamp(12px, 0.8vw, 16px) !important;
      /* font-weight: 900 !important; */
      font-weight: 800 !important;
      letter-spacing: 0.1em;
      text-transform: uppercase;
      margin: 0;
      /* color: color-mix(in srgb, var(--dimtitle) 50%, transparent); */
      /* color: var(--sec-title); */
      color: color-mix(in srgb, var(--title) 60%, transparent) !important;
      /* color: color-mix(in srgb, var(--accent2) 50%, transparent); */
      transition: color 0.2s ease-in-out, opacity 0.2s ease-in-out;
      margin-left: -2px;
      min-width: 0;
      display: block;
      overflow-wrap: break-word;
      word-wrap: break-all;
      white-space: normal;
      text-align: left;
    }

    .sh h2:hover {
      /* color: color-mix(in srgb, var(--dimtitle) 50%, transparent); */
      /* color: color-mix(in srgb, var(--sec-title) 100%, transparent) !important; */
      color: color-mix(in srgb, var(--title) 50%, transparent) !important;
    }

    .sh-pulse-btn:hover h2 {
      opacity: 0.95;
    }

    .sh {
      /* padding-top: 16px !important; */
      padding-top: 42px !important;
      padding-bottom: 12px !important;
    }

    .sh .sh-r {
      height: 10px !important;
      /* opacity: 0.1; */
      opacity: 0 !important;
      background: var(--dimtitle);
    }

    /* 1. Initialize the counter on the main container */
    #mn {
      counter-reset: secCounter;
    }

    /* 2. Increment the counter for every portfolio section 
   (Hidden display:none sections are automatically skipped!) */
    .portfolio-sec {
      counter-increment: secCounter;
    }

    /* 3. Base styles for the entire prefix */
    .auto-num {
      color: var(--title);
      /* font-family: 'Courier New', Courier, monospace; */
      /* font-weight: 900; */
      font-weight: 500;
      padding-right: 20px;
      /* font-size: clamp(12px, 0.9vw, 18px) */
      font-size: clamp(12px, 0.85vw, 14px)
    }

    /* 4. Inject the em-dashes with the tight letter-spacing */
    .auto-num::before {
      content: "——";
      letter-spacing: -0.2em;
      padding-right: 10px;
      /* font-weight: 700; */
      font-weight: 300;
    }

    /* 5. Inject the slashes and the dynamic number 
   (decimal-leading-zero automatically turns 1 into 01) */
    .auto-num::after {
      content: "// " counter(secCounter, decimal-leading-zero);
      letter-spacing: normal;
    }




    .div {
      display: none !important;
    }

    .portfolio-sec {
      padding-bottom: 15px !important;
    }

    /* --- GLOBAL FILTER BUTTONS --- */
    .portfolio-filters {
      display: flex;
      justify-content: left;
      /* justify-content: inherit; */
      /* gap: 10px; */
      gap: 7px;
      margin: 60px 48px 0px;
      flex-wrap: wrap;
      /* padding-left: calc(var(--sw) + 10px); */

    }


    /* .filter-btn {
      display: inline-flex;
      align-items: center;
      height: 32px;
      padding: 0 16px;
      border: 1.5px solid var(--dimtitle);
      background: transparent;
      color: var(--dimtitle);
      font-family: "Rubik", sans-serif;
      font-weight: 700;
      font-size: clamp(11px, 0.6vw, 14px);
      letter-spacing: 0.1em;
      border-radius: 6px;
      cursor: pointer;
      transition: all 0.2s ease-out;
      text-transform: uppercase;
    }

    .filter-btn:hover {
      border-color: var(--accent2);
      color: var(--accent2);
      transform: translateY(-1px);
    }

    .filter-btn.active {
      border-color: var(--accent2);
      color: var(--bg);
      background: var(--accent2);
    } */

    @media (max-width: 1050px) {
      .portfolio-filters {
        margin: 20px 22px 0px;
        /* padding-top: 20px; */
      }

    }

    /* --- MODERN ACCORDION CARD UI --- */
    .card-stack {
      display: flex;
      flex-direction: column;
      gap: 12px;
    }

    .ec-item {
      break-inside: avoid;
      /* opacity: 0;
      transform: translateY(10px);
      transition: opacity .7s ease-out, transform .7s cubic-bezier(0.22, 0.9, 0.25, 1); */
    }

    /* .ec-item.visible {
      opacity: 1;
      transform: translateY(0);
    } */
    /* .ec-item .uni-card {
      opacity: 0;
      transform: translateY(10px);
      transition: all 0.3s ease-in-out, opacity 0.7s ease-out, transform 0.7s cubic-bezier(0.22, 0.9, 0.25, 1);
    } */

    .ec-item.visible .uni-card {
      opacity: 1;
      transform: translateY(0);
    }

    /* Re-apply the hover lift so it doesn't get overridden by the .visible state */
    .ec-item.visible .uni-card:hover {
      transform: translateY(-3px);
    }














    /* SUMMARY VIEW (Always Visible) */
    .ec-summary {
      display: grid;
      grid-template-columns: 280px 1fr;
      gap: 24px;
      cursor: pointer;
      position: relative;
      transition: grid-template-columns 0.4s cubic-bezier(0.22, 0.9, 0.25, 1), gap 0.4s ease;
    }


    /* .ec-summary {
      display: grid;
      grid-template-columns: 220px 1fr;
      gap: 20px;
      cursor: pointer;
      position: relative;
      transition: grid-template-columns 0.4s cubic-bezier(0.22, 0.9, 0.25, 1), gap 0.4s ease;
    } */


    .ec-thumb {
      position: relative;
      width: 100%;
      height: 100%;
      background: #111;
      overflow: hidden;
      min-height: 0;
      /* transition: all 0.3s ease-in-out; */
      transition: opacity 0.3s ease-in-out, height 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
    }

    /* When Expanded: Shrink the thumbnail column to 10px */
    .ec-card.open .ec-summary {
      grid-template-columns: 15px 1fr;
      gap: 18px;
    }

    .ec-card.open .ec-thumb {
      opacity: 0.3;
      border-right: 2px solid var(--title);
    }


    .ec-thumb img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.5s ease;
    }

    .ec-card:hover .ec-thumb img {
      transform: scale(1.05);
    }

    .ec-info {
      /* padding: 24px 24px 24px 0; */
      padding: 16px 20px 16px 0;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
    }

    /* ══ LOGO ALIGNMENT IN CARD HEADERS ══ */
    .ec-info-header {
      margin-bottom: 12px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
    }

    .ec-info-header-text {
      flex: 1;
    }

    .ec-info-header .eclogos {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
      /* margin-right: 30px; */
      display: none !important;
      /*hides the ec card logos from all tiles*/
    }

    .ec-info-header .eclogos img {
      height: 38px;
      width: auto;
      object-fit: contain;
      border-radius: 4px;
    }

    .card-stack.tile-mode .ec-info-header .eclogos img {
      height: 24px;
    }

    @media (max-width: 800px) {
      .ec-info-header .eclogos img {
        height: 30px;
      }

      .card-stack.tile-mode .ec-info-header .eclogos img {
        height: 20px;
      }
    }

    .ec-title {
      /* font-size: clamp(18px, 1.5vw, 40px); */
      font-size: clamp(18px, 1.5vw, 26px);
      font-weight: 900;
      color: var(--dimtitle);
      text-transform: uppercase;
      line-height: 1.1;
      margin-bottom: 6px;
      transition: color 0.2s ease;
    }

    .ec-subtitle {
      font-size: 13px;
      font-weight: 700;
      color: var(--tdim-fr) !important;
      color: color-mix(in srgb, var(--title) 60%, transparent) !important;
      /* color: var(--dimtitle); */
      text-transform: uppercase;
      letter-spacing: 0.05em;
      line-height: .9;
    }

    .ec-brief {
      font-size: clamp(13px, 0.8vw, 16px);
      /* line-height: 1.6; */
      line-height: 1.4;
      color: var(--dimtitle);
      margin: 12px 0;
      max-width: 800px;
    }

    .card-stack.tile-mode .ec-brief {
      font-size: clamp(11px, 0.7vw, 14px);
      width: 100%;
      /* <-- Change this to your preferred tile size */
    }

    .card-stack.tile-mode .badge {
      /* font-size: clamp(8px, 0.5vw, 18px); */
      font-size: clamp(8px, 0.5vw, 13px);
      padding: 4px 6px;
      /* padding: 4px 6px 2px; */
      line-height: 1 !important;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      text-align: center;
    }

    .card-stack.tile-mode .ec-thumb {
      opacity: 1;
    }

    .expand-prompt {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      font-size: 11.5px;
      font-weight: 800;
      color: var(--accent);
      /* color: var(--border); */
      /* background-color: transparent; */
      /* box-shadow: inset 50px 0px 10px -10px rgba(255, 255, 255, 0.1 ); */

      /* color: color-mix(in srgb, var(--accent) 40%, transparent); */
      /* color: color-mix(in srgb, var(--text) 50%, transparent); */
      color: color-mix(in srgb, var(--g) 70%, transparent);
      text-transform: uppercase;
      letter-spacing: 0.1em;
      margin-top: 10px;
      /* display: none; */
      transition: all .3s ease;
    }

    .expand-icon {
      transition: transform 0.3s ease;
    }

    .ec-card:hover .expand-icon {
      transform: translateX(5px);
      transform: rotate(-90deg);

    }

    .ec-card:hover .expand-prompt {
      transform: translateX(10px);
      /* color: color-mix(in srgb, var(--text) 70%, transparent); */
      color: color-mix(in srgb, var(--text) 80%, transparent);
    }

    .ec-card.open .expand-icon {
      transform: rotate(180deg);
    }

    /* MOBILE ADJUSTMENTS FOR SUMMARY */
    @media (max-width: 800px) {

      .ec-summary,
      .ec-card.open .ec-summary {
        grid-template-columns: 1fr;
        gap: 0;
      }

      .ec-thumb {
        height: 200px;
        min-height: auto;
        transition: height 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
      }

      .ec-card.open .ec-thumb {
        height: 0px;
        width: 100% !important;
      }

      .ec-info {
        padding: 20px;
      }

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

    }

    /* DETAILS VIEW (Hidden by Default, Expands on Click) */
    .ec-details {
      display: grid;
      grid-template-rows: 0fr;
      transition: grid-template-rows 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .ec-details-inner {
      overflow: hidden;
      opacity: 0;
      transition: opacity 0.3s ease;
    }

    .ec-card.open .ec-details {
      grid-template-rows: 1fr;
    }














    /* 1. Make the entire opened card a pointer (for background clicking) */
    .ec-card.open {
      cursor: pointer;
    }

    /* 2. Revert text, standalone images, and text-heavy blocks to their default cursors */
    .ec-card.open .ec-details p,
    .ec-card.open .ec-details h1,
    .ec-card.open .ec-details h2,
    .ec-card.open .ec-details h3,
    .ec-card.open .ec-details h4,
    .ec-card.open .ec-details span,
    .ec-card.open .ec-details li,
    .ec-card.open .ec-details b,
    .ec-card.open .ec-details strong,
    .ec-card.open .ec-details i,
    .ec-card.open .ec-details img,
    .ec-card.open .ec-details .cslbl,
    .ec-card.open .ec-details .hbox,
    .ec-card.open .ec-details .dbox,
    .ec-card.open .ec-details .srow,
    .ec-card.open .ec-details .srow * {
      cursor: auto;
    }

    /* 3. Ensure actual interactive elements (links, buttons, carousels) keep the pointer */
    .ec-card.open .ec-details a,
    .ec-card.open .ec-details a *,
    .ec-card.open .ec-details button,
    .ec-card.open .ec-details button *,
    .ec-card.open .ec-details .cw,
    .ec-card.open .ec-details .cw * {
      cursor: pointer;
    }














    .ec-card.open .ec-details-inner {
      opacity: 1;
      /* padding-top: 15px; */
      /* border-top: 3px solid var(--border); */
      /* border-top: 3px solid color-mix(in srgb, var(--g) 50%, transparent 0%); */
      border-top: 2px solid color-mix(in srgb, var(--border) 100%, transparent 0%);
      border-top: 2px solid color-mix(in srgb, var(--border) 70%, transparent 0%);
      border-top: 2px solid color-mix(in srgb, var(--border) 30%, transparent 0%);
      /* border-top: 10px solid color-mix(in srgb, var(--border-fr) 100%, transparent 0%); */
      /* border-top: 10px solid color-mix(in srgb, var(--g) 70%, transparent);; */
      /* border-top: inherit; */
      ;
    }

    .ec-details-inner .cbody {
      padding: 20px 24px;
    }

    .ec-details-inner .clinks {
      border-top: none;
      background: transparent;
      padding: 0 24px 24px;
      position: relative;
      z-index: 50;
    }

    /* ══ TILE MODE (active when the "All / Default" filter is selected) ══ */
    /* .card-stack.tile-mode {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(300px, 400px));
      justify-content: start;
      align-items: stretch;
      gap: var(--uni-gap);
    } */

    /* Cap the maximum width of the full-width list items so they don't stretch forever */
    .card-stack:not(.tile-mode) {
      max-width: 1200px;
      /* You can adjust this value to your preferred readable width */
    }

    /* Typography adjustments for smaller screens */
    @media (max-width: 800px) {
      .card-stack.tile-mode .ec-title {
        font-size: 13px;
      }

      .card-stack.tile-mode .ec-subtitle {
        font-size: 9px;
        letter-spacing: 0;
      }

      .card-stack.tile-mode .ec-info {
        padding: 12px;
      }

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

    }

    .card-stack.tile-mode .ec-summary {
      grid-template-columns: 1fr;
      gap: 0;
    }

    .card-stack.tile-mode .ec-thumb {
      height: 190px;
    }

    .card-stack.tile-mode .ec-info {
      padding: 14px 16px 16px;
    }

    .card-stack.tile-mode .ec-title {
      /* font-size: 15px; */
      font-size: clamp(15px, 1.2vw, 25px);
      margin-bottom: 4px;
    }

    .card-stack.tile-mode .ec-subtitle {
      font-size: 10.5px;
    }

    .card-stack.tile-mode .expand-prompt,
    .card-stack.tile-mode .ec-details {
      display: none;
    }

    /* 1. The wrapper just toggles visibility, NO opacity fades here! */
    #card-lb {
      position: fixed;
      inset: 0;
      z-index: 9998;
      display: flex;
      align-items: center;
      justify-content: center;
      visibility: hidden;
      /* Replaces pointer-events/opacity */
      transition: visibility 0.4s;
      padding: 40px 20px;
    }

    #card-lb.open {
      visibility: visible;

    }

    /* 2. The backdrop explicitly animates from 0 blur to 8px blur */
    .card-lb-backdrop {
      position: absolute;
      inset: 0;
      cursor: pointer;

      /* STARTING STATE: completely clear and unblurred */
      /* background: rgba(10, 10, 10, 0); */
      background: var(--bg);
      backdrop-filter: blur(0px);
      -webkit-backdrop-filter: blur(0px);

      /* Explicitly transition ONLY background and filters */
      transition: background 0.4s ease-in-out, backdrop-filter 0.4s ease-in-out, -webkit-backdrop-filter 0.4s ease-in-out;
    }

    /* ENDING STATE: dark and blurred */
    #card-lb.open .card-lb-backdrop {
      /* background: rgba(10, 10, 10, 0.82);
      background: rgba(35, 41, 34, 0.88) !important; */
      background: color-mix(in srgb, var(--bg) 50%, transparent 0%) !important;
      background: color-mix(in srgb, #ccefff 50%, transparent 0%) !important;
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    /* 3. The popup box fades itself in independently */
    .card-lb-box {
      position: relative;
      z-index: 1;
      /* width: min(900px, 100%); */
      min-width: min(max(1200px, 50%), 100%);
      max-height: 88dvh;
      overflow-y: auto;
      background: color-mix(in srgb, var(--bg) 50%, transparent 0%) !important;
      /* background: blue !important; */
      border: 2px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);

      /* STARTING STATE for the box */
      opacity: 0;
      transform: translateY(20px) scale(0.95);
      /* Adds a premium little slide-up effect */
      transition: opacity 0.4s ease-in-out, transform 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
    }

    /* AFTER */
    #card-lb {
      position: fixed;
      inset: 0;
      z-index: 9998;
      display: flex;
      align-items: center;
      justify-content: center;
      visibility: hidden;
      transition: visibility 0.25s;
      /* Sped up */
      /* padding: 40px 20px; */
      padding: 40px 0px;
    }

    #card-lb.open {
      visibility: visible;
    }

    .card-lb-backdrop {
      position: absolute;
      inset: 0;
      cursor: pointer;
      background: rgba(10, 10, 10, 0);
      backdrop-filter: blur(0px);
      -webkit-backdrop-filter: blur(0px);
      transition: background 0.25s ease-in-out, backdrop-filter 0.25s ease-in-out, -webkit-backdrop-filter 0.25s ease-in-out;
      /* Sped up */
    }

    #card-lb.open .card-lb-backdrop {
      background: rgba(10, 10, 10, 0.82);
      backdrop-filter: blur(8px);
      -webkit-backdrop-filter: blur(8px);
    }

    /* .card-lb-box {
      position: relative;
      z-index: 1;
      width: min(900px, 100%);
      max-height: 88dvh;
      overflow-y: auto;
      background: color-mix(in srgb, var(--bg) 80%, transparent 0%);
      border: 2px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      opacity: 0;
      transform: translateY(8px) scale(0.97);
      transition: opacity 0.25s ease-in-out, transform 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
    } */

    /* ENDING STATE for the box */
    #card-lb.open .card-lb-box {
      opacity: 1;
      transform: translateY(0) scale(1);
    }

    #card-lb.open .ec-brief {
      display: none;
    }

    /* Wrapper handles centering and 10px buffer gaps */
    .card-lb-wrapper {
      position: relative;
      z-index: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      /* gap: 10px; */
      gap: 0px;
      width: 100%;
      max-width: 1020px;
      padding: 0 10px;
      /* Buffer from edge of screen */
      pointer-events: none;
    }

    .card-lb-wrapper>* {
      pointer-events: auto;
    }

    .card-lb-box {
      position: relative;
      z-index: 1;
      flex: 1 1 auto;
      max-width: 900px;
      width: 100%;
      min-width: 0;
      max-height: 88dvh;
      overflow-y: visible;
      /* background: color-mix(in srgb, var(--bg) 10%, transparent 0%); */
      background: color-mix(in srgb, var(--bg) 30%, transparent);
      border: 2px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      opacity: 0;
      transform: translateY(8px) scale(0.97);
      transition: opacity 0.25s ease-in-out, transform 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
    }

    /* .card-lb-box {
      position: relative;
      z-index: 1;
      flex: 1 1 auto;
      max-width: 900px;
      width: 100%;
      min-width: 0; 
      max-height: 88dvh;
      overflow-y: visible;
      background: color-mix(in srgb, var(--bg) 0%, transparent); 
      border: 2px solid var(--border);
      border-radius: 14px;
      box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
      backdrop-filter: blur(16px);
      -webkit-backdrop-filter: blur(16px);
      opacity: 0;
      transform: translateY(8px) scale(0.97);
      transition: opacity 0.25s ease-in-out, transform 0.4s cubic-bezier(0.22, 0.9, 0.25, 1);
    } */

    /* .card-lb-close {
      position: sticky;
      top: 10px;
      left: auto;
      float: none;
      margin-left: auto;
      margin-bottom: -32px;
      transform: translateX(-10px);
      background: transparent;
      border: 2px solid var(--border);
      color: var(--border);
      width: 32px;
      height: 32px;
      border-radius: 50%;
      font-size: 20px;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10;
      transition: all 0.4s ease-in-out;
      opacity: 0;
    } */
    .card-lb-close {
      position: fixed;
      top: -40px;
      right: 0px;
      /* background: var(--surface2); */
      background: transparent;
      /* border: 2px solid var(--border); */
      border: 0px;
      color: var(--text);
      width: 40px;
      height: 40px;
      border-radius: 50%;
      font-size: 24px;
      line-height: 1;
      display: flex;
      align-items: center;
      justify-content: center;
      cursor: pointer;
      z-index: 10000;
      transition: all 0.3s ease-in-out;
      opacity: 1;
      /* Make visible */
      margin: 0;
      transform: none;
      /* box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); */

    }

    #card-lb-content {
      max-height: calc(88dvh - 4px);
      overflow-y: auto;
      border-radius: 12px;
      /* padding-bottom: 20px; */
      padding-bottom: 0px;

      /* -webkit-mask-image: linear-gradient(to bottom, black 88%, transparent 100%), linear-gradient(to bottom, black, black);
      mask-image: linear-gradient(to bottom, black 88%, transparent 100%), linear-gradient(to bottom, black, black);
      -webkit-mask-size: calc(100% - 14px) 100%, 14px 100%;
      mask-size: calc(100% - 14px) 100%, 14px 100%;

      -webkit-mask-position: left top, right top;
      mask-position: left top, right top;
      -webkit-mask-repeat: no-repeat;
      mask-repeat: no-repeat; */
      overscroll-behavior-y: contain;
      /* Prevents scroll chaining to the body */
    }


    .card-lb-close:hover {
      /* background: var(--accent2); */
      border-color: var(--accent2);
      color: var(--accent2);
    }

    #card-lb-content .ec-summary {
      cursor: default;
    }

    #card-lb-content::-webkit-scrollbar {
      width: 4px;
    }

    #card-lb-content::-webkit-scrollbar-thumb {
      background: var(--badge);
    }

    #card-lb-content::-webkit-scrollbar-thumb:hover {
      background: var(--g);
    }

    #card-lb-content::-webkit-scrollbar-track {
      margin: 14px 0;
      /* This margin keeps it away from the curved corners! */
      border-radius: 100px;
      /* background-color: color-mix(in srgb, var(--bg) 10%, transparent 0%);      */
      background-color: transparent;

    }

    #card-lb-content .ec-card {
      border: none;
      border-radius: 0;
      background: transparent;
      /* backdrop-filter: none;
      -webkit-backdrop-filter: none; */
    }

    #card-lb-content .ec-card:hover {
      transform: none;
      box-shadow: none;
    }

    #card-lb-content .ec-card:hover .ec-title {
      color: var(--dimtitle);
    }

    /* .ec-card:hover .ec-title {
      color: var(--g);
    } */

    #card-lb-content .ec-card:hover .ec-thumb img {
      transform: scale(1);
    }

    #card-lb-content .expand-prompt {
      display: none !important;
    }

    /* Remove thumbnail entirely inside the lightbox */
    #card-lb-content .ec-card.open .ec-summary {
      grid-template-columns: 1fr;
      gap: 0;
      /* margin-left: 20px; */
    }

    #card-lb-content .ec-card.open .ec-thumb {
      display: none;
    }

    /* BELOW MAKES THE TITLE SECTION STICKY; STICKY TITLE */
    /* #card-lb-content .ec-summary {
      position: sticky !important;
      top: 0;
      z-index: 100;
      background: var(--bg) !important;
      border-bottom: 2px solid color-mix(in srgb, var(--border) 50%, transparent) !important;
      border-radius: 12px 12px 0 0; 
      margin: 0;
    }

    #card-lb-content::before {
      display: none !important;
    }

    #card-lb-content .ec-card.open .ec-details-inner {
      border-top: none !important;
    } */

    /* Restore the left padding that the thumbnail previously occupied */
    #card-lb-content .ec-card.open .ec-info {
      padding-left: 24px;
    }

    /* Side navigation arrows for the EC Lightbox */
    .card-lb-nav {
      background: transparent;
      border: none;
      color: var(--dimtitle);
      font-size: 32px;
      cursor: pointer;
      z-index: 10000;
      /* padding: 100px 10px; */
      padding: 100px 20px;
      /* padding: 10px; */
      flex-shrink: 0;
      /* Ensures arrows don't squash */
      transition: color 0.2s, transform 0.2s;
      /* background: pink; */
    }

    .card-lb-nav:hover {
      color: var(--accent2);
      transform: scale(1.1);
    }

    @media (max-width: 1050px) {
      .card-lb-wrapper {
        /* gap: 5px; */
        /* gap: 10px; */
        gap: 0px;
        /* padding: 0 5px;  */
        padding: 0 0px;
      }

      .card-lb-nav {
        font-size: 24px;
        /* padding: 5px; */
        /* padding: 100px 2px; */
        padding: 100px 10px;
      }

      .card-lb-box {
        /* Force the box narrower so the side arrows have guaranteed space */
        width: calc(100% - 50px);
      }
    }


    .card-lb-prev {
      left: 2vw;
    }

    .card-lb-next {
      right: 2vw;
    }

    /* @media (max-width: 1050px) {
      .card-lb-nav { display: none; }
    } */







    /* 1. Add bottom padding so text clears the blur when fully scrolled */
    /* #card-lb-content {
      padding-bottom: 20px;
    } */

    /* 2. Sticky blur overlay inside the scrolling modal */
    /* .card-lb-box::after {
      content: '';
      position: sticky;
      bottom: -1px;
      display: block;
      width: 100%;
      height: 60px;
      margin-top: -60px;
      pointer-events: none;
      z-index: 10;
      border-radius: 0 0 12px 12px;
    } */
    /* Replace your old ::after rules with this */
    /* .card-lb-box::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px; 
  background: linear-gradient(to bottom, transparent, var(--bg));
  pointer-events: none; 
  z-index: 10;
  border-radius: 0 0 12px 12px;
} */
    /* Add this new block */
    #card-lb-content::before {
      content: '';
      position: sticky;
      top: -1px;
      left: 0;
      display: block;
      width: 100%;
      height: 25px;
      /* Fades from solid background at the top to transparent */
      /* background: linear-gradient(to bottom, var(--bg), transparent); */
      background: linear-gradient(to bottom, var(--grad), transparent);
      /* background: linear-gradient(to bottom, var(--border), transparent); */
      /* background: linear-gradient(to bottom, color-mix(in srgb, var(--border) 50%, transparent), transparent); */

      pointer-events: none;
      z-index: 10;
      /* Prevents the sticky block from pushing your content down */
      margin-bottom: -25px;
      border-radius: 12px 12px 0 0;
    }

    #card-lb-content::after {
      content: '';
      position: sticky;
      bottom: -1px;
      left: 0;
      display: block;
      width: 100%;
      height: 60px;
      background: linear-gradient(to bottom, transparent, var(--bg));
      pointer-events: none;
      z-index: 10;
      margin-top: -60px;
      /* Prevents the sticky block from adding empty scroll space */
      border-radius: 0 0 12px 12px;
    }

    /* #card-lb-box::after {
      background: linear-gradient(to bottom, transparent, var(--bg));
    } */

    /* Hides the gradient when user reaches the bottom */
    /* .card-lb-box.at-bottom::after {
      opacity: 0;
    } */

    #card-lb-content .ec-item {
      transform: none !important;
      overflow: visible !important;
      /* REQUIRED FOR STICKY TO WORK */
    }

    #card-lb-content .ec-card {
      border: none;
      border-radius: 0;
      background: transparent !important;
      /* backdrop-filter: none !important;
      -webkit-backdrop-filter: none !important; */
      transform: none !important;
      box-shadow: none !important;
      margin-bottom: 20px;
      overflow: visible !important;
      /* REQUIRED FOR STICKY TO WORK */
    }









    @media (max-width: 800px) {
      #card-lb-content .ec-card.open .ec-info {
        padding-left: 20px;
      }
    }

    /* blog tile mode overrides */
    .card-stack.tile-mode .ec-item {
      display: block;
      height: 100%;
    }

    .card-stack.tile-mode .ec-card {
      display: flex;
      flex-direction: column;
      height: 100%;
    }

    .card-stack.tile-mode .ec-summary {
      display: flex !important;
      flex-direction: column;
      flex: 1;
      gap: 0;
    }

    .card-stack.tile-mode .ec-thumb {
      height: 190px;
      min-height: 190px;
      flex-shrink: 0;
    }

    .card-stack.tile-mode .ec-info {
      display: flex;
      flex-direction: column;
      flex: 1;
      padding: 14px 16px 16px;
    }

    /* body.filtering-active * {
      transition: none !important;
    } */

    body.filtering-active .ec-item,
    body.filtering-active .card-stack {
      transition: none !important;
    }

















    /* ══ TILE MODE (active when the "All / Default" filter is selected) ══ */
    .card-stack.tile-mode {
      display: grid;
      /* grid-template-columns: repeat(auto-fill, minmax(300px, 400px)); */
      /* grid-template-columns: repeat(auto-fit, minmax(min(calc(50% - 10px), 300px), 1fr)); */

      /* grid-template-columns: repeat(auto-fill, minmax(min(calc(50% - 10px), 300px), 1fr)); */
      /* grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)) !important; */

      /* grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important; */
      /* determines sizing for the ec cards */
      grid-template-columns: repeat(auto-fill, minmax(max(250px, 5vw), 1fr)) !important;
      grid-template-columns: repeat(auto-fill, minmax(max(220px, 5vw), 1fr)) !important;
      grid-template-columns: repeat(auto-fill, minmax(clamp(220px, 220px, 1vw), 1fr)) !important;

      /* grid-template-columns: repeat(auto-fill, minmax(max(180px, 1vw), 1fr)) !important; */
      /* grid-template-columns: repeat(auto-fit, minmax(max(250px, 5vw), 1fr)) !important; */
      /* grid-template-columns: repeat(auto-fill, minmax(5vw, 1fr)) !important; */

      /* grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important; */
      /* justify-content: start; */
      align-items: stretch;
      gap: var(--uni-gap);


    }
    @media (max-width: 1200px) {
      .card-stack.tile-mode {
          /* grid-template-columns: repeat(auto-fill, minmax(max(180px, 1vw), 1fr)) !important; */
          grid-template-columns: repeat(auto-fill, minmax(clamp(180px, 220px, 1vw), 1fr)) !important;
          /* grid-template-columns: repeat(auto-fill, minmax(clamp(18px, 22px, 1vw), 1fr)) !important; */

      }
    }

    .card-stack:not(.tile-mode) {
      max-width: 1200px;
    }

    .card-stack.tile-mode .ec-summary {
      grid-template-columns: 1fr;
      gap: 0;
    }

    /* Base Desktop Thumbnail Height */
    .card-stack.tile-mode .ec-thumb {
      height: 190px;
      min-height: 190px;
    }

    .card-stack.tile-mode .ec-info {
      padding: 14px 16px 16px;
    }

    .card-stack.tile-mode .ec-title {
      font-size: clamp(15px, 1.2vw, 25px);
      margin-bottom: 4px;
    }

    .card-stack.tile-mode .ec-subtitle {
      font-size: 10.5px;
    }

    .card-stack.tile-mode .expand-prompt,
    .card-stack.tile-mode .ec-details {
      display: none;
    }

    /* === MOBILE ADJUSTMENTS FOR TILE MODE === */
    /* (This MUST come after the base rules above so it can override them) */
    @media (max-width: 800px) {

      /* Forces 1 item per row full-width */
      .card-stack.tile-mode {
        /* grid-template-columns: 1fr; */
        grid-template-columns: 1fr 1fr 1fr !important;
      }

      /* Shrinks the thumbnail height on mobile */
      .card-stack.tile-mode .ec-thumb,
      .ec-thumb {
        /* height: 130px; */
        height: 100px;
        /* min-height: 130px; */
        min-height: 100px;
      }

      /* Shrinks typography and padding to fit */
      .card-stack.tile-mode .ec-title {
        font-size: 13px;
      }

      .card-stack.tile-mode .ec-subtitle {
        font-size: 9px;
        letter-spacing: 0;
      }

      .card-stack.tile-mode .ec-info {
        padding: 12px;
      }
    }
    @media (max-width: 550px) {

      .card-stack.tile-mode {
        grid-template-columns: 1fr 1fr !important;
      }
    }
    @media (max-width: 300px) {

      .card-stack.tile-mode {
        grid-template-columns: 1fr !important;
      }
    }


    .card-stack .ec-card.open {
      /* background: color-mix(in srgb, var(--dimtitle) 10%, transparent); */
      /* background: color-mix(in srgb, var(--accent2) 20%, transparent); */
      /* background: color-mix(in srgb, var(--g) 20%, transparent); */
      background: color-mix(in srgb, var(--bg) 20%, transparent);

      .ec-thumb {
        min-height: 10px;
      }

      /* border-color: color-mix(in srgb, var(--accent2) 50%, transparent); */
      border-color: color-mix(in srgb, var(--g) 50%, transparent);
      /* box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4); */

      /* .ec-summary {
        background: color-mix(in srgb, var(--bg) 40%, transparent);
        backdrop-filter: blur(100px);
        -webkit-backdrop-filter: blur(100px);
      } */

    }









    .ec-info-header {
      margin-bottom: 8px;
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 16px;
    }

    .ec-info-header-text {
      flex: 1;
    }

    .ec-info-header .eclogos {
      display: flex;
      gap: 8px;
      align-items: center;
      flex-shrink: 0;
    }

    .ec-info-header .eclogos img {
      height: 28px;
      width: auto;
      object-fit: contain;
      border-radius: 4px;
    }

    .card-stack.tile-mode .ec-info-header .eclogos img {
      height: 24px;
    }

    @media (max-width: 800px) {
      .ec-info-header .eclogos img {
        height: 24px;
      }

      .card-stack.tile-mode .ec-info-header .eclogos img {
        height: 20px;
      }

      .card-stack.tile-mode .ec-info-header .eclogos {
        display: none;
      }


      .ec-thumb {
        /* height: 150px; */
        min-height: auto;
        /* Make sure min-height transitions smoothly too */
        transition: height 0.4s cubic-bezier(0.22, 0.9, 0.25, 1), min-height 0.4s cubic-bezier(0.22, 0.9, 0.25, 1), opacity 0.3s ease;
      }

      /* .card-stack:not(.tile-mode) .ec-card.open {
        background: color-mix(in srgb, var(--g) 20%, transparent);

        .ec-thumb {
          min-height: 10px;
        }

        border-color: color-mix(in srgb, var(--g) 50%, transparent);
      } */


      .ec-title {
        font-size: clamp(18px, 1.5vw, 26px);
        /* Un-commented the smaller clamp */
        font-weight: 900;
        color: var(--dimtitle);
        text-transform: uppercase;
        line-height: 1.1;
        margin-bottom: 4px;
        transition: color 0.2s ease;
      }

      .ec-subtitle {
        font-size: 13px;
        font-weight: 700;
        color: var(--tdim);
        text-transform: uppercase;
        letter-spacing: 0.05em;
      }

      .ec-brief {
        font-size: clamp(13px, 0.8vw, 16px);
        line-height: 1.45;
        color: var(--dimtitle);
        margin: 8px 0;
        max-width: 800px;
      }
    }
























    /* Base: Flex row for desktop */
    .ec-subtitle {
      display: flex;
      flex-direction: row;
      flex-wrap: wrap;
      column-gap: 4px;
    }

    /* Hide the mobile dot on desktop */
    .sub-mobile-dot {
      display: inline;
      color: var(--g);
      /* Gives the dot a nice pop of color */
    }

    .sub-desktop-pipe {
      display: none;
    }

    /* Mobile: Stack them and swap the pipe for a dot */
    @media (max-width: 1050px) {

      /* .ec-subtitle {
        flex-direction: column;
        gap: 2px;
    } */
      .sub-desktop-pipe {
        /* display: inline; */
        display: none;
      }

      /* .sub-mobile-dot {
        display: none;
    } */
    }

    /* @media (max-width: 65.6874em) { */
    @media (max-width: 1100px) {
      #mn {
        padding-right: 0 !important;
      }
    }

    @media (min-width: 1051px) {

      /* #mn {
        padding-right: 0;
      } */

      #master-card-pool {
        padding-left: 0;
        margin-left: 0;
      }


      .portfolio-sec {
        max-width: max(min(95vw, 1400px), 40vw) !important;
        margin: 0 auto !important;
        padding-left: 80px !important; /*for sidebar*/
      }

      .ec-card {
        max-width: 100% !important;
      }

      .portfolio-filters {
        max-width: max(min(95vw, 1400px), 40vw) !important;
        margin: 60px auto 0;
        padding-left: 48px;
        padding-right: 48px;
        padding-left: 80px !important; /*for sidebar*/
      }

    }




















    .cap-bubble {
      display: flex;
      align-items: center;
      justify-content: center;
      height: 40px;
      margin: 0;
      border-radius: 100px;

      /* Frosted glass styling */
      background: color-mix(in srgb, var(--bg) 50%, transparent);
      background: var(--title);
      /* backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px); */
      border: 1px solid color-mix(in srgb, var(--border) 50%, transparent);
    }

/* Layout helpers extracted from repeated inline grid styles */
.ec-media-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 400px));
  gap: 16px;
  margin-top: 0;
}
.ec-split-grid {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
}
.ec-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  align-items: start;
}
.ec-detail-stack {
  display: grid;
  gap: 20px;
  align-items: start;
}
