/* Entry 020 — The things you deleted
   Series: Soulware.
   Scene art direction: a pool of dark slow water at the cold hour. The surface
   ripples in cool steel-blue; one warm copper refraction glows up from beneath —
   the heat of the unsaid. One frosted-glass messaging panel floats in the cool
   dark. The serif deleted drafts are the hero; they surface warm against all
   that blue. One accent: copper-coral. Display voices distinct to this entry:
   DM Serif Display (the soul) + Sora (the machine).
   Don't reuse the previous entry's recipe (019 was warm dune / iris-blue /
   Bodoni+Hanken / sharp radii). This one is cool water / copper / soft radii. */

.deleted-scene {
  --accent: #de7a4d;          /* copper-coral — the warmth already in the water */
  --accent-glow: #f2a878;
  --accent-deep: #b9613a;
  --on-dark: #eef1f6;         /* cool near-white, never #fff */
  --faint: rgba(206, 218, 232, 0.62);
  --glass-line: rgba(176, 198, 222, 0.22);

  position: relative;
  display: grid;
  place-items: center;
  min-height: 800px;
  padding: 120px 32px;
  border-color: rgba(10, 16, 24, 0.7);
  /* background-first: a real photograph (cool rippled water, one warm refraction)
     carries the scene; a cool scrim keeps the panel and type legible. */
  background-image:
    linear-gradient(176deg, rgba(8, 13, 20, 0.62) 0%, rgba(9, 15, 23, 0.36) 42%, rgba(6, 11, 18, 0.78) 100%),
    url("../../public/media/backgrounds/dark-cool-05-chuttersnap.jpg");
  background-size: cover, cover;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  font-family: "Sora", var(--ui-sans);
}

/* mid layer — the warm refraction, spilled and blurred up from the deep */
.refract {
  position: absolute;
  z-index: 0;
  left: 60%;
  top: 64%;
  width: min(720px, 84%);
  height: 420px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(58% 58% at 50% 50%, rgba(222, 122, 78, 0.20), transparent 72%);
  filter: blur(64px);
  pointer-events: none;
  transition: opacity 1100ms ease, transform 1100ms ease;
}

/* ------------------------------------------------------------------ */
/* THE COMPONENT — one frosted-glass messaging panel                   */
/* ------------------------------------------------------------------ */

.deleted-panel {
  position: relative;
  z-index: 2;
  width: min(660px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px 32px 28px;
  border-radius: 26px;
  /* cool frosted glass: a thin film of light over the water */
  background:
    linear-gradient(166deg, rgba(150, 178, 210, 0.12), rgba(12, 20, 34, 0.30));
  border: 1px solid var(--glass-line);
  box-shadow:
    0 1px 0 rgba(210, 226, 246, 0.26) inset,
    0 0 0 1px rgba(8, 12, 22, 0.20),
    0 60px 130px rgba(5, 9, 18, 0.66),
    0 16px 50px rgba(20, 40, 70, 0.30);
  backdrop-filter: blur(30px) saturate(1.25);
  -webkit-backdrop-filter: blur(30px) saturate(1.25);
  color: var(--on-dark);
}

/* machine chrome — small, sans, recessive */
.panel-meta {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-family: "Sora", var(--ui-sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(196, 210, 230, 0.6);
}
.panel-meta .dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 10px rgba(222, 122, 78, 0.85);
}
.panel-meta .sep { opacity: 0.45; }
.panel-meta .who { color: rgba(214, 226, 244, 0.82); }

/* a quiet caption that names the reveal — serif, the soul voice */
.panel-line {
  margin: 0;
  font-family: "DM Serif Display", "Newsreader", Georgia, serif;
  font-weight: 400;
  font-size: clamp(21px, 3.0vw, 28px);
  line-height: 1.18;
  letter-spacing: 0.004em;
  color: #f3eee9;
  text-wrap: balance;
}
.panel-line em { font-style: italic; color: var(--accent-glow); }

/* ---- the thread ---- */
.thread {
  display: grid;
  gap: 14px;
  margin: 2px 0 2px;
}

.msg {
  justify-self: end;
  width: fit-content;
  max-width: 84%;
  display: grid;
  gap: 0;
  cursor: default;
  transition: opacity 420ms ease, transform 420ms cubic-bezier(0.2, 0.6, 0.2, 1);
}

/* the sent (polite) bubble — cool glass, right-aligned */
.sent {
  justify-self: end;
  padding: 11px 16px;
  border-radius: 20px 20px 6px 20px;
  font-family: "Sora", var(--ui-sans);
  font-size: 15px;
  line-height: 1.4;
  color: #e8eef6;
  background: linear-gradient(180deg, rgba(120, 152, 196, 0.26), rgba(58, 86, 130, 0.30));
  border: 1px solid rgba(170, 196, 230, 0.26);
  box-shadow: 0 8px 22px rgba(8, 16, 32, 0.34);
}

/* the deleted draft — hidden until revealed, then rises warm in serif */
.draft {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  justify-self: end;
  text-align: right;
  font-family: "DM Serif Display", "Newsreader", Georgia, serif;
  font-size: clamp(16px, 2.0vw, 19px);
  line-height: 1.34;
  color: var(--accent-glow);
  transition: max-height 560ms cubic-bezier(0.2, 0.6, 0.2, 1), opacity 520ms ease, margin-top 520ms ease;
}
.draft .draft-label {
  display: block;
  font-family: "Sora", var(--ui-sans);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(222, 122, 78, 0.7);
  margin-bottom: 3px;
}
.draft .draft-text { display: block; max-width: 38ch; }

/* revealed state */
.deleted-panel[data-mode="deleted"] .msg { cursor: pointer; }
.deleted-panel[data-mode="deleted"] .draft {
  max-height: 160px;
  opacity: 1;
  margin-top: 8px;
}
.deleted-panel[data-mode="deleted"] .sent { opacity: 0.66; }

/* focus: one draft lifts, the others recede */
.deleted-panel[data-mode="deleted"].has-focus .msg:not(.is-focus) { opacity: 0.3; }
.msg.is-focus { transform: translateY(-2px) scale(1.012); }
.msg.is-focus .sent { opacity: 0.8; }

.focus-line {
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin: 0;
  font-family: "DM Serif Display", "Newsreader", Georgia, serif;
  font-style: italic;
  font-size: 17px;
  line-height: 1.4;
  color: #f0e7df;
  border-left: 2px solid var(--accent);
  padding-left: 0;
  transition: max-height 420ms ease, opacity 380ms ease, padding-left 380ms ease;
}
.deleted-panel.has-focus .focus-line {
  max-height: 80px;
  opacity: 1;
  padding-left: 14px;
}

/* ---- app's-view redaction ---- */
.deleted-panel[data-owner="app"] .draft .draft-text {
  color: transparent;
  background: linear-gradient(180deg, rgba(150, 166, 186, 0.32), rgba(120, 138, 160, 0.32));
  border-radius: 5px;
  box-decoration-break: clone;
  -webkit-box-decoration-break: clone;
  user-select: none;
}
.deleted-panel[data-owner="app"] .draft .draft-label::after {
  content: " · kept on a server you don't own";
  color: rgba(196, 210, 230, 0.5);
  letter-spacing: 0.06em;
}

/* ---- the live composer ---- */
.composer {
  margin-top: 2px;
  padding-top: 20px;
  border-top: 1px solid rgba(176, 198, 222, 0.16);
  display: grid;
  gap: 14px;
}
.composer-field {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 12px 18px;
  border-radius: 16px;
  background: rgba(14, 22, 36, 0.42);
  border: 1px solid rgba(176, 198, 222, 0.2);
}
.composer-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: "Sora", var(--ui-sans);
  font-size: 15px;
  color: #eaf0f8;
  caret-color: var(--accent);
}
.composer-input::placeholder { color: rgba(196, 210, 230, 0.42); }
.composer-send {
  flex: none;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(176, 198, 222, 0.26);
  background: rgba(120, 152, 196, 0.2);
  color: #dfe8f4;
  font-size: 15px;
  cursor: pointer;
  transition: transform 160ms ease, background 200ms ease;
}
.composer-send:hover { transform: translateY(-1px); background: rgba(120, 152, 196, 0.32); }

