/* Reportwall funnel skins — one night-time base, four funnel worlds.
   Themes key off body[data-theme=<funnel.theme>]; components are .rw-*
   custom classes so nothing depends on new Tailwind utilities. */

:root {
  --rw-serif: "AppleMyungjo", "Nanum Myeongjo", "Noto Serif KR", "Noto Serif CJK KR", serif;
}

/* ---- funnel worlds ---- */
body[data-theme] {
  --bg: #131318;
  --surface: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.12);
  --ink: #f2eee9;
  --muted: rgba(242, 238, 233, 0.55);
  --accent: #b8a6ff;
  --accent-ink: #17131f;
  --glow: rgba(184, 166, 255, 0.16);
  background: var(--bg);
  color: var(--ink);
}

body[data-theme="shadow-love"] {
  --bg: #14101d;
  --accent: #b18cff;
  --accent-ink: #180f28;
  --glow: rgba(177, 140, 255, 0.17);
}

body[data-theme="kabbalah"] {
  --bg: #0e1424;
  --accent: #d9b45b;
  --accent-ink: #191303;
  --glow: rgba(217, 180, 91, 0.15);
}

body[data-theme="jung"] {
  --bg: #16130f;
  --accent: #e0a458;
  --accent-ink: #1d1305;
  --glow: rgba(224, 164, 88, 0.15);
}

body[data-theme="sexless"] {
  --bg: #1a1214;
  --accent: #ff8f7a;
  --accent-ink: #240d08;
  --glow: rgba(255, 143, 122, 0.15);
}

body[data-theme="question-relay"] {
  --bg: #101817;
  --accent: #7bdac7;
  --accent-ink: #071817;
  --glow: rgba(123, 218, 199, 0.15);
}

/* ambient accent light behind the column */
body[data-theme] {
  background-image: radial-gradient(60vh 60vh at 50% -8vh, var(--glow), transparent 70%);
  background-repeat: no-repeat;
}

/* ---- primitives ---- */
.rw-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.rw-medallion {
  width: 4.25rem;
  height: 4.25rem;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  color: var(--accent);
  font-size: 1.9rem;
  box-shadow: 0 0 34px var(--glow), inset 0 0 18px var(--glow);
}

.rw-name {
  font-family: var(--rw-serif);
  font-size: 2.15rem;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
  text-shadow: 0 0 26px var(--glow);
  overflow-wrap: break-word;
}

.rw-serif { font-family: var(--rw-serif); }

.rw-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1.25rem;
}

.rw-btn {
  display: block;
  width: 100%;
  text-align: center;
  background: var(--accent);
  color: var(--accent-ink);
  border-radius: 0.9rem;
  padding: 1rem 1.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  border: 0;
  cursor: pointer;
  transition: transform 0.08s ease, filter 0.15s ease;
}
.rw-btn:active { transform: scale(0.985); }
.rw-btn:hover { filter: brightness(1.06); }

.rw-ghost {
  color: var(--muted);
  font-size: 0.8rem;
}

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

/* ---- quiz ---- */
.rw-progress {
  height: 3px;
  border-radius: 9999px;
  background: var(--line);
  overflow: hidden;
}
.rw-progress > span {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 9999px;
  transition: width 0.3s ease;
}

.rw-option {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.95rem 1.1rem;
  color: var(--ink);
  font-size: 0.98rem;
  line-height: 1.5;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease, transform 0.08s ease;
}
.rw-option:hover {
  border-color: color-mix(in srgb, var(--accent) 60%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}
.rw-option:active { transform: scale(0.99); }

.rw-question-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  width: 100%;
  min-height: 4.7rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  background: var(--surface);
  color: var(--ink);
  line-height: 1.55;
  cursor: pointer;
}

.rw-question-option input {
  flex: 0 0 auto;
  margin-top: 0.25rem;
  accent-color: var(--accent);
}

.rw-question-option:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: 0 0 20px var(--glow);
}

.rw-textarea {
  min-height: 8.5rem;
  line-height: 1.65;
  resize: vertical;
}

.rw-answer-pair {
  display: grid;
  gap: 0.8rem;
}

.rw-answer-card {
  min-height: 7rem;
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 1rem 1.1rem;
  background: var(--surface);
}

.rw-answer-text {
  margin: 0.35rem 0 0;
  color: var(--ink);
  line-height: 1.75;
  overflow-wrap: break-word;
}

.rw-guide {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.rw-guide-avatar {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 11%, transparent);
  color: var(--accent);
  font-family: var(--rw-serif);
  font-size: 1.1rem;
}

.rw-guide-name {
  margin: 0 0 0.15rem;
  color: var(--ink);
  font-family: var(--rw-serif);
  font-size: 1rem;
  font-weight: 700;
}

.rw-guide-signoff {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 0.5rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  text-align: left;
  font-size: 0.88rem;
  line-height: 1.65;
}

.rw-guide-signoff p { margin: 0; }
.rw-guide-signoff strong { color: var(--accent); font-weight: 700; }

.rw-calibration-choice {
  display: block;
  width: 100%;
  min-height: 4.5rem;
  padding: 1rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: 0.5rem;
  background: var(--surface);
  color: var(--ink);
  text-align: left;
  font-size: 0.98rem;
  line-height: 1.55;
  cursor: pointer;
}

.rw-calibration-choice:hover {
  border-color: color-mix(in srgb, var(--accent) 62%, transparent);
  background: color-mix(in srgb, var(--accent) 9%, transparent);
}

