/* Untoldby website. The app's own type: New York for titles and stories, SF Pro for everything else,
   small uppercase cobalt labels. Plain, editorial layout: white page, hairlines, real stories. */
:root {
  --bg: #ffffff; --surface: #f4f3ef; --ink: #121212; --body: #2a2a2a; --muted: #6b6b6b; --rule: #e7e5df;
  --accent: #2445e6; --accent-soft: #e8ebfd;
  /* Native iOS type where supported; otherwise the same bundled fonts as the Android app.
     Avoid ui-serif here: browsers can resolve it to their generic serif before reaching Newsreader. */
  --serif: -apple-system-ui-serif, "Newsreader", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* The app's liquid glass (same recipe as its tab bar): a frosted tint, a bright highlight along the top,
     a thin light edge and a soft shadow. */
  --glass: rgba(255, 255, 255, .74); --glass-hi: rgba(255, 255, 255, .32); --glass-top: rgba(255, 255, 255, .8);
  --glass-line: rgba(0, 0, 0, .06); --glass-shadow: 0 8px 28px rgba(0, 0, 0, .10), 0 1px 3px rgba(0, 0, 0, .06);
  /* A spring that settles with a small bounce, like the app's presses. */
  --spring: cubic-bezier(.34, 1.56, .64, 1); --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --surface: #1c1c1e; --ink: #f2f2f2; --body: #dcdcdc; --muted: #9a9a9a; --rule: #2a2a2c;
          --accent: #5b74ff; --accent-soft: #1d2442;
          --glass: rgba(28, 28, 30, .62); --glass-hi: rgba(255, 255, 255, .07); --glass-top: rgba(255, 255, 255, .22);
          --glass-line: rgba(255, 255, 255, .07); --glass-shadow: 0 8px 28px rgba(0, 0, 0, .5), 0 1px 3px rgba(0, 0, 0, .4); }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--body); font-family: var(--sans);
  font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; font-optical-sizing: none; font-variation-settings: "opsz" 16; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; }
h1, h2, h3 { font-family: var(--serif); color: var(--ink); font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: 40px; line-height: 1.12; margin: 12px 0 12px; }

/* Shared bits */
.eyebrow { font-size: 12px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin: 0; }
.wordmark { font-family: var(--serif); font-weight: 600; font-size: 24px; color: var(--ink); text-decoration: none; }
/* Liquid glass: any element with .glass, plus the buttons and the top bar below. */
.glass, .btn.quiet {
  background: linear-gradient(to bottom, var(--glass-hi), transparent 70%), var(--glass);
  -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--glass-top), inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
}
.btn { display: inline-block; font-weight: 600; font-size: 15px; text-decoration: none; border-radius: 999px; padding: 11px 20px;
  transition: transform .45s var(--spring), box-shadow .3s var(--ease), filter .3s var(--ease); }
/* Cobalt glass: the app's accent with the same highlight and edge. */
.btn.primary {
  background: linear-gradient(to bottom, rgba(255, 255, 255, .24), rgba(255, 255, 255, 0) 65%), var(--accent); color: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4), inset 0 0 0 1px rgba(0, 0, 0, .08),
    0 6px 18px color-mix(in srgb, var(--accent) 32%, transparent), 0 1px 2px rgba(0, 0, 0, .1);
}
.btn.quiet { color: var(--ink); }
.store { display: inline-flex; flex-direction: column; margin-top: 28px; color: var(--bg);
  background: linear-gradient(to bottom, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%), var(--ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22), inset 0 0 0 1px rgba(255, 255, 255, .06), 0 8px 22px rgba(0, 0, 0, .18);
  border-radius: 14px; padding: 9px 20px; font-weight: 600; font-size: 17px; line-height: 1.15; text-decoration: none;
  transition: transform .45s var(--spring), box-shadow .3s var(--ease); }
