/* Cliplowd v2. Brand Guide v1.0: Signal / Ink / Paper, Geologica + Martian Mono, "the ramp".
   Layout concept: marketing = Ink stage with one red signal; app = Paper desk (YouTube for clippers, Cloudflare for campaigners). */
:root {
  --signal: #E8202F;
  --signal-text: #C4111F;
  --on-signal: #FFFFFF;
  --bg: #FFFFFF;
  --surface: #FFFFFF;
  --sunk: #F4F4F5;
  --fg: #141414;          /* Ink */
  --fg-2: #3A3A3C;
  --mute: #737373;
  --line: #E8E8EB;
  --line-2: #D1D1D6;
  --ok: #1B7A47; --ok-bg: #DDEFE3;
  --warn: #8F5B00; --warn-bg: #F6E8C7;
  --bad: #B3261E; --bad-bg: #F8DEDA;
  --focus: #141414;
  --display: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Geologica", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Martian Mono", ui-monospace, "SFMono-Regular", Consolas, monospace;
  --r-card: 14px; --r-input: 10px; --pill: 999px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --rail: 248px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141416; --surface: #1C1C1F; --sunk: #242428; --fg: #F5F5F7; --fg-2: #D4D4D4; --mute: #8A8A8A;
    --line: #2C2C31; --line-2: #3A3A41; --signal-text: #FF6B6E; --focus: #F5F5F7;
    --ok: #4CC287; --ok-bg: #13281C; --warn: #E3AA42; --warn-bg: #2B2210; --bad: #FF7B70; --bad-bg: #331513;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141416; --surface: #1C1C1F; --sunk: #242428; --fg: #F5F5F7; --fg-2: #D4D4D4; --mute: #8A8A8A;
  --line: #2C2C31; --line-2: #3A3A41; --signal-text: #FF6B6E; --focus: #F5F5F7;
  --ok: #4CC287; --ok-bg: #13281C; --warn: #E3AA42; --warn-bg: #2B2210; --bad: #FF7B70; --bad-bg: #331513;
  color-scheme: dark;
}
/* Marketing stage: locked to Ink in both themes (deliberate single look) */
.ink {
  --bg: #141414; --surface: #1C1C1B; --sunk: #232322; --fg: #F4F1EA; --fg-2: #D7D3C9; --mute: #A29E95;
  --line: #2E2D2B; --line-2: #403F3B; --signal-text: #FF6B6E; --focus: #F4F1EA;
  --ok: #4CC287; --ok-bg: #13281C; --warn: #E3AA42; --warn-bg: #2B2210; --bad: #FF7B70; --bad-bg: #331513;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15px/1.55 var(--body); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
h1, h2, h3, h4 { font-family: var(--display); margin: 0; letter-spacing: -0.03em; line-height: 1.04; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.num { font-variant-numeric: tabular-nums; }
.mute { color: var(--mute); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 8px; z-index: 100; background: var(--fg); color: var(--bg); padding: 8px 14px; border-radius: var(--pill); }
.skip:focus { left: 8px; }
.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding-left: max(20px, env(safe-area-inset-left, 0px)); padding-right: max(20px, env(safe-area-inset-right, 0px)); }
.label { font: 400 13px/1.35 var(--body); color: var(--mute); }

/* ---------- Wordmark: the ramp ---------- */
.wm { font-family: var(--display); letter-spacing: -0.035em; line-height: 1; white-space: nowrap; text-decoration: none; color: inherit; display: inline-flex; align-items: baseline; }
.wm.sm .a { font-weight: 300; } .wm.sm .b { font-weight: 800; }
.ramp-word span { transition: font-weight 900ms var(--ease); }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: var(--pill); border: 1px solid var(--line-2); background: transparent; color: var(--fg); font-weight: 500; font-size: 15px; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .16s var(--ease), border-color .16s var(--ease), transform .1s var(--ease); }
.btn:hover { border-color: var(--fg); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn.primary { background: var(--signal); border-color: var(--signal); color: var(--on-signal); }
.btn.primary:hover { background: #D11826; border-color: #D11826; }
.btn.solid { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.btn.solid:hover { opacity: .9; }
.btn.ghost { border-color: transparent; }
.btn.ghost:hover { background: var(--sunk); }
.btn.sm { height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn.lg { height: 52px; padding: 0 26px; font-size: 16px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; transform: none; }
.btn i { font-size: 18px; }
.iconbtn { width: 38px; height: 38px; display: inline-grid; place-items: center; border-radius: var(--pill); border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--fg); position: relative; }
.iconbtn:hover { background: var(--sunk); }
.iconbtn i { font-size: 20px; }
.iconbtn .pip { position: absolute; top: 7px; right: 8px; width: 8px; height: 8px; border-radius: 50%; background: var(--signal); border: 2px solid var(--bg); }

/* ---------- Chips, badges ---------- */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { height: 34px; padding: 0 14px; border-radius: var(--pill); border: 1px solid var(--line); background: var(--surface); display: inline-flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; white-space: nowrap; text-decoration: none; color: var(--fg); }
.chip:hover { border-color: var(--line-2); }
.chip[aria-pressed="true"], .chip.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.chip i { font-size: 16px; }
.badge { display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: var(--pill); font: 500 12px/1 var(--body); white-space: nowrap; background: var(--sunk); color: var(--fg-2); }
.badge i { font-size: 14px; }
.badge.ok { background: var(--ok-bg); color: var(--ok); }
.badge.warn { background: var(--warn-bg); color: var(--warn); }
.badge.bad { background: var(--bad-bg); color: var(--bad); }
.badge.live { background: color-mix(in srgb, var(--signal) 10%, transparent); color: var(--signal-text); }
.badge.ink { background: var(--fg); color: var(--bg); }

/* ---------- Forms ---------- */
.field { display: grid; gap: 6px; }
.field > label, .field > .lbl { font-size: 13.5px; font-weight: 500; }
.input, .select, .textarea { width: 100%; height: 46px; border-radius: var(--r-input); border: 1px solid var(--line-2); background: var(--surface); padding: 0 14px; font-size: 15px; }
.textarea { height: auto; min-height: 96px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--mute); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in srgb, var(--fg) 14%, transparent); }
.input.err, .field.err .input { border-color: var(--bad); }
.hint { font-size: 13px; color: var(--mute); }
.errtext { font-size: 13px; color: var(--bad); display: flex; gap: 6px; align-items: flex-start; }
.okline { font-size: 13px; color: var(--ok); display: flex; gap: 6px; align-items: center; }
.prefix { display: flex; align-items: stretch; border: 1px solid var(--line-2); border-radius: var(--r-input); background: var(--surface); overflow: hidden; }
.prefix span { display: grid; place-items: center; padding: 0 12px; background: var(--sunk); color: var(--mute); font: 500 13px var(--mono); border-right: 1px solid var(--line); }
.prefix .input { border: 0; border-radius: 0; }
.prefix:focus-within { border-color: var(--fg); }
.otp { display: flex; gap: 8px; }
.otp input { width: 48px; height: 56px; text-align: center; font: 500 20px var(--mono); border-radius: var(--r-input); border: 1px solid var(--line-2); background: var(--surface); }
.otp input:focus { outline: none; border-color: var(--fg); }
.otp.err input { border-color: var(--bad); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--signal); flex: none; }
.seg-ctl { display: inline-flex; padding: 4px; border-radius: var(--pill); background: var(--sunk); gap: 2px; }
.seg-ctl button { border: 0; background: transparent; height: 34px; padding: 0 16px; border-radius: var(--pill); cursor: pointer; font-weight: 500; font-size: 14px; color: var(--mute); }
.seg-ctl button[aria-pressed="true"] { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgb(0 0 0 / .12); }
.ink .seg-ctl button[aria-pressed="true"] { background: var(--fg); color: var(--bg); }

