:root {
  color-scheme: dark;
  --bg: #16080b;
  --card: rgba(37, 16, 18, 0.84);
  --cream: #fff1d8;
  --muted: #d3b99c;
  --gold: #d7a84f;
  --wine: #7e1d2f;
  --line: rgba(255, 241, 216, 0.16);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(215, 168, 79, 0.22), transparent 32rem),
    radial-gradient(circle at bottom right, rgba(126, 29, 47, 0.55), transparent 28rem),
    linear-gradient(145deg, #120507, #2a0d14 58%, #11070a);
  color: var(--cream);
  font-family: Inter, system-ui, sans-serif;
  animation: backgroundDrift 12s ease-in-out infinite alternate;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 241, 216, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 241, 216, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, transparent, black 12%, black 88%, transparent);
}

.phone-shell {
  width: min(100%, 430px);
  min-height: 100vh;
  padding: 18px;
  display: grid;
  align-items: center;
}

.card {
  display: none;
  min-height: min(720px, calc(100vh - 36px));
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: linear-gradient(160deg, rgba(48, 19, 24, 0.92), var(--card));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.09);
  position: relative;
  overflow: hidden;
}

.card::after {
  content: "CERENIMO";
  position: absolute;
  right: -36px;
  bottom: 56px;
  transform: rotate(-90deg);
  color: rgba(255, 241, 216, 0.05);
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 0.16em;
}

.card.active {
  display: flex;
  flex-direction: column;
  justify-content: center;
  animation: reveal 440ms ease both;
}

.card.active .eyebrow,
.card.active h1,
.card.active h2,
.card.active .lead,
.card.active .primary,
.card.active .charge-box,
.card.active .meta-grid,
.card.active .suspect-card {
  animation: riseIn 560ms ease both;
}

.card.active h1,
.card.active h2 {
  animation-delay: 70ms;
}

.card.active .lead,
.card.active .charge-box,
.card.active .suspect-card {
  animation-delay: 140ms;
}

.card.active .meta-grid,
.card.active .primary {
  animation-delay: 220ms;
}

