:root{
  --sidebar-w: 16vw;
  --gap: 18px;
  --lens-h: 140px; /* JS measures actual height */
}

@font-face{
  font-family: "JetBrainsMono-Regular.woff2";
  src: url();
}

@font-face {
  font-family: "Newsreader";
  src: url("Newsreader-VariableFont_opsz,wght.ttf") format("truetype");
  font-weight: 200 900;
  font-style: normal;
  font-display: swap;
}

body{
  font-family: 'JetBrainsMono-Regular', -apple-system, Segoe UI, Roboto, sans-serif;
  margin:0;
  background:#fff;
}

html {
  scrollbar-gutter: stable;
}

/* ---------------- Lens ---------------- */
#lensBar{
  position:fixed;
  top:0;
  left:0;
  width:100vw;
  z-index:999;
  padding:16px 24px;
  border-bottom:1px solid #000;
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(10px) saturate(20);
  -webkit-backdrop-filter: blur(18px) saturate(1.35);
}

#lensInner{
  max-width:1400px;
  margin:0 auto;
  display:flex;
  align-items:center;
  gap:14px;
  border-radius:20px;
  padding:16px 16px;
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
}

#lensText{
  flex:1;
  font-family: "Newsreader";
    font-variation-settings: "wght" 600, "opsz" 36;

  overflow:hidden;
  white-space:nowrap;
  text-overflow:ellipsis;
  font-size:50px;
  line-height:1.12;
}

.lensYear{
  display:inline;
  padding:5px 16px;
  margin-right:14px;
  background:#000;
  color:#fff;
  font-weight:950;
}

.lensToken{
  display:inline;
  padding:5px 16px;
  border-radius:999px;
  margin-right:12px;
  background:none !important;
  font-family:'Newsreader';
  font-variation-settings: "wght" 600, "opsz" 36;
}

#lensLinkBtn{
  display:none;
text-decoration: none;
  color:black;
  font-size:16px;
  line-height:1;
  flex:0 0 auto;
  cursor:pointer;
}
#lensLinkBtn:hover{ background: rgba(255,255,255,0.78); }
#lensLinkBtn:active{ transform: translateY(1px); }

/* ---------------- Layout ---------------- */
.app{
  display:grid;
  grid-template-columns: var(--sidebar-w) 1fr calc(var(--sidebar-w) * 1);
  gap: var(--gap);
  padding:24px;
  padding-right:2vw;
  /* padding-top: calc(24px + var(--lens-h)); */
  box-sizing:border-box;
}

.leftAside,
.rightAside{
  position:sticky;
  top: calc(24px + var(--lens-h));
  align-self:start;
  height: calc(100vh - (48px + var(--lens-h)));
  overflow:auto;
}

.leftAside{
  border-right:1px solid #000;
  padding-right:18px;
}

.rightAside{
  padding-left:18px;
    border-left: 1px solid;

}

main{ min-width:0; }

/* ---------------- Sidebar typography ---------------- */
.sideTitle{
  font-size:14px;
  font-weight:800;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:#777;
  margin:2px 0 10px 0;
}

.sideHeadline{
    font-family: "Newsreader";
  font-variation-settings: "wght" 900, "opsz" 36;

  font-size:22px;
  font-weight:800;
  line-height:1.1;
  margin:0 0 18px 0;
}

.hint{
  color:#777;
  font-size:12px;
  line-height:1.4;
  margin-top:12px;
}

.storyHeadlineFull{
  font-family: "Newsreader"
}

/* ---------------- Left stack buttons (editorial rules) ---------------- */
.leftAside .stack{
  display:flex;
  flex-direction:column;
  margin: 8px 0 0 0;
}

.leftAside .stack button{
  appearance:none;
  -webkit-appearance:none;
  font: inherit;
  color: inherit;

  width:100%;
  padding:12px 0;
  text-align:left;

  background:transparent;
  border:none;
  border-bottom:1px solid rgba(0,0,0,0.18);
  border-radius:0;

  cursor:pointer;
  transition: border-color 160ms ease, opacity 160ms ease, transform 160ms ease;
}

.leftAside .stack button:first-child{
  border-top:1px solid rgba(0,0,0,0.18);
}

.leftAside .stack button:hover{
  border-bottom-color: rgba(0,0,0,0.35);
}

.leftAside .stack button.btnActive{
  border-top-color:#000;
  border-bottom-color:#000;
}

.leftAside .stack button[disabled]{
  opacity:.35;
  cursor:not-allowed;
}

