/*
  faxo.css: the look of faxo.com's static pages, the same as the app's Apple style
  (lib/widgets/apple_style.dart in the Flutter app: AppleColors, AppleGroupedSection,
  ApplePrimaryButton, AuthCard). One file for every static page, so they match each other and the
  app; a page adds only what's its own, inline.

  Served by nginx from public/site/ (signed-out visitors only: signed-in ones go to /app/).
  Link it with a version, and bump the version when this file changes:
    <link rel="stylesheet" href="/site/faxo.css?v=1">

  Contents: colors (light and dark) · base · layout · type · buttons · grouped lists and fields ·
  links and small print · auth card · motion · top bar · post (and its video) · join bar ·
  hand-off to the app. The conversation (faces, ▲ score ▼, comments) is thread.css.

  Versions: v=1 sign-in (2026-11-08) · v=2 post page · v=3 the conversation moved to thread.css,
  video on the post page
*/

/* ---------- colors: iOS system colors, as AppleColors ---------- */
:root {
  color-scheme: light dark;
  --bg: #ffffff;
  --page: #f2f2f7;            /* grouped background, wide-screen page behind cards */
  --card: #ffffff;
  --label: #000000;
  --secondary: rgba(60, 60, 67, .6);
  --tertiary: rgba(60, 60, 67, .3);
  --fill: #f2f2f7;            /* gray buttons, grouped sections */
  --fill-pressed: #e5e5ea;
  --separator: rgba(60, 60, 67, .29);
  --accent: #007aff;          /* systemBlue */
  --red: #ff3b30;
  --green: #34c759;
  --orange: #ff9500;
  --focus: rgba(0, 122, 255, .4);
  --shadow: 0 4px 24px rgba(0, 0, 0, .08);
  --ease: cubic-bezier(.2, .8, .2, 1);
  /* Faxo's logo colors, for the title's sweep and the loading bar */
  --brand-green: #6dbe4b;
  --brand-yellow: #fdb71e;
  --brand-red: #e42526;
  --brand-blue: #1b71b8;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;
    --page: #000000;
    --card: #1c1c1e;
    --label: #ffffff;
    --secondary: rgba(235, 235, 245, .6);
    --tertiary: rgba(235, 235, 245, .3);
    --fill: #1c1c1e;
    --fill-pressed: #2c2c2e;
    --separator: rgba(84, 84, 88, .65);
    --accent: #0a84ff;
    --red: #ff453a;
    --green: #30d158;
    --orange: #ff9f0a;
    --focus: rgba(10, 132, 255, .5);
    --shadow: none;
  }
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body {
  min-height: 100vh;
  min-height: 100svh;
  background: var(--bg);
  color: var(--label);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Roboto, "Segoe UI", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  text-size-adjust: 100%;
}
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
img, svg { display: block; max-width: 100%; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

/* ---------- layout ---------- */
/* one centered column, 380 wide for forms (the app's sign-in), wider for reading */
.fx-col { width: 100%; max-width: 380px; margin: 0 auto; padding: 0 24px; }
.fx-col.wide { max-width: 680px; padding: 0 16px; }
.fx-stack > * + * { margin-top: 12px; }
.fx-row { display: flex; gap: 12px; }
.fx-row > * { flex: 1; min-width: 0; }
.fx-center { text-align: center; }

/* ---------- type: the iOS text styles ---------- */
.fx-large-title { font-size: 34px; font-weight: 700; letter-spacing: -.8px; line-height: 1.15; margin: 0; }
.fx-title { font-size: 28px; font-weight: 700; letter-spacing: -.5px; line-height: 1.2; margin: 0; }
.fx-title2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.25; margin: 0; }
.fx-headline { font-size: 17px; font-weight: 600; letter-spacing: -.2px; }
.fx-subhead { font-size: 15px; }
.fx-footnote { font-size: 13px; }
.fx-caption { font-size: 12px; line-height: 1.4; }
.fx-secondary { color: var(--secondary); }

