/* Entry 030 — Make me an offer
   Series: Negotiated Interfaces (second entry).
   Scene art direction: a quiet, tense diplomatic room at the blue hour — deep composed
   navy, one cool light from the upper-left, two chairs pulled to a table where something
   is being settled. Background-first: a real photograph (dark-cool, Thomas Lefebvre) under
   a cool legibility scrim. One frosted-glass negotiation table floats in still, dark air:
   split into what the app asks and what you'll give, terms tradeable term by term, a warm
   gold accent for the deal on the table.
   Own recipe, distinct from 028 (clay-amber / Spectral / Space Grotesk / 20px, warm dune),
   029 (jade / Source Serif 4 / JetBrains Mono / 16px, misty teal) and 027 (cyan / Fraunces /
   IBM Plex Mono / 12px, mono defocus): brass-gold accent #d6b25e, Instrument Serif (the
   negotiator's voice) + Archivo (the machine's ledger of terms), a crisper 10px radius, a
   cool deep-navy room. */

.deal-scene {
  --deep: #081827;
  --panel-ink: #e7eef4;
  --panel-dim: rgba(199, 214, 226, 0.62);
  --slate: #7c93a8;           /* unresolved / cool terms */
  --accent: #d6b25e;          /* brass gold — the deal on the table */
  --accent-glow: #f0d492;
  --hold: #c9663f;            /* the one line it holds — a warm alarm */
  --radius: 10px;

  display: grid;
  place-items: center;
  min-height: 860px;
  padding: 120px 32px;
  border-color: rgba(6, 14, 22, 0.72);
  /* background-first: the deep-navy blue-hour photograph carries the mood; a cool scrim
     keeps the table legible and pulls the corners into shadow. */
  background-image:
    linear-gradient(165deg, rgba(6, 15, 25, 0.70) 0%, rgba(9, 22, 36, 0.40) 46%, rgba(4, 11, 19, 0.78) 100%),
    url("../../public/media/backgrounds/dark-cool-15-thomas.jpg");
  background-size: cover, cover;
  background-position: center, center 42%;
  background-repeat: no-repeat, no-repeat;
}

/* mid layer — a soft pool of cool light raking down onto the table */
.pool {
  position: absolute;
  z-index: 0;
  left: 46%;
  top: 40%;
  width: min(1000px, 100%);
  height: 620px;
  transform: translate(-50%, -50%);
  background:
    radial-gradient(54% 54% at 44% 40%, rgba(150, 184, 214, 0.20), transparent 70%),
    radial-gradient(40% 44% at 64% 64%, rgba(214, 178, 94, 0.10), transparent 76%);
  filter: blur(66px);
  pointer-events: none;
}

/* ------------------------------------------------------------------ */
/* THE COMPONENT — a permission prompt that bargains                   */
/* ------------------------------------------------------------------ */

.deal {
  position: relative;
  z-index: 2;
  width: min(640px, 100%);
  display: grid;
  gap: 22px;
  padding: 34px 36px 26px;
  border-radius: var(--radius);
  font-family: "Archivo", var(--ui-sans);
  color: var(--panel-ink);
  background:
    linear-gradient(168deg, rgba(150, 182, 210, 0.13), rgba(8, 18, 30, 0.36));
  border: 1px solid rgba(150, 184, 214, 0.20);
  box-shadow:
    0 1px 0 rgba(214, 232, 244, 0.22) inset,
    0 0 0 1px rgba(4, 10, 17, 0.28),
    0 54px 122px rgba(2, 7, 13, 0.62),
    0 14px 46px rgba(12, 40, 66, 0.24);
  backdrop-filter: blur(26px) saturate(1.2);
  -webkit-backdrop-filter: blur(26px) saturate(1.2);
}

/* --- head: who's asking + a live status --- */
.deal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(150, 184, 214, 0.16);
}

.who { display: flex; align-items: center; gap: 13px; }

