:root {
  --bg: #14120f;
  --bg-panel: #1c1a16;
  --ink: #ece7dc;
  --ink-dim: #a99f8c;
  --brass: #c9a961;
  --brass-dim: #8a7546;
  --line: #34302a;
  --warn: #d98c4a;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, Segoe UI, system-ui, sans-serif;
  line-height: 1.5;
}

h1, h2, .brand span {
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 700;
  letter-spacing: 0.02em;
}

em { color: var(--brass); font-style: normal; }

/* ---- L3B big splash moment ---- */
#l3b-splash {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  animation: splash-fade 1.8s ease forwards;
  animation-delay: 1.1s;
}
#l3b-splash.hidden { display: none; }
#l3b-splash img { width: 220px; filter: drop-shadow(0 0 30px rgba(201,169,97,0.35)); }
#l3b-splash p { color: var(--brass); font-family: Georgia, serif; font-size: 1.1rem; margin-top: 1rem; letter-spacing: 0.08em; text-transform: uppercase; }
@keyframes splash-fade {
  0% { opacity: 1; pointer-events: all; }
  80% { opacity: 1; pointer-events: all; }
  100% { opacity: 0; pointer-events: none; visibility: hidden; }
}

/* ---- top bar ---- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.brand-mark { width: 40px; height: 40px; object-fit: contain; }
.brand span { font-size: 1.1rem; }
nav a { color: var(--ink-dim); text-decoration: none; margin-left: 1.5rem; font-size: 0.9rem; }
nav a:hover { color: var(--brass); }

main { max-width: 880px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }

.hero { text-align: center; margin-bottom: 2.5rem; }
.hero h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.hero p { color: var(--ink-dim); }
.hero.small h1 { font-size: 1.6rem; }

.flash { background: var(--warn); color: #211a10; padding: 0.8rem 1rem; border-radius: 6px; margin-bottom: 1.5rem; }

/* ---- upload form ---- */
.dropzone {
  position: relative;
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 3rem 1.5rem;
  text-align: center;
  background: var(--bg-panel);
  cursor: pointer;
  transition: border-color 0.15s;
}
.dropzone.dragover { border-color: var(--brass); }
.dropzone input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-label { font-size: 1.1rem; margin: 0 0 0.3rem; }
.dz-sub { color: var(--ink-dim); font-size: 0.85rem; margin: 0; }
.file-list { list-style: none; padding: 0; margin: 1rem 0 0; color: var(--brass); font-size: 0.9rem; text-align: left; }
.file-list li { padding: 0.15rem 0; }
.file-summary { color: var(--ink); font-weight: 600; margin-bottom: 0.4rem; }
.file-remove { color: var(--ink-dim); font-size: 0.8rem; margin-left: 0.6rem; }
.file-remove:hover { color: var(--warn); }

.options-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin: 1.5rem 0;
}
fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 1rem 1.2rem;
}
legend { color: var(--brass); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 0 0.4rem; }
fieldset label { display: block; margin: 0.4rem 0; font-size: 0.92rem; }
fieldset input[type=number] { width: 90px; margin-left: 0.5rem; background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 4px; padding: 0.2rem 0.4rem; }

.glossary-hint {
  display: inline-block;
  width: 16px; height: 16px;
  line-height: 16px;
  border-radius: 50%;
  background: var(--brass-dim);
  color: var(--bg);
  font-size: 0.7rem;
  text-align: center;
  cursor: help;
}

.cta {
  display: inline-block;
  background: var(--brass);
  color: #1a1610;
  border: none;
  padding: 0.9rem 1.8rem;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  margin-top: 0.5rem;
}
.cta:hover { background: #ddbd7d; }

/* ---- results ---- */
.result-card {
  background: var(--bg-panel);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.analysis { color: var(--ink-dim); font-size: 0.9rem; }
.warn { color: var(--warn); }

.mockup-wrap { position: relative; max-width: 480px; margin: 0 auto 1rem; }
.mockup-img { width: 100%; border-radius: 6px; display: block; cursor: none; }
.monocle-hint { text-align: center; color: var(--ink-dim); font-size: 0.8rem; margin-top: 0.5rem; }
.monocle {
  position: absolute;
  width: 160px; height: 160px;
  border-radius: 50%;
  border: 6px solid var(--brass);
  box-shadow: 0 0 0 2px #000, 0 6px 18px rgba(0,0,0,0.5) inset, 0 0 25px rgba(201,169,97,0.5);
  pointer-events: none;
  display: none;
  background-repeat: no-repeat;
}

/* ---- pricing table ---- */
.pricing-block { margin-top: 2rem; }
.calc-explainer { color: var(--ink); font-size: 0.95rem; max-width: 60ch; line-height: 1.6; }
.fine-print { color: var(--ink-dim); font-size: 0.8rem; }
.pricing-table { width: 100%; border-collapse: collapse; margin-top: 0.8rem; }
.pricing-table th, .pricing-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.92rem; }
.pricing-table th { color: var(--brass); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }
.pricing-table .keep { color: var(--brass); font-weight: 700; }

/* ---- history ---- */
.history-table { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.history-table th, .history-table td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--line); text-align: left; font-size: 0.9rem; }
.history-table th { color: var(--brass); text-transform: uppercase; font-size: 0.75rem; }
.empty { color: var(--ink-dim); text-align: center; padding: 3rem 0; }

/* ---- glossary popover ---- */
.glossary-popover {
  position: fixed;
  max-width: 260px;
  background: var(--brass);
  color: #1a1610;
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  font-size: 0.85rem;
  z-index: 500;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}
.glossary-popover.hidden { display: none; }

footer { text-align: center; color: var(--ink-dim); padding: 2rem 0; font-size: 0.85rem; font-family: Georgia, serif; }

/* ---- processing overlay ---- */
.processing-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 9, 7, 0.92);
  z-index: 800;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.processing-overlay.hidden { display: none; }
.processing-overlay p { color: var(--brass); font-family: Georgia, serif; margin-top: 1.2rem; font-size: 1.05rem; }
.spin-mark { width: 120px; animation: spin-lean 1.4s ease-in-out infinite; }
@keyframes spin-lean {
  0%, 100% { transform: rotate(-8deg) scale(1); }
  50% { transform: rotate(8deg) scale(1.05); }
}
