:root{
  --bg1:#0b1020;
  --bg2:#0b1b3a;
  --card: rgba(255,255,255,.08);
  --border: rgba(255,255,255,.14);
  --text:#eaf0ff;
  --muted: rgba(234,240,255,.75);
  --accent:#7c5cff;
  --accent2:#2ee9a6;
  --shadow: 0 20px 60px rgba(0,0,0,.45);
  --radius: 18px;
}

*{ box-sizing:border-box; }
html,body{ min-height:100%; }

body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji","Segoe UI Emoji";
  color:var(--text);
  background:
    radial-gradient(1200px 800px at 20% 15%, rgba(124,92,255,.35), transparent 55%),
    radial-gradient(900px 700px at 80% 70%, rgba(46,233,166,.20), transparent 60%),
    linear-gradient(135deg, var(--bg1), var(--bg2));
  overflow-x:hidden;
  overflow-y:auto;
}

/* subtle animated grain */
body::before{
  content:"";
  position:fixed;
  inset:0;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='.25'/%3E%3C/svg%3E");
  opacity:.10;
  pointer-events:none;
  mix-blend-mode:overlay;
  animation: drift 12s linear infinite;
}
@keyframes drift { from{transform:translate3d(0,0,0)} to{transform:translate3d(-80px,-80px,0)} }

.wrap{
  min-height:100%;
  display:grid;
  place-items:center;
  padding:clamp(20px, 4vw, 48px);
}

.card{
  width:min(980px, 100%);
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  overflow:hidden;
  position:relative;
}

.spark{
  position:absolute;
  inset:-2px;
  pointer-events:none;
  background:
    radial-gradient(600px 250px at 20% 0%, rgba(124,92,255,.22), transparent 60%),
    radial-gradient(600px 250px at 80% 100%, rgba(46,233,166,.16), transparent 60%);
  filter: blur(10px);
  opacity:.9;
}

/* NEW HEADER (replaces old topbar) */
.header{
  position:relative;
  padding: 26px 22px 18px;
  border-bottom:1px solid rgba(255,255,255,.10);
}