.app-badge {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 11px;
  font-family: "Instrument Serif", serif;
  font-size: 1.4rem;
  color: #10202f;
  background: linear-gradient(160deg, var(--accent-glow), var(--accent));
  box-shadow: 0 6px 18px rgba(214, 178, 94, 0.3), 0 1px 0 rgba(255,255,255,0.4) inset;
}

.who-text { display: grid; gap: 1px; }
.app-name { font-size: 1.02rem; font-weight: 600; letter-spacing: 0.01em; }
.app-sub { font-size: 0.74rem; color: var(--panel-dim); letter-spacing: 0.01em; }

.status {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(199, 214, 226, 0.66);
  white-space: nowrap;
}
.status-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 0 0 rgba(240, 212, 146, 0.5);
  animation: pulse 1.8s ease-in-out infinite;
}
.status[data-state="signed"] .status-dot { background: var(--accent); box-shadow: 0 0 10px rgba(214,178,94,0.7); animation: none; }
.status[data-state="held"] .status-dot { background: var(--hold); box-shadow: 0 0 10px rgba(201,102,63,0.7); animation: none; }
.status[data-state="left"] .status-dot { background: var(--slate); animation: none; }
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(240,212,146,0.5); opacity: 1; }
  50% { box-shadow: 0 0 0 6px rgba(240,212,146,0); opacity: 0.6; }
}