.leftAside .stack button:not([disabled]):active{
  transform: translateY(1px);
}

/* =====================================================
   FILTER BUTTONS — SAME GLASS LANGUAGE AS LENS BAR
   Put the color UNDER the glass (soft blob behind)
   Requires JS: btn.style.setProperty('--c', color)
   ===================================================== */

.leftAside #filters{
  display:flex;
  flex-direction:column;
  gap:10px;
  margin-top:8px;
}

/* Button = glass sheet */
.leftAside #filters .filterBtn{
  --c: rgba(0,0,0,0.35); /* fallback */

  position: relative;
  z-index: 0;
  overflow: visible;

  appearance:none;
  -webkit-appearance:none;
  font: inherit;
  font-size: 14px;
  color: inherit;

  width:100%;
  padding: 12px 2px;

  display:flex;
  align-items:center;
  gap:10px;

  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.10);

  /* match lensBar glass */
  background: rgba(255,255,255,0.65);
  backdrop-filter: blur(18px) saturate(20);
  -webkit-backdrop-filter: blur(20px) saturate(20));

  cursor:pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

/* Color UNDER the glass */
.leftAside #filters .filterBtn::before{
  content:"";
  position:absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);

  width: 30px;
  height: 30px;
  border-radius: 999px;

  background: radial-gradient(circle at 35% 35%, var(--c), transparent 70%);
  filter: blur(10px);
  opacity: .95;

  z-index: -1;
  pointer-events:none;
}

/* Modern marker (optional) */
/* .leftAside #filters .filterBtn .dot{
  width: 10px;
  height: 22px;
  border-radius: 999px;
  background: var(--c);
  flex: 0 0 auto;
  opacity: .9;
} */

/* Hover / active */
.leftAside #filters .filterBtn:hover{
  background: rgba(255,255,255,0.78);
  border-color: rgba(0,0,0,0.16);
}

.leftAside #filters .filterBtn:active{
  transform: translateY(1px);
}

.leftAside #filters .filterBtn.btnActive{
  background: rgba(255,255,255,0.82);
  border-color: rgba(0,0,0,0.28);
}

/* ---------------- Stage / text ---------------- */
#stage{
  position:relative;
  border-radius:16px;
  padding:14px;
  min-height:520px;
  overflow:visible;
    padding-top: calc(14px + var(--lens-h));

}

#stage.bubblesMode{
  height: calc(100vh - (48px + var(--lens-h)));
  min-height: unset;
  overflow:auto;
}

#textLayer{
  position:relative;
  z-index:10;
  font-size:14px;
  line-height:2;
  white-space:normal;
  word-break:normal;
  padding-bottom:60vh;
}

.token{
  display:inline;
  padding:2px 10px;
  margin-right:6px;
  transition: opacity 180ms ease;
  cursor:pointer;
}
.token:hover{ outline: 1px solid rgba(0,0,0,0.18); }

.yearMarker{
  display:inline;
  padding:2px 10px;
  margin:0 10px 0 2px;
  background:#000;
  color:#fff;
  font-weight:800;
  font-size:14px;
  transition: opacity 180ms ease;
}

.barsOnly .token{
  color: transparent !important;
  user-select:none;
}

/* ---------------- Overlay SVG ---------------- */
#overlaySvg{
  position:absolute;
  inset:0;
  width:100%;
  overflow:visible;
  z-index:1;
  pointer-events:none;
}
#overlaySvg .dots{ pointer-events:all; }
#overlaySvg .dots circle{ pointer-events:all; cursor:pointer; }
#overlaySvg .labels{ pointer-events:none; }

/* ---------------- Lens Details ---------------- */
#lensDetails{
    font-family:"Newsreader";
  display:block;
  font-size:16px;
  line-height:1.45;
  color:black;
  margin:0;
}

#lensDetails .row{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}



