/* ChoirBird product site (nikielhard.se/en/choirbird).
   Colours, type, radii and glass come from the ChoirBird design system
   (app/ui/src/lib/skins.ts in the app repo): navy sky, coral bird, peach wing,
   amber beak, cream song. Light and dark follow the visitor's system
   appearance, as the app does. Everything is scoped to .cb-scope so the rest
   of nikielhard.se is untouched. Sizes in rem; WCAG 2.2 AA contrast. */

.cb-scope {
  --cb-navy: #1e3a7b;
  --cb-navy-deep: #0d1b3e;
  --cb-night: #0e1424;
  --cb-cream: #f4ebdd;
  --cb-amber: #f2a541;
  --cb-coral: #ff7a5c;
  --cb-peach: #ffb4a2;

  --cb-bg: #f7f2ea;
  --cb-bg-gradient: radial-gradient(120% 80% at 0% 0%, #ffffff 0%, #f7f2ea 55%, #f1e6da 100%);
  --cb-surface: #ffffff;
  --cb-ink: #14213d;
  --cb-ink-muted: #5d616c;
  --cb-line: rgba(20, 33, 61, 0.12);
  /* Coral deepened for AA: 5.0:1 as text on the cream, white on it 5.6:1. */
  --cb-accent: #b83e26;
  --cb-accent-ink: #ffffff;
  --cb-accent-soft: rgba(255, 122, 92, 0.14);
  --cb-glass-bg: rgba(255, 255, 255, 0.62);
  --cb-glass-border: rgba(255, 255, 255, 0.9);
  --cb-glass-shadow: 0 8px 32px rgba(20, 33, 61, 0.12), 0 1px 2px rgba(20, 33, 61, 0.08);
  --cb-soprano: #c2410c;
  --cb-alto: #a16207;
  --cb-tenor: #15803d;
  --cb-bass: #1d4ed8;

  --cb-font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, "Segoe UI", Roboto, sans-serif;
  --cb-font-display: "New York", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --cb-radius-s: 0.625rem;
  --cb-radius-m: 0.875rem;
  --cb-radius-l: 1.375rem;
  --cb-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  .cb-scope {
    --cb-bg: #0e1424;
    --cb-bg-gradient: radial-gradient(120% 80% at 0% 0%, #1e3a7b 0%, #0d1b3e 45%, #0e1424 100%);
    --cb-surface: #18213a;
    --cb-ink: #f4ebdd;
    --cb-ink-muted: #9aa3b8;
    --cb-line: rgba(244, 235, 221, 0.12);
    /* The icon's coral on the night sky, 7.2:1; dark ink on it 7.2:1. */
    --cb-accent: #ff7a5c;
    --cb-accent-ink: #1a0b06;
    --cb-accent-soft: rgba(255, 122, 92, 0.18);
    --cb-glass-bg: rgba(24, 33, 58, 0.55);
    --cb-glass-border: rgba(255, 255, 255, 0.14);
    --cb-glass-shadow: 0 10px 36px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
    --cb-soprano: #fb923c;
    --cb-alto: #facc15;
    --cb-tenor: #4ade80;
    --cb-bass: #60a5fa;
  }
}

/* The page body takes the ChoirBird sky; the site header and footer stay. */
body.cb-scope { background: var(--cb-bg-gradient), var(--cb-bg); background-attachment: fixed; }

/* The site header and footer keep their layout but take the page's glass. */
body.cb-scope .site-header { background: var(--cb-glass-bg); border-bottom-color: var(--cb-line); }
body.cb-scope .site-brand a, body.cb-scope .site-nav a { color: var(--cb-ink); }
body.cb-scope .site-nav li.active a { color: var(--cb-accent); background: var(--cb-accent-soft); border-color: var(--cb-line); }
body.cb-scope .site-footer { background: transparent; border-top-color: var(--cb-line); color: var(--cb-ink-muted); }
body.cb-scope .site-footer a, body.cb-scope .site-footer button { color: var(--cb-ink); }
body.cb-scope .site-footer p { color: var(--cb-ink-muted); }

.cb-section {
  color: var(--cb-ink);
  font-family: var(--cb-font-ui);
  padding-block: 3.5rem;
}
.cb-section + .cb-section { padding-top: 0.5rem; }
.cb-section h1, .cb-section h2, .cb-section h3 {
  color: var(--cb-ink);
  font-family: var(--cb-font-display);
  font-weight: 600;
  letter-spacing: -0.005em;
}
.cb-section h2 { font-size: 2rem; line-height: 1.15; margin: 0 0 0.75rem; }
.cb-section h3 { font-size: 1.3rem; line-height: 1.25; margin: 0 0 0.5rem; }
.cb-section p, .cb-section li { color: var(--cb-ink); font-size: 1.0625rem; line-height: 1.55; }
.cb-section a:not(.cb-btn) { color: var(--cb-accent); text-underline-offset: 0.15em; }
.cb-muted { color: var(--cb-ink-muted) !important; }
.cb-footnote { font-size: 0.875rem !important; line-height: 1.4 !important; color: var(--cb-ink-muted) !important; }
.cb-center { text-align: center; }

/* Hero */
.cb-hero { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 3rem; align-items: center; }
.cb-brand { display: flex; align-items: center; gap: 1rem; margin-bottom: 1.5rem; }
.cb-brand img { width: 4rem; height: 4rem; border-radius: 0.9rem; box-shadow: var(--cb-glass-shadow); }
.cb-brand span { font-family: var(--cb-font-display); font-size: 2.25rem; font-weight: 600; color: var(--cb-ink); }
.cb-hero h1 { font-size: 3rem; line-height: 1.08; margin: 0 0 1rem; }
.cb-lede { font-size: 1.25rem !important; line-height: 1.5 !important; color: var(--cb-ink-muted) !important; max-width: 34em; }
.cb-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin: 1.5rem 0 0.75rem; }
.cb-btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 2.75rem; padding: 0 1.25rem;
  border-radius: 999px; font-weight: 600; font-size: 1.0625rem; text-decoration: none;
  border: 1px solid transparent; font-family: var(--cb-font-ui);
}
.cb-btn--primary { background: var(--cb-accent); color: var(--cb-accent-ink); box-shadow: 0 4px 14px var(--cb-accent-soft); }
.cb-btn--secondary { background: var(--cb-glass-bg); color: var(--cb-ink); border-color: var(--cb-line); }
.cb-btn:focus-visible, .cb-section a:focus-visible, .cb-gallery:focus-visible {
  outline: 3px solid var(--cb-accent); outline-offset: 3px;
}

