/* Dropular — candle / vigil aesthetic.
   Warm dark only. Newsreader serif + Inter sans + JetBrains Mono. */

:root {
  --bg: #0d0905;
  --bg-card: #14100a;
  --bg-card-2: #1a140c;
  --bg-inset: #0a0703;

  --border: #2a2014;
  --border-strong: #3a2c1a;
  --border-dashed: #3a2c1a;

  --cream: #f3e9d2;
  --cream-dim: #c9bfa6;
  --muted: #8a7d62;
  --muted-2: #6a5e48;
  --faint: #4a4030;

  --gold: #d9a86a;
  --gold-bright: #e8bd80;
  --gold-dim: #a07a3a;
  --gold-deep: #5a401e;
  --gold-bg: rgba(217, 168, 106, 0.08);

  --green: #8ab37a;
  --red: #c47a5a;

  --serif: "Newsreader", "Source Serif 4", Georgia, serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; max-width: 100vw; overflow-x: hidden; }

body {
  background: var(--bg);
  color: var(--cream);
  font-family: var(--sans);
  line-height: 1.55;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; }
button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; color: inherit; }
button:disabled { opacity: 0.5; cursor: not-allowed; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

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

/* ─── Page shell ────────────────────────────────────────── */

.page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 24px;
}

.frame {
  width: 880px;
  max-width: 100%;
  padding: 48px 56px;
  background: var(--bg);
  color: var(--cream);
  font-family: var(--serif);
}

.eyebrow-row {
  margin-bottom: 28px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 56px;
  align-items: baseline;
}
.eyebrow-row > span:first-child {
  font: 600 13px var(--mono);
  color: var(--muted);
  letter-spacing: 2px;
}
.eyebrow-row .right {
  display: block;
  text-align: center;
  font: 600 13px var(--mono);
  color: var(--gold);
  letter-spacing: 2px;
}

.cols {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 56px;
  align-items: start;
}

/* ─── Hero ──────────────────────────────────────────────── */

.lead-title {
  font: 400 64px/0.98 var(--serif);
  letter-spacing: -1.2px;
  color: var(--cream);
  margin: 0;
}
.lead-title em {
  color: var(--gold);
  font-style: italic;
}
.lead-title .sub {
  display: block;
  margin-top: 8px;
  font-size: 38px;
  color: var(--cream-dim);
  line-height: 1.05;
  font-style: normal;
}
.lead-title .sub.small { font-size: 30px; line-height: 1.1; }
.lead-title .sub.mid   { font-size: 34px; line-height: 1.1; margin-top: 4px; }

.lead-sub {
  font: 16px/1.6 var(--serif);
  color: var(--cream-dim);
  max-width: 480px;
  margin-top: 28px;
}
.lead-sub strong { color: var(--cream); font-weight: 400; }
.lead-sub em { color: var(--gold); font-style: italic; }
.lead-sub .minted-fname {
  display: block;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}
.lead-sub .minted-stats { display: block; }

/* ─── Dropzone (Upload screen) ──────────────────────────── */

.dropzone {
  width: 100%;
  max-width: 520px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 40px 32px;
  background: var(--bg-card);
  color: var(--cream);
  border: 1px dashed var(--border-strong);
  font: italic 22px var(--serif);
  cursor: pointer;
  transition: border-color 200ms, background 200ms;
}
.dropzone.dragging {
  background: var(--bg-card-2);
  border-color: var(--gold);
}
.dropzone.dragging .label { color: var(--gold); }
.dropzone .caption {
  font: 12px var(--mono);
  color: var(--muted-2);
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ─── Uploading state ───────────────────────────────────── */

.uploading {
  max-width: 520px;
}
.uploading .label {
  font: 500 11px var(--mono);
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.uploading .filename {
  margin-top: 16px;
  font: italic 17px var(--serif);
  color: var(--muted);
}

.bar {
  position: relative;
  height: 4px;
  background: var(--bg-inset);
  border: 1px solid var(--border);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  background: var(--gold);
  width: 0%;
  transition: width 80ms linear;
}

/* ─── Minted (link ready) ───────────────────────────────── */

.minted-actions {
  margin-top: 36px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.copy-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 16px 24px;
  background: var(--gold);
  color: #2a1a05;
  border: none;
  font: 500 16px var(--serif);
  transition: background 120ms, color 120ms;
}
.copy-link-btn:hover { background: var(--gold-bright); }
.copy-link-btn.copied {
  background: var(--bg-card-2);
  color: var(--gold);
  border: 1px solid var(--gold-deep);
}
.copy-link-btn .url {
  font: 13px var(--mono);
  color: rgba(42, 26, 5, 0.7);
}
.copy-link-btn.copied .url { display: none; }

.btn-outline {
  padding: 14px 22px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border-strong);
  font: 500 15px var(--serif);
  transition: border-color 120ms;
}
.btn-outline:hover { border-color: var(--gold-deep); }

/* ─── Footer line ───────────────────────────────────────── */

.footer-line {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-strong);
  font: 13px var(--sans);
  color: var(--muted);
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-line .dot { color: var(--faint); }

/* ─── Candle column ─────────────────────────────────────── */

.candle-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}
.candle-col .caption {
  font: italic 14px/1.4 var(--serif);
  color: var(--muted);
  text-align: center;
  max-width: 220px;
  min-height: 40px;
}
.candle-col .caption em { color: var(--gold); font-style: italic; }
.candle-col .ttl-mono {
  font: 13px var(--mono);
  color: var(--gold);
  text-align: center;
  letter-spacing: 1px;
}
.candle-col .burns-out {
  font: 11px var(--mono);
  color: var(--muted);
  text-align: center;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-top: -4px;
}

/* ─── Vigil meta strip ──────────────────────────────────── */

