/* ==========================================================================
   cube.css: the project cube, the unfold panel, the loader and the waves.
   All gimmick styling lives here. Remove this file plus the matching
   modules in js/main.js and the page falls back to plain stacked sections.
   ========================================================================== */

/* ---------- The cube (built by js/cube.js) ----------
   #cube is fixed and moved/scaled by JS between the header corner and the
   stage. Faces are drawn at --base size and scaled, so text stays sharp.  */
#cube {
  --base: 400px;
  --glow: 0.6;          /* 0..1 crack brightness, set by JS */
  --grow: 1;            /* 0..1 how far the cracks have spread */
  --p: 0;               /* 0 = in the corner, 1 = on the stage */
  position: fixed; left: 0; top: 0; z-index: 30;
  width: var(--base); height: var(--base);
  perspective: 1400px;
  transform-origin: 0 0;
  touch-action: pan-y;  /* vertical swipes still scroll the page on phones */
  cursor: grab;
  user-select: none; -webkit-user-select: none;
}
#cube.dragging { cursor: grabbing; }
.cube-body { position: absolute; inset: 0; transform-style: preserve-3d; }
.face {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  padding: 40px; font: inherit; color: var(--text); text-align: center;
  background: radial-gradient(circle at 50% 42%, #221E58, #0C0A26 62%, #06051A);
  border: 2px solid rgba(143, 208, 255, calc(0.35 + 0.5 * var(--glow)));
  box-shadow: inset 0 0 calc(20px + 40px * var(--glow)) rgba(181, 124, 255, calc(0.1 + 0.22 * var(--glow)));
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  cursor: pointer; border-radius: 0;
}
.face:hover { border-color: var(--neon-b); }
/* the logo: line art from js/icons.js */
.face-icon { width: 62%; position: relative; z-index: 1; opacity: var(--p); transition: opacity 0.6s; }   /* hidden while loading and in the corner */
.face-icon svg { position: static; width: 100%; height: auto; display: block; overflow: visible; filter: drop-shadow(0 0 10px var(--neon-a)); }
.face-icon path, .face-icon circle, .face-icon rect { fill: none; stroke: var(--neon-a); stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: none; opacity: 1; }
.face-icon .b { stroke: var(--neon-b); }
.face-icon .dim { stroke: #5A6AA0; }
.face-icon .thin { stroke-width: 1.2; opacity: 0.6; }
.face-icon .dash { stroke: #4A5A8A; stroke-dasharray: 4 5; }
.face-icon .fill { fill: var(--neon-a); }
.face-title { font-family: var(--display); font-weight: 600; font-size: 1.6rem; letter-spacing: 0.01em; position: relative; z-index: 1; opacity: var(--p); transition: opacity 0.3s; }
.face > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none;
  filter: drop-shadow(0 0 calc(2px + 8px * var(--glow)) var(--neon-b)); }
.face > svg path { fill: none; stroke: var(--neon-b); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--grow)); opacity: calc(0.2 + 0.8 * var(--glow)); }

/* ---------- Stage: the empty slot the cube flies into ---------- */
.stage-slot { width: var(--cube-stage); aspect-ratio: 1; margin: 48px auto 24px; }
.hero-slot { width: min(78%, 330px); aspect-ratio: 1; margin: 40px auto 56px; }

/* ---------- Unfold panel (js/unfold.js) ---------- */
.js .project { display: none; }
.js .project.open { display: block; }
.js #unfold { display: none; transform-origin: 50% 0; }
.js #unfold.open { display: block; }
#unfold { background: rgba(5, 4, 12, 0.7); backdrop-filter: blur(6px); border-top: 2px solid var(--neon-a); box-shadow: 0 -12px 40px rgba(143, 208, 255, 0.18); }
.unfold-nav {
  position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 12px var(--gutter); background: rgba(8, 6, 22, 0.9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
}
.unfold-nav .sides { display: flex; flex-wrap: wrap; gap: 6px; margin-left: auto; }
.unfold-nav button { padding: 7px 14px; font-size: 0.9rem; }
.unfold-nav button[aria-current="true"] { border-color: var(--neon-a); color: var(--neon-a); }
.no-js-only { display: block; }
.js .no-js-only { display: none; }

/* ---------- Loader overlay (js/loader.js) ---------- */
#loader { position: fixed; inset: 0; z-index: 25; background: #05040C; transition: opacity 0.8s ease; }
#loader.out { opacity: 0; pointer-events: none; }
#loader .pct { position: absolute; left: 50%; bottom: 10vh; transform: translateX(-50%); color: var(--muted); font: 600 14px/1 var(--body); letter-spacing: 0.08em; }

/* ---------- Waves (js/fx.js) ---------- */
#waves { position: fixed; inset: 0; z-index: 29; pointer-events: none; width: 100%; height: 100%; }
#waves circle { fill: none; }