/* ---------- buttons: 50 tall, 12 corners (ApplePrimaryButton, the sign-in buttons) ---------- */
.fx-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  background: var(--fill);
  color: var(--label);
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, filter .15s, transform .12s var(--ease);
}
.fx-btn:hover { background: var(--fill-pressed); }
.fx-btn:active { transform: scale(.985); }
.fx-btn > span { overflow: hidden; text-overflow: ellipsis; }
/* a full-width button's icon sits at the left, the label centered across the whole button */
.fx-btn .fx-ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 24px; display: grid; place-items: center; }
.fx-btn.fx-inline-ic .fx-ic { position: static; transform: none; width: auto; }
.fx-btn.primary { background: var(--accent); color: #fff; }
.fx-btn.primary:hover { background: var(--accent); filter: brightness(1.06); }
/* Sign in with Apple: black on light, white on dark (Apple's own rule) */
.fx-btn.apple { background: #000; color: #fff; }
.fx-btn.apple:hover { background: #1d1d1f; }
@media (prefers-color-scheme: dark) {
  .fx-btn.apple { background: #fff; color: #000; }
  .fx-btn.apple:hover { background: #e5e5ea; }
}

/* ---------- grouped lists and fields (AppleGroupedSection) ---------- */
.fx-group { background: var(--fill); border-radius: 12px; overflow: hidden; }
/* the hairline between rows, starting under the text as in iOS: <i class="fx-sep"></i> */
.fx-sep { display: block; height: .5px; margin-left: 16px; background: var(--separator); }
.fx-field {
  display: block;
  width: 100%;
  padding: 15px 16px;
  border: 0;
  background: transparent;
  color: var(--label);
  font-size: 17px;
  text-align: left;
  outline: none;
}
.fx-field::placeholder, .fx-field.placeholder { color: var(--secondary); }
button.fx-field { cursor: text; }

/* ---------- links and small print ---------- */
.fx-link { border: 0; background: none; padding: 10px 6px; color: var(--accent); font-size: 15px; cursor: pointer; }
.fx-link:hover { text-decoration: underline; }
.fx-link.strong { font-weight: 600; }
.fx-quiet { border: 0; background: none; padding: 8px; color: var(--secondary); font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.fx-quiet:hover { color: var(--label); }
.fx-small-print { font-size: 12px; line-height: 1.4; color: var(--secondary); text-align: center; }
.fx-small-print a { text-decoration: underline; }
.fx-small-print a:hover { color: var(--label); }

/* ---------- auth card: on wide screens the form sits on a card over gray (AuthCard) ---------- */
.fx-auth { min-height: 100vh; min-height: 100svh; display: flex; justify-content: center; }
.fx-auth-card { width: 100%; display: flex; flex-direction: column; }
@media (min-width: 700px) {
  body.fx-auth-page { background: var(--page); }
  .fx-auth { align-items: center; }
  .fx-auth-card {
    width: auto;
    margin: 32px 0;
    padding: 0 8px 32px;
    background: var(--card);
    border-radius: 20px;
    border: .5px solid rgba(0, 0, 0, .08);
    box-shadow: var(--shadow);
  }
  .fx-auth-card .fx-col { width: 380px; }
}
/* phones only / wide screens only */
@media (min-width: 700px) { .fx-phone-only { display: none !important; } }
@media (max-width: 699.98px) { .fx-wide-only { display: none !important; } }

/* ---------- motion ---------- */
/* each row rises in a moment after the one above (the app's staggered entrance) */
.fx-in { opacity: 0; transform: translateY(10px); animation: fx-rise .5s var(--ease) forwards; }
@keyframes fx-rise { to { opacity: 1; transform: none; } }
/* the logo's colors sweep once across a title, as on the app's sign-in */
.fx-sweep {
  background: linear-gradient(90deg, var(--label) 0%, var(--label) 34%, var(--brand-green) 40%, var(--brand-yellow) 46%,
    var(--brand-red) 54%, var(--brand-blue) 60%, var(--label) 66%, var(--label) 100%);
  background-size: 300% 100%;
  background-position: 100% 0;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: fx-rise .5s var(--ease) forwards, fx-sweep 1.4s .35s ease-in-out forwards;
}
@keyframes fx-sweep { from { background-position: 100% 0; } to { background-position: 0% 0; } }
@media (prefers-reduced-motion: reduce) {
  .fx-in { animation: none; opacity: 1; transform: none; }
  .fx-sweep { animation: none; background: none; color: var(--label); }
  * { transition: none !important; }
}

/* faces, ▲ score ▼ and the conversation are in thread.css (also used by article pages) */

/* ---------- top bar: the logo, Get the App and Sign In, frosted over the page ---------- */
.fx-topbar {
  position: sticky; top: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: .5px solid var(--separator);
}
.fx-topbar-in { display: flex; align-items: center; justify-content: space-between; height: 52px; }
.fx-topbar-logo img { height: 28px; width: auto; }
.fx-topbar-actions { display: flex; gap: 8px; }
.fx-pill-btn {
  display: inline-flex; align-items: center; height: 32px; padding: 0 14px; border-radius: 16px;
  background: var(--fill); color: var(--label); font-size: 15px; font-weight: 600; white-space: nowrap;
}
.fx-pill-btn.primary { background: var(--accent); color: #fff; }
.fx-pill-btn:hover { filter: brightness(.97); }

/* ---------- a post, as the app draws it ---------- */
.fx-post { padding: 16px 0 6px; border-bottom: .5px solid var(--separator); }
.fx-author { display: flex; align-items: center; gap: 10px; }
.fx-author-text { min-width: 0; }
.fx-author-name { font-size: 16px; font-weight: 600; letter-spacing: -.2px; line-height: 1.25; }
.fx-author-name a:hover { text-decoration: underline; }
.fx-group-link { font-weight: 600; }
.fx-post-title { margin: 14px 0 0; font-size: 22px; font-weight: 700; letter-spacing: -.4px; line-height: 1.25; overflow-wrap: anywhere; }
.fx-post-text { margin: 10px 0 0; font-size: 17px; line-height: 1.45; overflow-wrap: anywhere; }
h1.fx-post-text.as-text { font-weight: 400; letter-spacing: 0; }
.fx-post-text a, .fx-comment-text a { color: var(--accent); }
.fx-post-text a:hover, .fx-comment-text a:hover { text-decoration: underline; }
.fx-post-media { margin: 12px -16px 0; }
.fx-post-media img { width: 100%; height: auto; max-height: 80vh; object-fit: contain; background: var(--fill); }
@media (min-width: 700px) { .fx-post-media { margin: 12px 0 0; } .fx-post-media img { border-radius: 14px; } }
/* video: Faxo's own (HLS) in a native player on black, or a YouTube video as its picture with a
   play button until tapped (the player loads only then, so the page stays fast) */
.fx-post-video { position: relative; background: #000; overflow: hidden; }
.fx-post-video video { display: block; width: 100%; height: auto; max-height: 80vh; background: #000; }
@media (min-width: 700px) { .fx-post-video { border-radius: 14px; } }
.fx-yt { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; padding: 0; border: 0; background: #000; cursor: pointer; }
.fx-yt img { width: 100%; height: 100%; object-fit: cover; }
.fx-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.fx-play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(0, 0, 0, .55); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  transition: transform .15s var(--ease), background-color .15s;
}
.fx-play svg { width: 28px; height: 28px; margin-left: 4px; fill: #fff; }
.fx-yt:hover .fx-play { transform: translate(-50%, -50%) scale(1.06); background: rgba(0, 0, 0, .7); }

.fx-post .fx-post-actions { margin-top: 8px; height: 44px; }
.fx-post-page .fx-comments { padding-bottom: 140px; } /* room above the join bar */

/* ---------- the join bar along the bottom ---------- */
.fx-joinbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-top: .5px solid var(--separator);
  padding-bottom: env(safe-area-inset-bottom);
}
.fx-joinbar-in { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 10px; }
.fx-joinbar-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fx-joinbar-text strong { font-size: 15px; }
.fx-btn.fx-joinbar-btn { width: auto; height: 40px; padding: 0 20px; font-size: 15px; border-radius: 20px; }

/* ---------- hand-off: the screen the app shows while it loads ---------- */
.fx-handoff {
  position: fixed;
  inset: 0;
  z-index: 10;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s var(--ease), visibility 0s linear .3s;
}
.fx-handoff.on { opacity: 1; visibility: visible; transition: opacity .3s var(--ease), visibility 0s; }
.fx-track { margin-top: 28px; width: 140px; height: 3px; border-radius: 3px; background: var(--fill-pressed); overflow: hidden; }
.fx-track i {
  display: block;
  width: 40%;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand-green), var(--brand-yellow), var(--brand-red), var(--brand-blue));
  animation: fx-slide 1.1s cubic-bezier(.45, 0, .25, 1) infinite;
}
@keyframes fx-slide { from { transform: translateX(-100%); } to { transform: translateX(250%); } }