.seal {
  width: fit-content;
  padding: 8px 12px;
  border: 1px solid rgba(215, 168, 79, 0.42);
  border-radius: 999px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.portrait-wrap {
  width: 190px;
  height: 238px;
  margin: 34px auto 26px;
  border: 1px solid rgba(215, 168, 79, 0.55);
  border-radius: 90px 90px 28px 28px;
  padding: 8px;
  position: relative;
  background: linear-gradient(145deg, rgba(215, 168, 79, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 0 rgba(215, 168, 79, 0.18);
  animation: portraitGlow 3.8s ease-in-out infinite;
}

.portrait-wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: inherit;
  background: conic-gradient(from 0deg, transparent, rgba(215, 168, 79, 0.75), transparent 34%);
  opacity: 0.5;
  animation: haloSpin 7s linear infinite;
}

.portrait {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 82px 82px 22px 22px;
  position: relative;
  z-index: 2;
}

.portrait.is-missing,
.suspect-photo.is-missing {
  display: none;
}

.portrait-fallback {
  position: absolute;
  inset: 8px;
  display: grid;
  place-items: center;
  border-radius: 82px 82px 22px 22px;
  background: linear-gradient(145deg, #51202a, #19090c);
  color: rgba(255, 241, 216, 0.38);
  font-family: "Cormorant Garamond", serif;
  font-size: 98px;
  font-weight: 700;
}

.photo-picker {
  width: fit-content;
  margin: -8px auto 24px;
  display: none;
  padding: 9px 13px;
  border: 1px dashed rgba(215, 168, 79, 0.52);
  border-radius: 999px;
  color: var(--gold);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.photo-picker.is-visible {
  display: block;
}

.photo-picker input {
  display: none;
}

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

h1,
h2 {
  margin: 0;
  font-family: "Cormorant Garamond", Georgia, serif;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

h1 {
  font-size: clamp(58px, 18vw, 82px);
}

h2 {
  font-size: clamp(46px, 13vw, 64px);
}

.lead {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.primary {
  width: 100%;
  margin-top: 34px;
  border: 0;
  border-radius: 20px;
  padding: 17px 20px;
  background: linear-gradient(135deg, #f5d28a, #b87822);
  color: #1d0909;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(184, 120, 34, 0.22);
  transition: transform 160ms ease, filter 160ms ease;
}

.primary:active {
  transform: scale(0.98);
  filter: brightness(1.08);
}

.primary.is-thinking {
  pointer-events: none;
  filter: saturate(0.8) brightness(0.92);
}

.charge-box,
.evidence-list article {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(255, 241, 216, 0.06);
}

.suspect-card {
  height: 230px;
  margin-top: 24px;
  border: 1px solid rgba(215, 168, 79, 0.42);
  border-radius: 30px;
  overflow: hidden;
  position: relative;
  background: rgba(255, 241, 216, 0.06);
}

.suspect-card::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 12px;
  width: 86px;
  height: 42px;
  z-index: 3;
  background:
    radial-gradient(circle at 12px 25px, rgba(255, 241, 216, 0.76) 0 4px, transparent 5px),
    radial-gradient(circle at 4px 14px, rgba(255, 241, 216, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 12px 10px, rgba(255, 241, 216, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 20px 14px, rgba(255, 241, 216, 0.6) 0 2px, transparent 3px),
    radial-gradient(circle at 58px 25px, rgba(255, 241, 216, 0.62) 0 4px, transparent 5px),
    radial-gradient(circle at 50px 14px, rgba(255, 241, 216, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 58px 10px, rgba(255, 241, 216, 0.5) 0 2px, transparent 3px),
    radial-gradient(circle at 66px 14px, rgba(255, 241, 216, 0.5) 0 2px, transparent 3px);
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.45));
  animation: pawFloat 2.8s ease-in-out infinite;
}

.suspect-card + .photo-picker {
  margin: 12px 0 0;
}

.suspect-photo {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 34%;
  position: relative;
  z-index: 2;
}

.suspect-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 241, 216, 0.45);
  font-weight: 800;
  background:
    radial-gradient(circle at 50% 42%, rgba(215, 168, 79, 0.16), transparent 8rem),
    linear-gradient(145deg, #51202a, #19090c);
}

.suspect-badge {
  position: absolute;
  left: 14px;
  bottom: 14px;
  z-index: 3;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(22, 8, 11, 0.72);
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.charge-box {
  margin-top: 28px;
  padding: 22px;
}

.charge-box p {
  margin: 0;
  color: var(--cream);
  line-height: 1.5;
}

.meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 18px;
}

.meta-grid div {
  min-height: 96px;
  padding: 16px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.18);
}

.meta-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.meta-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 16px;
}

.evidence-list {
  display: grid;
  gap: 12px;
  margin-top: 28px;
}

.evidence-list article {
  display: grid;
  grid-template-columns: 48px 1fr;
  gap: 14px;
  padding: 16px;
}

.card.active .evidence-list article {
  animation: evidenceIn 520ms ease both;
}

.card.active .evidence-list article:nth-child(1) {
  animation-delay: 80ms;
}

.card.active .evidence-list article:nth-child(2) {
  animation-delay: 180ms;
}

.card.active .evidence-list article:nth-child(3) {
  animation-delay: 280ms;
}

.card.active .evidence-list article:nth-child(4) {
  animation-delay: 380ms;
}

.evidence-list span {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(215, 168, 79, 0.14);
  color: var(--gold);
  font-weight: 900;
}

.evidence-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.verdict {
  text-align: center;
}

.stamp {
  width: fit-content;
  margin: -8px auto 22px;
  padding: 10px 18px;
  border: 2px solid rgba(215, 168, 79, 0.78);
  border-radius: 12px;
  color: var(--gold);
  font-weight: 900;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.card.active .stamp {
  animation: stampIn 620ms cubic-bezier(0.2, 1.65, 0.45, 1) 180ms both;
}

.sparkles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.sparkles span {
  position: absolute;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 18px rgba(215, 168, 79, 0.9);
  opacity: 0;
  animation: sparkleFall 2.4s ease-in-out infinite;
}

.sparkles span:nth-child(1) { left: 16%; animation-delay: 0ms; }
.sparkles span:nth-child(2) { left: 34%; animation-delay: 360ms; }
.sparkles span:nth-child(3) { left: 52%; animation-delay: 130ms; }
.sparkles span:nth-child(4) { left: 70%; animation-delay: 520ms; }
.sparkles span:nth-child(5) { left: 84%; animation-delay: 240ms; }

.gavel {
  width: 92px;
  height: 92px;
  margin: 0 auto 26px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.46);
  border-radius: 50%;
  color: var(--gold);
  font-family: Georgia, serif;
  font-size: 54px;
}

@keyframes reveal {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes backgroundDrift {
  from { background-position: 0 0, 0 0, 0 0; }
  to { background-position: 22px -18px, -18px 24px, 0 0; }
}

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

@keyframes portraitGlow {
  0%, 100% { box-shadow: 0 0 0 rgba(215, 168, 79, 0.14); }
  50% { box-shadow: 0 0 34px rgba(215, 168, 79, 0.22); }
}

@keyframes haloSpin {
  to { transform: rotate(1turn); }
}

@keyframes pawFloat {
  0%, 100% { transform: translateY(0); opacity: 0.55; }
  50% { transform: translateY(6px); opacity: 0.9; }
}

@keyframes evidenceIn {
  from {
    opacity: 0;
    transform: translateX(-14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes stampIn {
  from {
    opacity: 0;
    transform: rotate(-7deg) scale(1.8);
    filter: blur(2px);
  }
  to {
    opacity: 1;
    transform: rotate(-7deg) scale(1);
    filter: blur(0);
  }
}

@keyframes sparkleFall {
  0% {
    top: 8%;
    opacity: 0;
    transform: translateY(0) scale(0.5);
  }
  20% { opacity: 1; }
  100% {
    top: 78%;
    opacity: 0;
    transform: translateY(26px) scale(1.15);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1ms !important;
  }
}

@media (max-width: 380px) {
  .card {
    padding: 22px;
    border-radius: 28px;
  }

  .portrait-wrap {
    width: 168px;
    height: 212px;
  }
}

/* Analog case-file pass: less glossy, more designed-by-hand. */
:root {
  --paper: #ead7b9;
  --ink: #2b1713;
  --red-pen: #b94a3d;
}

body {
  background:
    radial-gradient(circle at top left, rgba(199, 148, 59, 0.14), transparent 29rem),
    radial-gradient(circle at bottom right, rgba(104, 26, 41, 0.42), transparent 26rem),
    linear-gradient(145deg, #140608, #2b0e14 58%, #11070a);
}

body::before {
  background-image:
    linear-gradient(rgba(255, 241, 216, 0.024) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 241, 216, 0.024) 1px, transparent 1px);
  background-size: 42px 42px;
}

.card {
  background:
    linear-gradient(rgba(255, 241, 216, 0.026) 1px, transparent 1px),
    radial-gradient(circle at 18% 12%, rgba(255, 241, 216, 0.07), transparent 12rem),
    linear-gradient(160deg, rgba(48, 22, 20, 0.96), rgba(39, 23, 20, 0.94));
  background-size: 100% 29px, auto, auto;
  box-shadow: 0 22px 62px rgba(0, 0, 0, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.card::after {
  content: "CONFIDENTIAL";
  color: rgba(234, 215, 185, 0.045);
  font-size: 44px;
}

.file-tab {
  position: absolute;
  right: 26px;
  top: 0;
  padding: 8px 16px 9px;
  border-radius: 0 0 14px 14px;
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.portrait-wrap,
.suspect-card {
  border: 8px solid var(--paper);
  border-bottom-width: 26px;
  border-radius: 8px;
  padding: 0;
  background: var(--paper);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.28);
  animation: none;
}

.portrait-wrap {
  transform: rotate(-1.5deg);
}

.suspect-card {
  transform: rotate(1deg);
}

.portrait-wrap::before {
  content: "Delil A";
  inset: auto auto -22px 10px;
  border-radius: 0;
  background: none;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  opacity: 1;
  animation: none;
  text-transform: uppercase;
}

.portrait,
.portrait-fallback {
  border-radius: 3px;
}

.portrait-fallback {
  inset: 0 0 26px;
}

.suspect-card::before {
  content: "Delil B";
  position: absolute;
  left: 10px;
  bottom: -21px;
  z-index: 4;
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hand-note {
  width: fit-content;
  margin: 18px 0 0;
  color: #f0c3b7;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
  transform: rotate(-1.5deg);
}

.charge-box,
.evidence-list article {
  background: rgba(234, 215, 185, 0.07);
}

.evidence-list article {
  position: relative;
}

.evidence-list article::after {
  content: "incelendi";
  position: absolute;
  right: 14px;
  top: 10px;
  color: rgba(185, 74, 61, 0.55);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-7deg);
}

.stamp {
  border-color: rgba(185, 74, 61, 0.8);
  color: #e3a096;
}

.sparkles span {
  width: 5px;
  height: 5px;
  background: rgba(234, 215, 185, 0.68);
  box-shadow: 0 0 10px rgba(234, 215, 185, 0.36);
}