/* --- the app's spoken position: Instrument Serif, the negotiator's voice --- */
.says {
  margin: 0;
  font-family: "Instrument Serif", var(--serif, Georgia), serif;
  font-size: 1.42rem;
  line-height: 1.42;
  letter-spacing: 0.004em;
  color: #f3f0e6;
  min-height: 2.7em;
}
.says .em { color: var(--accent-glow); font-style: italic; }
.says.is-hold { color: #f6d9cb; }
.says.is-hold .em { color: #f0a988; }
.says.is-flash { animation: saysIn 0.5s ease; }
@keyframes saysIn { from { opacity: 0.3; transform: translateY(3px); } to { opacity: 1; transform: none; } }

/* --- the terms table --- */
.terms { display: grid; gap: 10px; }

.term {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 16px;
  padding: 13px 15px;
  border-radius: 9px;
  border: 1px solid rgba(150, 184, 214, 0.16);
  background: rgba(14, 30, 46, 0.42);
  transition: border-color 0.25s ease, background 0.25s ease;
}
.term.is-active { border-color: rgba(214, 178, 94, 0.42); background: rgba(24, 40, 54, 0.5); }
.term.is-held { border-color: rgba(201, 102, 63, 0.45); }

.term-name {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.term-buys {
  grid-column: 1 / 2;
  font-size: 0.74rem;
  line-height: 1.4;
  color: var(--panel-dim);
  font-family: "Instrument Serif", serif;
  font-style: italic;
  letter-spacing: 0.01em;
}
.term-buys b { font-style: normal; font-weight: 400; color: var(--accent-glow); }

/* segmented offer control */
.levels {
  grid-row: 1 / 3;
  grid-column: 2 / 3;
  display: inline-flex;
  padding: 3px;
  border-radius: 8px;
  background: rgba(6, 15, 25, 0.55);
  border: 1px solid rgba(150, 184, 214, 0.14);
}
.lvl {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: rgba(199, 214, 226, 0.66);
  padding: 6px 11px;
  border: none;
  border-radius: 6px;
  background: transparent;
  transition: all 0.18s ease;
  white-space: nowrap;
}
.lvl:hover { color: #e7eef4; }
.lvl.is-on {
  color: #10202f;
  font-weight: 600;
  background: linear-gradient(180deg, var(--accent-glow), var(--accent));
  box-shadow: 0 2px 8px rgba(214, 178, 94, 0.28);
}
.lvl.is-on.lvl-none { background: linear-gradient(180deg, #9fb1c2, var(--slate)); color: #0c1a26; }
.term.is-held .lvl.is-on.lvl-none { background: linear-gradient(180deg, #e29a7c, var(--hold)); color: #24100a; }

/* --- foot: meters + tally --- */
.deal-foot {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(150, 184, 214, 0.16);
}
.meters { display: grid; gap: 9px; }
.meter {
  display: grid;
  grid-template-columns: 12ch 1fr auto;
  align-items: center;
  gap: 12px;
  font-size: 0.68rem;
  letter-spacing: 0.02em;
}
.meter-label { color: rgba(199, 214, 226, 0.6); text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.58rem; }
.bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(6, 15, 25, 0.6);
  overflow: hidden;
  border: 1px solid rgba(150, 184, 214, 0.12);
}
.fill { display: block; height: 100%; width: 0%; border-radius: 999px; transition: width 0.5s cubic-bezier(.2,.7,.2,1); }
.fill-cap { background: linear-gradient(90deg, var(--accent), var(--accent-glow)); }
.fill-take { background: linear-gradient(90deg, #5b7590, var(--slate)); }
.meter-val { font-variant-numeric: tabular-nums; color: rgba(224, 232, 240, 0.82); font-size: 0.72rem; min-width: 3.2ch; text-align: right; }

.tally {
  margin: 0;
  font-family: "Instrument Serif", serif;
  font-style: italic;
  font-size: 1rem;
  color: rgba(220, 230, 240, 0.82);
}
.tally b { font-style: normal; font-weight: 600; color: var(--accent-glow); }

/* --- controls --- */
.controls { display: flex; gap: 10px; flex-wrap: wrap; padding-top: 2px; }
.btn {
  appearance: none;
  cursor: pointer;
  font: inherit;
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  padding: 10px 18px;
  border-radius: 8px;
  transition: all 0.2s ease;
}
.btn-sign {
  color: #10202f;
  font-weight: 600;
  border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-glow), var(--accent));
  box-shadow: 0 6px 18px rgba(214, 178, 94, 0.24);
}
.btn-sign:hover { filter: brightness(1.06); }
.btn-walk {
  color: rgba(215, 226, 236, 0.82);
  border: 1px solid rgba(150, 184, 214, 0.3);
  background: transparent;
}
.btn-walk:hover { border-color: rgba(199, 214, 226, 0.55); color: #eef4f9; }
.btn-reset {
  color: rgba(215, 226, 236, 0.82);
  border: 1px solid rgba(150, 184, 214, 0.3);
  background: transparent;
}
.btn-reset:hover { border-color: rgba(214,178,94,0.5); color: #eef4f9; }

.receipt {
  margin: 0;
  padding: 12px 14px;
  border-radius: 8px;
  border-left: 2px solid var(--accent);
  background: rgba(24, 40, 54, 0.5);
  font-size: 0.82rem;
  line-height: 1.5;
  color: rgba(224, 232, 240, 0.88);
}
.receipt.is-left { border-left-color: var(--slate); }
.receipt.is-held { border-left-color: var(--hold); color: #f4ded2; }
.receipt b { color: var(--accent-glow); font-weight: 600; }
.receipt.is-held b { color: #f0a988; }
.receipt .kept { color: #cfe0ee; }

.disclaimer {
  margin: 0;
  font-size: 0.68rem;
  letter-spacing: 0.01em;
  color: rgba(180, 198, 212, 0.5);
}

.scene-credit {
  position: absolute;
  right: 14px;
  bottom: 11px;
  z-index: 3;
  font-family: var(--ui-sans);
  font-size: 0.58rem;
  letter-spacing: 0.05em;
  color: rgba(224, 236, 244, 0.4);
}

@media (max-width: 640px) {
  .deal-scene { padding: 84px 15px; min-height: 800px; }
  .deal { padding: 26px 20px 22px; gap: 18px; }
  .says { font-size: 1.2rem; min-height: 3.2em; }
  .term { grid-template-columns: 1fr; }
  .levels { grid-row: auto; grid-column: 1 / 2; justify-self: start; }
  .meter { grid-template-columns: 1fr auto; }
  .meter .bar { grid-column: 1 / 3; order: 3; }
}