/* ---- reveal ceremony (result page) ---- */
@keyframes rw-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes rw-name-in {
  from { opacity: 0; filter: blur(10px); transform: scale(0.96); }
  to { opacity: 1; filter: blur(0); transform: scale(1); }
}
@keyframes rw-medallion-in {
  from { opacity: 0; transform: scale(0.6); }
  to { opacity: 1; transform: scale(1); }
}

.rw-reveal > * { opacity: 0; animation: rw-rise 0.6s ease forwards; }
.rw-reveal .rw-medallion { animation: rw-medallion-in 0.7s cubic-bezier(0.2, 0.9, 0.3, 1.2) forwards; }
.rw-reveal .rw-name { animation: rw-name-in 0.9s ease forwards; }
.rw-reveal > :nth-child(1) { animation-delay: 0.1s; }
.rw-reveal > :nth-child(2) { animation-delay: 0.55s; }
.rw-reveal > :nth-child(3) { animation-delay: 0.8s; }
.rw-reveal > :nth-child(4) { animation-delay: 1.5s; }
.rw-reveal > :nth-child(5) { animation-delay: 2.1s; }
.rw-reveal > :nth-child(6) { animation-delay: 2.4s; }
.rw-reveal > :nth-child(7) { animation-delay: 2.7s; }
.rw-reveal > :nth-child(8) { animation-delay: 2.9s; }

@keyframes rw-name-tremble {
  0%, 100% { transform: translateY(0); }
  45% { transform: translateY(-1px); }
  55% { transform: translateY(1px); }
}

@keyframes rw-name-warm {
  0%, 100% { text-shadow: 0 0 26px var(--glow); }
  50% { text-shadow: 0 0 34px color-mix(in srgb, var(--accent) 34%, transparent); }
}

.rw-name--distant {
  display: inline-block;
  max-width: 100%;
  text-shadow: -0.45rem 0 28px var(--glow), 0.45rem 0 28px var(--glow);
}

.rw-reveal .rw-name--tremble {
  animation: rw-name-in 0.9s ease forwards, rw-name-tremble 2.2s ease-in-out 1.8s infinite;
}

.rw-name--guarded {
  display: inline-block;
  max-width: 100%;
  padding: 0.05rem 0.45rem 0.2rem;
  border-inline: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
}

.rw-reveal .rw-name--warm {
  animation: rw-name-in 0.9s ease forwards, rw-name-warm 2.8s ease-in-out 1.8s infinite;
}

.rw-name--spark {
  background: linear-gradient(90deg, var(--ink), var(--accent), var(--ink));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.rw-name--settled {
  display: inline-block;
  max-width: 100%;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 44%, transparent);
}

@media (prefers-reduced-motion: reduce) {
  .rw-reveal > *, .rw-reveal .rw-medallion, .rw-reveal .rw-name {
    animation: none;
    opacity: 1;
  }
  .rw-progress > span { transition: none; }
}

.rw-signal-stack {
  display: grid;
  gap: 0.65rem;
}

.rw-signal {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  font-size: 0.92rem;
}

.rw-signal strong { color: var(--accent); }

.rw-scene-card {
  border: 1px solid color-mix(in srgb, var(--accent) 42%, transparent);
  border-radius: 0.5rem;
  padding: 1.05rem 1.05rem 1.1rem;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  text-align: left;
}

.rw-scene-card h3 {
  margin: 0.45rem 0 0.45rem;
  color: var(--ink);
  font-family: var(--rw-serif);
  font-size: 1.08rem;
  line-height: 1.45;
}

.rw-scene-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 0.92rem;
}

.rw-scene-card .rw-scene-line {
  margin-top: 0.75rem;
  color: var(--accent);
}

.rw-scene-card .rw-eyebrow {
  font-size: 0.75rem;
  letter-spacing: 0.22em;
}

.rw-unlock-stack {
  text-align: left;
}

.rw-unlock-stack ul {
  margin: 0.75rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.55rem;
}

.rw-unlock-stack li {
  position: relative;
  padding-left: 1.1rem;
  color: var(--ink);
  line-height: 1.55;
  font-size: 0.92rem;
}

.rw-unlock-stack li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.68rem;
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--accent);
}

.rw-badge {
  width: fit-content;
  margin: 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  border-radius: 9999px;
  padding: 0.35rem 0.7rem;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  font-size: 0.78rem;
  font-weight: 700;
}

.rw-tease {
  border: 1px dashed var(--line);
  border-radius: 1rem;
  padding: 1.4rem 1.2rem;
  color: var(--muted);
  filter: blur(2.5px);
  user-select: none;
}

/* ---- analyzing ---- */
@keyframes rw-spin { to { transform: rotate(360deg); } }
.rw-spinner {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 9999px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  animation: rw-spin 0.9s linear infinite;
}
@media (prefers-reduced-motion: reduce) {
  .rw-spinner { animation-duration: 2.5s; }
}

/* ---- paywall offers ---- */
.rw-offer {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.95rem 1.1rem;
  cursor: pointer;
  transition: border-color 0.12s ease;
}
.rw-offer:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
  box-shadow: 0 0 20px var(--glow);
}
.rw-offer input[type="radio"] { accent-color: var(--accent); margin-top: 0.25rem; }

.rw-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0.9rem;
  padding: 0.9rem 1.1rem;
  color: var(--ink);
  font-size: 1rem;
}
.rw-input::placeholder { color: var(--muted); }
.rw-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }

/* ---- report ---- */
.rw-section { margin-top: 1rem; }
.rw-section-label {
  font-family: var(--rw-serif);
  font-size: 0.95rem;
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 0.45rem;
}
.rw-section-body {
  color: var(--ink);
  line-height: 1.85;
  font-size: 0.98rem;
}

/* focus visibility on dark */
a:focus-visible, button:focus-visible, .rw-option:focus-visible, .rw-question-option:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
