/* CosmoCircle shared design tokens + primitives.
   Layout: phone-first single column (max 520px app / 1080px marketing), bottom nav in the app. */
:root {
  --bg: #FFF7F9;
  --surface: #FFFFFF;
  --blush: #FCE6EC;
  --pink: #F4B6C8;
  --rose: #C2416B;
  --rose-ink: #FFFFFF;
  --ink: #2E1622;
  --muted: #7A5F6C;
  --line: #F2DCE4;
  --mark: #6B5452;
  --good: #2C8A66;
  --warn: #A86A12;
  --bad: #C0392F;
  --money-in: #2F7E61;
  --money-out: #B4514C;
  --shadow: 0 1px 2px rgba(46, 22, 34, .05), 0 8px 24px rgba(46, 22, 34, .06);
  --f-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --f-body: "Figtree", ui-sans-serif, -apple-system, "Segoe UI", Roboto, sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  /* Liquid glass: translucent surface, bright top edge, soft refraction blur */
  --glass: rgba(255, 255, 255, .1);
  --glass-strong: rgba(255, 255, 255, .22);
  --glass-thick: rgba(255, 250, 252, .72);
  --glass-shade: rgba(46, 22, 34, .14);
  --glass-edge: transparent;
  --glass-glow: rgba(255, 255, 255, .28);
  --glass-hi: rgba(255, 255, 255, .9);
  --glass-tint: rgba(244, 182, 200, .16);
  --amb-1: rgba(244, 182, 200, .55);
  --amb-2: rgba(194, 65, 107, .16);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #160D12; --surface: #22151C; --blush: #3A2230; --pink: #E8A2B8; --rose: #F08DAE; --rose-ink: #2A0F1C;
    --ink: #FBEFF3; --muted: #C2A6B3; --line: #3A2832; --mark: #EBCBD5; --good: #5CC79A; --warn: #E3AC52; --bad: #EF7A73; --money-in: #8ED8B4; --money-out: #F2A09B;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --glass: rgba(46, 28, 38, .12); --glass-strong: rgba(46, 28, 38, .2); --glass-thick: rgba(34, 21, 28, .74); --glass-shade: rgba(0, 0, 0, .5); --glass-edge: transparent; --glass-glow: rgba(255, 255, 255, .05); --glass-hi: rgba(255, 255, 255, .14); --glass-tint: rgba(240, 141, 174, .08);
    --amb-1: rgba(240, 141, 174, .2); --amb-2: rgba(232, 162, 184, .1);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #160D12; --surface: #22151C; --blush: #3A2230; --pink: #E8A2B8; --rose: #F08DAE; --rose-ink: #2A0F1C;
  --ink: #FBEFF3; --muted: #C2A6B3; --line: #3A2832; --mark: #EBCBD5; --good: #5CC79A; --warn: #E3AC52; --bad: #EF7A73; --money-in: #8ED8B4; --money-out: #F2A09B;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --glass: rgba(46, 28, 38, .12); --glass-strong: rgba(46, 28, 38, .2); --glass-thick: rgba(34, 21, 28, .74); --glass-shade: rgba(0, 0, 0, .5); --glass-edge: transparent; --glass-glow: rgba(255, 255, 255, .05); --glass-hi: rgba(255, 255, 255, .14); --glass-tint: rgba(240, 141, 174, .08);
    --amb-1: rgba(240, 141, 174, .2); --amb-2: rgba(232, 162, 184, .1);
  color-scheme: dark;
}

/* No zoom anywhere: stops double-tap zoom on touch screens */
html { touch-action: manipulation; }
/* iPhone: no sideways bounce or drift, even on a diagonal swipe (clip keeps sticky headers working) */
html, body { overflow-x: clip; overscroll-behavior-x: none; }
/* A band in the page colour under the status bar, so content scrolling up never shows behind the clock */
body::before { content: ""; position: fixed; z-index: 40; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); background: var(--bg); pointer-events: none; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 500; letter-spacing: -0.01em; text-wrap: balance; margin: 0; line-height: 1.15; }
p { margin: 0; }
a { color: var(--rose); }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--rose); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--muted); }