/* Gentle press: a quick squeeze, then a springy settle on release. */
.btn:active, a.store:active, .auth-box button:active { transform: scale(.95); transition-duration: .12s; }
@media (hover: hover) {
  .btn:hover, a.store:hover { transform: translateY(-1px); filter: brightness(1.05); }
}
.store small { font-weight: 400; font-size: 11px; opacity: .8; }
.stores { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.stores .store { margin-top: 0; }
.closing .stores { justify-content: center; margin-top: 24px; }
.note { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
footer.site { color: var(--muted); font-size: 14px; padding: 28px 0 44px; text-align: center; }
footer.site a { color: var(--muted); text-decoration: none; }
footer.site a:hover { color: var(--ink); }

/* Narrow pages: story, profile, privacy, terms, support, reset */
.wrap { max-width: 660px; margin: 0 auto; padding: 0 20px; }
header.site { padding: 20px 0 8px; }
.cover { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 22px; background: var(--surface); display: block; }
article { padding-top: 32px; }
article .eyebrow { margin-top: 26px; }
article h1 { font-size: 38px; }
.byline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 15px; }
.byline .avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-family: var(--serif); font-weight: 600; overflow: hidden; }
.byline .avatar img { width: 100%; height: 100%; object-fit: cover; }
.byline strong { color: var(--ink); font-weight: 600; }
.story { font-family: var(--serif); font-size: 20px; line-height: 1.7; color: var(--body); white-space: pre-wrap; margin: 28px 0 40px; }
.teaser { position: relative; max-height: 15em; overflow: hidden; }
.teaser::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 6em;
  background: linear-gradient(to bottom, transparent, var(--bg)); }
.cta { background: var(--surface); border-radius: 22px; padding: 28px 24px; margin: 0 0 48px; text-align: center; }
.cta h2 { margin: 0 0 6px; font-size: 24px; }
.cta p { margin: 0 0 16px; color: var(--muted); }
.cta .row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.state { text-align: center; padding: 80px 0; color: var(--muted); }
.state h1 { font-size: 30px; }

/* Landing page */
.page { max-width: 1040px; margin: 0 auto; padding: 0 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 22px 0; border-bottom: 1px solid var(--rule);
  position: sticky; top: 0; z-index: 50; background: var(--bg); view-transition-name: topbar;
  /* Paint the page colour out to the window's edges, so pictures scrolling underneath can't peek out at the sides. */
  box-shadow: 0 0 0 100vmax var(--bg); clip-path: inset(0 -100vmax); }
/* On the narrow pages the bar sits alone in its own wrapper, so that wrapper is what sticks. */
.page:has(> .topbar:only-child) { position: sticky; top: 0; z-index: 50; }
.topbar nav { display: flex; gap: 24px; font-size: 15px; }
.topbar nav a { color: var(--body); text-decoration: none; }
.topbar nav a:hover, .topbar nav a[aria-current] { color: var(--ink); }
.topbar nav a.get { color: var(--accent); font-weight: 600; }
.topbar.topbar-pill { top: 16px; margin-top: 16px; padding: 12px 20px 12px 14px; border: 0; border-radius: 999px;
  background: linear-gradient(to bottom, var(--glass-hi), transparent 70%), var(--glass);
  box-shadow: inset 0 1px 0 var(--glass-top), inset 0 0 0 1px var(--glass-line), var(--glass-shadow);
  clip-path: none; }
.topbar-pill .wordmark { display: inline-flex; align-items: center; gap: 10px; }
.nav-logo { display: block; width: 36px; height: 36px; border-radius: 10px; }
.topbar-pill nav { align-items: center; gap: 20px; }
.topbar-pill nav a.get { padding: 8px 14px; border-radius: 999px; background: var(--accent-soft); }
/* No smooth scrolling: opening a link (e.g. /#latest) or going back used to animate the scroll, which looked like a bounce. */
[id] { scroll-margin-top: 84px; }

