/* Frame Focus — one stylesheet, no external fonts. Frosted panels with hairline borders over
   the app's time-of-day sky: the same on every platform, so Android needs no Liquid Glass.
   sky.js sets the --sky-* colours, --stars, --glow and --accent, and adds .sky-light by day
   (dark text, like the app). The values below are the night sky, used until it runs. */

:root {
  --sky-top: rgb(5, 5, 16);
  --sky-mid: rgb(10, 10, 26);
  --sky-horizon: rgb(18, 18, 42);
  --sky-bottom: rgb(8, 8, 26);
  --stars: 1;
  --glow: 0;
  --accent: rgb(153, 102, 255);
  --accent-rgb: 153, 102, 255;

  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.72);
  --faint: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.1);
  --glass: rgba(255, 255, 255, 0.05);
  --glass-strong: rgba(255, 255, 255, 0.1);
  --glass-edge: rgba(255, 255, 255, 0.14);
  --edge-strong: rgba(255, 255, 255, 0.26);
  --shadow: rgba(0, 0, 0, 0.18);
  --field: rgba(0, 0, 0, 0.2);
  --on-text: #0b0c14;
  --bar: rgba(255, 255, 255, 0.03);
  --frost: blur(20px) saturate(140%);
  --ok: #9be7b4;
  --warn: #ffd98a;
  --err: #ffb0a8;
  --corner: rgba(255, 255, 255, 0.55);
  --radius: 14px;
  --radius-sm: 10px;
  --sans: system-ui, -apple-system, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: system-ui, -apple-system, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: dark;
}

/* Daylight: dark text on lighter frost, as the app switches to black text by day. */
:root.sky-light {
  --text: #0b0c14;
  --muted: rgba(0, 0, 0, 0.66);
  --faint: rgba(0, 0, 0, 0.5);
  --line: rgba(0, 0, 0, 0.09);
  --glass: rgba(255, 255, 255, 0.4);
  --glass-strong: rgba(255, 255, 255, 0.58);
  --glass-edge: rgba(0, 0, 0, 0.1);
  --edge-strong: rgba(0, 0, 0, 0.2);
  --shadow: rgba(20, 40, 80, 0.08);
  --field: rgba(255, 255, 255, 0.5);
  --on-text: #ffffff;
  --bar: rgba(255, 255, 255, 0.16);
  --ok: #0d6b34;
  --warn: #7a4d00;
  --err: #a3241c;
  --corner: rgba(255, 255, 255, 0.85);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; background: var(--sky-bottom); }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font: 1rem/1.6 var(--sans);
  color: var(--text);
  background: transparent;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------------ the sky */