/* Device frames: iPad mini and iPhone. */
.cb-ipad, .cb-iphone { background: #0b0f1a; box-shadow: 0 24px 60px rgba(13, 27, 62, 0.28); margin: 0; }
.cb-ipad { border-radius: 2rem; padding: 0.9rem; }
.cb-ipad img { border-radius: 1.2rem; }
.cb-iphone { border-radius: 2.6rem; padding: 0.55rem; max-width: 15rem; }
.cb-iphone img { border-radius: 2.1rem; }
.cb-ipad picture, .cb-iphone picture { display: block; }
.cb-ipad img, .cb-iphone img { display: block; width: 100%; height: auto; }
.cb-hero-devices { position: relative; padding-bottom: 2rem; }
.cb-hero-devices .cb-ipad { max-width: 26rem; margin-left: auto; }
.cb-hero-devices .cb-iphone { position: absolute; left: 0; bottom: 0; width: 38%; }

/* Glass cards, as in the app. */
.cb-card {
  background: var(--cb-glass-bg);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--cb-glass-border);
  border-radius: var(--cb-radius-l);
  box-shadow: var(--cb-glass-shadow);
  padding: 1.5rem;
}
.cb-card p:last-child { margin-bottom: 0; }
.cb-grid { display: grid; gap: 1rem; }
.cb-grid-3 { grid-template-columns: repeat(3, 1fr); }
.cb-grid-2 { grid-template-columns: repeat(2, 1fr); }