.meta-strip {
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--border-strong);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font: 13px var(--mono);
  flex-wrap: wrap;
}
.meta-strip > div {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.meta-strip .k {
  color: var(--cream-dim);
  font-size: 13px;
  letter-spacing: 0.5px;
}
.meta-strip .v {
  color: var(--muted-2);
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
}

/* ─── Vigil actions ─────────────────────────────────────── */

.vigil-actions {
  margin-top: 40px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 26px;
  background: var(--gold);
  color: #2a1a05;
  border: none;
  font: 500 16px var(--serif);
  transition: background 120ms, color 120ms;
}
.download-btn:hover:not(:disabled):not(.paid) { background: var(--gold-bright); }
.download-btn .hint {
  font: italic 15px var(--serif);
  color: rgba(42, 26, 5, 0.6);
}
.download-btn.downloading { cursor: default; }
.download-btn.downloading .pct {
  font: 500 14px var(--mono);
}
.download-btn .progress-rail {
  flex: 1;
  min-width: 80px;
  height: 4px;
  background: rgba(42, 26, 5, 0.25);
  position: relative;
  overflow: hidden;
}
.download-btn .progress-rail-fill {
  position: absolute;
  inset: 0;
  width: 0%;
  background: #2a1a05;
  transition: width 80ms linear;
}
.download-btn.paid {
  background: var(--bg-card-2);
  color: var(--gold);
  border: 1px solid var(--gold-deep);
}
.download-btn.paid .hint { color: var(--muted); }

.share-row {
  display: flex;
  gap: 12px;
}

.burn-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 12px 22px;
  background: transparent;
  color: var(--red);
  border: 1px dashed var(--red);
  font: 500 14px var(--serif);
  transition: background 120ms, color 120ms;
  cursor: pointer;
}
.burn-btn:hover:not(:disabled) {
  background: rgba(196, 122, 90, 0.08);
  color: var(--red);
}
.burn-btn .hint {
  font: italic 12px var(--serif);
  color: var(--muted);
}
.burn-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 14px 22px;
  background: transparent;
  color: var(--cream);
  border: 1px solid var(--border-strong);
  font: 500 15px var(--serif);
  transition: color 120ms, border-color 120ms, background-color 320ms;
  min-width: 0;
}
.share-btn:hover { border-color: var(--gold-deep); }
.share-btn.copied {
  background: var(--gold-bg);
  color: var(--gold);
  border-color: var(--gold-deep);
}
.share-btn .hint {
  flex: 1;
  min-width: 0;
  font: 13px var(--mono);
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.share-btn.grow { flex: 1 1 0; }

.under-actions {
  margin-top: 18px;
  font: 13px var(--sans);
  color: var(--muted);
  display: flex;
  gap: 10px;
  align-items: baseline;
  flex-wrap: wrap;
}
.under-actions .dot { color: var(--faint); }
.under-actions .light-your-own {
  color: var(--gold);
  text-decoration: none;
  font-style: italic;
  font-family: var(--serif);
}
.under-actions .light-your-own:hover { color: var(--gold-bright); }

/* ─── File glyph ────────────────────────────────────────── */

.fileglyph {
  width: 56px; height: 56px;
  display: inline-flex; align-items: center; justify-content: center;
  background-image: repeating-linear-gradient(
    -45deg,
    transparent 0, transparent 4px,
    rgba(217, 168, 106, 0.18) 4px, rgba(217, 168, 106, 0.18) 5px
  );
  border: 1px solid var(--border-strong);
  color: var(--gold);
  font: 600 11px var(--mono);
  letter-spacing: 0.5px;
  flex-shrink: 0;
}

/* ─── 404 / not-found ───────────────────────────────────── */

.not-found {
  text-align: center;
}
.not-found .eyebrow {
  display: inline-block;
  font: 500 11px var(--mono);
  letter-spacing: 2.5px;
  color: var(--muted);
  margin-bottom: 18px;
}

/* ─── Toast ─────────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-card);
  color: var(--cream);
  border: 1px solid var(--border-strong);
  padding: 12px 18px;
  font: 13px var(--mono);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  max-width: calc(100% - 32px);
  z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.toast.err { border-color: var(--red); color: var(--red); }
.toast.ok  { border-color: var(--green); color: var(--green); }

/* ─── Custom scrollbar ──────────────────────────────────── */

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--gold-deep); }

/* ─── Responsive ────────────────────────────────────────── */

@media (max-width: 760px) {
  .page {
    padding: 24px 16px;
    align-items: flex-start;
  }
  .frame { padding: 28px 22px; }
  .cols { grid-template-columns: 1fr; gap: 12px; }
  .lead-title { font-size: clamp(38px, 9vw, 56px); }
  .lead-title .sub { font-size: clamp(24px, 6vw, 32px); }
  .share-btn.grow { flex: 1 1 0; }
  .meta-strip { gap: 28px; }
  .copy-link-btn .url { display: none; }
  .eyebrow-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 20px;
  }
  .eyebrow-row > span:first-child,
  .eyebrow-row .right { font-size: 11px; letter-spacing: 1.5px; }
  .eyebrow-row .right { text-align: right; }

  /* Candle: shrink it; non-interactive, decoration only on mobile. */
  .candle-col { gap: 6px; }
  .candle-col svg { width: 96px; height: auto; }
  .candle-col .caption { font-size: 12px; min-height: 0; }
  .candle-col .ttl-mono { font-size: 11px; }
  .candle-col .burns-out { font-size: 10px; }
  /* Footer line: keep inline-with-wrap but hide the standalone dot. */
  .footer-line { gap: 8px 16px; margin-top: 20px; padding-top: 18px; }
  .footer-line .dot { display: none; }
}
