/* Driftlet link pages — tokens mirror the app (lib/theme.ts light palette). Single file, no framework. */
:root {
  --bg: #F6F6F4;
  --surface: #FFFFFF;
  --ink: #1A1A1A;
  --muted: #707070;
  --hairline: #E3E3E0;
  --accent: #E0442B;
  --on-accent: #FFFFFF;
  --radius: 14px;
  --maxw: 460px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --surface: #1C1C1C;
    --ink: #F2F2F0;
    --muted: #9A9A9A;
    --hairline: #2C2C2C;
    --accent: #F0563E;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.card {
  width: 100%;
  max-width: var(--maxw);
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  overflow: hidden;
}
.hero { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: var(--bg); }
.hero-fallback {
  width: 100%; aspect-ratio: 16 / 9; display: flex; align-items: center; justify-content: center; background: var(--bg);
}
.hero-fallback img { width: 96px; height: 96px; opacity: .85; }
.body { padding: 20px; }
h1 { font-size: 22px; line-height: 1.25; margin: 0 0 6px; letter-spacing: -0.2px; }
.sub { color: var(--muted); font-size: 14px; margin: 0 0 2px; }
.author { color: var(--muted); font-size: 14px; margin: 2px 0 0; }
.avatar { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; display: block; margin: 0 auto 12px; background: var(--bg); }
.avatar-fallback {
  width: 72px; height: 72px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: var(--bg); color: var(--ink); font-size: 30px; font-weight: 600; margin: 0 auto 12px;
}
.profile-body { text-align: center; }
.btn {
  display: block; width: 100%; margin-top: 16px; padding: 14px 16px;
  background: var(--accent); color: var(--on-accent); border: none; border-radius: var(--radius);
  font-size: 16px; font-weight: 600; text-align: center; text-decoration: none; cursor: pointer;
}
.btn:active { opacity: .85; }
.badges { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 8px; text-decoration: none;
  background: var(--ink); color: var(--bg); border-radius: 10px; padding: 8px 14px; font-size: 13px; font-weight: 600;
}
.badge small { display: block; font-size: 10px; font-weight: 400; opacity: .8; }
.badge-ico { width: 18px; height: 18px; flex: none; display: block; }
.root { text-align: center; max-width: var(--maxw); }
.root .mascot { width: 128px; height: 128px; margin: 0 auto 16px; display: block; }
.root h1 { font-size: 28px; }
.root .tagline { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
.wordmark { font-weight: 700; }
/* landing wordmark is the brand image inside the <h1>; kill the text strut so it sits tight */
.root .wordmark { line-height: 0; margin: 2px 0 12px; }
.root .wordmark img { display: inline-block; height: auto; }
.notfound { text-align: center; max-width: var(--maxw); }
.notfound h1 { font-size: 24px; }
.notfound p { color: var(--muted); }
.footer { margin-top: 20px; font-size: 12px; color: var(--muted); text-align: center; }
.footer a { color: var(--muted); }

/* /p content page — full-width, top-aligned, framed by a header + get-the-app footer. */
body.reader-page { justify-content: flex-start; align-items: stretch; padding: 0; }
/* No bar/background — the wordmark sits straight on the page background. */
.topbar { padding: 16px 20px 0; }
/* brand wordmark image (assets/brand → web/public); ink on light, cream on dark, like the app.
   The "Driftlet" link text stays for screen readers but is pushed off-screen. */
.topbar .wordmark {
  display: inline-block; height: 22px; aspect-ratio: 1271 / 435; vertical-align: middle;
  background: url(/wordmark-ink.png) left center / contain no-repeat;
  text-indent: -9999px; overflow: hidden; white-space: nowrap;
}
@media (prefers-color-scheme: dark) { .topbar .wordmark { background-image: url(/wordmark-cream.png); } }

.reader { width: 100%; max-width: 620px; margin: 0 auto; padding: 26px 20px 8px; }
.reader h1 { font-size: 26px; line-height: 1.22; margin: 0 0 8px; letter-spacing: -0.3px; }
.reader .meta { color: var(--muted); font-size: 14px; margin: 0 0 20px; line-height: 1.4; }
.reader .meta .by { color: var(--ink); font-weight: 600; }

.reader .media { display: block; width: 100%; max-width: 100%; border-radius: var(--radius); margin: 4px 0 22px; }
.reader .post-img { background: var(--bg); }
/* width:100% + height:auto keeps the video inside the column on every browser (auto width makes iOS
   Safari use the intrinsic 720px and overflow); max-height only caps an unusually tall clip. */
.reader .video { height: auto; max-height: 80vh; margin: 4px auto 22px; background: #000; }

.reader .content { font-size: 17px; line-height: 1.65; }
.reader .content p { margin: 0 0 1em; overflow-wrap: anywhere; }
.reader .content p:last-child { margin-bottom: 0; }

.get-app { border-top: 1px solid var(--hairline); margin-top: 20px; padding: 28px 20px 40px; text-align: center; }
.app-cta {
  display: inline-block; color: var(--ink); font-size: 15px; font-weight: 600; text-decoration: none;
  border-bottom: 2px solid var(--accent); padding-bottom: 2px;
}
.get-app-sub { color: var(--muted); font-size: 13px; margin: 14px 0 14px; }
.get-app .badges { margin-top: 0; }