/* STORY MODE */
.story{
  padding: 18px 22px 10px;
  border-bottom:1px solid rgba(255,255,255,.10);
}
.story-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:12px;
}
.story-kicker{
  font-size:11px;
  letter-spacing:.3em;
  text-transform:uppercase;
  color: rgba(234,240,255,.55);
}
.story-title{
  font-size:14px;
  font-weight:700;
  color: rgba(234,240,255,.85);
}
.story-scroll{
  font-size:12px;
  color: rgba(234,240,255,.6);
  margin: 0 0 12px;
}
.story-track{
  position:relative;
  display:grid;
  gap:16px;
  padding:6px 10px 6px 30px;
  max-height: min(420px, 60vh);
  overflow-y:auto;
  scrollbar-gutter: stable;
  background: rgba(0,0,0,.08);
  border-radius:14px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(124,92,255,.6) rgba(0,0,0,.2);
}
.story-track::before{
  display:none;
}
.story-track::-webkit-scrollbar{
  width:8px;
}
.story-track::-webkit-scrollbar-track{
  background: rgba(0,0,0,.2);
  border-radius:999px;
}
.story-track::-webkit-scrollbar-thumb{
  background: linear-gradient(180deg, rgba(124,92,255,.8), rgba(46,233,166,.7));
  border-radius:999px;
}
.story-level{
  position:relative;
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:14px 16px;
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  overflow:visible;
}
.js .story-level{
  opacity:0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
}
.js .story-level.is-visible{
  opacity:1;
  transform: translateY(0);
}
.story-level::before{
  content:"";
  position:absolute;
  left:-22px;
  top:22px;
  width:12px;
  height:12px;
  border-radius:50%;
  background: #0b1020;
  border:2px solid rgba(124,92,255,.75);
  box-shadow: 0 0 10px rgba(124,92,255,.35);
}
.story-level::after{
  content:"";
  position:absolute;
  left:-16px;
  top:34px;
  bottom:-18px;
  width:2px;
  background: linear-gradient(180deg, rgba(124,92,255,.6), rgba(46,233,166,.4));
  opacity:.7;
}
.story-level:last-child::after{
  display:none;
}
.story-badge{
  font-size:12px;
  font-weight:800;
  padding:6px 10px;
  border-radius:999px;
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(46,233,166,.85));
  color:#07101f;
  white-space:nowrap;
}
.story-level.is-locked{
  opacity:.7;
}
.story-level.is-locked .story-badge{
  background: rgba(255,255,255,.18);
  color: var(--text);
}
.story-chapter{
  font-size:11px;
  letter-spacing:.2em;
  text-transform:uppercase;
  color: rgba(234,240,255,.55);
  margin-bottom:6px;
}
.story-body{
  position:relative;
  z-index:1;
}
.story-h2{
  margin:0 0 6px;
  font-size:16px;
  letter-spacing:.2px;
}
.story-text{
  margin:0;
  color:var(--muted);
  font-size:14px;
}
.story-boost{
  margin-top:10px;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(124,92,255,.35);
  background: rgba(124,92,255,.12);
  color: rgba(234,240,255,.9);
  font-size:13px;
  animation: boost-pulse 2.4s ease-in-out infinite;
}
.story-boost span{
  font-weight:800;
}
.story-boost.is-hype{
  background: linear-gradient(135deg, rgba(124,92,255,.35), rgba(46,233,166,.18));
  border-color: rgba(124,92,255,.65);
  box-shadow: 0 0 18px rgba(124,92,255,.28);
}
.story-boost.is-alt{
  background: linear-gradient(135deg, rgba(46,233,166,.28), rgba(255,184,77,.24));
  border-color: rgba(46,233,166,.6);
}
.story-boost.is-relief{
  background: linear-gradient(135deg, rgba(46,233,166,.28), rgba(66,165,245,.18));
  border-color: rgba(46,233,166,.65);
}
.story-boost.is-fear{
  background: linear-gradient(135deg, rgba(255,193,7,.22), rgba(255,138,101,.2));
  border-color: rgba(255,193,7,.55);
}
.story-boost.is-pressure{
  background: linear-gradient(135deg, rgba(255,99,99,.28), rgba(124,92,255,.18));
  border-color: rgba(255,99,99,.6);
}
.story-boost.is-frustrated{
  background: linear-gradient(135deg, rgba(255,99,99,.25), rgba(255,193,7,.18));
  border-color: rgba(255,99,99,.6);
}
.story-boost.is-hope{
  background: linear-gradient(135deg, rgba(46,233,166,.32), rgba(124,92,255,.2));
  border-color: rgba(46,233,166,.7);
}
.story-boost.is-uncertain{
  background: linear-gradient(135deg, rgba(255,193,7,.2), rgba(124,92,255,.18));
  border-color: rgba(255,193,7,.55);
}
.story-boost.is-tense{
  background: linear-gradient(135deg, rgba(255,99,99,.22), rgba(46,233,166,.16));
  border-color: rgba(255,99,99,.55);
}
.story-boost.is-wonder{
  background: linear-gradient(135deg, rgba(124,92,255,.28), rgba(66,165,245,.2));
  border-color: rgba(124,92,255,.6);
}
.story-boost.is-quirk{
  background: linear-gradient(135deg, rgba(46,233,166,.22), rgba(255,184,77,.22));
  border-color: rgba(46,233,166,.6);
}
.story-unlock{
  margin-top:12px;
  font-size:11px;
  letter-spacing:.25em;
  text-transform:uppercase;
  color: rgba(234,240,255,.6);
}
.story-skills{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:8px;
}
.story-skills span{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.85);
}
.story-orb{
  position:absolute;
  right:-24px;
  top:50%;
  width:100px;
  height:100px;
  transform: translateY(-50%);
  background: radial-gradient(circle at 30% 30%, rgba(46,233,166,.55), rgba(124,92,255,0) 70%);
  opacity:.5;
  filter: blur(2px);
}

@keyframes boost-pulse{
  0%, 100%{ box-shadow: 0 0 0 rgba(124,92,255,.0); }
  50%{ box-shadow: 0 0 16px rgba(124,92,255,.35); }
}

.hero{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 2.5rem;
}

.hero-text h1{
  margin:0 0 10px;
  font-size: clamp(28px, 3.6vw, 46px);
  line-height:1.05;
  letter-spacing:-.6px;
}