/* A voice line: the coloured left edge of the app's mixer strips. */
.cb-voice { border-left: 0.3rem solid var(--cb-role, var(--cb-accent)); }
.cb-voice--s { --cb-role: var(--cb-soprano); }
.cb-voice--a { --cb-role: var(--cb-alto); }
.cb-voice--t { --cb-role: var(--cb-tenor); }
.cb-voice--b { --cb-role: var(--cb-bass); }

.cb-eyebrow {
  display: block; font-family: var(--cb-font-ui); font-size: 0.8125rem; font-weight: 700;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--cb-accent); margin-bottom: 0.5rem;
}
.cb-pill {
  display: inline-flex; align-items: center; padding: 0.15rem 0.7rem; border-radius: 999px;
  font-size: 0.875rem; font-weight: 600; background: var(--cb-accent-soft); color: var(--cb-ink);
  border: 1px solid var(--cb-line); margin: 0 0.35rem 0.35rem 0;
}

/* Feature rows */
.cb-feature { display: grid; grid-template-columns: 22rem 1fr; gap: 3rem; align-items: center; padding-block: 1.5rem; }
.cb-feature--flip { grid-template-columns: 1fr 22rem; }
.cb-feature--flip > figure { order: 2; }
.cb-feature--phone { grid-template-columns: 15rem 1fr; }
.cb-feature ul { padding-left: 1.2rem; }

/* Three skins side by side. */
.cb-skins { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.25rem; }
.cb-skins figcaption { text-align: center; font-size: 0.9375rem; color: var(--cb-ink-muted); margin-top: 0.75rem; }

/* Gallery */
.cb-gallery { display: flex; gap: 1.25rem; overflow-x: auto; scroll-snap-type: x mandatory; padding: 0.5rem 0.25rem 1.5rem; }
.cb-gallery figure { flex: 0 0 15rem; margin: 0; scroll-snap-align: start; }
.cb-gallery figure.cb-wide { flex-basis: 26rem; }
.cb-gallery figcaption { font-size: 0.875rem; color: var(--cb-ink-muted); text-align: center; margin-top: 0.6rem; }

.cb-steps { counter-reset: cb-step; list-style: none; padding: 0; margin: 0; }
.cb-steps li { counter-increment: cb-step; position: relative; padding-left: 3rem; margin-bottom: 1rem; }
.cb-steps li::before {
  content: counter(cb-step); position: absolute; left: 0; top: 0; width: 2rem; height: 2rem; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
  background: var(--cb-accent); color: var(--cb-accent-ink);
}

.cb-faq details { border-bottom: 1px solid var(--cb-line); padding: 0.9rem 0; }
.cb-faq summary { cursor: pointer; font-weight: 600; font-size: 1.0625rem; color: var(--cb-ink); }
.cb-faq details p { margin: 0.6rem 0 0; }

@media (max-width: 60rem) {
  .cb-hero, .cb-feature, .cb-feature--flip, .cb-feature--phone { grid-template-columns: 1fr; gap: 1.5rem; }
  .cb-feature--flip > figure { order: 0; }
  .cb-feature > figure { max-width: 22rem; }
  .cb-feature--phone > figure { max-width: 15rem; }
  .cb-grid-3, .cb-grid-2 { grid-template-columns: 1fr; }
  .cb-skins { grid-template-columns: 1fr; max-width: 22rem; }
  .cb-hero h1 { font-size: 2.25rem; }
  .cb-hero-devices .cb-ipad { max-width: 20rem; }
}

@media (prefers-reduced-motion: no-preference) {
  .cb-btn { transition: filter 140ms var(--cb-ease), transform 140ms var(--cb-ease); }
  .cb-btn:hover { filter: brightness(1.07); transform: translateY(-1px); }
}
