/* sean.callsyne.com — terminal portfolio v4
 * palette: #0a0a0a bg / #00FF41 neon / #888 muted / #FF4136 red accent
 */

:root {
  --bg: #0a0a0a;
  --green: #00FF41;
  --green-dim: #00b82f;
  --green-deep: #007a1e;
  --muted: #888;
  --muted-dark: #555;
  --red: #FF4136;
  --amber: #FFBF00;
  --glow: 0 0 4px rgba(0, 255, 65, 0.4);
  --glow-strong: 0 0 8px rgba(0, 255, 65, 0.6);
  --mono: 'Fira Code', 'JetBrains Mono', 'Menlo', 'Consolas', 'Courier New', monospace;
}

* {
  box-sizing: border-box;
  border-radius: 0 !important;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--green);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  text-shadow: var(--glow);
}

body {
  /* Lock body to viewport so the terminal window can own the scroll */
  height: 100vh;
  overflow: hidden;
  padding: 40px 0 0 0;
  background:
    radial-gradient(ellipse at center, #0a0a0a 0%, #000000 90%);
}

/* Matrix rain background */
.matrix-bg {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  z-index: 0;
  pointer-events: none;
  opacity: 0.22;
  display: block;
}

/* CRT scanlines overlay */
.scanlines {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    to bottom,
    rgba(0, 255, 65, 0.0) 0px,
    rgba(0, 255, 65, 0.0) 2px,
    rgba(0, 255, 65, 0.08) 3px,
    rgba(0, 255, 65, 0.0) 4px
  );
  z-index: 9;
  mix-blend-mode: overlay;
  opacity: 0.35;
}

.crt-vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    rgba(0, 0, 0, 0) 55%,
    rgba(0, 0, 0, 0.7) 100%
  );
  z-index: 8;
}

/* Cursor magnetic glow — subtler + faster */
.cursor-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 7;
  background: radial-gradient(
    circle 240px at var(--cx, 50%) var(--cy, 50%),
    rgba(0, 255, 65, 0.05) 0%,
    rgba(0, 255, 65, 0.0) 60%
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}
.cursor-glow.on { opacity: 1; }

/* Firework particle layer */
.firework-layer {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 60;
  overflow: hidden;
}
.fw-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color, #FFAA00);
  border-radius: 50% !important;
  pointer-events: none;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px var(--color, #FFAA00), 0 0 12px var(--color, #FFAA00);
  animation: fw-burst 600ms cubic-bezier(0.2, 0.7, 0.3, 1) forwards;
}
@keyframes fw-burst {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  60%  { opacity: 0.9; }
  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(0.3);
  }
}

/* Top bar */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--green-deep);
  background: #000;
  z-index: 20;
  font-size: 13px;
  color: var(--green-dim);
}

.topbar-left { letter-spacing: 1px; }
.topbar-right { display: flex; gap: 14px; align-items: center; }