/* ---------- Context ribbon (signature: the whole talk, clip bracketed) ---------- */
.ribbon { position: relative; height: 8px; border-radius: var(--pill); background: color-mix(in srgb, var(--fg) 14%, transparent); }
.ribbon .seg { position: absolute; top: -5px; bottom: -5px; min-width: 6px; background: var(--signal); border-radius: 2px; }
.ribbon .seg::before, .ribbon .seg::after { content: ""; position: absolute; top: -3px; bottom: -3px; width: 5px; border: 2px solid var(--fg); }
.ribbon .seg::before { left: -7px; border-right: 0; }
.ribbon .seg::after { right: -7px; border-left: 0; }
.ribbon .seg.dim { background: color-mix(in srgb, var(--fg) 40%, transparent); }
.ribbon .seg.dim::before, .ribbon .seg.dim::after { display: none; }
.ribbon-meta { display: flex; justify-content: space-between; margin-top: 10px; font: 400 11px var(--mono); color: var(--mute); }

/* ---------- Meter (budget: spent solid, reserved hatched) ---------- */
.meter { height: 10px; border-radius: var(--pill); background: var(--sunk); overflow: hidden; display: flex; }
.meter .spent { background: var(--fg); }
.meter .res { background: repeating-linear-gradient(135deg, var(--signal) 0 4px, color-mix(in srgb, var(--signal) 35%, transparent) 4px 8px); }
.meter.slim { height: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 12.5px; color: var(--mute); margin-top: 8px; }
.legend b { color: var(--fg); font-weight: 500; }
.legend i.sw { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 6px; vertical-align: 0; }