/* the kept drawer — where erased fragments sink */
.kept {
  display: grid;
  gap: 10px;
}
.kept-head {
  margin: 0;
  font-family: "Sora", var(--ui-sans);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(196, 210, 230, 0.52);
}
.kept-head b { color: var(--accent-glow); font-weight: 700; }
.kept-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.kept-chip {
  font-family: "DM Serif Display", "Newsreader", Georgia, serif;
  font-size: 14px;
  color: var(--accent-glow);
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(222, 122, 78, 0.1);
  border: 1px solid rgba(222, 122, 78, 0.28);
  animation: sink 520ms cubic-bezier(0.2, 0.6, 0.2, 1) both;
}
@keyframes sink {
  from { opacity: 0; transform: translateY(-10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ---- controls ---- */
.controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-top: 2px;
}
.seg {
  display: inline-flex;
  padding: 4px;
  border-radius: 999px;
  background: rgba(14, 22, 36, 0.5);
  border: 1px solid rgba(176, 198, 222, 0.18);
}
.seg button {
  font-family: "Sora", var(--ui-sans);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  padding: 9px 16px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: rgba(206, 218, 232, 0.66);
  cursor: pointer;
  transition: background 220ms ease, color 220ms ease;
}
.seg button[aria-pressed="true"] {
  background: linear-gradient(180deg, var(--accent), var(--accent-deep));
  color: #1a1009;
  box-shadow: 0 8px 22px rgba(222, 122, 78, 0.34);
}
.owner-toggle {
  font-family: "Sora", var(--ui-sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(206, 218, 232, 0.7);
  background: none;
  border: none;
  border-bottom: 1px dashed rgba(206, 218, 232, 0.4);
  padding: 2px 0;
  cursor: pointer;
  transition: color 200ms ease, border-color 200ms ease;
}
.owner-toggle:hover { color: var(--accent-glow); border-color: var(--accent); }
.owner-toggle .owner-state { color: var(--accent-glow); }
.deleted-panel[data-owner="app"] .owner-toggle .owner-state { color: rgba(196, 210, 230, 0.7); }

/* unobtrusive photo attribution */
.scene-credit {
  position: absolute;
  right: 16px;
  bottom: 13px;
  z-index: 3;
  font-family: var(--ui-sans);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(220, 228, 244, 0.32);
  pointer-events: none;
}

.deleted-scene:has(.deleted-panel[data-mode="deleted"]) .refract { opacity: 1; transform: translate(-50%, -50%) scale(1.06); }

@media (prefers-reduced-motion: reduce) {
  .kept-chip, .draft, .focus-line, .refract { animation: none; transition: none; }
}

@media (max-width: 720px) {
  .deleted-scene { padding: 72px 14px; min-height: 0; }
  .deleted-panel { padding: 26px 20px 22px; border-radius: 22px; gap: 18px; }
  .msg { max-width: 92%; }
  .controls { justify-content: flex-start; }
}