.hero { display: grid; grid-template-columns: 1fr 380px; gap: 64px; align-items: center; padding: 64px 0 72px; }
.hero h1 { font-size: 50px; line-height: 1.08; font-weight: 500; letter-spacing: -0.015em; margin: 14px 0 18px; }
.hero .lede { font-size: 19px; line-height: 1.6; color: var(--muted); max-width: 480px; margin: 0; }
.voices { margin: 0; min-width: 0; }
.voices-stage > * { grid-area: 1 / 1; }
.voices-logo { display: none; width: clamp(200px, 25vw, 288px); height: auto; }
.voices-settled .voices-letter { visibility: hidden; }
.voices-settled .voices-logo { display: block; }
.voices-stage { height: 420px; display: grid; place-items: center; perspective: 800px; }
.voices-letter { display: block; font-family: var(--serif); font-size: clamp(220px, 28vw, 340px); font-weight: 600;
  line-height: 1; color: #2445e6; transform-origin: 50% 55%; }
.voices-caption { margin: 12px 0 0; text-align: center; color: var(--muted); font-size: 14px; letter-spacing: .04em; }
.voices-letter { min-width: .85em; text-align: center; }
.voices-letter[data-treatment="outline"] { -webkit-text-stroke: 2px var(--voice-color); color: transparent !important; }
.voices-letter[data-treatment="stripes"], .voices-letter[data-treatment="dots"] {
  color: transparent !important; background-clip: text; -webkit-background-clip: text;
  background-image: repeating-linear-gradient(135deg, var(--voice-color) 0 9px, #e8b557 9px 14px, #b44973 14px 21px);
}
.voices-letter[data-treatment="dots"] {
  background-color: var(--voice-color); background-image: radial-gradient(#f4d184 23%, transparent 25%); background-size: 13px 13px;
}
.voices-letter[data-treatment="cutout"] { background: var(--voice-color); color: white !important; padding: 0 .06em;
  clip-path: polygon(3% 3%, 96% 0, 100% 96%, 0 100%); }
.voices-letter[data-treatment="shadow"] { text-shadow: 5px 4px 0 #e9b75a, 10px 8px 0 #d56a83; }
.topbar .wordmark { transition: none; }
.caption { color: var(--muted); font-size: 13px; text-align: center; margin: 18px 0 0; }
.caption.sample { text-align: left; margin: 10px 0 0; }

.block { padding: 56px 0; border-top: 1px solid var(--rule); }
.block > .eyebrow { margin-bottom: 8px; }
.block h2 { font-size: 32px; line-height: 1.15; margin: 0 0 8px; }
.block .sub { color: var(--muted); margin: 0 0 28px; max-width: 560px; }

/* Latest stories, read live from the app */
.latest { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.latest a { display: block; text-decoration: none; color: inherit; }
.latest .thumb { aspect-ratio: 4 / 3; border-radius: 16px; background: var(--surface) center / cover no-repeat; margin-bottom: 14px;
  display: grid; place-items: start; padding: 14px; transition: transform .5s var(--ease), box-shadow .5s var(--ease); }
@media (hover: hover) {
  .latest a:hover .thumb { transform: translateY(-3px) scale(1.015); box-shadow: 0 14px 34px rgba(0, 0, 0, .14); }
}
.latest .thumb span { font-family: var(--serif); font-weight: 700; font-size: 44px; line-height: .8; color: var(--accent); opacity: .5; }
.latest .eyebrow { margin-bottom: 6px; }
.latest h3 { font-size: 21px; line-height: 1.25; margin: 0 0 6px; }
.latest a:hover h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.latest .by { font-size: 14px; color: var(--muted); margin: 0 0 8px; }
.latest .by strong { color: var(--ink); font-weight: 600; }
.latest-empty { text-align: center; padding: 28px 16px; border-radius: 16px; background: var(--surface); }
.latest-empty p { font-family: var(--serif); font-size: 18px; color: var(--body); margin: 0; }
.latest .open { font-family: var(--serif); font-size: 16px; line-height: 1.55; color: var(--body); margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* How it works: three plain columns */
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.how h3 { font-size: 20px; margin: 0 0 6px; }
.how p { margin: 0; color: var(--muted); line-height: 1.6; }

.byline-demo { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.byline-card { background: var(--accent); color: #fff; border-radius: 24px; padding: 32px; }
.byline-card .q { font-family: var(--serif); font-weight: 700; font-size: 52px; line-height: .7; opacity: .4; margin: 0 0 10px; }
.byline-card .t { font-family: var(--serif); font-weight: 600; font-size: 28px; line-height: 1.25; margin: 0 0 18px; }
.byline-card .by { opacity: .85; margin: 0; }
.byline-card .by strong { opacity: 1; }

.closing { text-align: center; padding: 72px 0 56px; border-top: 1px solid var(--rule); }
.closing h2 { font-size: 36px; font-weight: 500; margin: 0 0 8px; }
.closing p { color: var(--muted); margin: 0; }

@media (max-width: 860px) {
  .hero, .byline-demo { grid-template-columns: 1fr; }
  .hero { padding: 40px 0 48px; gap: 40px; }
  .hero h1 { font-size: 38px; }
  .latest, .how { grid-template-columns: 1fr; gap: 28px; }
  .voices-stage { height: 320px; }
  .topbar nav a:not(.get) { display: none; }
}
@media (max-width: 480px) { h1, article h1 { font-size: 32px; } .story { font-size: 18px; } }

/* Plain pages: privacy, terms, support, password reset, email confirmed */
.doc { padding: 40px 0 24px; }
.doc h1 { font-size: 36px; }
.doc h2 { font-size: 22px; margin: 34px 0 8px; }
.doc h3 { font-family: var(--sans); font-size: 16px; font-weight: 600; letter-spacing: 0; margin: 22px 0 4px; }
.doc p, .doc li { font-size: 16px; line-height: 1.7; }
.doc ul { padding-left: 20px; }
.doc li { margin: 5px 0; }
.doc strong { color: var(--ink); }
.auth-box { background: var(--surface); border-radius: 22px; padding: 28px 24px; margin: 24px 0 40px; }
.auth-box h1 { font-size: 28px; margin-top: 0; }
.auth-box form { display: grid; gap: 12px; margin-top: 16px; }
.auth-box input { font: inherit; font-size: 16px; padding: 13px 18px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--bg); color: var(--ink); transition: border-color .2s var(--ease), box-shadow .2s var(--ease); }
.auth-box input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
.auth-box button { border: 0; font: inherit; font-weight: 600; cursor: pointer; padding: 13px 22px; }
.auth-box .msg { margin: 0; color: var(--muted); font-size: 14px; min-height: 1em; }

/* Profile page (/u/<id>) */
.profile-head { text-align: center; padding: 48px 0 24px; }
.profile-head .avatar.big { width: 88px; height: 88px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  display: inline-flex; align-items: center; justify-content: center; font-family: var(--serif); font-size: 34px; font-weight: 600; overflow: hidden; }
.profile-head .avatar.big img { width: 100%; height: 100%; object-fit: cover; }
.profile-head h1 { font-size: 32px; margin: 14px 0 2px; }
.profile-head .handle { color: var(--muted); margin: 0 0 12px; }
.profile-head .bio { color: var(--body); max-width: 520px; margin: 0 auto 10px; }
.profile-head .count { color: var(--muted); font-size: 14px; margin: 0; }
.story-list { list-style: none; padding: 0; margin: 0 0 40px; }
.story-list li { border-top: 1px solid var(--rule); }
.story-list a { display: block; padding: 18px 2px; text-decoration: none; color: inherit; transition: transform .35s var(--ease); }
@media (hover: hover) { .story-list a:hover { transform: translateX(4px); } }
.story-list strong { display: block; font-family: var(--serif); font-weight: 600; font-size: 20px; color: var(--ink); margin-bottom: 4px; }
.story-list span { color: var(--muted); font-size: 15px; }

/* Motion: quiet and quick. Pages cross-fade into each other, and that's all that happens on load. Content used to
   fade in on top of the page fade: the new page arrived blank, then faded in a second time, which read as a flicker. */
@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .22s; animation-timing-function: var(--ease); }
@keyframes rise { from { opacity: 0; } to { opacity: 1; } }
/* Stories and profiles arrive after the page (in place of "Loading…"), so they still ease in. */
#main > article, #main > .profile-head { animation: rise .25s var(--ease) both; }
@supports (animation-timeline: view()) {
  .block > *, .closing > *, .latest li, .how > div, .story-list li {
    animation: rise linear both; animation-timeline: view(); animation-range: entry 0% entry 40%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  @view-transition { navigation: none; }
}
