@charset "UTF-8";

:root {
  --mdc-theme-primary: #f5f5f5;
  --mdc-theme-on-primary: #0b0b0c;
  --mdc-theme-secondary: #d9d9d9;
  --mdc-theme-on-secondary: #0b0b0c;
  --mdc-theme-surface: rgba(20, 20, 21, 0.94);
  --mdc-theme-on-surface: #f5f5f5;
  --mdc-theme-background: #0b0b0c;
  --mdc-theme-error: #f87171;
  --bg:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 25%),
    radial-gradient(circle at 80% 0%, rgba(255, 255, 255, 0.05), transparent 20%),
    linear-gradient(180deg, #050505 0%, #0b0b0c 48%, #111112 100%);
  --border: rgba(255, 255, 255, 0.12);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text-2: rgba(245, 245, 245, 0.72);
  --text-3: rgba(245, 245, 245, 0.54);
  --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);
  --shadow-md: 0 14px 30px rgba(0, 0, 0, 0.38);
  --radius-xl: 30px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--mdc-theme-on-surface);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.35;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.9), transparent 92%);
}

.app-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 20px 0 48px;
  position: relative;
  z-index: 1;
}

.top-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(18, 18, 19, 0.72);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: #0f0f10;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  flex: 0 0 auto;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.brand-mark svg {
  width: 20px;
  height: 20px;
}

.brand-copy strong {
  display: block;
  font-size: 1rem;
  letter-spacing: 0.03em;
}

.brand-copy span {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 0.88rem;
}

.mini-note {
  color: var(--text-3);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.hero {
  position: relative;
  overflow: hidden;
  display: grid;
  gap: 18px;
  padding: 32px 28px 28px;
  margin-bottom: 20px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.02)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(15, 15, 16, 0.96), rgba(8, 8, 9, 0.98));
  box-shadow: var(--shadow-lg);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -10% -42% auto;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.12), transparent 62%);
  pointer-events: none;
}

.hero-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 14ch;
  font-family: "Noto Serif KR", serif;
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0;
  max-width: 64ch;
  color: var(--text-2);
  line-height: 1.8;
  font-size: 1.02rem;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: 20px;
  align-items: start;
}

.surface-card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: rgba(20, 20, 21, 0.88);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.surface-card--result {
  overflow: visible;
}

.surface-card__header {
  padding: 24px 24px 0;
}

.surface-card__header h2 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.02em;
}

.surface-card__header p {
  margin: 8px 0 0;
  color: var(--text-2);
  line-height: 1.7;
}

.surface-card__body {
  padding: 24px;
}

.choice-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.choice {
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.choice:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.05);
}

.choice label {
  color: var(--mdc-theme-on-surface);
  font-weight: 700;
}

.mdc-form-field {
  color: var(--mdc-theme-on-surface);
}

.mdc-radio .mdc-radio__background::before,
.mdc-radio .mdc-radio__background::after,
.mdc-radio .mdc-radio__inner-circle {
  border-color: #ffffff;
  background-color: #ffffff;
}

.mdc-radio .mdc-radio__outer-circle {
  border-color: rgba(255, 255, 255, 0.6);
}

.mdc-text-field {
  width: 100%;
  --mdc-theme-primary: #ffffff;
  --mdc-theme-on-surface: #f5f5f5;
  --mdc-text-field-fill-color: rgba(255, 255, 255, 0.04);
  --mdc-text-field-idle-line-color: rgba(255, 255, 255, 0.16);
  --mdc-text-field-hover-line-color: rgba(255, 255, 255, 0.24);
  --mdc-text-field-label-ink-color: rgba(245, 245, 245, 0.72);
  --mdc-text-field-ink-color: #f5f5f5;
  --mdc-text-field-disabled-fill-color: rgba(255, 255, 255, 0.02);
  --mdc-text-field-disabled-ink-color: rgba(245, 245, 245, 0.4);
  --mdc-text-field-disabled-label-color: rgba(245, 245, 245, 0.3);
}

.mdc-text-field .mdc-text-field__input {
  color: #f5f5f5 !important;
  caret-color: #ffffff;
}

.mdc-text-field .mdc-floating-label {
  color: rgba(245, 245, 245, 0.72) !important;
}

.mdc-text-field--outlined .mdc-notched-outline__leading,
.mdc-text-field--outlined .mdc-notched-outline__notch,
.mdc-text-field--outlined .mdc-notched-outline__trailing {
  border-color: rgba(255, 255, 255, 0.16);
}

.mdc-text-field--outlined.mdc-text-field--focused .mdc-notched-outline__leading,
.mdc-text-field--outlined.mdc-text-field--focused .mdc-notched-outline__notch,
.mdc-text-field--outlined.mdc-text-field--focused .mdc-notched-outline__trailing {
  border-color: rgba(255, 255, 255, 0.46);
}

.mdc-text-field__input::placeholder {
  color: rgba(245, 245, 245, 0.62);
  opacity: 1;
}

.mdc-text-field__input::-webkit-input-placeholder {
  color: rgba(245, 245, 245, 0.62);
  opacity: 1;
}

.mdc-text-field__input::-moz-placeholder {
  color: rgba(245, 245, 245, 0.62);
  opacity: 1;
}

.mdc-text-field__input:-ms-input-placeholder {
  color: rgba(245, 245, 245, 0.62);
  opacity: 1;
}