.gradient{
  background: linear-gradient(90deg, #ffffff, rgba(255,255,255,.85), rgba(46,233,166,.95));
  -webkit-background-clip:text;
  background-clip:text;
  color:transparent;
}

.hero-sub{
  margin: 0 0 16px;
  color: rgba(234,240,255,.75);
  font-size: 16px;
  line-height: 1.55;
}

/* Image – clean */
.hero-image img{
  max-width: 220px;
  width:100%;
  height:auto;
  display:block;
}

/* CTA buttons */
.cta{
  display:flex;
  flex-wrap:wrap;
  gap:12px;
  margin-top:10px;
}

.btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.16);
  background: rgba(0,0,0,.20);
  color:var(--text);
  padding:12px 14px;
  border-radius:14px;
  cursor:pointer;
  text-decoration:none;
  display:inline-flex;
  align-items:center;
  gap:10px;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
  user-select:none;
}

.btn:hover{
  transform: translateY(-1px);
  border-color: rgba(255,255,255,.24);
  background: rgba(0,0,0,.26);
}

.btn.primary{
  background: linear-gradient(135deg, rgba(124,92,255,.95), rgba(46,233,166,.85));
  border-color: rgba(255,255,255,.20);
  color:#07101f;
  font-weight:800;
}
.btn.primary:hover{ transform: translateY(-2px); }

.btn.is-disabled{
  opacity:.55;
  cursor:not-allowed;
}
.btn.is-disabled:hover{
  transform:none;
  border-color: rgba(255,255,255,.16);
  background: rgba(0,0,0,.20);
}

/* GRID CONTENT (Quick info starts here = same level as summary) */
.content{
  display:grid;
  grid-template-columns: 1.25fr .9fr;
  gap:22px;
  padding:22px 22px 22px;
}

@media (max-width: 860px){
  .content{ grid-template-columns:1fr; }
}

/* text basics */
p{
  margin:0 0 18px;
  color:var(--muted);
  font-size:16px;
  line-height:1.55;
}

.section{
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid rgba(255,255,255,.10);
}

.h2{
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: .2px;
}

.muted{ color: var(--muted); }

/* RIGHT PANEL */
.panel{
  background: rgba(0,0,0,.18);
  border:1px solid rgba(255,255,255,.12);
  border-radius:16px;
  padding:16px;
}

.panel-title{
  font-weight:800;
  margin-bottom:10px;
}

.kv{
  display:grid;
  grid-template-columns: 110px 1fr;
  gap:10px 12px;
  font-size:14px;
  color:var(--muted);
}
.kv b{ color: var(--text); font-weight:800; }

.pill{
  display:inline-flex;
  gap:8px;
  flex-wrap:wrap;
  margin-top:12px;
}
.pill span{
  font-size:12px;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.85);
}

.footer{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:14px 22px 18px;
  border-top:1px solid rgba(255,255,255,.10);
  color:rgba(234,240,255,.6);
  font-size:12px;
  flex-wrap:wrap;
}

.job{
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
}

.job-top{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:12px;
}

.job-title{ font-weight: 850; }
.job-meta{
  margin-top: 4px;
  font-size: 12px;
  color: rgba(234,240,255,.65);
}

.tag{
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.14);
  background: rgba(255,255,255,.06);
  color: rgba(234,240,255,.85);
  white-space: nowrap;
}

.list{
  margin: 10px 0 0;
  padding-left: 18px;
  color: rgba(234,240,255,.78);
  line-height: 1.55;
  font-size: 14px;
}
.list li{ margin: 6px 0; }

.subhead{
  margin-top: 14px;
  font-size: 12px;
  color: rgba(234,240,255,.6);
  margin-bottom: 8px;
}

.note{
  margin-top: 14px;
  color: rgba(234,240,255,.7);
  font-size: 13px;
  line-height: 1.5;
  background: rgba(0,0,0,.14);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 16px;
  padding: 12px;
}

/* Responsive header */
@media (max-width: 900px){
  .hero{
    flex-direction:column-reverse;
    text-align:center;
  }
  .cta{ justify-content:center; }
  .hero-image img{
    max-width: 180px;
    margin: 0 auto;
  }
}
@media (max-width: 700px){
  .story-head{
    flex-direction:column;
    align-items:flex-start;
  }
  .story-track{
    padding:6px 8px;
    max-height: 60vh;
  }
  .story-track::before,
  .story-level::before{
    display:none;
  }
  .story-level{
    flex-direction:column;
    align-items:flex-start;
  }
}
/* Ninja bubble + shuriken (UPDATED) */
.hero-image{
  position: relative;
  cursor: pointer;
  display: inline-block;
}

