/* miracle.fyi — /updates ("Still Showing Up") changelog pages.
   Standalone stylesheet: the SPA's styles.css is NOT loaded here.
   Same visual system as the app (anchored to the 3·6·9 Journal page):
   #08080c night surfaces, quiet gold + indigo accents, Fraunces display +
   Inter body, generous whitespace, ~680px reading column. No multi-stop
   dawn gradient anywhere in chrome — accents are single hues or two stops. */

:root {
  --bg-0: #08080c;
  --bg-1: #0f0f15;
  --surface: rgba(255, 255, 255, 0.035);
  --surface-2: rgba(255, 255, 255, 0.07);
  --border: rgba(255, 255, 255, 0.06);
  --border-2: rgba(255, 255, 255, 0.14);
  --ink: #f5f5f7;
  --ink-2: #c7c7d1;
  --ink-3: #8a8a99;
  --ink-4: #4a4a57;
  --gold: #fbbf24;
  --indigo: #6366f1;
  --indigo-2: #818cf8;
  --green: #34d399;
  --red: #f87171;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-display: "Fraunces", "Inter", serif;
  --r-md: 14px;
  --r-lg: 22px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

* { box-sizing: border-box; }
html, body {
  margin: 0; padding: 0;
  background: var(--bg-0); color: var(--ink);
  font-family: var(--font-sans); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
body.up {
  min-height: 100vh;
  /* Two quiet glows, like the app shell — violet up top, dawn far below. */
  background:
    radial-gradient(1100px 700px at 18% -18%, rgba(124, 58, 237, 0.14), transparent 60%),
    radial-gradient(800px 700px at 105% 100%, rgba(245, 158, 107, 0.07), transparent 55%),
    linear-gradient(180deg, #08080c 0%, #0c0c14 100%);
  padding: 48px 24px calc(64px + env(safe-area-inset-bottom, 0px));
}
::selection { background: rgba(167, 139, 250, 0.4); color: #fff; }
a { color: var(--indigo-2); text-decoration: none; }
a:hover { color: var(--gold); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid rgba(251, 191, 36, 0.7); outline-offset: 2px;
}
button { font-family: inherit; }

/* ---- Layout: one ~680px reading column ---- */
.up-masthead, .up-main, .up-footer, .up-crumb, .up-banner, .up-topbar {
  max-width: 680px; margin-left: auto; margin-right: auto;
}

/* ---- Site topbar — the same brand vocabulary as the app header ---- */
.up-topbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  margin-bottom: 36px;
  border-bottom: 1px solid var(--border);
}
.up-topbar__brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.up-topbar__brand:hover { color: var(--ink); }
.up-topbar__brand svg { display: block; }
.up-topbar__name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 500; letter-spacing: -0.015em;
}
.up-topbar__tld { color: var(--ink-3); }
.up-topbar__nav { display: inline-flex; align-items: center; gap: 18px; }
.up-topbar__link {
  font-size: 13px; font-weight: 600; color: var(--ink-3);
}
.up-topbar__link--current { color: var(--ink); }
.up-topbar__link:hover { color: var(--gold); }
.up-topbar__cta {
  padding: 8px 16px;
  font-size: 13px; font-weight: 600; color: #fff;
  background: var(--indigo);
  border-radius: 999px;
  transition: background 160ms var(--ease-out);
}
.up-topbar__cta:hover { background: #4f46e5; color: #fff; }

/* ---- Masthead ---- */
.up-masthead { margin-bottom: 40px; }
.up-brand {
  display: inline-block; margin-bottom: 28px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.02em;
  color: var(--ink-3);
}
.up-brand:hover { color: var(--gold); }
.up-masthead__title {
  margin: 0 0 10px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(34px, 6vw, 46px); line-height: 1.08;
  letter-spacing: -0.02em; color: var(--ink);
  font-variation-settings: "opsz" 100;
}
.up-masthead__slogan {
  margin: 0 0 6px;
  font-size: 16px; color: var(--ink-2); line-height: 1.55;
}
.up-masthead__counter {
  margin: 0 0 26px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  color: var(--gold);
}
.up-masthead__row {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.up-rss {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; flex: 0 0 auto;
  border: 1px solid var(--border); border-radius: 999px;
  color: var(--ink-3); background: var(--surface);
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.up-rss:hover { color: var(--gold); border-color: var(--border-2); }

/* ---- Subscribe form (masthead inline + post-page card) ---- */
.up-subscribe {
  display: flex; gap: 10px; flex: 1 1 320px; min-width: 0;
}
.up-subscribe__email {
  flex: 1 1 auto; min-width: 0;
  padding: 10px 14px;
  font-size: 16px; color: var(--ink);
  background: var(--bg-1);
  border: 1px solid var(--border-2); border-radius: var(--r-md);
  transition: border-color 160ms var(--ease-out);
}
.up-subscribe__email::placeholder { color: var(--ink-4); }
.up-subscribe__email:focus { border-color: var(--indigo); outline: none; }
.up-subscribe__btn {
  flex: 0 0 auto;
  padding: 10px 18px; min-height: 44px;
  font-size: 14px; font-weight: 600; color: #fff;
  background: var(--indigo);
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer;
  transition: background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.up-subscribe__btn:hover { background: var(--indigo-2); }
.up-subscribe__btn:active { transform: translateY(1px); }
.up-subscribe__micro {
  margin: 10px 0 0;
  font-size: 13px; color: var(--ink-3);
}
/* Honeypot — parked far offscreen, never display:none (bots check that). */
.up-subscribe__hp {
  position: absolute; left: -9999px; top: -9999px;
  width: 1px; height: 1px; opacity: 0;
}
.up-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); overflow: hidden; white-space: nowrap;
}

/* ---- Subscribe result banner ---- */
.up-banner {
  margin: 0 auto 24px;
  padding: 12px 16px;
  font-size: 14px; line-height: 1.5;
  border-radius: var(--r-md);
}
.up-banner--ok {
  color: var(--green);
  background: rgba(52, 211, 153, 0.08);
  border: 1px solid rgba(52, 211, 153, 0.25);
}
.up-banner--err {
  color: var(--red);
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
}

/* ---- Entries (full posts, list + single) ---- */
.up-main { display: flex; flex-direction: column; gap: 28px; }
.up-entry {
  position: relative;
  padding: 28px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
}
/* Quiet two-stop dawn line along the top — same vocabulary as the Journal's
   session cards (and NOT the banned multi-stop brand gradient). */
.up-entry::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px;
  background: linear-gradient(90deg, rgba(251, 191, 36, 0.55), rgba(245, 158, 107, 0.35));
}
.up-entry__date {
  margin: 0 0 10px;
  font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  color: var(--gold);
}
/* Release-version pill beside the date (rendered only when a post sets `version`). */
.up-entry__version {
  display: inline-block;
  margin-left: 8px;
  padding: 1px 7px 2px;
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: none;
  color: var(--gold);
  background: rgba(251, 191, 36, 0.08);
  vertical-align: 1px;
}
.up-entry__title {
  margin: 0 0 14px;
  font-family: var(--font-display); font-weight: 500;
  font-size: clamp(23px, 3.4vw, 30px); line-height: 1.18;
  letter-spacing: -0.02em; color: var(--ink);
  font-variation-settings: "opsz" 100;
  overflow-wrap: anywhere;
}
.up-entry__title a { color: inherit; }
.up-entry__title a:hover { color: var(--gold); }
.up-entry__body { color: var(--ink-2); font-size: 16px; line-height: 1.65; }
.up-entry__body p { margin: 0 0 14px; }
.up-entry__body p:last-child { margin-bottom: 0; }
.up-entry__body h3 {
  margin: 22px 0 8px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 19px; letter-spacing: -0.01em; color: var(--ink);
}
.up-entry__body ul { margin: 0 0 14px; padding-left: 1.25em; }
.up-entry__body li { margin: 0 0 6px; }
.up-entry__body li::marker { color: var(--gold); }

/* ---- Emoji reactions ---- */
.up-reactions {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin-top: 22px;
}
.up-react {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 38px; padding: 6px 14px;
  font-size: 15px; color: var(--ink-2);
  background: var(--surface);
  border: 1px solid var(--border-2); border-radius: 999px;
  cursor: pointer;
  transition: border-color 160ms var(--ease-out), background 160ms var(--ease-out), transform 160ms var(--ease-out);
}
.up-react:hover { border-color: rgba(251, 191, 36, 0.45); background: var(--surface-2); }
.up-react:active { transform: scale(0.96); }
.up-react__count {
  font-size: 13px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  min-width: 1ch; text-align: center;
}
.up-react.is-reacted {
  background: rgba(251, 191, 36, 0.10);
  border-color: rgba(251, 191, 36, 0.45);
  cursor: default;
}
.up-react.is-reacted .up-react__count { color: var(--gold); }
.up-react:disabled { opacity: 1; } /* a cast reaction is a state, not a greyed control */

/* ---- Share row ---- */
.up-share {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 14px; padding-top: 16px;
  border-top: 1px solid var(--border);
}
.up-share-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 34px; padding: 5px 13px;
  font-size: 13px; font-weight: 500; color: var(--ink-3);
  background: transparent;
  border: 1px solid var(--border); border-radius: 999px;
  cursor: pointer;
  transition: color 160ms var(--ease-out), border-color 160ms var(--ease-out);
}
.up-share-btn:hover { color: var(--ink); border-color: var(--border-2); }
a.up-share-btn:hover { color: var(--ink); }
/* Copy flips to "Copied ✓" for 1.5s — min-width reserves the wider label so
   the button (and everything after it) NEVER changes size or position. */
.up-share-btn--copy { min-width: 96px; }
/* Native share: slot always reserved; /updates.js flips visibility on only
   when navigator.share exists. Hidden ≠ collapsed — nothing ever shifts. */
.up-share-btn--native { visibility: hidden; min-width: 82px; }
.up-share-btn--native.is-available { visibility: visible; }

/* ---- Pagination (list) ---- */
.up-pagination {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 4px;
}
.up-pagination__slot { min-height: 24px; }
.up-pagination__slot--right { text-align: right; }
.up-page-link { font-size: 14px; font-weight: 600; color: var(--gold); }
.up-page-link:hover { color: var(--indigo-2); }

/* ---- Breadcrumb (post page + 404) ---- */
.up-crumb { margin-bottom: 24px; }
.up-crumb a { font-size: 14px; font-weight: 500; color: var(--ink-3); }
.up-crumb a:hover { color: var(--gold); }

/* ---- Prev / next (post page) ---- */
.up-adjacent {
  display: flex; justify-content: space-between; gap: 16px;
}
.up-adjacent__slot { flex: 1 1 50%; min-width: 0; min-height: 44px; }
.up-adjacent__slot--right { text-align: right; }
.up-adjacent__link { display: inline-flex; flex-direction: column; gap: 3px; max-width: 100%; }
.up-adjacent__link--right { align-items: flex-end; }
.up-adjacent__dir {
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--ink-3);
}
.up-adjacent__name {
  font-family: var(--font-display); font-size: 15px; font-weight: 500;
  color: var(--ink-2); line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%;
}
.up-adjacent__link:hover .up-adjacent__name { color: var(--gold); }

/* ---- Subscribe card (post page) ---- */
.up-subscribe-card {
  padding: 26px 32px;
  background: var(--surface);
  border: 1px solid rgba(99, 102, 241, 0.25);
  border-radius: var(--r-lg);
}
.up-subscribe-card__title {
  margin: 0 0 16px;
  font-family: var(--font-display); font-weight: 500;
  font-size: 21px; letter-spacing: -0.015em; color: var(--ink);
}

/* ---- 404 ---- */
.up-404 { padding: 40px 32px; text-align: left; }
.up-404__text { color: var(--ink-2); line-height: 1.65; max-width: 36rem; }

/* ---- Footer ---- */
.up-footer {
  margin-top: 48px;
  font-size: 13px; color: var(--ink-4);
}
.up-footer a { color: var(--ink-3); }
.up-footer a:hover { color: var(--gold); }

/* ---- Small screens ---- */
@media (max-width: 720px) {
  body.up { padding: 28px 16px calc(48px + env(safe-area-inset-bottom, 0px)); }
  .up-masthead { margin-bottom: 28px; }
  .up-entry, .up-subscribe-card { padding: 22px 18px; }
  .up-404 { padding: 28px 18px; }
  .up-subscribe { flex-wrap: wrap; }
  .up-subscribe__email { flex: 1 1 200px; }
  .up-adjacent { flex-direction: column; gap: 10px; }
  .up-adjacent__slot--right { text-align: left; }
  .up-adjacent__link--right { align-items: flex-start; }
}

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