.voice-toggle {
  cursor: pointer;
  color: var(--green);
  user-select: none;
  padding: 2px 6px;
  border: 1px solid var(--green-deep);
  transition: background 0.15s, color 0.15s;
}
.voice-toggle:hover { background: var(--green-deep); color: #000; text-shadow: none; }
.voice-toggle.off { color: var(--muted); border-color: var(--muted-dark); }

/* ----------------- Floating terminal window — fixed in viewport ----------------- */
.term-window {
  position: fixed;
  top: 56px;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 15;
  width: 72vw;
  max-width: 1080px;
  min-width: 320px;
  background: rgba(6, 8, 6, 0.92);
  border: 1px solid var(--green-deep);
  box-shadow:
    0 0 0 1px rgba(0, 255, 65, 0.12),
    0 10px 40px rgba(0, 0, 0, 0.75),
    0 30px 80px rgba(0, 0, 0, 0.6),
    0 0 40px rgba(0, 255, 65, 0.12);
  display: flex;
  flex-direction: column;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  overflow: hidden;
  transform-origin: 50% 50%;
}

/* The entering anim translates while preserving the centering transform */
.term-window.entering {
  animation: term-enter 600ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
}
@keyframes term-enter {
  0%   { opacity: 0; transform: translateX(-50%) translateY(20px); }
  100% { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* Window chrome bar — fixed at top of window */
.term-chrome {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 30px;
  padding: 0 12px;
  background: linear-gradient(180deg, #0d120d 0%, #070907 100%);
  border-bottom: 1px solid var(--green-deep);
  user-select: none;
  flex-shrink: 0;
}
.chrome-dots { display: inline-flex; gap: 7px; }
.chrome-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50% !important;
  box-shadow: inset 0 0 1px rgba(0,0,0,0.6);
}
.chrome-dot--red    { background: #FF5F56; }
.chrome-dot--amber  { background: #FFBD2E; }
.chrome-dot--green  { background: #27C93F; }
.chrome-title {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--green-dim);
  text-shadow: var(--glow);
  letter-spacing: 1px;
}
.chrome-spacer { width: 52px; }

/* ----------------- Terminal output area — the ONLY scroll ----------------- */
.terminal {
  flex: 1 1 auto;
  padding: 10px 26px 10px;
  white-space: pre-wrap;
  word-break: break-word;
  text-align: left;
  overflow-y: auto;
  min-height: 0;
}

.boot { margin: 0; padding: 0; }
.boot:empty { display: none; }

.line {
  margin: 0;
  padding: 0;
  white-space: pre-wrap;
  word-break: break-word;
}

.line-ok    { color: var(--green); }
.line-warn  { color: var(--amber); }
.line-err   { color: var(--red); }
.line-muted { color: var(--muted); text-shadow: none; }
.line-dim   { color: var(--green-dim); }
.line-user  { color: var(--amber); text-shadow: 0 0 4px rgba(255, 191, 0, 0.35); }

/* FS listing: dirs = amber/bold, files = plain green-dim, hidden = muted. */
.ls-row     { display: flex; flex-wrap: wrap; gap: 0 22px; }
.ls-dir     { color: var(--amber); font-weight: 700; text-shadow: 0 0 4px rgba(255, 191, 0, 0.35); }
.ls-file    { color: var(--green-dim); }
.ls-hidden  { color: var(--muted); text-shadow: none; }

.ok-tag   { color: var(--green); }
.fail-tag { color: var(--red); }
.warn-tag { color: var(--amber); }

.banner {
  color: var(--green);
  text-shadow: var(--glow-strong);
  font-family: var(--mono);
  font-weight: 500;
  margin: 0 0 6px;
  font-size: 13px;
  line-height: 1.15;
  white-space: pre;
  overflow: hidden;
}

.banner.animating { animation: banner-pulse 1.4s ease-in-out; }
@keyframes banner-pulse {
  0%   { filter: brightness(0.6) blur(2px); text-shadow: 0 0 2px rgba(0,255,65,0.3); }
  40%  { filter: brightness(1.8) blur(0);  text-shadow: 0 0 18px rgba(0,255,65,0.95); }
  100% { filter: brightness(1) blur(0);    text-shadow: var(--glow-strong); }
}

.banner .banner-row {
  display: block;
  opacity: 0;
  transform: translateY(-4px);
  animation: banner-row-in 380ms cubic-bezier(0.2, 0.9, 0.2, 1) forwards;
}
@keyframes banner-row-in {
  from { opacity: 0; transform: translateY(-4px); filter: blur(3px); }
  to   { opacity: 1; transform: translateY(0); filter: blur(0); }
}

.tagline {
  color: var(--muted);
  text-shadow: none;
  margin: 0 0 18px;
  letter-spacing: 1px;
}

/* Headshot */
.headshot-row {
  display: flex;
  align-items: center;
  gap: 18px;
  margin: 8px 0 14px;
  position: relative;
}

/* Inline cube slot — sits right of the headshot+name block.
 * NOTE: do NOT set `perspective` here. The `.cube-scene` inside already owns
 * the 3D context. Nesting two perspective elements (slot + scene) with the
 * scene defaulting to `transform-style: flat` causes the cube's 3D faces to
 * be projected to 2D first and then re-projected — faces end up scattered
 * instead of joining into a solid cube. */
.cube-inline-slot {
  /* v8: pull cube ~32px to the left so it sits closer to the name block
   * without drifting off the right edge of the terminal. */
  margin-left: auto;
  margin-right: 32px;
  width: 200px;
  height: 200px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
@media (max-width: 900px) {
  .cube-inline-slot { width: 160px; height: 160px; margin-right: 24px; }
}
@media (max-width: 640px) {
  .cube-inline-slot { width: 130px; height: 130px; margin-right: 16px; }
}
@media (max-width: 480px) {
  /* On very narrow screens, wrap the cube to its own row so name has room */
  .headshot-row { flex-wrap: wrap; }
  .cube-inline-slot { width: 110px; height: 110px; margin-left: 0; margin-right: 0; }
}
.headshot {
  width: 120px;
  height: 120px;
  border-radius: 50% !important;
  object-fit: cover;
  object-position: center 20%;
  border: 2px solid var(--green);
  box-shadow:
    0 0 0 3px rgba(0, 255, 65, 0.18),
    0 0 18px rgba(0, 255, 65, 0.55),
    inset 0 0 20px rgba(0, 255, 65, 0.15);
  filter: contrast(1.05) saturate(0.9) brightness(0.95);
  background: #000;
}
.headshot-meta {
  color: var(--green-dim);
  text-shadow: var(--glow);
  font-size: 13px;
  line-height: 1.45;
}
.headshot-meta .name { color: var(--green); font-size: 15px; letter-spacing: 1px; }
.headshot-meta .role { color: var(--muted); text-shadow: none; }

@media (max-width: 560px) {
  .headshot { width: 90px; height: 90px; }
  .headshot-row { gap: 12px; }
}

.section-header {
  color: var(--green);
  border-bottom: 1px solid var(--green-deep);
  margin: 18px 0 10px;
  padding-bottom: 4px;
  letter-spacing: 1px;
}

.kv { display: flex; gap: 12px; }
.kv .k { color: var(--muted); min-width: 110px; text-shadow: none; }
.kv .v { color: var(--green); }

/* Skill rows */
.skill-bars {
  margin: 8px 0;
  font-family: var(--mono);
  white-space: pre;
  line-height: 1.5;
}
.skill-bar-row {
  display: block;
  color: var(--green-dim);
  white-space: pre;
  transition: text-shadow 0.25s ease;
}
.skill-bar-row .sb-name { color: var(--green-dim); }
.skill-bar-row .sb-bar { color: var(--green); text-shadow: var(--glow); }
.skill-bar-row .sb-bar-empty { color: var(--green-deep); text-shadow: none; }
.skill-bar-row .sb-pct { color: var(--amber); text-shadow: 0 0 4px rgba(255, 191, 0, 0.35); }

/* One-shot finalize flash */
.skill-bar-row.tick-flash { text-shadow: 0 0 10px rgba(0, 255, 65, 0.55); }
.skill-bar-row.tick-flash .sb-bar { text-shadow: 0 0 10px rgba(0, 255, 65, 0.9); }
.skill-bar-row.tick-flash .sb-pct { text-shadow: 0 0 10px rgba(255, 191, 0, 0.8); }

.project {
  margin: 8px 0 14px;
  padding-left: 12px;
  border-left: 2px solid var(--green-deep);
}
.project .p-name { color: var(--green); font-weight: 500; }
.project .p-desc { color: var(--muted); text-shadow: none; margin-top: 2px; }
.project a, .link { color: var(--amber); text-decoration: none; text-shadow: 0 0 4px rgba(255, 191, 0, 0.35); }
.project a:hover, .link:hover { text-decoration: underline; color: #fff; }

.prompt-echo { color: var(--muted); text-shadow: none; margin-top: 14px; }
.prompt-echo .ps { color: var(--green); text-shadow: var(--glow); }
.prompt-echo .cmd { color: var(--amber); text-shadow: 0 0 4px rgba(255, 191, 0, 0.35); }

.ai-line { color: var(--green); }
.ai-tag { color: var(--muted); text-shadow: none; }

.thinking-inline {
  display: inline;
  color: var(--muted);
  text-shadow: none;
  white-space: nowrap;
}
.thinking-inline::after {
  content: '...';
  display: inline;
  animation: dots 1.2s steps(4, end) infinite;
}
@keyframes dots {
  0%   { content: '';    }
  25%  { content: '.';   }
  50%  { content: '..';  }
  75%  { content: '...'; }
  100% { content: '';    }
}

/* ----------------- Prompt input row — pinned at bottom of terminal window ----------------- */
.prompt-form {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px 14px;
  border-top: 1px solid var(--green-deep);
  background: rgba(0, 0, 0, 0.55);
}

.prompt-prefix {
  color: var(--green);
  font-weight: 500;
  text-shadow: var(--glow-strong);
  flex-shrink: 0;
}

/* Input + cursor on the same baseline. Mirror span measures typed text width.
 * Input width is set via JS to match the mirror's rendered width, so the
 * block cursor sits flush right after the last typed character. */
.prompt-input-wrap {
  display: inline-flex;
  align-items: baseline;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  position: relative;
}

/* Off-screen mirror used for width measurement only */
.prompt-mirror {
  position: absolute;
  visibility: hidden;
  white-space: pre;
  pointer-events: none;
  font-family: var(--mono);
  font-size: 16px;
  font-weight: normal;
  letter-spacing: normal;
  padding: 0;
  margin: 0;
  left: -9999px;
  top: 0;
}

.prompt-input {
  width: 2px;           /* JS sets this; 2px floor so caret has a home */
  min-width: 0;
  background: transparent;
  border: none;
  outline: none;
  color: var(--green);
  font-family: var(--mono);
  font-size: 16px;
  caret-color: transparent;
  text-shadow: var(--glow);
  padding: 0;
  margin: 0;
  text-align: left;
  line-height: 1.2;
  vertical-align: baseline;
}
.prompt-input::placeholder { color: var(--muted-dark); text-shadow: none; }
.prompt-input:disabled { opacity: 0.5; }

.cursor {
  color: var(--green);
  font-size: 16px;
  line-height: 1.2;
  animation: blink 1s steps(2, start) infinite;
  text-shadow: var(--glow-strong);
  margin-left: 0;
  pointer-events: none;
  flex-shrink: 0;
  vertical-align: baseline;
}
@keyframes blink {
  to { visibility: hidden; }
}

/* Link list */
.links-block { margin: 8px 0; }
.links-block .link-row { display: flex; gap: 14px; color: var(--muted); text-shadow: none; }
.links-block .link-row .k { min-width: 110px; color: var(--muted); }
.links-block .link-row a { color: var(--amber); }

/* Guardrail block — inline SVG + refusal message */
.easter-block {
  margin: 10px 0;
  padding: 10px 14px;
  border: 1px dashed var(--red);
  background: rgba(255, 65, 54, 0.04);
  display: flex;
  align-items: center;
  gap: 16px;
}
.easter-block .easter-gif {
  flex-shrink: 0;
}
.easter-block .easter-gif svg {
  display: block;
  max-width: 260px;
  height: auto;
}
.easter-block .line-err {
  color: var(--red);
  text-shadow: 0 0 4px rgba(255, 65, 54, 0.35);
}
@media (max-width: 560px) {
  .easter-block { flex-direction: column; align-items: flex-start; gap: 8px; }
  .easter-block .easter-gif svg { max-width: 100%; }
}

/* Hidden (konami) */
.easter {
  color: var(--red);
  text-shadow: 0 0 6px rgba(255, 65, 54, 0.5);
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px dashed var(--red);
}

/* ----------------- 3D Cube Loader ----------------- */
.cube-stage {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(6, 8, 6, 0.55) 0%, rgba(0, 0, 0, 0.85) 100%);
  transition: opacity 0.8s ease, visibility 0.8s ease;
}
.cube-stage.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.cube-scene {
  width: 320px;
  height: 320px;
  perspective: 1000px;
  cursor: grab;
  touch-action: none;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1), height 600ms cubic-bezier(0.4, 0, 0.2, 1);
  /* Kill stray whitespace-text boxes that otherwise offset the cube down
   * inside the scene (visible as "faces don't line up" after v6). */
  font-size: 0;
  line-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cube-scene:active,
.cube.dragging { cursor: grabbing; }

.cube {
  position: relative;
  width: 320px;
  height: 320px;
  transform-style: preserve-3d;
  /* JS drives rotation each frame. No CSS animation. */
  transform: translateZ(-160px) rotateX(-8deg) rotateY(0deg);
  will-change: transform;
  transition: width 600ms cubic-bezier(0.4, 0, 0.2, 1), height 600ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Inline sizing — cube shrinks when moved into the headshot row */
.cube-scene--inline { width: 190px; height: 190px; perspective: 600px; }
.cube--inline { width: 190px; height: 190px; }
.cube-scene--inline .cube-face {
  width: 190px; height: 190px;
  box-shadow: inset 0 0 20px rgba(0, 255, 65, 0.22), 0 0 10px rgba(0, 255, 65, 0.25);
}
.cube-scene--inline .cube-face--front  { transform: rotateY(  0deg) translateZ(95px); }
.cube-scene--inline .cube-face--back   { transform: rotateY(180deg) translateZ(95px); }
.cube-scene--inline .cube-face--right  { transform: rotateY( 90deg) translateZ(95px); }
.cube-scene--inline .cube-face--left   { transform: rotateY(-90deg) translateZ(95px); }
.cube-scene--inline .cube-face--top    { transform: rotateX( 90deg) translateZ(95px); }
.cube-scene--inline .cube-face--bottom { transform: rotateX(-90deg) translateZ(95px); }
.cube-scene--inline .cube-face::after { font-size: 9px; bottom: 4px; left: 5px; padding: 1px 4px; }

@media (max-width: 900px) {
  .cube-scene--inline, .cube--inline { width: 150px; height: 150px; }
  .cube-scene--inline .cube-face { width: 150px; height: 150px; }
  .cube-scene--inline .cube-face--front  { transform: rotateY(  0deg) translateZ(75px); }
  .cube-scene--inline .cube-face--back   { transform: rotateY(180deg) translateZ(75px); }
  .cube-scene--inline .cube-face--right  { transform: rotateY( 90deg) translateZ(75px); }
  .cube-scene--inline .cube-face--left   { transform: rotateY(-90deg) translateZ(75px); }
  .cube-scene--inline .cube-face--top    { transform: rotateX( 90deg) translateZ(75px); }
  .cube-scene--inline .cube-face--bottom { transform: rotateX(-90deg) translateZ(75px); }
}
@media (max-width: 640px) {
  .cube-scene--inline, .cube--inline { width: 120px; height: 120px; }
  .cube-scene--inline .cube-face { width: 120px; height: 120px; }
  .cube-scene--inline .cube-face--front  { transform: rotateY(  0deg) translateZ(60px); }
  .cube-scene--inline .cube-face--back   { transform: rotateY(180deg) translateZ(60px); }
  .cube-scene--inline .cube-face--right  { transform: rotateY( 90deg) translateZ(60px); }
  .cube-scene--inline .cube-face--left   { transform: rotateY(-90deg) translateZ(60px); }
  .cube-scene--inline .cube-face--top    { transform: rotateX( 90deg) translateZ(60px); }
  .cube-scene--inline .cube-face--bottom { transform: rotateX(-90deg) translateZ(60px); }
}
@media (max-width: 480px) {
  .cube-scene--inline, .cube--inline { width: 100px; height: 100px; }
  .cube-scene--inline .cube-face { width: 100px; height: 100px; }
  .cube-scene--inline .cube-face--front  { transform: rotateY(  0deg) translateZ(50px); }
  .cube-scene--inline .cube-face--back   { transform: rotateY(180deg) translateZ(50px); }
  .cube-scene--inline .cube-face--right  { transform: rotateY( 90deg) translateZ(50px); }
  .cube-scene--inline .cube-face--left   { transform: rotateY(-90deg) translateZ(50px); }
  .cube-scene--inline .cube-face--top    { transform: rotateX( 90deg) translateZ(50px); }
  .cube-scene--inline .cube-face--bottom { transform: rotateX(-90deg) translateZ(50px); }
  .cube-scene--inline .cube-face::after { display: none; }
}
.cube.paused { /* JS checks this class to pause auto-rotate */ }

/* Exit: clean fade + gentle scale-down. No rotation, no per-face bending. */
.cube-stage.cube-exiting {
  animation: cube-stage-out 600ms cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
@keyframes cube-stage-out {
  0%   { opacity: 1; transform: scale(1); }
  100% { opacity: 0; transform: scale(0.95); }
}

/* Handoff: fade caption + backdrop but keep cube visible while we move it. */
.cube-stage.cube-exiting-caption .cube-caption { opacity: 0; transition: opacity 400ms ease; }
.cube-stage.cube-exiting-caption { background: transparent; transition: background 400ms ease; }

.cube-face {
  position: absolute;
  width: 320px;
  height: 320px;
  background-color: #050705;
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  border: 1px solid var(--green);
  box-shadow:
    inset 0 0 40px rgba(0, 255, 65, 0.22),
    0 0 20px rgba(0, 255, 65, 0.25);
  opacity: 0.96;
  pointer-events: none; /* drag on .cube-scene, not on faces */
}
.cube-face::after {
  content: attr(data-site);
  position: absolute;
  bottom: 8px;
  left: 10px;
  color: var(--green);
  font: 500 12px/1 var(--mono);
  letter-spacing: 1px;
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.9), var(--glow);
  background: rgba(0,0,0,0.6);
  padding: 3px 6px;
  border: 1px solid var(--green-deep);
}

.cube-face--front  { transform: rotateY(  0deg) translateZ(160px); background-image: url('/assets/cube-faces/talleyai.png'); }
.cube-face--back   { transform: rotateY(180deg) translateZ(160px); background-image: url('/assets/cube-faces/callsyne.png'); }
.cube-face--right  { transform: rotateY( 90deg) translateZ(160px); background-image: url('/assets/cube-faces/cadence.png'); }
.cube-face--left   { transform: rotateY(-90deg) translateZ(160px); background-image: url('/assets/cube-faces/shattered_realm.png'); }
.cube-face--top    { transform: rotateX( 90deg) translateZ(160px); background-image: url('/assets/cube-faces/portfolio.png'); }
.cube-face--bottom { transform: rotateX(-90deg) translateZ(160px); background-image: url('/assets/cube-faces/sacredforgetting.png'); }

.cube-caption {
  margin-top: 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--green-dim);
  font-size: 13px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-shadow: var(--glow);
}
.cube-hint::before { content: '> '; color: var(--green); }
.cube-skip {
  color: var(--amber);
  text-shadow: 0 0 4px rgba(255, 191, 0, 0.35);
  cursor: pointer;
  user-select: none;
  padding: 3px 8px;
  border: 1px solid rgba(255, 191, 0, 0.45);
}
.cube-skip:hover { background: rgba(255, 191, 0, 0.12); color: #fff; }

@media (max-width: 560px) {
  .cube-scene, .cube { width: 220px; height: 220px; }
  .cube-face { width: 220px; height: 220px; }
  .cube-face--front  { transform: rotateY(  0deg) translateZ(110px); }
  .cube-face--back   { transform: rotateY(180deg) translateZ(110px); }
  .cube-face--right  { transform: rotateY( 90deg) translateZ(110px); }
  .cube-face--left   { transform: rotateY(-90deg) translateZ(110px); }
  .cube-face--top    { transform: rotateX( 90deg) translateZ(110px); }
  .cube-face--bottom { transform: rotateX(-90deg) translateZ(110px); }
}

/* ----------------- Link popover ----------------- */
.link-popover {
  position: fixed;
  z-index: 50;
  pointer-events: none;
  background: rgba(6, 8, 6, 0.95);
  border: 1px solid var(--green-deep);
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.8), 0 0 12px rgba(0, 255, 65, 0.25);
  padding: 6px;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  max-width: 320px;
  font-size: 12px;
}
.link-popover.on {
  opacity: 1;
  transform: translateY(0);
}
.link-popover img {
  display: block;
  max-width: 300px;
  max-height: 170px;
  object-fit: cover;
  border: 1px solid var(--green-deep);
}
.link-popover .lp-label {
  color: var(--green);
  padding: 4px 4px 2px;
  font-size: 11px;
  letter-spacing: 1px;
}

/* ----------------- Responsive ----------------- */
@media (max-width: 900px) {
  .term-window { width: 88vw; }
}
@media (max-width: 768px) {
  html, body { font-size: 14px; }
  .topbar { padding: 0 12px; font-size: 12px; }
  .term-window { width: 94vw; top: 48px; bottom: 10px; }
  .terminal { padding: 10px 14px; }
  .prompt-form { padding: 8px 14px 12px; }
  .banner { font-size: 11px; }
}

@media (max-width: 640px) {
  .term-window {
    width: auto;
    left: 8px;
    right: 8px;
    transform: none;
    max-width: none;
    min-width: 0;
  }
  /* When not centered via transform, the entering animation can't use
     translateX(-50%) — override with a plain translateY fade. */
  .term-window.entering {
    animation: term-enter-mobile 600ms cubic-bezier(0.2, 0.9, 0.2, 1) both;
  }
  @keyframes term-enter-mobile {
    0%   { opacity: 0; transform: translateY(20px); }
    100% { opacity: 1; transform: translateY(0); }
  }
}

@media (max-width: 480px) {
  html, body { font-size: 13px; }
  .topbar { font-size: 11px; height: 36px; padding: 0 8px; }
  body { padding-top: 36px; }
  .term-window {
    top: 40px;
    bottom: 8px;
    left: 8px;
    right: 8px;
  }
  .terminal { padding: 8px 10px; }
  .prompt-form { padding: 8px 10px 10px; }
  .banner { font-size: 8px; letter-spacing: 0; line-height: 1.1; }
  .tagline { font-size: 11px; }
  .kv { flex-direction: column; gap: 0; }
  .kv .k { min-width: 0; }
  .prompt-input, .cursor, .prompt-mirror { font-size: 14px; }

  /* Skill bars: shrink bar width + wrap name column */
  .skill-bars {
    white-space: pre-wrap;
    font-size: 11px;
    line-height: 1.45;
  }
  .skill-bar-row { white-space: pre-wrap; }

  /* Project links wrap instead of forcing overflow */
  .project .p-desc { word-break: break-word; }

  /* Headshot + meta stack vertically at super narrow widths */
  .headshot-row { flex-direction: column; align-items: flex-start; gap: 8px; }

  /* Terminal chrome title can be cramped; shrink slightly */
  .chrome-title { font-size: 11px; letter-spacing: 0.5px; }
}

/* ----------------- v8 typewriter reveal ----------------- */
/* Elements in the middle of being revealed start fully hidden via clip-path
 * and animate to fully visible. The "pending" state hides them instantly
 * before the first requestAnimationFrame kick. */
.tw-pending {
  clip-path: inset(0 100% 0 0);
  -webkit-clip-path: inset(0 100% 0 0);
}
.tw-revealing {
  /* Transition is set inline by JS so duration can vary per element. */
  will-change: clip-path;
}

/* Selection */
::selection { background: var(--green); color: #000; text-shadow: none; }

/* Scrollbar — only the terminal inner scrolls */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #000; }
::-webkit-scrollbar-thumb { background: var(--green-deep); }
::-webkit-scrollbar-thumb:hover { background: var(--green-dim); }

/* ---- music / audio card (v9 / v12) ---- */
.audio-card {
  border: 1px solid var(--green-deep);
  padding: 10px 12px;
  margin: 10px 0;
  background: rgba(0, 20, 0, 0.25);
  box-shadow: 0 0 12px rgba(0, 255, 65, 0.08) inset;
}
.audio-card .ac-label {
  display: block;
  font-size: 0.82rem;
  color: var(--green-dim);
  letter-spacing: 2px;
  margin-bottom: 6px;
  text-transform: uppercase;
}
.audio-card audio {
  width: 100%;
  height: 36px;
  filter: hue-rotate(90deg) saturate(0.7) brightness(0.9);
  background: #000;
}
.audio-card iframe {
  width: 100%;
  border: 0;
  background: #000;
}
.audio-card .ac-note {
  display: block;
  margin-top: 6px;
  color: var(--green-dim);
  font-size: 0.78rem;
}