.sky {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-mid) 35%, var(--sky-horizon) 50%, var(--sky-bottom) 100%);
  transition: background 1.2s ease;
}
.sky .stars {
  position: absolute; inset: 0; opacity: var(--stars); transition: opacity 1.2s ease;
  background-image:
    radial-gradient(1.2px 1.2px at 7% 12%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 19% 34%, #fff 50%, transparent 52%),
    radial-gradient(1.6px 1.6px at 27% 8%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 36% 22%, rgba(255, 255, 255, .8) 50%, transparent 52%),
    radial-gradient(1.3px 1.3px at 44% 41%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 53% 15%, #fff 50%, transparent 52%),
    radial-gradient(1.8px 1.8px at 61% 29%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 69% 6%, rgba(255, 255, 255, .7) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 77% 38%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 84% 18%, #fff 50%, transparent 52%),
    radial-gradient(1.5px 1.5px at 92% 44%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 12% 52%, rgba(255, 255, 255, .7) 50%, transparent 52%),
    radial-gradient(1.2px 1.2px at 31% 61%, #fff 50%, transparent 52%),
    radial-gradient(1px 1px at 58% 55%, #fff 50%, transparent 52%),
    radial-gradient(1.4px 1.4px at 88% 63%, #fff 50%, transparent 52%);
  background-size: 640px 640px;
}
.sky .stars.far {
  opacity: calc(var(--stars) * 0.6);
  background-size: 410px 410px;
  background-position: 120px 70px;
}
.sky .glow {
  position: absolute; left: -20%; right: -20%; bottom: -10%; height: 70%;
  opacity: var(--glow); transition: opacity 1.2s ease;
  background: radial-gradient(50% 60% at 50% 100%, var(--sky-horizon), transparent 75%);
}
@media (prefers-reduced-motion: reduce) {
  .sky, .sky .stars, .sky .glow { transition: none; }
  * { scroll-behavior: auto !important; transition: none !important; }
}

/* ------------------------------------------------------------------ type */
main { flex: 1; width: 100%; max-width: 68rem; margin: 0 auto; padding: 1rem 1rem 3rem; }

h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.15; margin: 0 0 .6em; letter-spacing: -0.015em; }
h1 { font-size: clamp(2rem, 6.5vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.3rem, 4vw, 1.7rem); }
h3 { font-size: 1.1rem; font-weight: 600; }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--text); text-decoration-color: rgba(var(--accent-rgb), .9); text-decoration-thickness: 2px; text-underline-offset: .18em; }
a:hover { text-decoration-color: var(--text); }
strong { color: var(--text); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 6px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--text); color: var(--sky-top); padding: .6rem 1rem; z-index: 10; border-radius: 999px; }
.skip:focus { left: .5rem; top: .5rem; }

.muted { color: var(--muted); }
.small { font-size: .9rem; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 40rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .16em; font-size: .72rem; color: var(--muted); margin-bottom: .5rem; font-weight: 600; }
[hidden] { display: none !important; }

/* ------------------------------------------------------------------ frosted panels */
.card, .notice, .store.soon, .pill, .badge, .authbox, .quote, .site-footer, .prose {
  -webkit-backdrop-filter: var(--frost);
  backdrop-filter: var(--frost);
}
.card {
  background: var(--glass);
  border: 1px solid var(--glass-edge);
  border-radius: var(--radius);
  padding: 1.35rem;
  box-shadow: 0 1px 2px var(--shadow);
}

/* The logo's two corners around something that matters, like the words in the app. */
.framed { position: relative; display: inline-block; max-width: 34rem; padding: 1.4rem 1.8rem; }
@media (max-width: 30rem) { .framed { padding: 1.1rem 1.2rem; } .framed::before, .framed::after { width: 2rem; height: 2rem; } }
.framed::before, .framed::after {
  content: ""; position: absolute; width: 2.6rem; height: 2.6rem; pointer-events: none;
  border: 0 solid var(--corner);
}
.framed::before { top: 0; left: 0; border-top-width: .55rem; border-left-width: .55rem; }
.framed::after { bottom: 0; right: 0; border-bottom-width: .55rem; border-right-width: .55rem; }

/* ------------------------------------------------------------------ header and footer */
/* Stays at the top while scrolling, full width, with the content lined up with the page below.
   Clear on the sky at the top of the page; a faint frost fades in once it scrolls (header.js). */
.site-header {
  position: sticky; top: 0; z-index: 5;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .25rem 1rem;
  width: 100%; padding: .55rem max(1rem, calc((100% - 66rem) / 2));
}
.site-header::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: var(--bar);
  -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  opacity: 0; transition: opacity .6s ease;
}
.site-header.frosted::before { opacity: 1; }
html { scroll-padding-top: 5rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font: 700 1.15rem/1 var(--display); letter-spacing: -0.01em; color: var(--text); text-decoration: none; padding: .45rem 0; }
.brand-mark { fill: var(--corner); }
.site-header nav { display: flex; flex-wrap: wrap; gap: .15rem; }
.site-header nav a { display: inline-block; padding: .55rem .8rem; border-radius: 8px; color: var(--muted); text-decoration: none; font-weight: 500; font-size: .95rem; transition: color .15s ease, background .15s ease; }
.site-header nav a:hover { color: var(--text); background: var(--glass-strong); }
.site-footer {
  border-top: 1px solid var(--line); background: var(--glass);
  padding: 1.5rem 1rem 2rem; text-align: center;
}
.site-footer nav { display: flex; flex-wrap: wrap; justify-content: center; }
.site-footer nav a { display: inline-block; padding: .6rem .6rem; color: var(--text); text-decoration: none; }
.site-footer nav a:hover { text-decoration: underline; }
.site-footer p { margin: .25rem 0; }
.slogan, .slogan-line { font-style: italic; color: var(--muted); }

/* ------------------------------------------------------------------ buttons */
/* Solid in the text colour (white at night, near-black by day), like Claude's; secondary ones
   are outlined frost. */
.btn, button {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 2.75rem; padding: .55rem 1.1rem; border-radius: var(--radius-sm);
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--on-text); font: 500 .97rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background .15s ease, border-color .15s ease, opacity .15s ease, transform .1s ease;
}
.btn:hover, button:hover { opacity: .86; color: var(--on-text); }
.btn:active, button:active { transform: scale(.98); }
.btn.secondary, button.secondary {
  background: var(--glass); border-color: var(--edge-strong); color: var(--text);
  -webkit-backdrop-filter: var(--frost); backdrop-filter: var(--frost);
}
.btn.secondary:hover, button.secondary:hover { opacity: 1; background: var(--glass-strong); color: var(--text); }
button.danger { background: transparent; border-color: var(--err); color: var(--err); }
button.danger:hover { opacity: 1; background: var(--glass-strong); color: var(--err); }
button.link { min-height: 2.75rem; padding: .3rem .2rem; border: 0; border-radius: 4px; background: none; color: var(--text); text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), .9); font-weight: 400; }
button.link:hover { background: none; opacity: 1; color: var(--text); }
button:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }
.actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin: 1rem 0; }