/* Hover effect on image */
.hero-image img{
  transition: transform .18s ease, filter .18s ease;
}
.hero-image:hover img{
  transform: translateY(-2px) scale(1.02);
  filter: drop-shadow(0 14px 30px rgba(124,92,255,.25));
}

/* Speech bubble LEFT of the image */
.ninja-bubble{
  position:absolute;
  top: 18%;
  right: calc(100% + 14px);   /* place bubble to the LEFT */
  background: rgb(255, 253, 253);
  color:#570758;
  padding:10px 14px;
  border-radius:14px;
  font-size:13px;
  white-space:nowrap;
  opacity:0;
  transform: translateX(10px) scale(.95);
  pointer-events:none;
  transition: all .25s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,.4);
}

.ninja-bubble::after{
  content:"";
  position:absolute;
  top: 18px;
  right: -6px;               /* arrow points to image */
  width:12px;
  height:12px;
  background: rgba(0,0,0,.85);
  transform: rotate(45deg);
}

/* Bigger shuriken centered on image */
.shuriken{
  position:absolute;
  top:60%;
  left:5%;
  width:56px;       /* bigger */
  height:56px;      /* bigger */
  border-radius:50%;
  background:
    conic-gradient(
      from 0deg,
      #ddd 0 10%,
      transparent 10% 25%,
      #ddd 25% 35%,
      transparent 35% 50%,
      #ddd 50% 60%,
      transparent 60% 75%,
      #ddd 75% 85%,
      transparent 85% 100%
    );
  opacity:0;
  pointer-events:none;
  filter: drop-shadow(0 10px 18px rgba(0,0,0,.45));
}

/* Active state (triggered by JS) */
.hero-image.active .ninja-bubble{
  opacity:1;
  transform: translateX(0) scale(1);
}

.hero-image.active .shuriken{
  animation: shuriken-fly-left 1s ease-out forwards;
}

@keyframes shuriken-fly-left{
  0%{
    opacity:1;
    transform: translate(-50%,-50%) rotate(0deg) scale(1);
  }
  100%{
    opacity:0;
    transform: translate(-220px,-70px) rotate(-900deg) scale(.6); /* fly LEFT */
  }
}

/* Mobile: bubble should appear above (space constraints) */
@media (max-width: 900px){
  .ninja-bubble{
    top: auto;
    bottom: 110%;
    right: 50%;
    transform: translate(50%, 10px) scale(.95);
    white-space: normal;
    width: max-content;
    max-width: 220px;
    text-align: center;
  }
  .ninja-bubble::after{
    top:auto;
    bottom:-6px;
    right: 50%;
    transform: translateX(50%) rotate(45deg);
  }
  .hero-image.active .ninja-bubble{
    transform: translate(50%, 0) scale(1);
  }
}

/* === HERO TITLE ANIMATION === */
.hero-text h1{
  opacity: 0;
  transform: translateY(14px);
  animation: hero-title-in .9s ease-out forwards;
}

.hero-text .gradient{
  animation: name-glow 2.4s ease-in-out infinite alternate;
}

/* Subtitle comes slightly later */
.hero-sub{
  opacity: 0;
  transform: translateY(10px);
  animation: hero-sub-in .9s ease-out forwards;
  animation-delay: .25s;
}

@keyframes hero-title-in{
  to{
    opacity:1;
    transform: translateY(0);
  }
}

@keyframes hero-sub-in{
  to{
    opacity:1;
    transform: translateY(0);
  }
}

@keyframes name-glow{
  0%{
    text-shadow: 0 0 0 rgba(46,233,166,0);
  }
  100%{
    text-shadow: 0 0 18px rgba(46,233,166,.35);
  }
}
/* === HERO IMAGE ANIMATION + HOVER === */
.hero-image img{
  opacity: 0;
  transform: translateY(14px) scale(.98);
  animation: hero-img-in .9s ease-out forwards;
  animation-delay: .15s;

  /* hover + smooth */
  transition: transform .18s ease, filter .18s ease;
  will-change: transform, filter;
}

@keyframes hero-img-in{
  to{
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

/* hover: subtle lift + glow */
.hero-image:hover img{
  transform: translateY(-3px) scale(1.03);
  filter: drop-shadow(0 16px 34px rgba(124,92,255,.28));
}

/* optional: reduce motion for accessibility */
@media (prefers-reduced-motion: reduce){
  .hero-text h1,
  .hero-sub,
  .hero-image img,
  .story-level,
  .story-boost{
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}