/* ---------- Quote-card thumbnails ---------- */
.qcard { position: relative; aspect-ratio: 16 / 10; border-radius: var(--r-card); overflow: hidden; padding: 16px 18px 26px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; }
.qcard.v { aspect-ratio: 9 / 16; }
.qcard .q { font: 700 clamp(17px, 1.9vw, 22px)/1.12 var(--display); letter-spacing: -0.03em; }
.qcard .q em { font-style: normal; font-weight: 900; }
.qcard .who { display: flex; align-items: center; gap: 8px; font-size: 12.5px; opacity: .85; }
.qcard .dur { position: absolute; right: 10px; bottom: 14px; font: 500 11px var(--mono); padding: 3px 6px; border-radius: 4px; background: rgb(20 20 20 / .78); color: #F4F1EA; }
.qcard .rb { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgb(244 241 234 / .22); }
.qcard .rb span { position: absolute; top: 0; bottom: 0; background: #E8202F; }
.th-red { background: #FFFFFF; color: #141414; box-shadow: inset 0 0 0 1px #E5E5E3; }
.th-red .q em { color: #C4111F; }
.th-ink { background: #141414; color: #F4F1EA; box-shadow: inset 0 0 0 1px #2E2D2B; }
.th-paper { background: #F5F5F4; color: #141414; }
.th-paper .q em { color: #C4111F; }
.th-ink .q em { color: #FF5A62; }
.th-stone { background: #262626; color: #F5F5F4; }
.th-stone .q em { color: #FF5A62; }
.th-bone { background: #EAE9E6; color: #141414; }
.th-bone .q em { color: #C4111F; }

/* ---------- Avatars ---------- */
.av { width: 32px; height: 32px; border-radius: 50%; display: inline-grid; place-items: center; font: 600 0px var(--body); color: transparent; flex: none; letter-spacing: 0; box-shadow: inset 0 0 0 1px rgb(0 0 0 / .04); }
.av.lg { width: 44px; height: 44px; font-size: 15px; }
.av.xl { width: 64px; height: 64px; font-size: 22px; }
.mono-cl { display: inline-grid; place-items: center; background: var(--signal); color: var(--on-signal); border-radius: 10px; font-family: var(--display); letter-spacing: -0.06em; line-height: 1; }
.mono-cl .c { font-weight: 350; } .mono-cl .l { font-weight: 900; }

/* ---------- Platform marks (brand initials in brand-neutral chips) ---------- */
.plat { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.plat i { font-size: 17px; }

/* ---------- Cards & panels ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); }
.panel.pad { padding: 20px; }
.panel h3 { font-size: 17px; letter-spacing: -0.02em; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.panel-b { padding: 20px; }
.notice { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: var(--r-card); background: var(--sunk); font-size: 14px; }
.notice i { font-size: 20px; flex: none; margin-top: 1px; }
.notice.ok { background: var(--ok-bg); color: var(--ok); }
.notice.warn { background: var(--warn-bg); color: var(--warn); }
.notice.bad { background: var(--bad-bg); color: var(--bad); }
.notice.ok b, .notice.warn b, .notice.bad b { color: inherit; }
.notice p + p { margin-top: 4px; }
.notice .act { margin-left: auto; flex: none; }

/* ---------- Toast ---------- */
#toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; background: #141414; color: #F4F1EA; padding: 12px 18px; border-radius: var(--pill); font-size: 14px; z-index: 90; pointer-events: none; transition: .25s var(--ease); max-width: calc(100% - 32px); box-shadow: 0 12px 40px rgb(0 0 0 / .25); display: flex; gap: 10px; align-items: center; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast i { color: #4CC287; font-size: 18px; }

/* ---------- Motion ---------- */
@keyframes rise { from { transform: translateY(14px); } to { transform: none; } }
@keyframes tick { 0%, 100% { transform: scaleY(.35); } 50% { transform: scaleY(1); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: no-preference) {
  .rise { animation: rise .7s var(--ease) both; }
  .rise.d1 { animation-delay: .08s; } .rise.d2 { animation-delay: .16s; } .rise.d3 { animation-delay: .24s; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}

/* ===== Buttons with a light media finish (soft gloss, inner highlight, gentle press), used site-wide ===== */
.btn { transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .2s; }
.btn:active { transform: translateY(1px) scale(.98); }
.btn.primary { background: linear-gradient(180deg, #F43C48 0%, #E8202F 55%, #D3172A 100%); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .28), inset 0 -1px 0 rgb(0 0 0 / .12), 0 1px 2px rgb(110 10 20 / .3), 0 8px 18px -8px rgb(150 15 30 / .55); }
.btn.primary:hover { filter: brightness(1.06); background: linear-gradient(180deg, #F43C48 0%, #E8202F 55%, #D3172A 100%); }
.btn.white, .cr .btn.white, .cr .ap-hero .btn.white { background: linear-gradient(180deg, #FFFFFF 0%, #ECECF0 100%); border-color: transparent; color: #1D1D1F;
  box-shadow: inset 0 1px 0 #fff, inset 0 -1px 0 rgb(0 0 0 / .06), 0 1px 2px rgb(0 0 0 / .25), 0 8px 20px -10px rgb(0 0 0 / .6); }
.btn.white:hover { filter: brightness(1.03); }
.btn.dark, .cr .btn.dark, .btn.solid { background: linear-gradient(180deg, #3A3A3C 0%, #1D1D1F 60%, #111113 100%); border-color: transparent; color: #fff;
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .14), 0 1px 2px rgb(0 0 0 / .3), 0 8px 18px -8px rgb(0 0 0 / .45); }
.btn.gray, .cr .btn.gray { background: linear-gradient(180deg, #F5F5F7, #E6E6EB); border-color: transparent; color: #1D1D1F; box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgb(0 0 0 / .1); }
@media (prefers-reduced-motion: no-preference) { .btn.primary:hover, .btn.white:hover, .btn.dark:hover { transform: translateY(-1px); } }
[data-go] { cursor: pointer; }

/* v20: flat buttons. Colour carries the meaning, no gloss, no lift. */
.btn.primary, .btn.white, .cr .btn.white, .cr .ap-hero .btn.white, .btn.dark, .cr .btn.dark, .btn.solid, .btn.gray, .cr .btn.gray { box-shadow: none; filter: none; }
.btn.primary { background: #E8202F; } .btn.primary:hover { background: #D11826; filter: none; }
.btn.white, .cr .btn.white, .cr .ap-hero .btn.white { background: #F5F5F7; } .btn.white:hover, .cr .btn.white:hover { background: #fff; filter: none; }
.btn.dark, .cr .btn.dark, .btn.solid { background: #1D1D1F; color: #fff; } .btn.dark:hover, .btn.solid:hover { background: #333336; opacity: 1; }
.btn.gray, .cr .btn.gray { background: #F5F5F7; } .btn.gray:hover, .cr .btn.gray:hover { background: #E8E8ED; }
@media (prefers-reduced-motion: no-preference) { .btn.primary:hover, .btn.white:hover, .btn.dark:hover { transform: none; } }
.av { background: var(--sunk); color: var(--fg); font-size: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.av.lg { font-size: 15px; } .av.xl { font-size: 22px; }
