/* Juno Code Studio — brand layer on top of Pico CSS v2.
   System fonts, no third-party requests. WCAG 2.2 AA color choices. */

/* ----------------------------------------------------------------------
   Design tokens
   ---------------------------------------------------------------------- */
:root {
  /* Studio accent — celestial indigo. #5b54e6 clears AA on light
     surfaces (5.05:1 on warm-white). On dark surfaces it's lightened
     to #8b86f0 in the dark-mode block below (raw indigo fails there). */
  --pico-primary: #5b54e6 !important;
  --pico-primary-background: #5b54e6 !important;
  --pico-primary-border: #5b54e6 !important;
  --pico-primary-hover: #4a43d1 !important;
  --pico-primary-hover-background: #4a43d1 !important;
  --pico-primary-hover-border: #4a43d1 !important;
  --pico-primary-focus: rgba(91, 84, 230, 0.3) !important;
  --pico-primary-underline: rgba(91, 84, 230, 0.5) !important;
  --pico-primary-inverse: #fff !important;

  /* Brand palette (Holdclose) */
  --brand-navy: #1f2a44;
  --brand-salmon: #c97458;     /* large/decorative only (3.18:1 — not body text) */
  --brand-warm: #f8f6f3;

  /* Type */
  --pico-font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --pico-line-height: 1.6;
  --pico-border-radius: 0.85rem;

  /* Layout */
  --container: 70rem;          /* ~1120px */
  --container-narrow: 44rem;   /* prose + CTA blocks */
  --measure: 38rem;            /* readable subhead/lead measure */
  --prose: 44rem;
}

/* Indigo fails on the dark studio shell (2.62:1) — lighten to AA. */
@media (prefers-color-scheme: dark) {
  :root:not(.theme-holdclose) {
    --pico-primary: #8b86f0 !important;
    --pico-primary-background: #8b86f0 !important;
    --pico-primary-border: #8b86f0 !important;
    --pico-primary-hover: #a7a3f5 !important;
    --pico-primary-hover-background: #a7a3f5 !important;
    --pico-primary-hover-border: #a7a3f5 !important;
    --pico-primary-focus: rgba(139, 134, 240, 0.35) !important;
    --pico-primary-underline: rgba(139, 134, 240, 0.55) !important;
    --pico-primary-inverse: #1b1b2b !important;
  }
}

/* Holdclose product pages — warm palette, fixed light theme.
   Salmon is darkened to #a85638 for the accent so it passes AA as text
   (4.80:1 on warm-white) AND gives white button labels ≥4.5:1. The
   brighter #c97458 is reserved for large/decorative use (gradients,
   the app mock). Class sits on <html> so the override reaches the page
   background (Pico paints it from the root scope). */
.theme-holdclose {
  --pico-primary: #a85638 !important;
  --pico-primary-background: #a85638 !important;
  --pico-primary-border: #a85638 !important;
  --pico-primary-hover: #934a2f !important;
  --pico-primary-hover-background: #934a2f !important;
  --pico-primary-hover-border: #934a2f !important;
  --pico-primary-focus: rgba(168, 86, 56, 0.28) !important;
  --pico-primary-underline: rgba(168, 86, 56, 0.5) !important;
  --pico-primary-inverse: #fff !important;
  --pico-background-color: #f8f6f3 !important;
  --pico-color: #2f333a !important;            /* ~12:1 on warm-white */
  --pico-muted-color: #5b6470 !important;       /* ~5.4:1 on warm-white */
  --pico-h1-color: #1f2a44 !important;
  --pico-h2-color: #1f2a44 !important;
  --pico-h3-color: #1f2a44 !important;
  --pico-h4-color: #1f2a44 !important;
  --pico-card-background-color: #fff !important;
  --pico-muted-border-color: #e7e2db !important;
}

/* ----------------------------------------------------------------------
   Type scale (fluid, ~major third) + measure
   ---------------------------------------------------------------------- */
