/* chaewon/chaewon.css */
/* All styles below are scoped under body.chaewon-mode so they are inert
   when the mode is off. See docs/superpowers/specs/2026-04-22-chaewon-mode-design.md */

body.chaewon-mode {
  background: #000 !important;
  color: #e8e8e8 !important;
  /* The marquee bars + background text + bubbles will overlay; content gets cards via Task 3.2 */
}

body.chaewon-mode a { color: #ff89b8; }
body.chaewon-mode a:hover { color: #ffb3d1; }
body.chaewon-mode header,
body.chaewon-mode nav,
body.chaewon-mode footer {
  background: transparent !important;
}
body.chaewon-mode hr {
  border-color: rgba(255, 255, 255, 0.1);
}

.chaewon-exit {
  position: fixed;
  top: 38px;
  right: 38px;
  z-index: 9999;
  background: rgba(20, 20, 20, 0.85);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  cursor: pointer;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  transition: background 0.2s, transform 0.2s;
}

.chaewon-exit:hover {
  background: rgba(40, 40, 40, 0.95);
  transform: scale(1.05);
}

body.chaewon-mode .chaewon-card {
  background: #0a0a0a;
  border: 1px solid #1c1c1c;
  border-radius: 14px;
  padding: 18px 22px;
  margin: 16px 0;
  font-family: 'Latin Modern Roman', 'Computer Modern', Georgia, serif;
}

body.chaewon-mode .chaewon-card h2,
body.chaewon-mode .chaewon-card h3 {
  color: #fff;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 700;
}

body.chaewon-mode .chaewon-marquee {
  position: fixed;
  z-index: 50;
  background: #000;
  overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-weight: 700;
  font-size: 14px;
  color: #fff;
  pointer-events: none;
}

body.chaewon-mode .chaewon-marquee-inner {
  display: inline-block;
  white-space: nowrap;
  padding: 6px 0;
}

body.chaewon-mode .chaewon-marquee-top {
  top: 0; left: 0; right: 0;
  height: 30px;
  border-bottom: 1px solid #1a1a1a;
}
body.chaewon-mode .chaewon-marquee-top .chaewon-marquee-inner {
  animation: chaewon-marquee-x 26s linear infinite;
}

body.chaewon-mode .chaewon-marquee-bottom {
  bottom: 0; left: 0; right: 0;
  height: 30px;
  border-top: 1px solid #1a1a1a;
}
body.chaewon-mode .chaewon-marquee-bottom .chaewon-marquee-inner {
  animation: chaewon-marquee-x-reverse 26s linear infinite;
}

@keyframes chaewon-marquee-x {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
@keyframes chaewon-marquee-x-reverse {
  from { transform: translateX(-50%); }
  to   { transform: translateX(0); }
}

/* Padding-top / bottom on body so content doesn't sit under the bars */
body.chaewon-mode {
  padding-top: 30px !important;
  padding-bottom: 30px !important;
  padding-left: 30px !important;
  padding-right: 30px !important;
}

body.chaewon-mode .chaewon-marquee-left,
body.chaewon-mode .chaewon-marquee-right {
  top: 30px; bottom: 30px;
  width: 30px;
}

body.chaewon-mode .chaewon-marquee-left {
  left: 0;
  border-right: 1px solid #1a1a1a;
}
body.chaewon-mode .chaewon-marquee-right {
  right: 0;
  border-left: 1px solid #1a1a1a;
}

body.chaewon-mode .chaewon-marquee-left .chaewon-marquee-inner,
body.chaewon-mode .chaewon-marquee-right .chaewon-marquee-inner {
  writing-mode: vertical-rl;
  display: block;
  height: 200%;
  text-orientation: mixed;
}

body.chaewon-mode .chaewon-marquee-left .chaewon-marquee-inner {
  animation: chaewon-marquee-y-reverse 26s linear infinite;
}
body.chaewon-mode .chaewon-marquee-right .chaewon-marquee-inner {
  animation: chaewon-marquee-y 26s linear infinite;
}

@keyframes chaewon-marquee-y {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}
@keyframes chaewon-marquee-y-reverse {
  from { transform: translateY(-50%); }
  to   { transform: translateY(0); }
}

body.chaewon-mode .chaewon-bg {
  position: fixed;
  top: 30px; left: 30px; right: 30px; bottom: 30px;
  z-index: 0;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0.18;
  user-select: none;
  transform: rotate(-10deg) scale(1.1);
  transform-origin: center;
}

body.chaewon-mode .chaewon-bg-row {
  white-space: nowrap;
  font-size: 110px;
  font-weight: 900;
  letter-spacing: 12px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  line-height: 1.1;
}

body.chaewon-mode .chaewon-bg-row span {
  display: inline-block;
  animation: chaewon-letter-flash 3s linear infinite;
}

@keyframes chaewon-letter-flash {
  0%   { color: #ff0066; }
  20%  { color: #00ffe5; }
  40%  { color: #ffee00; }
  60%  { color: #b300ff; }
  80%  { color: #ff6a00; }
  100% { color: #ff0066; }
}

/* Ensure cards + content sit above the background */
body.chaewon-mode .chaewon-card,
body.chaewon-mode main,
body.chaewon-mode header,
body.chaewon-mode footer {
  position: relative;
  z-index: 5;
}

body.chaewon-mode .chaewon-headshot-wrap {
  position: relative;
  display: inline-block;
}

body.chaewon-mode img.chaewon-headshot {
  width: 180px;
  height: 180px;
  object-fit: cover;
  border-radius: 50%;
  border: 4px solid white;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
  animation: chaewon-breath 6s ease-in-out infinite;
}

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

body.chaewon-mode .chaewon-headshot-sticker {
  position: absolute;
  top: 35%;
  right: 12%;
  font-size: 36px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.4));
  animation: chaewon-heart-pulse 1.2s ease-in-out infinite;
  pointer-events: none;
}

@keyframes chaewon-heart-pulse {
  0%, 100% { transform: scale(1); }
  50%      { transform: scale(1.15); }
}

/* Force headshot to a circular fixed size, defeating .bio-flex img and any
   LaTeX.css max-width constraints. */
body.chaewon-mode img.chaewon-headshot {
  width: 200px !important;
  height: 200px !important;
  min-width: 200px !important;
  max-width: 200px !important;
  max-height: 200px !important;
  object-fit: cover;
  aspect-ratio: 1 / 1;
  flex-shrink: 0;
}

/* Preserve the original bio-flex layout (headshot on the right) when our
   span wrap becomes a flex item. */
body.chaewon-mode .chaewon-headshot-wrap {
  order: 2;
  flex-shrink: 0;
}

/* Zero out top-margin on the first child of any chaewon card so headings
   don't render with a big empty gap above them inside the card. */
body.chaewon-mode .chaewon-card > *:first-child {
  margin-top: 0;
}

/* Also zero out trailing margin-bottom on the last child for symmetry. */
body.chaewon-mode .chaewon-card > *:last-child {
  margin-bottom: 0;
}

/* Sillier vibes — comic-sans-core across the whole chaewon-mode tree.
   Override every prior font-family declaration in this file AND any external
   styles (LaTeX.css's serif baseline). */
body.chaewon-mode,
body.chaewon-mode * {
  font-family: "Comic Sans MS", "Comic Neue", "Chalkboard SE", cursive !important;
}

body.chaewon-mode .chaewon-trail-heart {
  position: fixed;
  pointer-events: none;
  z-index: 100;
  font-size: 14px;
  color: #ff66a3;
  transform: translate(-50%, -50%);
  animation: chaewon-trail-fade 0.7s ease-out forwards;
}
@keyframes chaewon-trail-fade {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  100% { opacity: 0; transform: translate(-50%, -180%) scale(0.6); }
}

body.chaewon-mode .chaewon-burst-heart {
  position: fixed;
  pointer-events: none;
  z-index: 99;
  font-size: 18px;
  color: #ff3388;
  transform: translate(-50%, -50%);
  animation: chaewon-burst-fly 0.8s ease-out forwards;
}
@keyframes chaewon-burst-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.6); }
  60%  { opacity: 0.9; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy))) scale(1.2); }
}

body.chaewon-mode .chaewon-card {
  transition: transform 0.18s ease-out, box-shadow 0.18s ease-out;
  will-change: transform;
}
body.chaewon-mode .chaewon-card:hover {
  box-shadow: 0 12px 32px rgba(255, 100, 140, 0.18);
}

body.chaewon-mode .chaewon-idle-popup {
  position: fixed;
  bottom: 60px;
  right: 60px;
  z-index: 200;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 16px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.6);
  animation: chaewon-idle-slide-in 0.4s ease-out;
}
body.chaewon-mode .chaewon-idle-popup img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid white;
}
body.chaewon-mode .chaewon-idle-text {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.5px;
}
body.chaewon-mode .chaewon-idle-popup.chaewon-idle-leaving {
  animation: chaewon-idle-slide-out 0.5s ease-in forwards;
}
@keyframes chaewon-idle-slide-in {
  from { opacity: 0; transform: translateX(120%); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes chaewon-idle-slide-out {
  from { opacity: 1; transform: translateX(0); }
  to   { opacity: 0; transform: translateX(120%); }
}

/* CRAZY: red overlay flashes. Uses ::after so it doesn't fight the
   body background !important from the dark theme. */
body.chaewon-mode.chaewon-egg-crazy::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 500;
  background: #ff0033;
  animation: chaewon-egg-crazy-flash 1.2s ease-out 1 forwards;
}
@keyframes chaewon-egg-crazy-flash {
  0%, 100% { opacity: 0; }
  10%, 30%, 50% { opacity: 0.75; }
  20%, 40%, 60% { opacity: 0; }
}

/* FEARLESS: petals now spawned by JS; each .chaewon-petal drifts with its own
   randomized duration, horizontal sway, and rotation. */
.chaewon-petal {
  position: fixed;
  top: -60px;
  pointer-events: none;
  z-index: 1000;
  user-select: none;
  will-change: transform, opacity;
}
@keyframes chaewon-petal-drift {
  0%   { transform: translate(0, 0) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  50%  { transform: translate(calc(var(--sway) * 0.7), 50vh) rotate(calc(var(--rot) * 0.5)); }
  100% { transform: translate(var(--sway), 115vh) rotate(var(--rot)); opacity: 0.6; }
}

/* Dim overlay shown during the laser show — fades the page (and the chaewon
   wallpaper) toward black so the beams pop. Sits between page content (z<999)
   and the laser stage (z=1000). */
.chaewon-laser-dim {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 999;
  background: #000;
  opacity: 0;
  animation: chaewon-laser-dim-in 2.6s ease-in-out 1 forwards;
}
@keyframes chaewon-laser-dim-in {
  0%   { opacity: 0; }
  18%  { opacity: 0.65; }
  82%  { opacity: 0.65; }
  100% { opacity: 0; }
}

/* ANTIFRAGILE: concert-style laser show. Two projectors at top-left and top-right,
   each emitting multiple cone-shaped beams that sweep back and forth in a fan
   motion. Beams are JS-spawned (.chaewon-laser-beam) so each can have its own
   angle, delay, and sweep range. */
.chaewon-laser-stage {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  isolation: isolate;     /* establishes a stacking context — mix-blend-mode below
                             stays scoped to siblings within this stage */
  overflow: hidden;
}

.chaewon-laser-beam {
  position: absolute;
  top: 0;
  width: 30vw;
  height: 130vh;
  /* Cone shape — narrow at top (the projector point), wide at bottom (the floor) */
  clip-path: polygon(48% 0, 52% 0, 100% 100%, 0 100%);
  background: linear-gradient(
    180deg,
    rgba(255, 0, 153, 0.85) 0%,
    rgba(255, 0, 153, 0.45) 25%,
    rgba(255, 0, 153, 0.18) 60%,
    rgba(255, 0, 153, 0)    100%
  );
  filter: blur(14px);
  transform-origin: 50% 0;
  transform: translateX(-50%) rotate(var(--base-angle));
  opacity: 0;
  animation: chaewon-laser-fan 2.6s ease-in-out 1 forwards;
  mix-blend-mode: screen;  /* now blends only with sibling beams in the stage */
}

@keyframes chaewon-laser-fan {
  0%   { transform: translateX(-50%) rotate(calc(var(--base-angle) - var(--sweep-amount))); opacity: 0; }
  12%  { opacity: 1; }
  50%  { transform: translateX(-50%) rotate(calc(var(--base-angle) + var(--sweep-amount))); opacity: 1; }
  88%  { opacity: 1; }
  100% { transform: translateX(-50%) rotate(calc(var(--base-angle) - var(--sweep-amount))); opacity: 0; }
}

/* EASY: glow on photos (unchanged). */
body.chaewon-mode.chaewon-egg-easy img {
  animation: chaewon-easy-glow 1.5s ease-in-out;
}
@keyframes chaewon-easy-glow {
  0%, 100% { filter: none; }
  50%      { filter: brightness(1.3) drop-shadow(0 0 10px #ffe0a3); }
}

/* PERFECTNIGHT: stars now spawned by JS at random positions, each twinkling on
   its own schedule. */
.chaewon-star {
  position: fixed;
  pointer-events: none;
  z-index: 1000;
  color: #fff;
  text-shadow: 0 0 6px rgba(255, 255, 255, 0.85);
  user-select: none;
  opacity: 0;
  will-change: transform, opacity;
}
@keyframes chaewon-star-twinkle {
  0%   { opacity: 0; transform: scale(0.4); }
  45%  { opacity: 1; transform: scale(1.35); }
  100% { opacity: 0; transform: scale(0.5); }
}
