/* =========================
   GLOBAL / PAGE LAYOUT
   ========================= */

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

body {
  background: #000;
  color: #fff;
  font-family: Inter, sans-serif;
  overflow: hidden;              /* 🔒 no scroll at all on this page */
}

/* =========================
   CARD STACK
   ========================= */

#card-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  height: 60vh;
  transition: transform 0.75s ease, opacity 0.5s ease, filter 0.75s ease;
  pointer-events: auto;
  z-index: 2;                    /* above the nodes */
}

/* breathing motion for each card */
.card {
  font-size: 2.2rem;
  padding: 16px 32px;
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  cursor: pointer;
  transition: transform 0.6s ease, background 0.3s ease;
  transform: translateY(0) scale(1);
  animation: breath 5s ease-in-out infinite;
}

@keyframes breath {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.04); }
}

.card:hover {
  background: rgba(255,255,255,0.12);
  transform: scale(1.06);
}

/* RESTING STATE: big cards in center */
.stack-default {
  transform: translateY(0) scale(1);
  opacity: 1;
  filter: none;
}

/* ACTIVE STATE: when a category is opened
   ⚠ size & blur are controlled from JS via:
   const STACK_ACTIVE_SCALE = ...;
   const STACK_ACTIVE_BLUR  = ...;
*/
.stack-active {
  transform:
    translateY(-250px)
    scale(var(--stack-active-scale, 0.45));
  opacity: 0.82;
  filter: blur(var(--stack-active-blur, 1.8px));
}

/* =========================
   GRAPH CONTAINER (NODES)
   ========================= */

#graph-container {
  position: fixed;               /* fixed to viewport */
  left: 0;
  top: 0;
  width: 100%;
  height: 100vh;                 /* full screen */
  z-index: 1;                    /* under the cards */
  pointer-events: auto;          /* ✅ REQUIRED so drag works */
}

#graph-container svg {
  width: 100%;
  height: 100%;
  pointer-events: auto;          /* ✅ allow svg to receive events */
}

/* Only circles should be interactive (drag) */
#graph-container line {
  pointer-events: none;
}

#graph-container text {
  pointer-events: none;
}

#graph-container circle {
  pointer-events: all;
}

/* =========================
   HINT "JAW" MOTION
   ========================= */

.work-hint {
  color: rgba(255,255,255,0.55);
  font-size: 13px;
  letter-spacing: 0.02em;
  text-align: center;
  margin-top: 70px;
  transition: transform 0.5s ease, opacity 0.5s ease;
  z-index: 2;
  position: relative;
}

/* when graph is open, push hint down a bit */
.work-hint.jaw-open {
  transform: translateY(55px);
  opacity: 0.9;
}


#graph-container rect {
  pointer-events: all;
}



/* =========================================================
   MODE 3 (embedded layer)
   ========================================================= */
#work-mode3-layer[aria-hidden="true"] { display: none; }

#work-mode3-layer {
  position: relative;
  width: 100%;
  background: #ffffff;
  color: #111;
  padding: 110px 0 160px;
}

html.mode3-active,
body.mode3-active {
  overflow: auto !important;
}

#work-mode3-layer .mode3-wrap{
  width: min(980px, calc(100% - 48px));
  margin: 0 auto;
}

#work-mode3-layer .mode3-hero{
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 28px;
  align-items: center;
  margin-bottom: 42px;
}

#work-mode3-layer .mode3-hero-circle{
  width: 220px;
  height: 220px;
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(0,0,0,0.18);
  background: #eee;
}

#work-mode3-layer .mode3-hero-img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#work-mode3-layer .mode3-title{
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.1;
  font-weight: 700;
  color: #111;
}

#work-mode3-layer .mode3-download{
  display: inline-block;
  padding: 10px 14px;
  border-radius: 999px;
  background: #111;
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
}

#work-mode3-layer .mode3-gallery{
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  margin: 24px 0 44px;
}

#work-mode3-layer .mode3-rect{
  width: 640px;
  max-width: 100%;
  height: 380px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  background: #e9e9e9;
  box-shadow: 0 12px 45px rgba(0,0,0,0.14);
}

#work-mode3-layer .mode3-rect img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

#work-mode3-layer .mode3-field{
  position: relative;
  border-radius: 26px;
  background: #f5f5f5;
  box-shadow: 0 12px 50px rgba(0,0,0,0.10);
  padding: 34px 28px;
  min-height: 680px;
  overflow: hidden;
}

#work-mode3-layer .mode3-words{
  position: relative;
  z-index: 1;
  font-size: 14px;
  line-height: 1.7;
  color: #1b1b1b;
  user-select: none;
}

#work-mode3-layer .mode3-word{
  display: inline;
  transition: opacity 80ms linear;
}

#work-mode3-layer .mode3-carve-shape{
  position: absolute;
  z-index: 2;
  touch-action: none;
  cursor: grab;
  box-shadow: 0 18px 60px rgba(0,0,0,0.18);
}

#work-mode3-layer .mode3-carve-shape:active{ cursor: grabbing; }

#work-mode3-layer .mode3-carve-circle{
  width: 220px;
  height: 220px;
  border-radius: 999px;
  background: #ffffff;
}

#work-mode3-layer .mode3-carve-rect{
  width: 340px;
  height: 180px;
  border-radius: 18px;
  background: #ffffff;
}

#work-mode3-layer .mode3-footnote{
  margin-top: 16px;
  font-size: 12px;
  color: rgba(0,0,0,0.55);
  text-align: center;
}

#work-mode3-layer .mode3-go-top{
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 9999;
  padding: 10px 14px;
  border-radius: 999px;
  border: 0;
  background: #111;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 40px rgba(0,0,0,0.22);
  transition: opacity 200ms ease;
}

/* Stage 3: make ONLY the label text scale (without jumping) and become clickable */
.node-label.node-label-child{
  transform-box: fill-box;
  transform-origin: 0% 50%; /* lock left edge so scaling doesn't "jump" */
  transition: transform 160ms ease, opacity 160ms ease;
  cursor: default;
}

.node-label.node-label-child.stage3-hot{
  transform: scale(1.3);
  cursor: pointer;
}

/* Root pill label can scale from center if needed */
.node-label.node-label-root{
  transform-box: fill-box;
  transform-origin: 50% 50%;
}