.logo { display: inline-flex; align-items: center; gap: calc(var(--logo-h, 24px) * .25); text-decoration: none; color: var(--mark); line-height: 1; }
.logo svg { flex: none; display: block; }
.logo b { font-family: "Quicksand", var(--f-body); font-weight: 400; font-size: calc(var(--logo-h, 24px) * .9); letter-spacing: .01em; white-space: nowrap; }
.logo b span { font-weight: 700; }
.logo .tm { font-family: var(--f-body); font-weight: 500; font-size: .42em; vertical-align: top; position: relative; top: -.1em; margin-left: .08em; }
svg { flex-shrink: 0; }

.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; text-align: center;
  background: linear-gradient(180deg, color-mix(in srgb, var(--rose) 80%, #fff), var(--rose) 72%);
  color: var(--rose-ink); font-weight: 600; font-size: 15px;
  cursor: pointer; text-decoration: none; -webkit-tap-highlight-color: transparent;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(46, 22, 34, .12);
  transition: transform .5s cubic-bezier(.2, .9, .25, 1), box-shadow .3s ease, filter .3s ease, background-color .3s ease;
}
@media (hover: hover) and (pointer: fine) {
  .btn:not(:disabled):hover { filter: brightness(1.05); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .36), inset 0 -1px 0 rgba(0, 0, 0, .06), 0 1px 2px rgba(46, 22, 34, .12), 0 3px 8px rgba(46, 22, 34, .08); }
  .btn.ghost:not(:disabled):hover, .btn.danger:not(:disabled):hover { filter: none; background-color: color-mix(in srgb, var(--surface) 88%, transparent); }
  .btn.soft:not(:disabled):hover { filter: none; background-color: color-mix(in srgb, var(--blush) 75%, var(--pink)); }
  .btn.glass:not(:disabled):hover { filter: none; background-color: color-mix(in srgb, var(--surface) 30%, transparent); }
}
.card { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 18px; }
/* Liquid glass, iOS-style: clear tint, a bright rim that catches light from the top, soft depth.
   Real blur only on floating bars and panels that content scrolls beneath (blur is the most expensive effect to draw). */
.glass {
  position: relative;
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 45%), var(--glass);
  border: 1px solid var(--glass-edge);
  box-shadow: inset 0 1px 22px var(--glass-glow), 0 12px 32px -14px var(--glass-shade);
}
.glass.strong { background: linear-gradient(180deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, 0) 55%), var(--glass-strong); }
header.top .glass, nav.tabs .glass, .sheet.glass { -webkit-backdrop-filter: blur(12px) saturate(190%); backdrop-filter: blur(12px) saturate(190%); }
.sheet.glass.strong { background: var(--glass-thick); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  header.top .glass, nav.tabs .glass { background: var(--glass-thick); }
}
/* Gradients start at the outer edge, so the shine never repeats into a clear border as a thin line.
   Important: the background shorthand in each variant would reset it. */
.glass, .btn, .app .card, .app .stat { background-origin: border-box !important; }
/* Soft pink light behind glass so it has something to refract */
.ambient { position: fixed; inset: -120px 0; z-index: -1; pointer-events: none; background:
  radial-gradient(40vmax 40vmax at 8% 4%, var(--amb-1), transparent 70%),
  radial-gradient(36vmax 36vmax at 96% 38%, var(--amb-2), transparent 70%),
  radial-gradient(44vmax 44vmax at 30% 100%, var(--amb-1), transparent 70%); }
.btn.glass { background: linear-gradient(180deg, rgba(255, 255, 255, .16), rgba(255, 255, 255, 0) 60%), var(--glass-strong); color: var(--ink); box-shadow: inset 0 1px 1px var(--glass-hi), 0 1px 2px rgba(46, 22, 34, .06); }
/* Press feel, like native iOS buttons: a small sink, a slight dim, and the lift shadow goes flat.
   Down is quick; the release eases back with no bounce. */