/* ------------------------------------------------------------------ layout */
.grid { display: grid; gap: 1rem; list-style: none; padding: 0; margin: 0 0 1rem; }
@media (min-width: 46rem) { .grid.three { grid-template-columns: repeat(3, 1fr); } .grid.two { grid-template-columns: repeat(2, 1fr); } }
.grid .card > :last-child { margin-bottom: 0; }
.page { padding-top: 1.5rem; }
.page.narrow, .prose { max-width: 44rem; margin: 0 auto; }
.prose { background: var(--glass); border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: 1.5rem; box-shadow: 0 1px 2px var(--shadow); }
.prose h2 { margin-top: 2rem; }
.prose li { margin-bottom: .4rem; }
section + section { margin-top: 2.5rem; }
.stack > * + * { margin-top: 1rem; }

/* ------------------------------------------------------------------ home */
.hero { padding: 3rem 0 1.5rem; text-align: center; }
.hero h1 { margin-bottom: .9rem; }
.hero .lede { margin-left: auto; margin-right: auto; }
.store.soon { display: inline-flex; align-items: center; gap: .55rem; padding: .55rem 1rem; border: 1px solid var(--glass-edge); border-radius: var(--radius-sm); background: var(--glass); color: var(--text); font-weight: 500; }
.soon-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); }
.steps ol.grid { counter-reset: step; }
.steps .card { counter-increment: step; position: relative; padding-top: 3rem; }
.steps .card::before { content: counter(step); position: absolute; top: 1rem; left: 1.35rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; background: transparent; border: 1px solid var(--edge-strong); }
.tiers { list-style: none; padding: 0; }
.tiers li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 .75rem; padding: .45rem 0; border-bottom: 1px solid var(--line); }
.tiers li span:last-child { color: var(--text); font-weight: 600; }
.privacy-strip ul { padding-left: 1.2rem; }

