:root {
  --bg: #14110e;
  --bg-2: #1c1814;
  --ink: #f3eadc;
  --ink-dim: #b7aa96;
  --ember: #e25b2a;
  --ember-2: #ff7a45;
  --brass: #c4a574;
  --line: rgba(243, 234, 220, 0.12);
  --ok: #c8e38a;
  --bad: #ff6b4a;
  --display: "Fustat", "Trebuchet MS", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.5;
  overflow-x: clip;
}

body {
  padding: 18px 18px calc(32px + env(safe-area-inset-bottom));
  max-width: 720px;
  margin: 0 auto;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  opacity: 0.07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");
  z-index: 0;
}

header, main, footer { position: relative; z-index: 1; }

.top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0 28px;
}

.mark {
  font-family: var(--display);
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.mark-hook {
  width: 18px;
  height: 18px;
  border: 2.5px solid var(--ember);
  border-right-color: transparent;
  border-radius: 50%;
  position: relative;
}

.mark-hook::after {
  content: "";
  position: absolute;
  right: -3px;
  bottom: 1px;
  width: 8px;
  height: 8px;
  border-right: 2.5px solid var(--ink);
  border-bottom: 2.5px solid var(--ink);
  transform: rotate(45deg);
}

.by {
  color: var(--brass);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1 {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(32px, 8vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.045em;
  max-width: 14ch;
  margin: 8px 0 16px;
}

.kicker {
  color: var(--ember);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.lede {
  color: var(--ink-dim);
  max-width: 42em;
  font-size: 13.5px;
}

.deck { margin: 28px 0 40px; }

.drop {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  min-height: 188px;
  padding: 28px;
  border: 1px dashed var(--brass);
  background:
    linear-gradient(180deg, rgba(226, 91, 42, 0.07), transparent 42%),
    var(--bg-2);
  cursor: pointer;
  text-align: left;
}

.drop:hover, .drop.hot {
  border-color: var(--ember);
  background: #241910;
}

.drop-rule {
  font-family: var(--display);
  font-weight: 700;
  font-size: 28px;
  letter-spacing: -0.03em;
}

.drop-sub { color: var(--ink-dim); font-size: 12px; }

.card {
  margin-top: 12px;
  padding: 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.fname {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  word-break: break-word;
}

.fmeta { color: var(--ink-dim); font-size: 12px; }

.formats { display: flex; gap: 8px; flex-wrap: wrap; }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  color: var(--ink);
  font-size: 12px;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.chip:has(input:checked) {
  border-color: var(--ember);
  color: var(--ember-2);
}

.chip input { accent-color: var(--ember); }

.go, .ghost {
  appearance: none;
  border: 0;
  cursor: pointer;
  font-family: var(--display);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  min-height: 48px;
  padding: 12px 16px;
  text-align: center;
  text-decoration: none;
}

.go {
  background: var(--ember);
  color: #1a0d08;
}

.go:disabled { opacity: 0.45; cursor: wait; }

.ghost {
  background: transparent;
  color: var(--ink-dim);
  border: 1px solid var(--line);
}

.bar {
  height: 6px;
  background: #2a241e;
  overflow: hidden;
}

.bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: var(--ember);
  transform-origin: left center;
}

.status { font-family: var(--display); font-weight: 700; font-size: 18px; }

.log, .err { font-size: 12px; color: var(--ink-dim); white-space: pre-wrap; }

.err { color: var(--bad); margin-top: 10px; }

audio { width: 100%; height: 40px; }

.notes h2 {
  font-family: var(--display);
  font-size: 22px;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.notes ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.notes li {
  padding-left: 16px;
  border-left: 2px solid var(--ember);
  color: var(--ink-dim);
}

.byline {
  display: flex;
  align-items: baseline;
  gap: 14px;
}

.pro-link {
  color: var(--ember);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
}

.pro-strip {
  margin: 8px 0 24px;
  padding: 22px 0 0;
  border-top: 1px solid var(--line);
}

.pro-strip h2 {
  font-family: var(--display);
  font-weight: 800;
  font-style: normal;
  font-size: clamp(26px, 6vw, 36px);
  letter-spacing: -0.04em;
  line-height: 1;
  max-width: 16ch;
  margin: 8px 0 12px;
}

.pro-strip .go {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 16px;
  min-width: 160px;
}

.pay .fmeta { max-width: 46em; }

.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
}

.toggle input { accent-color: var(--ember); }

.quota { margin: 8px 0 20px; }
.quota-line {
  font-family: var(--display);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.03em;
  margin: 6px 0 10px;
}

.mono-inline { font-family: var(--mono); font-size: 0.92em; }

code {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--brass);
}

footer {
  margin-top: 48px;
  color: var(--brass);
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