.btn:not(:disabled):active, .btn.pressed:not(:disabled) {
  transform: scale(.975); filter: brightness(.94);
  box-shadow: inset 0 1px 2px rgba(46, 22, 34, .12), inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(46, 22, 34, 0);
  transition: transform .09s ease-out, filter .09s ease-out, box-shadow .09s ease-out;
}
.btn.released { transition: transform .28s cubic-bezier(.25, .8, .35, 1), filter .28s ease, box-shadow .28s ease; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.ghost { background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--ink); border-color: var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi), 0 1px 2px rgba(46, 22, 34, .05); }
.btn.soft { background: var(--blush); color: var(--ink); box-shadow: 0 1px 2px rgba(46, 22, 34, .05); }
.btn.danger { background: color-mix(in srgb, var(--surface) 55%, transparent); color: var(--bad); border-color: var(--glass-edge); box-shadow: inset 0 1px 0 var(--glass-hi); }
.btn.sm { min-height: 34px; padding: 0 12px; font-size: 13px; }
.btn.block { width: 100%; }


.field { display: grid; gap: 6px; }
.field > span { font-size: 13px; font-weight: 600; color: var(--muted); }
.input, select.input, textarea.input {
  width: 100%; box-sizing: border-box; min-height: 46px; padding: 10px 14px;
  border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--bg);
}
textarea.input { min-height: 96px; resize: vertical; line-height: 1.45; }
.input:focus { outline: none; border-color: var(--rose); box-shadow: 0 0 0 3px color-mix(in srgb, var(--rose) 18%, transparent); }

.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--blush); color: var(--ink); white-space: nowrap; }
.chip.good { background: color-mix(in srgb, var(--good) 14%, transparent); color: var(--good); }
.chip.warn { background: color-mix(in srgb, var(--warn) 16%, transparent); color: var(--warn); }
.chip.bad { background: color-mix(in srgb, var(--bad) 14%, transparent); color: var(--bad); }

/* Status pill at the top of the screen, like iOS: sized to its text, centered, clear of the bars and the + button */
.toast {
  position: fixed; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 12px); transform: translate(-50%, -16px) scale(.96);
  width: max-content; max-width: min(420px, calc(100vw - 48px)); box-sizing: border-box; text-align: center; text-wrap: balance;
  background: color-mix(in srgb, var(--ink) 88%, transparent); color: var(--bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  padding: 11px 20px; border-radius: 999px; font-size: 14px; font-weight: 600; line-height: 1.3; box-shadow: 0 8px 24px rgba(30, 10, 20, .18);
  opacity: 0; pointer-events: none; transition: opacity .25s ease, transform .4s cubic-bezier(.32, .72, 0, 1); z-index: 80;
}
.toast.show { opacity: 1; transform: translate(-50%, 0) scale(1); }

/* Motion: scroll reveals that animate only opacity and transform. Content stays readable at every frame. */
/* Scroll reveal: content rises a short way out of a soft blur and settles on a long ease-out.
   Glass cards skip the blur, because a filter would switch off their see-through blur while it runs. */
.rv:not(.in) { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(6px); }
.rv.in { animation: ccRise 1s cubic-bezier(.16, 1, .3, 1) var(--d, 0ms) backwards; }
.rv.glass:not(.in), .rv.card:not(.in) { filter: none; }
.rv.glass.in, .rv.card.in { animation-name: ccRiseCard; }
@keyframes ccRise { from { opacity: 0; transform: translate3d(0, 28px, 0); filter: blur(6px); } 55% { filter: blur(0); } }
@keyframes ccRiseCard { from { opacity: 0; transform: translate3d(0, 28px, 0); } }
@keyframes ccFade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .rv:not(.in) { opacity: 1; transform: none; filter: none; } }

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