.helper-text {
  margin-top: 10px;
  color: var(--text-3);
  font-size: 0.9rem;
  line-height: 1.6;
}

.actions {
  margin-top: 22px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.mdc-button {
  width: 100%;
  height: 52px;
  justify-content: center;
  border-radius: 999px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 700;
  --mdc-theme-primary: #f5f5f5;
  --mdc-theme-on-primary: #0b0b0c;
  --mdc-theme-secondary: #f5f5f5;
}

.mdc-button--raised {
  box-shadow: var(--shadow-md);
}

.mdc-button--outlined {
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--mdc-theme-on-surface);
}

.result-stack {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.verse-card {
  position: relative;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03)),
    radial-gradient(circle at top right, rgba(255, 255, 255, 0.05), transparent 28%);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.verse-label {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  color: rgba(245, 245, 245, 0.82);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.verse-meta {
  margin-top: 18px;
}

.source-popover {
  position: relative;
  display: block;
  width: 100%;
}

.source-popover > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}

.source-popover > summary::-webkit-details-marker {
  display: none;
}

.source-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.source-trigger:hover {
  transform: translateY(-1px);
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.07);
}

.source-trigger .tag {
  color: var(--text-3);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-trigger .value {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.source-popover__panel {
  position: static;
  width: 100%;
  margin-top: 10px;
  padding: 16px 18px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(12, 12, 13, 0.98);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  max-height: none;
  overflow: visible;
  transition: opacity 160ms ease, visibility 160ms ease, transform 160ms ease;
}

.source-popover[open] .source-popover__panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.source-popover__title {
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.source-popover__text {
  color: #f5f5f5;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: break-word;
  overflow-wrap: anywhere;
  font-size: 0.96rem;
}

.verse-text {
  margin: 0;
  white-space: pre-wrap;
  word-break: keep-all;
  line-height: 1.9;
  font-family: "Noto Serif KR", serif;
  font-size: clamp(1.08rem, 2.3vw, 1.38rem);
  font-weight: 500;
  color: #f5f5f5;
}

.source-panel {
  display: grid;
  gap: 12px;
}

.source-card {
  padding: 18px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
}

.source-card .label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-3);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.source-text {
  color: #f5f5f5;
  line-height: 1.8;
  white-space: pre-wrap;
  word-break: keep-all;
  font-weight: 500;
}

.image-frame {
  padding: 18px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.28);
}

.verse-image {
  width: 100%;
  display: block;
  border-radius: 20px;
  background: #0a0a0a;
}

.empty-state {
  padding: 28px 24px 32px;
  text-align: center;
  color: var(--text-2);
}

.empty-state .icon {
  width: 60px;
  height: 60px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.empty-state h3 {
  margin: 0 0 8px;
  color: #f5f5f5;
  font-size: 1.08rem;
}

.empty-state p {
  margin: 0;
  line-height: 1.7;
}

.hidden {
  display: none !important;
}

.loading-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(11, 11, 12, 0.2);
  border-top-color: rgba(11, 11, 12, 0.88);
  animation: spin 0.8s linear infinite;
  display: none;
}

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

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

@media (max-width: 640px) {
  .app-shell {
    width: min(100% - 18px, 100%);
    padding-top: 14px;
  }

  .top-card {
    border-radius: 24px;
    padding: 14px 16px;
    align-items: flex-start;
    flex-direction: column;
  }

  .hero {
    padding: 24px 18px 20px;
  }

  .surface-card__header,
  .surface-card__body,
  .result-stack {
    padding-left: 18px;
    padding-right: 18px;
  }

  .choice-group {
    grid-template-columns: 1fr;
  }
}

/* Loading Modal */
.loading-modal {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 250ms ease, visibility 250ms ease;
}

.loading-modal.active {
  display: flex !important;
  opacity: 1;
  visibility: visible;
}

.loading-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 5, 6, 0.78);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.loading-modal__content {
  position: relative;
  width: min(440px, 100%);
  padding: 36px 28px 32px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-strong);
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.08), transparent 50%),
    linear-gradient(180deg, rgba(24, 24, 26, 0.98), rgba(14, 14, 15, 0.98));
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.7);
  text-align: center;
  transform: scale(0.94) translateY(10px);
  transition: transform 250ms cubic-bezier(0.16, 1, 0.3, 1);
}

.loading-modal.active .loading-modal__content {
  transform: scale(1) translateY(0);
}

.loading-modal__spinner {
  position: relative;
  width: 68px;
  height: 68px;
  margin: 0 auto 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.1);
  border-top-color: #ffffff;
  animation: spin 1s cubic-bezier(0.6, 0.2, 0.4, 0.8) infinite;
}

.spinner-core {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f5f5f5;
  animation: pulse-glow 2s ease-in-out infinite;
}

.loading-modal__title {
  margin: 0 0 10px;
  font-family: "Noto Sans KR", sans-serif;
  font-size: 1.25rem;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
}

.loading-modal__desc {
  margin: 0 0 24px;
  font-size: 0.92rem;
  color: var(--text-2);
  line-height: 1.6;
  word-break: keep-all;
}

.loading-modal__progress-bar {
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  position: relative;
}

.loading-modal__progress-indeterminate {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 40%;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
  animation: shimmer-progress 1.6s ease-in-out infinite;
}

@keyframes pulse-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.18);
  }
}

@keyframes shimmer-progress {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(300%);
  }
}