/* ------------------------------------------------------------------ share pages */
.share { max-width: 30rem; margin: 2rem auto 0; text-align: center; }
.share h1 { font-size: clamp(1.7rem, 6vw, 2.3rem); margin-bottom: .25em; }
.avatar {
  width: 5.2rem; height: 5.2rem; margin: 0 auto 1rem; border-radius: 50%; display: grid; place-items: center;
  font: 700 2.2rem/1 var(--display); color: var(--text);
  background: rgba(var(--accent-rgb), .3); border: 1px solid var(--glass-edge);
}
.badge { display: inline-flex; align-items: center; gap: .3rem; vertical-align: middle; font: 600 .78rem/1 var(--sans); color: var(--text); background: var(--glass); border: 1px solid var(--glass-edge); border-radius: 999px; padding: .28rem .6rem .28rem .32rem; }
.handle { color: var(--muted); }
.bio { white-space: pre-line; }
.price { font-size: 1.15rem; font-weight: 600; color: var(--text); }
.lock { vertical-align: -1px; }
.spoke { color: var(--muted); }
.share .actions { justify-content: center; }
.explain { max-width: 30rem; margin-left: auto; margin-right: auto; }
.frames { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.frame-link { display: grid; gap: .2rem; text-decoration: none; text-align: left; transition: background .2s ease; }
.frame-link:hover { background: var(--glass-strong); }
.frame-link strong { font-size: 1.1rem; }
.frame-link .bio, .frame-link .price { color: var(--muted); font-size: .95rem; }
.code-label { margin-bottom: .2rem; color: var(--muted); }
.code-large { font: 700 clamp(1.7rem, 9vw, 2.8rem)/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .14em; color: var(--text); margin: 0 0 1rem; user-select: all; word-break: break-all; }

/* ------------------------------------------------------------------ forms */
label { display: block; font-weight: 600; margin-bottom: .35rem; }
.hint { display: block; font-weight: 400; font-size: .9rem; color: var(--muted); }
input[type="text"], input[type="email"], textarea, select {
  width: 100%; max-width: 100%; padding: .7rem .9rem; border-radius: var(--radius-sm);
  border: 1px solid var(--edge-strong); background: var(--field); color: var(--text);
  font: 1rem/1.4 var(--sans); transition: border-color .15s ease;
}
input[type="text"]:focus, input[type="email"]:focus, textarea:focus, select:focus { border-color: var(--text); }
input::placeholder, textarea::placeholder { color: var(--faint); }
textarea { min-height: 9rem; resize: vertical; }
input.code { max-width: 12rem; font: 600 1.4rem/1.2 ui-monospace, Menlo, Consolas, monospace; letter-spacing: .3em; }
.field { margin-bottom: 1rem; }
fieldset { border: 1px solid var(--glass-edge); border-radius: var(--radius); padding: .75rem 1rem; margin: 0 0 1rem; }
legend { font-weight: 600; padding: 0 .4rem; }
.choice { display: inline-flex; align-items: center; gap: .45rem; min-height: 2.75rem; margin-right: 1.25rem; font-weight: 400; }
.choice input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }

/* ------------------------------------------------------------------ status */
.notice { border-radius: var(--radius-sm); padding: .85rem 1.05rem; border: 1px solid var(--glass-edge); background: var(--glass); margin: 0 0 1rem; }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.warn { border-color: var(--warn); color: var(--warn); }
.notice.err { border-color: var(--err); color: var(--err); }
.loading { color: var(--muted); }
.draft-banner { border: 1px dashed var(--warn); border-radius: var(--radius-sm); padding: .85rem 1.05rem; color: var(--warn); background: var(--glass); }
.draft-banner strong { color: var(--warn); }
.pill { display: inline-block; font: 600 .78rem/1 var(--sans); padding: .32rem .65rem; border-radius: 999px; border: 1px solid var(--glass-edge); background: var(--glass); color: var(--text); vertical-align: middle; }

/* ------------------------------------------------------------------ account, plans, org, admin */
.authbox { margin-bottom: 1.5rem; }
.authbox.signed-in { display: flex; flex-wrap: wrap; align-items: center; gap: 0 1rem; padding: .55rem 1.35rem; }
.authbox.signed-in p { margin: 0; }
.plan h2 { margin-bottom: .2em; }
.plan .amount { font-size: 1.6rem; font-weight: 700; color: var(--text); margin: 0; }
.facts { display: grid; grid-template-columns: minmax(7rem, auto) 1fr; gap: .35rem 1rem; margin: 0 0 1rem; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; color: var(--text); }
@media (max-width: 24rem) { .facts { grid-template-columns: 1fr; } .facts dd { margin-bottom: .5rem; } }
progress { width: 100%; height: .7rem; accent-color: var(--accent); }
.qr { display: block; width: 100%; max-width: 15rem; height: auto; border-radius: var(--radius); background: #fff; }
.item { border-top: 1px solid var(--line); padding: 1rem 0; }
.item:first-of-type { border-top: 0; }
.quote { white-space: pre-wrap; background: var(--field); border-left: 3px solid var(--accent); border-radius: 10px; padding: .75rem .95rem; margin: .5rem 0 .8rem; }
.section-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.section-head h2 { margin: 0; }
details { border-bottom: 1px solid var(--line); padding: .2rem 0; }
summary { cursor: pointer; padding: .75rem 0; font-weight: 600; }
details p { margin: 0 0 1rem; color: var(--muted); }

/* Browsers without backdrop blur get a more solid panel so text stays readable. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(12, 14, 38, 0.78); --glass-strong: rgba(30, 32, 60, 0.85); }
  :root.sky-light { --glass: rgba(255, 255, 255, 0.82); --glass-strong: rgba(255, 255, 255, 0.92); }
}