h1 { font-size: clamp(2.4rem, 1.9rem + 2.4vw, 3.4rem); line-height: 1.08; letter-spacing: -0.022em; }
h2 { font-size: clamp(1.85rem, 1.6rem + 1.2vw, 2.4rem); line-height: 1.15; letter-spacing: -0.018em; }
h3 { font-size: clamp(1.35rem, 1.25rem + 0.5vw, 1.6rem); line-height: 1.25; letter-spacing: -0.01em; }
p, li { font-size: 1.0625rem; }
.prose p, .prose li { font-size: 1.0625rem; line-height: 1.65; }
.prose { max-width: 68ch; }            /* 50–75ch optimum for dense legal text */
.prose p, .prose ul, .prose ol { max-width: 100%; }
.prose p { margin-bottom: 1.1em; }
.prose ul, .prose ol { padding-left: 1.5rem; }
.prose li { margin-bottom: 0.4em; }
/* Prose links underlined — color alone fails WCAG 1.4.1. */
.prose a { text-decoration: underline; text-underline-offset: 0.14em; }
.prose a:hover { text-decoration-thickness: 2px; }

/* ----------------------------------------------------------------------
   Layout shell
   ---------------------------------------------------------------------- */
body { display: flex; flex-direction: column; min-height: 100vh; overflow-x: hidden; }
/* Kill Pico's <main> padding + per-<section> margin — my hero/.block padding
   is the single source of vertical rhythm, so those would just double it. */
main { flex: 1 0 auto; padding-block: 0; }
main > section { margin-bottom: 0; }
.container { max-width: var(--container); }
.narrow { max-width: var(--container-narrow); margin-inline: auto; }

/* Skip link (visible on focus) */
.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -3rem;
  z-index: 100;
  background: var(--pico-primary);
  color: var(--pico-primary-inverse);
  padding: 0.6rem 1rem;
  border-radius: 0.5rem;
  text-decoration: none;
  transition: top 0.15s ease;
}
.skip-link:focus { top: 0.75rem; }

/* ----------------------------------------------------------------------
   Header / nav
   ---------------------------------------------------------------------- */
/* Single-row header ~56px tall (the cross-platform sweet spot: iOS nav bar
   44pt, Android app bar 56dp, mobile-web consensus 56–64px). Items stay
   vertically centered; nav links keep a ≥44px tap target. flex-wrap is a
   safety net for very narrow (~320px) screens only. */
.site-header { border-bottom: 1px solid var(--pico-muted-border-color); padding-block: 0; }
.site-header nav {
  max-width: var(--container);
  margin: 0 auto;
  min-height: 3.5rem;
  align-items: center;
  flex-wrap: wrap;
  row-gap: 0;
}
.site-header nav a { padding-block: 0.55rem; }
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--pico-h1-color);
  text-decoration: none;
}
.brand:hover { text-decoration: none; }
.brand svg { flex: none; color: var(--pico-primary); }

