html, body { height: 100%; margin: 0; background: #050409; overflow: hidden; color: #ece6f5; }
a { color: #f2cf7a; }
a:hover { color: #fff; }
button { font: inherit; }

/* Hover states (the prototype's style-hover attributes; !important beats the inline styles) */
.hv-icon:hover  { color: #f2cf7a !important; border-color: rgba(242,207,122,0.6) !important; }
.hv-pill:hover  { background: #f2cf7a !important; color: #1a1206 !important; }
.hv-ghost:hover { color: #f2cf7a !important; border-color: #f2cf7a !important; }
.hv-enter:hover { box-shadow: 0 0 40px rgba(242,207,122,0.7),0 0 110px rgba(150,100,255,0.55) !important; transform: scale(1.04) !important; }
.hv-link:hover  { color: #f2cf7a !important; }
.hv-close:hover { color: #fff !important; }
.hv-visit:hover { background: #fff !important; color: #1a1206 !important; }
.hv-nav:hover   { border-color: #f2cf7a !important; color: #f2cf7a !important; }

/* Project cards (built from projects.js by app.js) */
.card {
  position: absolute; left: 0; top: 0; width: clamp(128px,12.5vw,196px); opacity: 0; cursor: pointer;
  will-change: transform,opacity; border-radius: 14px; padding: 1.5px; box-sizing: border-box;
  box-shadow: 0 12px 40px rgba(0,0,0,0.55),0 0 24px rgba(150,100,255,0.18);
  pointer-events: none; /* not interactive until the snap makes the cards live */
}
.cards-live .card { pointer-events: auto; }
.card:hover { box-shadow: 0 0 0 1px rgba(242,207,122,0.5),0 0 50px rgba(180,140,255,0.6),0 20px 60px rgba(0,0,0,0.6); }
.card-border { position: absolute; inset: 0; border-radius: 14px; overflow: hidden; background: rgba(190,160,255,0.22); }
.card-spin {
  position: absolute; left: -50%; top: -50%; width: 200%; height: 200%;
  background: conic-gradient(from 0deg, transparent 0deg, #b48cff 35deg, transparent 80deg, transparent 180deg, #f2cf7a 215deg, transparent 260deg);
}
.card-panel {
  position: relative; border-radius: 12.5px; overflow: hidden;
  background: linear-gradient(180deg,rgba(30,22,52,0.97),rgba(12,9,22,0.98));
  padding: 10px; display: flex; flex-direction: column; gap: 10px;
}
.card-shine {
  position: absolute; top: 0; bottom: 0; left: 0; width: 100%; pointer-events: none;
  background: linear-gradient(105deg, transparent 30%, rgba(255,240,210,0.16) 45%, rgba(180,140,255,0.22) 52%, transparent 66%);
  transform: translateX(-110%);
}
.card-meta {
  position: relative; display: flex; justify-content: space-between;
  font: 500 10px/1 'JetBrains Mono','Noto Sans TC',monospace; letter-spacing: 0.12em; color: rgba(230,220,255,0.7);
}
.card-cover {
  position: relative; aspect-ratio: 4/3; border-radius: 8px; overflow: hidden;
  background: repeating-linear-gradient(135deg,rgba(180,140,255,0.16) 0 6px,rgba(180,140,255,0.04) 6px 12px);
  border: 1px solid rgba(180,140,255,0.18); display: flex; align-items: flex-end; padding: 8px; box-sizing: border-box;
  font: 400 9px/1 'JetBrains Mono','Noto Sans TC',monospace; color: rgba(230,220,255,0.55); letter-spacing: 0.08em;
}
.card-cover > span { position: relative; }
.card-cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.card-sig { position: absolute; left: 50%; top: 50%; width: 58%; aspect-ratio: 1; margin-left: -29%; margin-top: -29%; opacity: 0.5; }
.card-text { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 0 2px 2px; }
.card-title { font: 400 22px/1.05 'Instrument Serif','Noto Serif TC',serif; color: #f4efe6; }
.card-cat { font: 500 10px/1.2 'JetBrains Mono','Noto Sans TC',monospace; letter-spacing: 0.1em; text-transform: uppercase; color: #f2cf7a; }

/* Headline words (built by app.js in the current language) */
.hw { display: inline-block; opacity: 0; }
.hw-acc {
  background: linear-gradient(100deg,#f2cf7a 0%,#f2cf7a 40%,#fff8e6 50%,#f2cf7a 60%,#f2cf7a 100%);
  background-size: 300% 100%; background-position: 100% 0; -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: 0.08em; filter: drop-shadow(0 2px 14px rgba(5,4,9,0.95)) drop-shadow(0 0 2px rgba(5,4,9,0.8));
}

/* Compositor layers (perf): the hair sway and the eyes change every frame, so they get their own layers
   and the big magician image underneath is not re-rasterised every frame */
#hair, #pupilL, #pupilR, #arcL, #arcR, #sqL, #sqR { will-change: transform; }

/* Loader intro sentence (built and "spark-written" by app.js; transform/opacity animations only) */
.load-intro { max-width: min(94vw, 860px); padding: 0 8px; box-sizing: border-box; margin: -6px 0 -4px; text-align: center; font: 400 clamp(22px,3vw,34px)/1.3 'Instrument Serif','Noto Serif TC',serif; color: #f6f1ea; }
.li-line { position: relative; }
.li-2 { font-style: italic; color: #f2cf7a; margin-top: 0.12em; }
.li-seg { display: inline-block; white-space: nowrap; }
.li-u { position: relative; display: inline-block; }
.li-t { display: inline-block; opacity: 0; }
.li-glow { position: absolute; left: 0; top: 0; white-space: nowrap; opacity: 0; pointer-events: none; color: #fff3cf; text-shadow: 0 0 8px rgba(242,207,122,0.95), 0 0 22px rgba(180,140,255,0.7); }
.li-sweep { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.li-band { position: absolute; top: 0; bottom: 0; left: 0; overflow: hidden; -webkit-mask-image: linear-gradient(90deg, transparent, #000 50%, transparent); mask-image: linear-gradient(90deg, transparent, #000 50%, transparent); }
.li-copy { position: absolute; top: 0; left: 0; }
.li-copy .li-t { opacity: 1; color: #fff8e6; }
.li-copy .li-glow { display: none; }
@media (prefers-reduced-motion: reduce) { .li-t { opacity: 1; } }
