/* Mailfume — "Graphite & Ember": a burner inbox that visibly runs out of time.
   The email address is the hero (mono, large); the half-life bar under it is
   the signature — it drains and warms toward ember as expiry nears. */
:root {
  --bg: #14130f;
  --panel: #1c1a15;
  --panel-2: #26231c;
  --line: #322e27;
  --text: #ece6db;
  --muted: #968e80;
  --ember: #f1913e;
  --ember-hot: #e5562b;
  --calm: #6f7d63;      /* half-life "plenty of time" hue */
  --radius: 14px;
  --shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.8);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Cascadia Code", "Menlo", monospace;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background:
    radial-gradient(120% 80% at 50% -10%, #1b1912 0%, var(--bg) 60%) no-repeat;
  color: var(--text);
  font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--ember); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---- header ---- */
.top {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px clamp(16px, 5vw, 48px);
  border-bottom: 1px solid var(--line);
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 15px;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-mark {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ember);
  box-shadow: 0 0 0 4px rgba(241, 145, 62, 0.16);
}
.top nav a {
  color: var(--muted); font-size: 14px; letter-spacing: 0.02em;
  text-transform: uppercase;
}
.top nav a:hover { color: var(--text); text-decoration: none; }

/* ---- layout ---- */
main {
  width: 100%; max-width: 720px; margin: 0 auto;
  padding: clamp(28px, 6vw, 56px) 16px 40px;
  flex: 1;
}

/* ---- hero ---- */
.hero {
  background: linear-gradient(180deg, var(--panel), #191710);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(22px, 4vw, 34px);
}
.eyebrow {
  color: var(--muted); font-size: 12px; font-weight: 600;
  letter-spacing: 0.18em; text-transform: uppercase;
  margin-bottom: 14px;
}
.addr-row {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
}
.address {
  flex: 1 1 auto; min-width: 0;
  font: 600 clamp(20px, 5vw, 30px)/1.15 var(--mono);
  letter-spacing: -0.01em;
  word-break: break-all;
}
.btn {
  background: var(--ember); color: #1a0f04; border: 0; cursor: pointer;
  border-radius: 9px; padding: 10px 18px;
  font: 600 15px/1 system-ui, sans-serif;
  transition: filter 0.15s ease, background 0.15s ease, transform 0.05s ease;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.btn.ghost {
  background: var(--panel-2); color: var(--text);
  border: 1px solid var(--line);
}
.btn.ghost:hover { background: #2f2b22; filter: none; }
.btn.copy { flex: 0 0 auto; }
.btn.copy.done { background: var(--calm); color: #0d1108; }
.btn.icon { padding: 8px 12px; }

/* ---- half-life signature ---- */
.lifebar {
  margin: 20px 0 16px;
  height: 6px; border-radius: 999px;
  background: #241f18;
  overflow: hidden;
}
.lifebar-fill {
  height: 100%; width: 100%;
  border-radius: 999px;
  background: var(--calm);
  transition: width 1s linear, background 0.8s ease;
}
.lifebar-fill.low { background: var(--ember); }
.lifebar-fill.critical {
  background: var(--ember-hot);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { opacity: 0.55; } }

.controls {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; flex-wrap: wrap;
}
.countdown { display: flex; flex-direction: column; gap: 2px; }
.countdown-label {
  color: var(--muted); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.timer {
  font: 600 20px/1 var(--mono);
  font-variant-numeric: tabular-nums;
}
.actions { display: flex; gap: 10px; }

/* ---- ad slots (filled post-launch) ---- */
.ad-slot {
  min-height: 90px; margin: 22px 0; border-radius: var(--radius);
  border: 1px dashed var(--line);
  background: repeating-linear-gradient(45deg,
    #17150f, #17150f 12px, #14120d 12px, #14120d 24px);
}

/* ---- inbox ---- */
.inbox-head {
  display: flex; align-items: baseline; gap: 10px;
  margin: 6px 2px 14px;
}
.inbox-head h2 {
  font-size: 15px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
}
.count { color: var(--muted); font: 500 13px/1 var(--mono); }
.messages { list-style: none; padding: 0; }
.messages li {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 2fr auto;
  gap: 14px; align-items: baseline; cursor: pointer;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 15px 16px; margin-bottom: 9px;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
  animation: arrive 0.32s ease both;
}
@keyframes arrive {
  from { opacity: 0; transform: translateY(-6px); }
}
.messages li:hover {
  background: var(--panel-2);
  border-color: #443d31;
}
.messages li:focus-visible { outline: 2px solid var(--ember); outline-offset: 2px; }
.m-from {
  color: var(--muted); font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-subject {
  font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m-time { color: var(--muted); font: 13px/1 var(--mono); }
.empty { color: var(--muted); text-align: center; padding: 26px 12px; line-height: 1.6; }

/* ---- footer ---- */
.foot {
  border-top: 1px solid var(--line);
  padding: 20px clamp(16px, 5vw, 48px);
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  color: var(--muted); font-size: 13px;
}

/* ---- article pages (FAQ, guides, legal) ---- */
.article { max-width: 680px; margin: 0 auto; padding: clamp(28px, 6vw, 56px) 16px 48px; flex: 1; width: 100%; }
.article h1 { font-size: clamp(26px, 5vw, 32px); line-height: 1.15; margin-bottom: 14px; letter-spacing: -0.01em; }
.article .lede { color: var(--muted); font-size: 18px; margin-bottom: 24px; }
.article h2 { font-size: 20px; margin: 28px 0 8px; }
.article p, .article li { color: #cfc8bb; margin-bottom: 12px; }
.article ul, .article ol { padding-left: 22px; }
.article a { color: var(--ember); }
.article .updated { color: var(--muted); font-size: 13px; margin-top: 32px; }

/* ---- shared site footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  text-align: center; color: var(--muted); font-size: 14px;
  padding: 26px 16px;
  display: flex; gap: 8px 18px; justify-content: center; flex-wrap: wrap;
}
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); text-decoration: none; }

/* ---- viewer ---- */
dialog#viewer {
  width: min(720px, 94vw); border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel); color: var(--text); padding: 0;
  box-shadow: var(--shadow);
  /* restore modal centering — the global `* { margin: 0 }` reset clobbers the
     UA stylesheet's `margin: auto` that centers an open <dialog>. */
  margin: auto;
}
dialog::backdrop { background: rgba(6, 5, 3, 0.72); backdrop-filter: blur(2px); }
.viewer-head {
  display: flex; justify-content: space-between; align-items: start; gap: 14px;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.viewer-meta { min-width: 0; }
.v-subject { font-weight: 700; word-break: break-word; }
.v-from { color: var(--muted); font: 13px/1.4 var(--mono); margin-top: 3px; word-break: break-all; }
#v-frame {
  width: 100%; height: min(60vh, 520px); border: 0;
  background: #fff; display: block;
}
.v-attachments { padding: 14px 20px; display: flex; gap: 10px; flex-wrap: wrap; }
.v-attachments:empty { display: none; }
.v-attachments a {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: 8px; padding: 7px 12px; font-size: 14px;
  color: var(--text);
}
.v-attachments a:hover { border-color: var(--ember); text-decoration: none; }

/* ---- responsive ---- */
@media (max-width: 560px) {
  .messages li { grid-template-columns: 1fr auto; }
  .m-from { display: none; }
  .controls { justify-content: stretch; }
  .actions { flex: 1; }
  .actions .btn { flex: 1; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
  .lifebar-fill { transition: width 1s linear; }
}