/* ----------------------------------------------------------------------
   Eyebrow + hero
   ---------------------------------------------------------------------- */
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.11em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--pico-primary);
  margin-bottom: 0.7rem;
}
.hero { padding: clamp(1.5rem, 5vw, 4.5rem) 0 clamp(1.25rem, 4vw, 3.25rem); position: relative; }
.hero h1 { margin-bottom: 0.9rem; max-width: 22ch; text-wrap: balance; }
.hero .lead {
  font-size: clamp(1.1rem, 0.9rem + 0.9vw, 1.35rem);
  line-height: 1.5;
  color: var(--pico-muted-color);
  max-width: 44ch;
  margin-bottom: 1.6rem;
  text-wrap: pretty;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.hero-actions a[role="button"] { margin-bottom: 0; }
.cta-note { font-size: 0.9rem; color: var(--pico-muted-color); margin-top: 0.85rem; }

/* Two-column hero (copy + app mock) */
.hero-split {
  display: grid;
  gap: clamp(1.5rem, 4vw, 3.25rem);
  grid-template-columns: 1fr;
  align-items: center;
}
@media (min-width: 56rem) {
  /* Copy slightly wider than the visual — the copy converts, the mock supports. */
  .hero-split { grid-template-columns: 1.15fr 0.85fr; }
}

/* Soft warm gradient wash behind the Holdclose hero */
.theme-holdclose .hero::before {
  content: "";
  position: absolute;
  inset: -10% 0 auto 0;
  height: 130%;
  background:
    radial-gradient(60% 60% at 80% 0%, rgba(201, 116, 88, 0.16), transparent 60%),
    radial-gradient(50% 50% at 0% 30%, rgba(31, 42, 68, 0.06), transparent 60%);
  z-index: -1;
  pointer-events: none;
}

/* ----------------------------------------------------------------------
   App mock (CSS only — no screenshots, never goes stale)
   ---------------------------------------------------------------------- */
.device-wrap { display: flex; justify-content: center; perspective: 1500px; }
.device {
  width: min(300px, 78vw);
  aspect-ratio: 9 / 19;
  border-radius: 2.4rem;
  border: 11px solid var(--brand-navy);
  background: var(--brand-warm);
  /* Layered, navy-tinted elevation (contact + ambient) reads warmer and
     more credible than one flat black shadow. Subtle tilt = "designed,
     intentional"; reset flat on mobile so it never looks accidental. */
  box-shadow:
    0 1px 2px rgba(31, 42, 68, 0.12),
    0 26px 50px -18px rgba(31, 42, 68, 0.34);
  transform: rotate(-3.5deg);
  padding: 0.9rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  overflow: hidden;
}
@media (max-width: 56rem) {
  .device { transform: none; width: min(270px, 72vw); }
}
.mock-greeting {
  background: linear-gradient(135deg, #c97458, #b5634a);
  color: #fff;
  border-radius: 1rem;
  padding: 0.85rem 0.95rem;
}
.mock-greeting strong { display: block; font-size: 0.95rem; }
.mock-greeting span { font-size: 0.78rem; opacity: 0.9; }
.mock-card {
  background: #fff;
  border: 1px solid #ece7e0;
  border-radius: 0.9rem;
  padding: 0.7rem 0.8rem;
  font-size: 0.78rem;
  color: #2f333a;
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.mock-dot { width: 0.7rem; height: 0.7rem; border-radius: 50%; background: #c97458; flex: none; }
.mock-card .when { margin-left: auto; color: #5b6470; font-variant-numeric: tabular-nums; }
.mock-bubble {
  border-radius: 1rem;
  padding: 0.6rem 0.75rem;
  font-size: 0.78rem;
  line-height: 1.35;
  max-width: 88%;
}
.mock-bubble.them { background: #ece7e0; color: #2f333a; align-self: flex-end; border-bottom-right-radius: 0.3rem; }
.mock-bubble.coach { background: var(--brand-navy); color: #f3f1ee; align-self: flex-start; border-bottom-left-radius: 0.3rem; }

/* ----------------------------------------------------------------------
   Sections, cards, grids
   ---------------------------------------------------------------------- */
section.block { padding: clamp(1.5rem, 4vw, 3.5rem) 0; }
.section-head { max-width: var(--measure); margin-bottom: clamp(1rem, 2.5vw, 1.6rem); }
.section-head .eyebrow { margin-bottom: 0.5rem; }
.section-head p { color: var(--pico-muted-color); margin-bottom: 0; }

.divider { height: 1px; border: 0; background: linear-gradient(90deg, transparent, var(--pico-muted-border-color), transparent); margin: 0; }

.grid-cards {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 17rem), 1fr));
}
/* Peer value cards: ONE depth cue (border only), no shadow, no hover —
   non-interactive cards must not look clickable. */
.grid-cards > article:not(.product-card) {
  box-shadow: none;
  border: 1px solid var(--pico-muted-border-color);
}
/* The product card is the one card meant to feel lifted + interactive. */
.product-card { display: flex; flex-direction: column; gap: 0.5rem; transition: transform 0.18s ease, box-shadow 0.18s ease; }
.product-card:hover, .product-card:focus-within { transform: translateY(-2px); box-shadow: var(--pico-card-box-shadow), 0 14px 32px -12px rgba(31, 42, 68, 0.18); }
.product-card .tag { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--pico-primary); }
.product-card h3 { margin: 0; }
.product-card p { color: var(--pico-muted-color); margin: 0; flex: 1; }
.product-card .card-cta { margin-top: 0.75rem; font-weight: 600; }

/* Status pill — navy text on the salmon tint (salmon-on-tint can fail AA);
   a 1px salmon stroke gives the edge contrast + says "label, not button". */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.32rem 0.8rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--pico-primary-focus);
  border: 1px solid var(--pico-primary);
  color: var(--pico-h1-color);
}

/* Benefit list — benefit-led, two columns on wide screens */
ul.features { list-style: none; padding: 0; display: grid; gap: 1.1rem 1.75rem; }
@media (min-width: 40rem) { ul.features { grid-template-columns: 1fr 1fr; } }
ul.features li { position: relative; padding-left: 2rem; }
ul.features li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.12rem;
  width: 1.3rem;
  height: 1.3rem;
  border-radius: 50%;
  background: var(--pico-primary-focus);
}
ul.features li::after {
  content: "";
  position: absolute;
  left: 0.44rem;
  top: 0.32rem;
  width: 0.32rem;
  height: 0.6rem;
  border: solid var(--pico-primary);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
ul.features li strong { display: block; color: var(--pico-h2-color); }
ul.features li span { color: var(--pico-muted-color); font-size: 0.97rem; }

/* How-it-works steps — a narrative sequence, not peer cards: no boxes, a
   faint connector rail (desktop), and the number badge as the anchor. */
ol.steps { list-style: none; padding: 0; counter-reset: step; display: grid; gap: 2rem; position: relative; }
@media (min-width: 48rem) {
  ol.steps { grid-template-columns: repeat(3, 1fr); }
  ol.steps::before {
    content: "";
    position: absolute;
    top: 1.5rem;
    left: 16%;
    right: 16%;
    height: 2px;
    background: var(--pico-muted-border-color);
    z-index: 0;
  }
}
ol.steps li {
  counter-increment: step;
  position: relative;
  z-index: 1;
}
ol.steps li::before {
  content: counter(step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  background: var(--pico-card-background-color);
  border: 2px solid var(--pico-primary);
  color: var(--pico-h1-color);
  font-weight: 700;
  font-size: 1.25rem;
  margin-bottom: 0.85rem;
}
ol.steps li strong { display: block; margin-bottom: 0.3rem; color: var(--pico-h3-color); }
ol.steps li span { color: var(--pico-muted-color); font-size: 0.97rem; }

/* Callout / trust line */
.callout {
  border-left: 4px solid var(--pico-primary);
  background: var(--pico-card-background-color);
  padding: 1rem 1.25rem;
  border-radius: 0 var(--pico-border-radius) var(--pico-border-radius) 0;
}
.trustline { color: var(--pico-muted-color); font-size: 0.95rem; }

/* Long-form */
.prose h2 { margin-top: 2.4rem; scroll-margin-top: 1.5rem; }
.prose h3 { margin-top: 1.7rem; }
.meta { color: var(--pico-muted-color); font-size: 0.9rem; }
html { scroll-behavior: smooth; scroll-padding-top: 1rem; }

/* Table of contents + "short version" summary for the policy page */
.toc {
  background: var(--pico-card-background-color);
  border-left: 3px solid var(--pico-primary);
  border-radius: 0 0.5rem 0.5rem 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0 2.25rem;
}
.toc strong { display: block; margin-bottom: 0.4rem; }
.toc ol { margin: 0; }
.summary { background: var(--pico-card-background-color); border: 1px solid var(--pico-muted-border-color); border-radius: 0.6rem; padding: 1.1rem 1.35rem; }
.summary strong { color: var(--pico-h2-color); }
.backtotop { font-size: 0.85rem; }

/* ----------------------------------------------------------------------
   Footer
   ---------------------------------------------------------------------- */
.site-footer {
  flex-shrink: 0;
  border-top: 1px solid var(--pico-muted-border-color);
  padding: 1.75rem 0;
  margin-top: clamp(1.5rem, 4vw, 3rem);
  color: var(--pico-muted-color);
  font-size: 0.9rem;
}
.site-footer nav { max-width: var(--container); margin: 0 auto; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.ver { opacity: 0.75; font-variant-numeric: tabular-nums; }

/* ----------------------------------------------------------------------
   Buttons / CTAs, focus, motion
   ---------------------------------------------------------------------- */
/* ≥48px touch target; centered label; semibold. Hero primary a touch taller. */
a[role="button"], button {
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease;
}
.hero-actions a[role="button"] { min-height: 3.25rem; }

/* Focus-visible: thick, high-contrast ring (WCAG 2.2 SC 2.4.13). Navy on the
   warm Holdclose theme; lighter indigo elsewhere (incl. the dark studio shell). */
:where(a, button, [role="button"], input, summary, [tabindex]):focus-visible {
  outline: 3px solid #8b86f0;
  outline-offset: 2px;
  border-radius: 6px;
}
.theme-holdclose :where(a, button, [role="button"], input, summary):focus-visible {
  outline-color: #1f2a44;
}

/* Lift only where hover is real (no stuck hover on touch screens). */
@media (hover: hover) {
  a[role="button"]:hover, button:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px -8px rgba(31, 42, 68, 0.3);
  }
}
a[role="button"]:active, button:active { transform: translateY(0); box-shadow: none; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  a[role="button"]:hover, button:hover, .product-card:hover { transform: none; }
}
