:root {
  color-scheme: light;
  --paper: #f7f7f3;
  --ink: #18191d;
  --muted: #6c707a;
  --line: #dedfd8;
  --panel: #ffffff;
  --shadow: 0 24px 70px rgba(28, 30, 36, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(247, 247, 243, 0.7)),
    radial-gradient(circle at 10% 10%, rgba(15, 159, 143, 0.12), transparent 28%),
    radial-gradient(circle at 90% 20%, rgba(240, 68, 56, 0.12), transparent 28%),
    var(--paper);
  font-family: "Pretendard", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  letter-spacing: 0;
}

button {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.hub-shell {
  width: min(1120px, calc(100vw - 32px));
  margin: 24px auto;
  display: grid;
  gap: 18px;
}

.hub-head,
.hub-card {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hub-head {
  min-height: 300px;
  padding: 34px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.hub-head h1 {
  max-width: 9ch;
  margin: 38px 0 0;
  font-size: clamp(48px, 8vw, 92px);
  line-height: 0.95;
}

.hub-head p {
  max-width: 680px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
}

.hub-card {
  min-height: 260px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, #fff, var(--soft));
  transition: transform 160ms ease, border-color 160ms ease;
}

.hub-card:hover {
  transform: translateY(-2px);
  border-color: var(--item);
}

.hub-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--item);
  border-radius: 8px;
  font-weight: 800;
}

.hub-card strong {
  margin-top: auto;
  font-size: 25px;
  line-height: 1.18;
}

.hub-card small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.hub-card em {
  margin-top: 18px;
  color: var(--item);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: calc(100vh - 48px);
  margin: 24px auto;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 18px;
}

.test-shell {
  width: min(430px, calc(100vw - 20px));
  min-height: calc(100vh - 20px);
  margin: 10px auto;
}

.start-screen,
.result-card,
.analysis-panel {
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.start-screen {
  min-height: calc(100vh - 20px);
  padding: 16px;
  display: grid;
  grid-template-rows: auto minmax(250px, 1fr) auto auto auto auto;
  gap: 12px;
  overflow: hidden;
}

.left-rail,
.stage {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(24, 25, 29, 0.08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.left-rail {
  border-radius: 8px;
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.stage {
  border-radius: 8px;
  padding: 32px;
  min-height: 680px;
}

.brand,
.back-link {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 800;
}

.back-link {
  width: fit-content;
  min-height: 38px;
  padding: 0 12px;
  border: 1px solid rgba(24, 25, 29, 0.1);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
}

.back-link svg {
  width: 17px;
  height: 17px;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  color: #fff;
  background: #18191d;
  border-radius: 7px;
}

.intro h1,
.start-title h1,
.hero-copy h2,
.prompt-card h2,
.analysis-panel h2,
.result-card h2 {
  margin: 0;
  letter-spacing: 0;
}

.start-title h1 {
  width: 100%;
  text-align: center;
  white-space: normal;
  text-wrap: balance;
  word-break: keep-all;
  font-size: clamp(24px, 6.3vw, 34px);
  line-height: 1.12;
}

.image-shower {
  position: relative;
  min-height: 250px;
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 48%),
    linear-gradient(145deg, #fff, var(--soft));
  overflow: hidden;
}

.rolling-showcase {
  min-height: 280px;
  display: grid;
  place-items: center;
  isolation: isolate;
}

.rolling-showcase::before,
.rolling-showcase::after {
  content: "";
  position: absolute;
  width: 168px;
  height: 218px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.34)),
    var(--soft);
  box-shadow: 0 18px 44px rgba(24, 25, 29, 0.12);
}

.rolling-showcase::before {
  transform: translate(-28px, 11px) rotate(-7deg);
}

.rolling-showcase::after {
  transform: translate(30px, -8px) rotate(6deg);
}

.image-shower img {
  position: absolute;
  left: var(--x);
  top: var(--y);
  width: 70px;
  height: 92px;
  border-radius: 8px;
  object-fit: cover;
  object-position: center center;
  transform: rotate(var(--r)) scale(var(--s));
  box-shadow: 0 14px 28px rgba(24, 25, 29, 0.18);
  animation: float-card 4.8s ease-in-out infinite alternate;
  animation-delay: var(--d);
}

.rolling-showcase .rolling-card {
  left: 50%;
  top: 50%;
  z-index: 1;
  width: min(178px, 48vw);
  height: min(232px, 62vw);
  border: 4px solid #fff;
  border-radius: 8px;
  opacity: 0;
  transform-origin: center center;
  transform: translate(calc(-50% + var(--entry-x)), calc(-50% + var(--entry-y))) rotate(var(--entry-r)) scale(0.78);
  transition: transform 520ms cubic-bezier(0.2, 0.75, 0.25, 1);
  box-shadow: 0 24px 54px rgba(24, 25, 29, 0.28);
}

.rolling-showcase .rolling-card.active {
  opacity: 1;
  transform: translate(-50%, -50%) rotate(var(--center-r)) scale(1);
}

.rolling-showcase .rolling-card:nth-child(3n) {
  object-position: center top;
}

.single-prompt {
  padding: 16px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff, var(--soft));
}

.single-prompt span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.single-prompt p {
  margin: 8px 0 0;
  font-size: 19px;
  font-weight: 800;
  line-height: 1.35;
}

.intro h1 {
  max-width: 9ch;
  font-size: 46px;
  line-height: 1.02;
}

.intro p {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.65;
}

.page-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.page-meta span {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  color: var(--accent);
  background: var(--soft);
  font-size: 12px;
  font-weight: 800;
}

.test-list {
  display: grid;
  gap: 10px;
}

.test-button {
  width: 100%;
  min-height: 78px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: #fff;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.test-button:hover,
.test-button.active {
  transform: translateY(-1px);
  border-color: var(--item);
  background: linear-gradient(90deg, color-mix(in srgb, var(--item) 10%, white), #fff 68%);
}

.test-chip {
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #fff;
  background: var(--item);
  font-size: 13px;
  font-weight: 800;
}

.test-button strong,
.test-button small {
  display: block;
}

.test-button strong {
  font-size: 16px;
}

.test-button small {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.privacy {
  margin: auto 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.compact-text {
  padding-top: 0;
  border-top: 0;
  text-align: center;
}

.hero-panel,
.recorder-panel,
.analysis-panel,
.result-card {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

.hero-panel {
  justify-content: space-between;
  gap: 28px;
}

.result-orb {
  width: min(420px, 72vw);
  aspect-ratio: 1;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.96), var(--soft)),
    var(--soft);
  box-shadow: inset 0 0 0 1px rgba(24, 25, 29, 0.05);
  font-size: clamp(72px, 10vw, 132px);
  font-weight: 800;
}

.hero-copy h2,
.prompt-card h2 {
  font-size: clamp(34px, 5vw, 72px);
  line-height: 1;
}

.hero-copy p,
.analysis-panel p,
.result-desc,
.reason {
  color: var(--muted);
  font-size: 17px;
  line-height: 1.65;
}

.script-preview {
  display: grid;
  gap: 10px;
}

.script-line {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background: #fff;
}

.script-line span {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.script-line p {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

.actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  width: 100%;
}

.primary-action,
.ghost-action {
  min-height: 48px;
  min-width: 0;
  border-radius: 8px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  font-weight: 800;
  white-space: normal;
  text-align: center;
  line-height: 1.2;
}

.primary-action {
  color: #fff;
  background: var(--accent);
}

.primary-action.danger {
  background: #18191d;
}

.ghost-action {
  color: var(--ink);
  background: #fff;
  border-color: rgba(24, 25, 29, 0.12);
}

svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mini-results {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.mini-results article {
  min-height: 138px;
  padding: 14px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background: #fff;
}

.avatar,
.poster {
  display: grid;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 8px;
  font-weight: 800;
}

.avatar {
  width: 38px;
  height: 38px;
  margin-bottom: 12px;
}

.mini-results strong,
.mini-results span {
  display: block;
}

.mini-results strong {
  font-size: 15px;
}

.mini-results span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.progress-row {
  display: grid;
  grid-template-columns: 60px 1fr;
  gap: 14px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.progress-row div {
  height: 8px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.progress-row i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.prompt-card {
  margin-top: 52px;
}

.prompt-card > span,
.match {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.prompt-card p {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 17px;
}

.wave {
  height: 150px;
  margin: auto 0 28px;
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border-radius: 8px;
  background: linear-gradient(145deg, #fff, var(--soft));
}

.wave.compact {
  height: 86px;
  margin: 0;
  padding: 12px;
}

.wave b {
  width: 7px;
  height: calc(20px + (var(--i) % 9) * 8px);
  border-radius: 8px;
  background: var(--accent);
  opacity: 0.72;
  transform-origin: center;
}

.wave.live b {
  animation: wave 720ms ease-in-out infinite alternate;
  animation-delay: calc(var(--i) * -45ms);
}

.error {
  margin: 0 0 16px;
  color: #b42318;
  font-size: 14px;
  font-weight: 700;
}

.analysis-panel {
  min-height: calc(100vh - 20px);
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 28px;
}

.scan-ring {
  width: 132px;
  height: 132px;
  margin-bottom: 26px;
  border: 14px solid var(--soft);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

.result-card {
  min-height: calc(100vh - 20px);
  padding: 14px;
}

.result-top {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 14px;
  align-items: center;
}

.poster {
  aspect-ratio: 1;
  font-size: 54px;
  box-shadow: inset 0 -80px 100px rgba(0, 0, 0, 0.16);
  overflow: hidden;
  position: relative;
  display: grid;
  place-items: center;
  background: var(--soft);
}

.poster img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
}

.poster span {
  display: none;
}

.poster img:not([src]),
.poster img[src=""] {
  display: none;
}

.poster img:not([src]) + span,
.poster img[src=""] + span {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
}

.match {
  margin: 0 0 6px;
}

.result-card h2 {
  font-size: clamp(34px, 10vw, 46px);
  line-height: 1;
}

.result-card h3 {
  margin: 8px 0 0;
  font-size: 17px;
  line-height: 1.25;
}

.result-desc {
  margin: 14px 0 10px;
  font-size: 15px;
  line-height: 1.5;
}

.tag-row,
.stats {
  display: grid;
  gap: 10px;
}

.tag-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 8px 0 10px;
}

.tag-row span,
.stats div {
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background: #fff;
}

.tag-row span {
  padding: 9px 7px;
  text-align: center;
  font-size: 12px;
  font-weight: 800;
}

.quote-module {
  margin: 8px 0 10px;
  padding: 11px;
  border: 1px solid color-mix(in srgb, var(--accent) 20%, transparent);
  border-radius: 8px;
  background: linear-gradient(145deg, #fff, var(--soft));
}

.quote-module span {
  display: block;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
}

.quote-module p {
  margin: 6px 0 0;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.4;
}

.quote-module small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.quote-module audio {
  width: 100%;
  margin-top: 8px;
}

.stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stats div {
  padding: 10px;
}

.stats span,
.stats strong,
.stats small,
.stats i {
  display: block;
}

.stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stats strong {
  margin: 5px 0;
  font-size: 22px;
}

.stats small {
  min-height: 30px;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.stats i {
  height: 7px;
  overflow: hidden;
  border-radius: 8px;
  background: var(--soft);
}

.stats b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.result-details {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.result-details article {
  padding: 11px;
  border: 1px solid rgba(24, 25, 29, 0.08);
  border-radius: 8px;
  background: #fff;
}

.result-details strong {
  display: block;
  font-size: 13px;
}

.result-details p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.reason {
  display: none;
}

.result-actions {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  width: 100%;
}

.haze-cta {
  padding: 12px;
  display: block;
  border-radius: 8px;
  color: #fff;
  background: #18191d;
  overflow-wrap: anywhere;
}

.haze-cta strong,
.haze-cta span {
  display: block;
}

.haze-cta strong {
  font-size: 14px;
}

.haze-cta span {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 12px;
  line-height: 1.35;
}

.record-action {
  min-height: 64px;
  width: 100%;
  border: 0;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font-size: 18px;
  font-weight: 800;
}

.record-action.danger {
  background: #18191d;
}

@keyframes wave {
  from {
    transform: scaleY(0.45);
  }

  to {
    transform: scaleY(1.35);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes float-card {
  from {
    translate: 0 -5px;
  }

  to {
    translate: 0 8px;
  }
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 20px, 620px);
    grid-template-columns: 1fr;
    margin: 10px auto;
  }

  .hub-grid {
    grid-template-columns: 1fr;
  }

  .hub-card {
    min-height: 180px;
  }

  .stage {
    min-height: 560px;
    padding: 22px;
  }

  .intro h1 {
    max-width: none;
    font-size: 34px;
  }

  .test-list {
    grid-template-columns: 1fr;
  }

  .result-orb {
    width: 100%;
    max-height: 260px;
  }

  .mini-results,
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-top {
    grid-template-columns: 1fr;
  }

  .poster {
    max-height: 230px;
  }
}

@media (max-width: 520px) {
  .left-rail,
  .stage {
    padding: 18px;
  }

  .test-button {
    grid-template-columns: 46px 1fr;
  }

  .hero-copy h2,
  .prompt-card h2,
  .result-card h2 {
    font-size: 36px;
  }

  .start-title h1 {
    font-size: clamp(22px, 6.1vw, 28px);
    line-height: 1.14;
  }

  .script-line,
  .tag-row,
  .stats {
    grid-template-columns: 1fr;
  }

  .actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .primary-action,
  .ghost-action {
    width: 100%;
  }

  .start-screen .actions {
    grid-template-columns: 1fr;
  }

  .rolling-showcase {
    min-height: 240px;
  }

  .rolling-showcase::before,
  .rolling-showcase::after {
    width: 142px;
    height: 184px;
  }

  .wave {
    gap: 4px;
    padding: 10px;
  }

  .wave b {
    width: 5px;
  }
}
