:root {
  color-scheme: dark;
  --bg: #100b1f;
  --bg-2: #17112c;
  --text: #f8f2ff;
  --muted: #c8b9d8;
  --soft: rgba(255, 255, 255, 0.08);
  --soft-2: rgba(255, 255, 255, 0.14);
  --line: rgba(255, 255, 255, 0.18);
  --pink: #ff7ac8;
  --violet: #9e7bff;
  --cyan: #73f7ff;
  --gold: #ffd166;
  --shadow: 0 24px 90px rgba(0, 0, 0, 0.38);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --font-ui: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Noto Serif SC", serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ui);
  color: var(--text);
  background:
    radial-gradient(circle at 15% 12%, rgba(255, 122, 200, 0.28), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(115, 247, 255, 0.18), transparent 24%),
    linear-gradient(135deg, #090614 0%, var(--bg) 42%, var(--bg-2) 100%);
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(circle at center, black, transparent 78%);
}

.ambient {
  position: fixed;
  width: 34vmax;
  aspect-ratio: 1;
  border-radius: 999px;
  filter: blur(42px);
  opacity: 0.24;
  pointer-events: none;
  animation: drift 14s ease-in-out infinite alternate;
}

.ambient-one { left: -12vmax; top: 18vh; background: var(--pink); }
.ambient-two { right: -14vmax; top: 6vh; background: var(--cyan); animation-delay: -4s; }
.ambient-three { left: 35vw; bottom: -18vmax; background: var(--violet); animation-delay: -8s; }

.shell {
  position: relative;
  width: min(1180px, calc(100% - 36px));
  margin: 0 auto;
  padding: 56px 0 72px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: 44px;
  align-items: center;
  min-height: 520px;
}

.eyebrow, .label {
  margin: 0;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; }

h1 {
  margin-top: 18px;
  font-family: var(--font-display);
  font-size: clamp(48px, 8vw, 104px);
  line-height: .95;
  letter-spacing: -0.08em;
  text-wrap: balance;
}

h1 span {
  background: linear-gradient(90deg, var(--pink), var(--gold), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.lead {
  width: min(680px, 100%);
  margin: 26px 0 0;
  color: var(--muted);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.86;
}

.hero-actions, .tool-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.hero-actions { margin-top: 34px; }

button, .ghost {
  border: 0;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: transform .22s ease, border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

button:hover, .ghost:hover { transform: translateY(-2px); }
button:active, .ghost:active { transform: translateY(0) scale(.98); }
button.copied { border-color: rgba(115,247,255,.52); color: var(--cyan); }

.primary {
  padding: 15px 24px;
  border-radius: 999px;
  color: #16091c;
  background: linear-gradient(135deg, var(--pink), var(--gold));
  box-shadow: 0 14px 38px rgba(255, 122, 200, .28);
}

.ghost, .soft {
  padding: 13px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  text-decoration: none;
  backdrop-filter: blur(18px);
}

.soft { font-size: 13px; }

.card-stack {
  position: relative;
  min-height: 410px;
  perspective: 1000px;
}

.floating-card {
  position: absolute;
  inset: 34px 22px;
  border: 1px solid var(--line);
  border-radius: 38px;
  background: linear-gradient(145deg, rgba(255,255,255,.16), rgba(255,255,255,.05));
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.card-back {
  transform: rotate(-9deg) translate(-18px, 24px);
  background:
    linear-gradient(135deg, rgba(115,247,255,.14), rgba(255,122,200,.08)),
    repeating-linear-gradient(135deg, rgba(255,255,255,.08) 0 1px, transparent 1px 16px);
  animation: floatBack 6s ease-in-out infinite;
}

.card-front {
  display: grid;
  place-items: center;
  padding: 34px;
  transform: rotate(5deg);
  animation: floatFront 5s ease-in-out infinite;
}

.avatar-orbit {
  display: grid;
  place-items: center;
  width: 178px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: conic-gradient(from 180deg, var(--pink), var(--gold), var(--cyan), var(--violet), var(--pink));
  animation: spin 9s linear infinite;
}

.avatar-core {
  display: grid;
  place-items: center;
  width: 142px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: rgba(16, 11, 31, .88);
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 900;
  box-shadow: inset 0 0 42px rgba(255, 255, 255, .1);
}

.fake-lines {
  position: absolute;
  right: 40px;
  bottom: 42px;
  left: 40px;
  display: grid;
  gap: 12px;
}

.fake-lines span {
  height: 11px;
  border-radius: 999px;
  background: rgba(255,255,255,.14);
}
.fake-lines span:nth-child(1) { width: 72%; }
.fake-lines span:nth-child(2) { width: 92%; }
.fake-lines span:nth-child(3) { width: 55%; }
.fake-lines span:nth-child(4) { width: 80%; }

.drop-section { margin-top: 8px; }

.drop-zone {
  display: grid;
  place-items: center;
  gap: 10px;
  min-height: 210px;
  padding: 34px;
  border: 1px dashed rgba(255,255,255,.34);
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,.07);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
  text-align: center;
  transition: transform .24s ease, border-color .24s ease, background .24s ease;
}

.drop-zone.dragover {
  transform: translateY(-4px) scale(1.01);
  border-color: var(--cyan);
  background: rgba(115, 247, 255, .11);
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 64px;
  aspect-ratio: 1;
  border-radius: 22px;
  color: #15091d;
  background: linear-gradient(135deg, var(--cyan), var(--pink));
  font-size: 32px;
  animation: pulse 2.2s ease-in-out infinite;
}

.drop-zone strong { font-size: 22px; }
.drop-zone small, .status { color: var(--muted); }
.status { margin: 14px 6px 0; min-height: 24px; }
.status.error { color: #ff9fb9; }
.status.success { color: #92fff2; }

.result-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 24px;
  margin-top: 34px;
}

.hidden { display: none !important; }
.glass {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, .08);
  box-shadow: var(--shadow);
  backdrop-filter: blur(24px);
}

.profile-panel {
  position: sticky;
  top: 22px;
  align-self: start;
  padding: 18px;
}

.image-wrap {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 330px;
  border-radius: 26px;
  background: linear-gradient(145deg, rgba(255,122,200,.16), rgba(115,247,255,.08));
}

.image-wrap img {
  width: 100%;
  height: 100%;
  max-height: 430px;
  object-fit: cover;
}

.image-fallback {
  display: grid;
  place-items: center;
  width: 160px;
  aspect-ratio: 1;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--muted);
  font-weight: 900;
  letter-spacing: .08em;
  background: rgba(255,255,255,.08);
}

.profile-meta { padding: 22px 8px 12px; }
.profile-meta h2 { margin-top: 6px; font-family: var(--font-display); font-size: 34px; line-height: 1.18; }

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.tag {
  padding: 7px 10px;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  color: #fbeaff;
  background: rgba(255,255,255,.08);
  font-size: 12px;
}

.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.mini-stats div {
  padding: 14px 10px;
  border-radius: 18px;
  background: rgba(255,255,255,.08);
  text-align: center;
}

.mini-stats strong { display: block; font-size: 22px; }
.mini-stats span { color: var(--muted); font-size: 12px; }

.content-panel { min-width: 0; }

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 20px;
}
.toolbar h2 { margin-top: 4px; font-family: var(--font-display); font-size: 30px; }

.summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 18px 0;
}

.summary-card {
  overflow: hidden;
  position: relative;
  min-height: 118px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(255,255,255,.075);
}

.summary-card::after {
  content: "";
  position: absolute;
  right: -42px;
  bottom: -46px;
  width: 110px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent, var(--pink));
  opacity: .2;
  filter: blur(3px);
}
.summary-card strong { display: block; margin-bottom: 10px; font-size: 13px; color: var(--cyan); }
.summary-card p { margin: 0; color: var(--muted); line-height: 1.66; }

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 12px;
}