@media (max-width: 768px) {
  :root{
    --sidebar-w: 0px;
    --gap: 0px;
  }

  /* Turn off right column */
  .rightAside{ display:none !important; }

  /* Single column app layout */
  .app{
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0;
    padding-bottom: 110px; /* space for bottom bar */
  }

  main{ padding: 0 12px; }

  /* Lens bar: full width + smaller type, hide year */
  #lensBar{
    width: 100vw;
    padding: 10px 12px;
   min-height: 12vh;
  }
  #lensText{
    font-size: 22px;
    line-height: 1.12;
    white-space: normal;
  }
  .lensYear{ display:none !important; }

  /* Stage: keep top padding for lens bar */
  #stage{
    padding: 12px;
    padding-top: calc(12px + var(--lens-h));
    min-height: 60vh;
  }

  /* LEFT ASIDE becomes bottom bar + overlay sheet */
  .leftAside{
    position: fixed;
    left: 0;
    bottom: 0;
    top: auto;
    width: 100vw;
    height: 100px;
    z-index: 1000;

    border-right: none;
    border-top: 1px solid rgba(0,0,0,0.25);
    padding: 10px 12px;

    background: rgba(255,255,255,0.78);
    backdrop-filter: blur(18px) saturate(20);
    -webkit-backdrop-filter: blur(18px) saturate(20);

    overflow: hidden;
  }

  /* Hide desktop-y typography in the bottom bar state */
  .leftAside .sideTitle,
  .leftAside .sideHeadline,
  .leftAside .hint{
    display: none;
  }

  /* Show a compact mobile bar */
  .leftAside .mobileBar{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap: 12px;
    height: 100%;
  }

  .filters{
        padding-right: 25px;
        margin-bottom: 20px;

  }

  .mobilePrimaryBtn{
    appearance:none;
    -webkit-appearance:none;
    font: inherit;
    font-weight: 800;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.18);
    padding: 12px 16px;
    background: rgba(255,255,255,0.85);
    cursor:pointer;
  }
  .mobilePrimaryBtn:active{ transform: translateY(1px); }

  .mobileStatus{
    flex: 1;
    font-size: 12px;
    line-height: 1.2;
    color: #666;
    overflow:hidden;
    white-space:nowrap;
    text-overflow: ellipsis;
    text-align: right;
  }

  /* Overlay sheet (full-screen panel) */
  body.mobilePanelOpen .leftAside{
    height: 100vh;
    bottom: 0;
    top: auto;
    overflow: auto;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
  }

  /* When overlay is open, show original leftAside content */
  body.mobilePanelOpen .leftAside .sideTitle,
  body.mobilePanelOpen .leftAside .sideHeadline,
  body.mobilePanelOpen .leftAside .hint{
    display: block;
  }

  /* Keep the mobileBar visible as a small header when open */
  body.mobilePanelOpen .leftAside .mobileBar{
    /* position: sticky; */
    top: 0;
    padding: 6px 0 10px 0;
    background: transparent;
    border-bottom: 1px solid rgba(0,0,0,0.12);
    z-index: 2;
  }

  /* Show filters + stack in overlay mode, hide them in compact mode */
  .leftAside .stack,
  .leftAside #filters,
  .leftAside #status{
    display: none;
  }
  body.mobilePanelOpen .leftAside .stack,
  body.mobilePanelOpen .leftAside #filters,
  body.mobilePanelOpen .leftAside #status{
    display: block;
            
  }
  .filterBtn {

  margin-bottom: 10px;}

  /* Close button only in overlay */
  .mobileCloseBtn{
    display:none;
    position: sticky;
    top: 50px;
    margin-left: auto;
    margin-top: 10px;
    z-index: 3;

    appearance:none;
    -webkit-appearance:none;
    font: inherit;
    font-weight: 800;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,0.18);
    padding: 10px 14px;
    background: rgba(255,255,255,0.9);
    cursor:pointer;
  }
  body.mobilePanelOpen .mobileCloseBtn{
    display: inline-flex;
  }

  /* Make filter buttons easier to tap on mobile */
  .leftAside #filters .filterBtn{
    padding: 14px 10px;
    border-radius: 18px;
  }

  /* Optional: reduce headline size in overlay */
  body.mobilePanelOpen .leftAside .sideHeadline{
    font-size: 18px;
  }
}

/* Default hidden on desktop */
.mobileBar, .mobileCloseBtn{
  display:none;
}

@media (max-width: 768px) {
  /* Compact bottom bar keeps full height */
  .leftAside .mobileBar{
    height: 100%;
  }

  /* When overlay is open, mobileBar becomes a normal header */
  body.mobilePanelOpen .leftAside .mobileBar{
    height: auto;              /* ✅ key fix */
    justify-content: space-between;
    align-items: center;
    padding: 10px 0 12px 0;
  }

  /* Give overlay content breathing room so headline/buttons aren't clipped */
  body.mobilePanelOpen .leftAside{
    padding-top: 12px;
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }

  /* Optional: prevent the headline from hiding under the sticky header */
  body.mobilePanelOpen .leftAside .sideHeadline{
    margin-top: 10px;
  }

  .lensToken{

  padding:0px 0px;

}
}