/* Public bio page (shared by bio.html and the in-app preview) */
.bio { max-width: 460px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; text-align: center; }
.bio-head { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.bio-av { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--pink); color: var(--ink); font-family: var(--f-display); font-size: 38px; overflow: hidden; box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--line); }
.bio-av img { width: 100%; height: 100%; object-fit: cover; }
.bio-head h1 { font-size: 32px; margin-top: 8px; }
.bio-head .title { color: var(--muted); font-size: 15px; }
.bio-loc { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 14px; }
.bio-loc svg { color: var(--rose); flex: none; }
.bio-url { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--rose); padding: 5px 12px; border-radius: 999px; margin-top: 4px; }
.bio-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-radius: var(--r-md); padding: 14px 6px; }
.bio-stats div + div { border-left: 1px solid var(--line); }
.bio-stats b { display: block; font-family: var(--f-display); font-size: 24px; font-weight: 500; line-height: 1.1; }
.bio-stats span { font-size: 11px; color: var(--muted); letter-spacing: .02em; }
.bio-links { display: grid; gap: 10px; }
.bio { position: relative; }
.bio-banner { margin: 0 0 -58px; border-radius: 24px; overflow: hidden; aspect-ratio: 3 / 1.1; max-width: 100%; background: var(--blush); box-shadow: 0 1px 2px rgba(46, 22, 34, .06), 0 10px 30px -14px rgba(46, 22, 34, .3); }
.bio-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-head { position: relative; isolation: isolate; }
.bio:not(.has-banner) .bio-head::before { content: ""; position: absolute; z-index: -1; left: 50%; top: -36px; width: 300px; height: 220px; transform: translateX(-50%); pointer-events: none; background: radial-gradient(closest-side, color-mix(in srgb, var(--rose) 26%, transparent), transparent); }
.bio-av { box-shadow: 0 0 0 4px var(--surface), 0 0 0 5.5px color-mix(in srgb, var(--rose) 45%, transparent) !important; }
.bio-links a.bio-link { display: grid; grid-template-columns: 52px minmax(0, 1fr) 24px; align-items: center; gap: 14px; min-height: 68px; padding: 8px 18px 8px 8px; border-radius: 18px; color: var(--ink); text-decoration: none; text-align: left; transition: transform .3s cubic-bezier(.2, .8, .2, 1), box-shadow .3s ease; }
.bio-links a.bio-link:hover { transform: translateY(-2px); }
.bio-links a.bio-link:hover .bio-go { transform: translateX(2px); color: var(--ink); }
.bio-links a.bio-link:active { transform: scale(.985); transition-duration: .1s; }
.bio-txt { min-width: 0; display: grid; gap: 2px; }
.bio-txt b { font-weight: 600; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.bio-txt small { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bio-txt small:empty { display: none; }
.bio-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--tile, color-mix(in srgb, var(--rose) 12%, var(--surface))); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08), 0 8px 16px -10px var(--tile, rgba(46, 22, 34, .35)); }
.bio-ico.ig { background: radial-gradient(circle at 30% 107%, #FDF497 0%, #FDF497 5%, #FD5949 45%, #D6249F 60%, #285AEB 90%); --tile: #D6249F; }
.bio-ico img { width: 24px; height: 24px; display: block; }
.bio-ico.brand img.logo { width: 26px; height: 26px; filter: brightness(0) invert(1); }
.bio-ico.brand.dark-logo img.logo { filter: brightness(0); }
.bio-ico img.fav { border-radius: 6px; }
.bio-ico .bio-glyph { color: var(--rose); }
.bio-ico.brand .bio-glyph { color: #fff; }
.bio-go { justify-self: end; display: grid; place-items: center; color: var(--muted); transition: transform .3s cubic-bezier(.2, .8, .2, 1), color .2s ease; }
.bio-about { text-align: left; border-radius: var(--r-md); padding: 16px 18px; white-space: pre-line; overflow-wrap: anywhere; }
.bio-sec { display: flex; flex-direction: column; gap: 10px; text-align: left; }
.bio-skills { display: flex; flex-wrap: wrap; gap: 8px; }
.bio-skills .chip { background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.bio-skills .chip b { color: var(--rose); font-weight: 700; }
.bio-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; border-radius: var(--r-md); overflow: hidden; }
.bio-grid button { all: unset; cursor: pointer; aspect-ratio: 1; max-width: 100%; background: var(--blush); position: relative; }
.bio-grid button:focus-visible { outline: 2px solid var(--rose); outline-offset: -2px; }
.bio-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bio-empty { padding: 22px; border: 1.5px dashed var(--line); border-radius: var(--r-md); color: var(--muted); font-size: 14px; }
.bio-foot { display: flex; justify-content: center; padding-top: 6px; font-size: 12px; color: var(--muted); }

/* Pull to refresh (see CC.pullToRefresh): liquid glass disc with the shears mascot. Only transform and opacity animate. */
.ptr { position: fixed; z-index: 20; left: 50%; top: calc(env(safe-area-inset-top, 0px) + 8px); width: 52px; height: 52px; margin-left: -26px;
  border-radius: 50%; display: grid; place-items: center; pointer-events: none; opacity: 0; transform: translate3d(0, -60px, 0);
  /* Liquid glass, like the rest of the app: see-through, blurred behind, soft inner glow, no outline */
  background: linear-gradient(180deg, rgba(255, 255, 255, .22), rgba(255, 255, 255, 0) 55%), var(--glass);
  -webkit-backdrop-filter: blur(12px) saturate(190%); backdrop-filter: blur(12px) saturate(190%);
  box-shadow: inset 0 1px 14px var(--glass-glow), 0 8px 22px -6px var(--glass-shade); }
.ptr svg { width: 40px; height: 40px; overflow: visible; }
.ptr .blade { fill: var(--rose); }
.ptr .ring { fill: var(--surface); stroke: var(--rose); stroke-width: 2.6; }
.ptr .pupil { fill: var(--ink); }
.ptr .happy { fill: none; stroke: var(--ink); stroke-width: 1.8; stroke-linecap: round; opacity: 0; }
.ptr .pivot { fill: var(--ink); }
.ptr .spark { fill: var(--rose); opacity: 0; transform-box: fill-box; transform-origin: center; }
.ptr.smile .pupil { opacity: 0; } .ptr.smile .happy { opacity: 1; }
/* Moments, all short: a squash-and-stretch hop when it is ready, a flip with sparkles on the snip,
   a happy wiggle while it loads, and a pop when it is done. */
.ptr .half-l, .ptr .half-r { transform-box: view-box; transform-origin: 24px 27px; }
.ptr svg { transform-origin: 50% 40%; }
.ptr.pop svg { animation: ptrHop .32s cubic-bezier(.3, 1.5, .6, 1); }
.ptr.shut .half-l, .ptr.shut .half-r { transition: transform .1s cubic-bezier(.6, 0, .9, .3); }
.ptr.snip .spark { animation: ptrSpark .45s cubic-bezier(.2, .8, .3, 1); }
.ptr.snip .spark:nth-of-type(2) { animation-delay: .03s; } .ptr.snip .spark:nth-of-type(3) { animation-delay: .06s; } .ptr.snip .spark:nth-of-type(4) { animation-delay: .015s; }
.ptr.flip svg { animation: ptrFlip .42s cubic-bezier(.3, 1.35, .5, 1); }
.ptr.busy svg { animation: ptrWiggle .3s ease-in-out infinite alternate; }
.ptr.busy .half-l { animation: ptrSnipL .3s ease-in-out infinite; } .ptr.busy .half-r { animation: ptrSnipR .3s ease-in-out infinite; }
.ptr.done svg { animation: ptrOut .22s cubic-bezier(.4, 0, 1, 1) forwards; }
.ptr.bye { transition: transform .32s cubic-bezier(.32, .72, 0, 1), opacity .25s ease; }
@keyframes ptrHop { 30% { transform: scale(1.16, .86) translateY(2px); } 62% { transform: scale(.92, 1.12) translateY(-3px); } }
@keyframes ptrSpark { 0% { opacity: 0; transform: scale(.2); } 35% { opacity: 1; transform: scale(1.2); } 100% { opacity: 0; transform: scale(.6) translate(var(--sx), var(--sy)); } }
@keyframes ptrFlip { from { transform: rotate(0) scale(1.1); } to { transform: rotate(360deg) scale(1); } }
@keyframes ptrWiggle { from { transform: rotate(-9deg); } to { transform: rotate(9deg); } }
@keyframes ptrSnipL { 50% { transform: rotate(-18deg); } }
@keyframes ptrSnipR { 50% { transform: rotate(18deg); } }
@keyframes ptrOut { 35% { transform: scale(1.22); } 100% { transform: scale(0); opacity: 0; } }
.ptr-ease { transition: transform .32s cubic-bezier(.32, .72, 0, 1); }
.ptr-pulling, .ptr-pulling * { -webkit-user-select: none !important; user-select: none !important; -webkit-touch-callout: none !important; }