.tab {
  padding: 11px 16px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: rgba(255,255,255,.07);
}
.tab.active {
  border-color: rgba(115,247,255,.52);
  background: rgba(115,247,255,.13);
  box-shadow: 0 8px 24px rgba(115,247,255,.08);
}

.tab-panels { padding: 18px; }
.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 14px; animation: fadeUp .3s ease both; }

.field-card {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: var(--radius-lg);
  background: rgba(7, 4, 16, .28);
}

.copy-field-button {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 7px 11px;
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.07);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(14px);
}

.copy-field-button:hover {
  color: var(--text);
  border-color: rgba(115,247,255,.48);
  background: rgba(115,247,255,.12);
}

.field-title {
  margin: 0 72px 10px 0;
  color: var(--gold);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.field-body {
  color: #f2e8ff;
  line-height: 1.78;
  white-space: pre-wrap;
  word-break: break-word;
}

.empty {
  padding: 28px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  text-align: center;
}

.raw-json {
  overflow: auto;
  max-height: 680px;
  margin: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background: rgba(0,0,0,.28);
  color: #d8fff9;
  font-size: 13px;
  line-height: 1.58;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.reveal { animation: fadeUp .72s cubic-bezier(.2,.7,.2,1) both; }
.delay-1 { animation-delay: .12s; }
.delay-2 { animation-delay: .22s; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes drift {
  from { transform: translate3d(0,0,0) scale(1); }
  to { transform: translate3d(6vw,-4vh,0) scale(1.14); }
}

@keyframes floatFront {
  0%, 100% { transform: rotate(5deg) translateY(0); }
  50% { transform: rotate(2deg) translateY(-16px); }
}

@keyframes floatBack {
  0%, 100% { transform: rotate(-9deg) translate(-18px, 24px); }
  50% { transform: rotate(-12deg) translate(-26px, 10px); }
}

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

@keyframes pulse {
  0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(115,247,255,.28); }
  50% { transform: scale(1.05); box-shadow: 0 0 0 16px rgba(115,247,255,0); }
}

@media (max-width: 900px) {
  .hero, .result-grid { grid-template-columns: 1fr; }
  .hero { min-height: unset; padding-top: 24px; }
  .card-stack { min-height: 360px; }
  .profile-panel { position: relative; top: auto; }
  .summary-cards { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1180px); padding-top: 28px; }
  .toolbar { align-items: flex-start; flex-direction: column; }
  .tool-actions, .hero-actions { width: 100%; }
  .primary, .ghost, .soft { width: 100%; text-align: center; justify-content: center; }
  .floating-card { inset: 28px 6px; }
}
