/* ClipQuant design system — warm paper, ink, one vermilion accent. */
:root {
  --paper: #F4F0E8;
  --paper-2: #EBE5D9;
  --card: #FBF9F4;
  --white: #FFFFFF;
  --ink: #16140F;
  --ink-2: #2B2822;
  --ink-3: #47423A;
  --muted: #6E675B;
  --faint: #6B6458; /* 4.5:1+ on paper and paper-2 (WCAG AA) */
  --line: #DCD4C4;
  --line-2: #E7E1D5;
  --accent: #FF5A1F;
  --accent-2: #B53A0B;
  --accent-strong: #C2410C; /* white text on this passes WCAG AA */
  --accent-soft: #FFE6D9;
  --accent-ink: #D4430D; /* accent for large text on light backgrounds: 4:1 on paper (AA large) */
  --green: #17734F;
  --green-soft: #DCEFE4;
  --amber: #8A560C;
  --amber-soft: #F8EBD3;
  --red: #B9341A;
  --red-soft: #F8E0D9;
  --serif: 'Instrument Serif', 'Iowan Old Style', Georgia, serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 18px;
  --shadow-1: 0 1px 0 rgba(22, 20, 15, .04), 0 1px 2px rgba(22, 20, 15, .06);
  --shadow-2: 0 1px 0 rgba(22, 20, 15, .04), 0 8px 24px -8px rgba(22, 20, 15, .16);
  --shadow-3: 0 30px 80px -30px rgba(22, 20, 15, .45);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

@font-face { font-family: 'ClipQuant Heavy'; src: url(/fonts/Roboto-Black.ttf) format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'ClipQuant Bold'; src: url(/fonts/Roboto-Bold.ttf) format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'ClipQuant Condensed'; src: url(/fonts/Roboto-BoldCondensed.ttf) format('truetype'); font-weight: 400 900; font-display: swap; }
@font-face { font-family: 'ClipQuant Body'; src: url(/fonts/Roboto-Medium.ttf) format('truetype'); font-weight: 400 700; font-display: swap; }
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans);
  font-size: 15px; line-height: 1.55; font-feature-settings: 'ss01', 'cv11';
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, video, svg { display: block; max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: var(--accent); color: #fff; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.01em; }
.mono { font-family: var(--mono); font-feature-settings: 'zero'; }
.muted { color: var(--muted); }
.eyebrow { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- logo ---------- */
.logo { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 650; letter-spacing: -0.02em; font-size: 19px; }
.logo-mark { width: 26px; height: 26px; flex: none; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--ink); --fg: var(--paper); --bd: var(--ink);
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--bd);
  background: var(--bg); color: var(--fg); font-weight: 550; font-size: 14px; letter-spacing: -0.005em;
  text-decoration: none; cursor: pointer; white-space: nowrap; user-select: none;
  transition: transform .15s var(--ease), background .15s, box-shadow .15s, opacity .15s;
}
.btn:hover { background: var(--ink-2); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-loading { opacity: .55; cursor: not-allowed; }
.btn.is-loading { position: relative; color: transparent !important; }
.btn.is-loading::after {
  content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--fg); border-right-color: transparent; animation: spin .7s linear infinite;
}
.btn-accent { --bg: var(--accent-strong); --bd: var(--accent-strong); --fg: #fff; }
.btn-accent:hover { background: #A83809; }
.btn-ghost { --bg: transparent; --fg: var(--ink); --bd: var(--line); }
.btn-ghost:hover { background: rgba(22, 20, 15, .05); }
.btn-quiet { --bg: transparent; --fg: var(--ink-3); --bd: transparent; padding: 0 10px; }
.btn-quiet:hover { background: rgba(22, 20, 15, .06); color: var(--ink); }
.btn-danger { --bg: transparent; --fg: var(--red); --bd: #E9C3B8; }
.btn-danger:hover { background: var(--red-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; }
.btn-lg { height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn-block { width: 100%; }
.btn svg { width: 16px; height: 16px; flex: none; }

/* ---------- forms ---------- */
.field { display: grid; gap: 6px; }
.field > span, .label { font-size: 13px; font-weight: 550; color: var(--ink-2); }
.hint { font-size: 12.5px; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; height: 42px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--white); transition: border-color .15s, box-shadow .15s; font-size: 14.5px;
}
.textarea { height: auto; min-height: 96px; padding: 10px 14px; resize: vertical; line-height: 1.5; }
.input:hover, .select:hover, .textarea:hover { border-color: #C9BFAD; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22, 20, 15, .08); }
.input.is-invalid { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-soft); }
.field-error { color: var(--red); font-size: 12.5px; }

.seg { display: inline-flex; padding: 3px; border-radius: 999px; background: var(--paper-2); border: 1px solid var(--line-2); gap: 2px; }
.seg button {
  border: 0; background: transparent; height: 32px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  font-size: 13.5px; font-weight: 550; color: var(--muted); transition: background .15s, color .15s;
}
.seg button[aria-pressed="true"] { background: var(--white); color: var(--ink); box-shadow: var(--shadow-1); }
.seg button:hover:not([aria-pressed="true"]) { color: var(--ink); }

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; }
.switch input { position: absolute; opacity: 0; }
.switch .track { width: 36px; height: 21px; border-radius: 999px; background: var(--line); position: relative; transition: background .2s; flex: none; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 17px; height: 17px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-1); transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--ink); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- surfaces ---------- */
.card { background: var(--card); border: 1px solid var(--line-2); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 9px; border-radius: 999px;
  font-size: 12px; font-weight: 600; background: var(--paper-2); color: var(--ink-3); white-space: nowrap;
}
.chip-accent { background: var(--accent-soft); color: var(--accent-2); }
.chip-green { background: var(--green-soft); color: var(--green); }
.chip-amber { background: var(--amber-soft); color: var(--amber); }
.chip-red { background: var(--red-soft); color: var(--red); }
.chip-ink { background: var(--ink); color: var(--paper); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.dot.pulse { animation: pulse 1.4s ease-in-out infinite; }

.alert { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid; }
.alert-error { background: var(--red-soft); border-color: #EFC6BB; color: #7D2410; }
.alert-info { background: var(--white); border-color: var(--line); color: var(--ink-2); }
.alert-test { background: repeating-linear-gradient(-45deg, #FFF4E8, #FFF4E8 10px, #FFEEDC 10px, #FFEEDC 20px); border-color: #F5CFAE; color: #7A3B12; }

/* ---------- toast ---------- */
.toasts { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); display: grid; gap: 8px; z-index: 1000; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; align-items: center; gap: 10px; min-width: 260px; max-width: 520px;
  padding: 11px 16px; border-radius: 12px; background: var(--ink); color: var(--paper); font-size: 14px;
  box-shadow: var(--shadow-3); animation: toast-in .3s var(--ease);
}
.toast.is-error { background: #5E1D0E; }
.toast a, .toast button { color: var(--accent); background: none; border: 0; font-weight: 600; cursor: pointer; padding: 0; margin-left: auto; text-decoration: none; }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(22, 20, 15, .45); backdrop-filter: blur(3px);
  display: grid; place-items: center; z-index: 900; padding: 20px; animation: fade .2s;
}
.modal { width: min(480px, 100%); background: var(--card); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-3); animation: pop .25s var(--ease); }
.modal h3 { margin: 0 0 6px; font-family: var(--serif); font-weight: 400; font-size: 28px; letter-spacing: -0.01em; line-height: 1.1; }
.modal p { margin: 0 0 18px; color: var(--muted); }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---------- misc ---------- */
.meter { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: var(--ink); transition: width .6s var(--ease); }
.meter.is-warn > i { background: var(--accent); }
.skeleton { background: linear-gradient(90deg, var(--paper-2) 0%, #F2EDE3 50%, var(--paper-2) 100%); background-size: 200% 100%; animation: shimmer 1.4s linear infinite; border-radius: 10px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--ink); animation: spin .7s linear infinite; }
kbd { font-family: var(--mono); font-size: 11.5px; padding: 1px 6px; border-radius: 5px; border: 1px solid var(--line); background: var(--white); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 50% { opacity: .35; } }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* keyboard users can jump past the navigation */
.skip { position: absolute; left: 12px; top: -60px; z-index: 1000; background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 10px; font-weight: 600; text-decoration: none; transition: top .15s; }
.skip:focus { top: 12px; outline: 2px solid var(--accent); outline-offset: 2px; }

/* headings and clip titles wrap evenly instead of leaving one word on the last line */
h1, h2, h3, h4, .ccard h4, .pcard h3 { text-wrap: balance; }
p, li { text-wrap: pretty; }

.cookie-note { position: fixed; left: 16px; bottom: 16px; z-index: 60; max-width: 420px; display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 14px; background: var(--ink, #16140F); color: #F4F0E8; font-size: 13.5px; line-height: 1.45; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.cookie-note p { margin: 0; }
.cookie-note a { color: #F4F0E8; text-decoration: underline; }
.cookie-note .btn { flex: none; background: #F4F0E8; color: #16140F; border-color: #F4F0E8; }
@media (max-width: 480px) { .cookie-note { left: 10px; right: 10px; bottom: 10px; max-width: none; } }

/* Hints in empty fields are clearly lighter than typed text, so a form never looks filled in. */
.input::placeholder, .textarea::placeholder { color: #B3AA9A; opacity: 1; font-weight: 400; }
.cookie-note { max-width: 380px; font-size: 13px; }
.cookie-note { transition: opacity .25s, transform .25s; }
.cookie-note.leaving { opacity: 0; transform: translateY(12px); }

/* Fullscreen shows the whole video. The cards crop to fill their frame; in fullscreen that
   would zoom a vertical clip right in on a wide screen. */
video:fullscreen { object-fit: contain !important; background: #000; }
video:-webkit-full-screen { object-fit: contain !important; background: #000; }

/* password checklist: each rule ticks as it is met */
.pw-rules { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 12px; font-size: 12.5px; color: var(--muted); }
.pw-rules li::before { content: '○'; display: inline-block; width: 1.2em; }
.pw-rules li.ok { color: #1F7A4D; }
.pw-rules li.ok::before { content: '✓'; font-weight: 700; }
@media (max-width: 380px) { .pw-rules { grid-template-columns: 1fr; } }
.pw-match { display: block; min-height: 1.3em; margin-top: 6px; font-size: 12.5px; }
.pw-match.ok { color: #1F7A4D; }
.pw-match.bad { color: #B42318; }
/* On wide screens the notice sits bottom-right, away from the left-aligned section headings
   (it used to cover "Before → after"); it also steps away after a short scroll. */
@media (min-width: 900px) { .cookie-note { left: auto; right: 16px; } }

/* cookie notice in the footer: part of the page, never over the content */
.cookie-note.cookie-inline { position: static; inset: auto; margin: 0 auto 22px; max-width: 720px; transform: none; box-shadow: none; }

/* promo code box (pricing, sign-up, billing) */
.promo-wrap { margin: 14px auto 22px; max-width: 560px; text-align: center; }
.promo-wrap[hidden] { display: none; }
.promo { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.promo-toggle { display: inline-flex; align-items: center; gap: 7px; padding: 4px 6px; border: 0; background: none; color: var(--ink-2); font-size: 13.5px; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 4px; }
.promo-toggle svg { color: var(--muted); }
.promo-toggle:hover { text-decoration-color: var(--ink); }
.promo-toggle:focus-visible, .promo-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.promo-form { display: flex; gap: 8px; align-items: center; justify-content: center; width: 100%; max-width: 340px; }
.promo-form[hidden] { display: none; }
.promo-form .input { flex: 1; min-width: 0; height: 36px; text-transform: uppercase; }
.promo-msg { margin: 0; font-size: 13px; color: var(--muted); }
.promo-msg.is-bad { color: var(--red); }
.promo-msg[hidden] { display: none; }
.promo-on { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 8px 12px; font-size: 13.5px; }
.promo-on .chip { display: inline-flex; align-items: center; gap: 6px; }
.promo-text { color: var(--ink-2); text-align: left; }
.promo-link { border: 0; background: none; padding: 2px 4px; color: var(--muted); font-size: 13px; text-decoration: underline; cursor: pointer; }
.promo-link:hover { color: var(--ink); }
.plan-price s { color: var(--muted); font-size: 20px; margin-right: 2px; align-self: center; }
.plan.featured .plan-price s { color: #BDB5A7; }
.bplan .p s { color: var(--muted); font-size: .65em; margin-right: 6px; font-weight: 400; }
.plan-promo { color: #15803D; font-size: 12.5px; font-weight: 600; margin: -4px 0 14px; }
.plan.featured .plan-promo { color: #7FD6A0; }
.plan-price.has-off { flex-wrap: nowrap; gap: 5px; }
.plan-price.has-off b { font-size: 46px; }
.plan-price.has-off span { white-space: nowrap; font-size: 13px; }

.plan-promo-note { color: var(--muted); font-weight: 500; }
.plan.featured .plan-promo-note { color: #BDB5A7; }

/* ---------- interaction details ---------- */
/* Pulse to confirm */
@keyframes cq-pulse { 0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 90, 31, .45); } 40% { transform: scale(1.04); } 100% { transform: scale(1); box-shadow: 0 0 0 10px rgba(255, 90, 31, 0); } }
.is-pulse { animation: cq-pulse .55s cubic-bezier(.2, .8, .2, 1); }
/* Crossfade a label through a short blur */
.is-swapping { opacity: 0; filter: blur(3px); }
[data-label] { transition: opacity .12s ease, filter .12s ease; }
/* Fitts's law: on touch screens, small controls get a full-size tap area */
@media (pointer: coarse) {
  .seg button, .promo-link, .promo-toggle, .share-copy, .demo-tab, .stage-replay, .cal-more, .pw button, #showPw { min-height: 44px; }
  .cal-plus { width: 40px; height: 40px; }
  .pp-int button, .switch { min-height: 44px; }
}
@media (prefers-reduced-motion: reduce) { .is-pulse { animation: none; } .is-swapping { filter: none; } }
