/* ==========================================================================
   In Case of Crisis AI — design system
   Base look and feel ported from the "Apple demo" (the black-and-white,
   Apple-esque styled reference build) per Christopher's direction: only the
   hero's scroll/zoom mechanic comes from the "Mercury demo" (this repo's own
   prior draft) — everything else, look/feel/language, is Apple's.
   ========================================================================== */

:root {
  --ink: #1d1d1f;
  --gray: #6e6e73;
  --gray-2: #86868b;
  --line: #d2d2d7;
  --line-soft: #e8e8ed;
  --wash: #f5f5f7;
  --blue: #0071e3;
  --blue-dark: #0058b8;
  --blue-link: #2997ff;
  --radius: 18px;
  --radius-sm: 12px;
  --max-width: 1200px;
  --gutter: clamp(20px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 17px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: #fff;
}

img { display: block; max-width: 100%; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 4px; }
a:focus-visible { outline: 2px solid var(--blue); outline-offset: 4px; }

h1, h2, h3, h4, p { margin-top: 0; }
p:last-child { margin-bottom: 0; }

h1 { font-size: clamp(38px, 7vw, 76px); line-height: 1.05; font-weight: 600; letter-spacing: -0.035em; margin: 0 0 18px; }
h2 { font-size: clamp(29px, 4.4vw, 46px); line-height: 1.08; font-weight: 600; letter-spacing: -0.028em; margin: 0 0 16px; }
h3 { font-size: 21px; line-height: 1.22; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 8px; }
h4 { font-size: 16px; font-weight: 600; letter-spacing: -0.015em; margin: 0 0 6px; }

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  min-height: 44px;
  padding: 10px 18px;
  border-radius: 9999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  transform: translateY(-160%);
  text-decoration: none;
}
.skip-link:focus { transform: translateY(0); }

/* ------------------------------------------------------------ structure -- */

.wrap { max-width: var(--max-width); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 700px; margin-left: auto; margin-right: auto; }
.center { text-align: center; }

section { padding: 96px 0; }
section.wash { background: var(--wash); }
section.dark { background: #000; color: #f5f5f7; }
section.dark h1, section.dark h2, section.dark h3 { color: #f5f5f7; }
section.dark .lede { color: #a1a1a6; }
section.dark .kicker { color: var(--blue-link); }
section.dark .link { color: var(--blue-link); }
section.dark a { color: var(--blue-link); }
section.dark .small { color: #a1a1a6; }
section.dark .card, section.dark .tier { background: #1c1c1e; border-color: #2c2c2e; }
section.dark .spec, section.dark .spec > div { border-color: #2c2c2e; }
section.dark.sm { padding: 68px 0; }

.kicker { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; color: var(--blue); margin: 0 0 12px; }
.lede { font-size: clamp(18px, 2vw, 24px); line-height: 1.38; letter-spacing: -0.015em; color: var(--gray); margin: 0; }
.small { font-size: 14px; line-height: 1.52; color: var(--gray); }

.link { color: var(--blue); text-decoration: none; font-size: 18px; }
.link:hover { text-decoration: underline; }
.link::after { content: " \203A"; }
.links { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 26px; }
.links.center { justify-content: center; }

/* --------------------------------------------------------------- chrome -- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 48px;
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}
.site-header .wrap { display: flex; align-items: center; gap: 32px; width: 100%; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.02em;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
}
.brand img { width: 22px; height: 22px; object-fit: contain; }

.site-nav { display: flex; gap: 26px; flex: 1; }
.nav-link { font-size: 12.5px; color: var(--ink); text-decoration: none; opacity: 0.85; white-space: nowrap; }
.nav-link:hover { opacity: 1; }
.nav-cta { margin-left: auto; font-size: 12.5px; color: var(--blue); text-decoration: none; white-space: nowrap; }

/* Below 860px, the inline nav-links and hamburger swap places: links move
   into the slide-down `.mobile-nav` panel, the toggle button appears. Above
   860px it's the reverse — plain top-nav, no toggle, panel force-hidden. */
.nav-toggle {
  display: none;
  flex: none;
  width: 32px;
  height: 32px;
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}
.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 1px;
  background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle.is-active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.is-active span:nth-child(2) { opacity: 0; }
.nav-toggle.is-active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-nav {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  flex-direction: column;
  padding: 4px var(--gutter) 12px;
  background: #fff;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 12px 24px -12px rgba(0, 0, 0, 0.18);
}
.mobile-nav-link {
  padding: 13px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 15px;
  color: var(--ink);
  text-decoration: none;
}
.mobile-nav-link:last-child { border-bottom: 0; }
.mobile-nav-cta { color: var(--blue); font-weight: 600; }

@media (max-width: 860px) {
  .site-nav, .site-header .nav-cta { display: none; }
  .nav-toggle { display: flex; }
  .mobile-nav.is-open { display: flex; }
}

/* ---------------------------------------------------------------- cards -- */

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 26px;
}
section.wash .card { background: #fff; }
.card .num { font-size: 12.5px; color: var(--blue); font-weight: 600; margin: 0 0 10px; }

.card-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.card-title-row h3, .card-title-row h4 { margin: 0; }
.card-title-row .soon { margin-bottom: 0; flex: none; }

.brand-logo-full { display: block; height: 40px; width: auto; margin-bottom: 8px; }
.brand-cards .card { padding: 18px 20px; }

.list-label { font-size: 13px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray); margin: 0 0 14px; }
section.dark .list-label { color: #a1a1a6; }

.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 820px) { .g3, .g4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .g2, .g3, .g4 { grid-template-columns: 1fr; } }

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 54px; align-items: start; }
@media (max-width: 820px) { .row { grid-template-columns: 1fr; gap: 26px; } }

/* ----------------------------------------------------------- spec lists -- */

.spec { border-top: 1px solid var(--line); margin: 0; }
.spec > div {
  border-bottom: 1px solid var(--line);
  padding: 22px 0;
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 32px;
}
.spec dt { font-weight: 600; letter-spacing: -0.015em; margin: 0; }
.spec dd { margin: 0; color: var(--gray); }
@media (max-width: 700px) { .spec > div { grid-template-columns: 1fr; gap: 6px; } }

/* -------------------------------------------------------------- buttons -- */

.button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  background: var(--blue);
  color: #fff;
  border: 1px solid var(--blue);
  font-size: 15px;
  font-weight: 500;
  padding: 11px 24px;
  border-radius: 9999px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.18s ease;
}
.button:hover, .btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); }
.button-secondary { background: transparent; color: var(--blue); }
.button-secondary:hover { background: rgba(0, 113, 227, 0.06); }
.button-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 20px; }
.button.wide { width: 100%; }

/* Spacing/utility classes — replace inline style="" attributes, which the
   CSP's style-src 'self' blocks the moment this is actually deployed. */
.brand-suffix { color: var(--blue); font-weight: 700; }
.mt-lede { margin-top: 20px; }
.mt-grid { margin-top: 54px; }
.honest-note { max-width: 740px; margin: 38px auto 0; text-align: center; }
.callout-card { max-width: 820px; margin: 48px auto 0; background: var(--wash); }
.tier-solo { max-width: 420px; margin: 36px auto 0; }
.mt-sm { margin-top: 14px; }
.mb-0 { margin-bottom: 0; }

.price-toggle {
  display: inline-flex;
  margin: 0 0 14px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--wash);
}
.toggle-btn {
  border: 0;
  background: transparent;
  color: var(--gray);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 7px 18px;
  border-radius: 9999px;
  cursor: pointer;
}
.toggle-btn.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }

.soon {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 9999px;
  background: var(--wash);
  color: var(--gray);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
section.dark .soon,
.card.dark .soon { background: #2c2c2e; color: #a1a1a6; border-color: #3a3a3c; }

/* --------------------------------------------------------------- tiers --- */

.tier {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 28px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.tier .name { font-size: 24px; font-weight: 600; letter-spacing: -0.02em; margin: 0 0 5px; }
.tier .who { font-size: 14px; color: var(--gray); margin: 0 0 20px; }
.tier .price { font-size: 15px; margin: 0 0 10px; }
.tier .price b { font-size: 26px; font-weight: 600; letter-spacing: -0.02em; }
.tier ul { list-style: none; margin: 0 0 20px; padding: 0; flex: 1; }
.tier li { font-size: 14.5px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.tier li:last-child { border-bottom: 0; }
.tier .button { margin-top: 0; }

/* -------------------------------------------------------------- reveal --- */

.r { opacity: 1; transform: none; }
.js-reveal .r { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js-reveal .r.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .js-reveal .r { opacity: 1; transform: none; transition: none; }
}

/* -------------------------------------------------------------- footer --- */

footer.site { background: var(--wash); padding: 44px 0 58px; font-size: 12px; color: var(--gray); line-height: 1.6; }
footer.site .footer-inner { display: block; }
footer.site .brand { margin-bottom: 18px; }
footer.site .footer-legal { display: grid; gap: 12px; }
footer.site p { margin: 0; }

/* ==========================================================================
   Hero — kept as the "Mercury demo" scroll/zoom mechanic, per Christopher's
   direction. A full-bleed photo hero reads dark by design; the rest of the
   page above uses Apple's light system, so the hero declares its own local
   tokens and background rather than inheriting the page defaults.
   ========================================================================== */

.hero {
  position: relative;
  height: 200vh;
  min-height: 1200px;
  padding: 0;
  background: #0b0b0d;
  --hero-scale: 4.2;
  --embed-opacity: 1;
  --detail-opacity: 0;
  --detail-scale: 0.28;
  --start-opacity: 1;
  --end-opacity: 1;
  --shade-opacity: 0.72;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 640px;
  overflow: hidden;
  background: #0b0b0d;
}

.hero-zoom {
  position: absolute;
  inset: 0;
  transform: scale(var(--hero-scale));
  transform-origin: 50% 66.5%;
}

.hero-media-plane {
  position: absolute;
  top: 50%;
  left: 50%;
  width: max(100vw, 177.778vh);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  transform: translate(-50%, -50%);
}

.hero-photo, .hero-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.hero-photo { object-fit: cover; }
.hero-shade { background: color-mix(in srgb, #0b0b0d 58%, transparent); opacity: var(--shade-opacity); }

.screen-embed {
  position: absolute;
  z-index: 2;
  top: 64.15%;
  left: 47.9%;
  width: 4.58%;
  height: 5.35%;
  overflow: hidden;
  border: 0;
  border-radius: 1px;
  background: #0b0b0d;
  clip-path: polygon(0 0, 100% 0, 98% 100%, 2% 100%);
  opacity: var(--embed-opacity);
}

.screen-content {
  width: 100%;
  height: 100%;
  filter: brightness(0.72) saturate(0.78) contrast(0.94);
  object-fit: cover;
  object-position: center;
  transform: scale(1.015);
}

.screen-detail {
  position: absolute;
  z-index: 3;
  top: 64%;
  left: 50%;
  width: min(76vw, 720px);
  height: min(60vh, 540px);
  max-width: none;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.55);
  opacity: var(--detail-opacity);
  transform: translate(-50%, -50%) scale(var(--detail-scale));
  transform-origin: center;
}

.hero-copy {
  position: absolute;
  z-index: 5;
  right: var(--gutter);
  left: var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: auto;
  color: #fff;
  text-align: center;
}
.hero-copy h1 { color: #fff; max-width: 900px; }
.hero-accent { color: var(--blue); }
.hero-copy p { color: #f5f5f7; font-size: clamp(18px, 2vw, 24px); max-width: 700px; }
.hero-copy-start { top: clamp(116px, 15vh, 170px); opacity: var(--start-opacity); }

.motion-fallback .hero-zoom, .motion-fallback .hero-shade, .motion-fallback .hero-copy {
  will-change: transform, opacity;
}

@supports (animation-timeline: scroll()) {
  .motion-enabled .hero-zoom {
    animation: hero-push linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 100vh;
  }
  .motion-enabled .screen-embed {
    animation: screen-depart linear both;
    animation-timeline: scroll(root block);
    animation-range: 45vh 52vh;
  }
  .motion-enabled .screen-detail {
    animation: screen-detail-arrive linear both;
    animation-timeline: scroll(root block);
    animation-range: 45vh 100vh;
  }
  .motion-enabled .hero-shade {
    animation: shade-deepen linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 100vh;
  }
  .motion-enabled .hero-copy-start {
    animation: copy-leave linear both;
    animation-timeline: scroll(root block);
    animation-range: 12vh 52vh;
  }
}

@keyframes hero-push { from { transform: scale(1); } to { transform: scale(4.2); } }
@keyframes screen-depart { from { opacity: 1; } to { opacity: 0; } }
@keyframes screen-detail-arrive {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.28); }
  20% { opacity: 1; }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
@keyframes shade-deepen { from { opacity: 0.58; } to { opacity: 0.72; } }
@keyframes copy-leave { from { opacity: 1; } to { opacity: 0; } }

@media (max-width: 760px) {
  .hero-sticky { min-height: 560px; }
  .hero-copy-start { top: 104px; }
  .screen-detail { top: 64%; width: 92vw; height: 56vh; border-radius: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .hero { height: 100vh; min-height: 640px; }
  .hero-sticky { position: relative; }
  .hero-zoom { transform: scale(4.2); }
  .screen-embed { opacity: 0; }
  .screen-detail { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  .hero-copy-start { opacity: 1; }
  .hero-zoom, .screen-embed, .screen-detail, .hero-shade, .hero-copy-start { animation: none !important; }
}

/* ==========================================================================
   Chat window — the hero's animated, typed demonstration, revealed inside
   `.screen-detail` as the scroll-zoom completes. Uses the page's own Apple
   tokens directly now that the whole site shares one design system.
   ========================================================================== */

.chatwin {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.cw-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fbfbfd, #f5f5f7);
}
.cw-dots { display: flex; gap: 6px; }
.cw-dots i { width: 10px; height: 10px; border-radius: 50%; background: #dcdce1; display: block; }
.cw-dots i:nth-child(1) { background: #ff5f57; }
.cw-dots i:nth-child(2) { background: #febc2e; }
.cw-dots i:nth-child(3) { background: #28c840; }
.cw-title { font-size: 12.5px; font-weight: 500; color: var(--gray); margin-left: 4px; }
.cw-badge {
  margin-left: auto;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
  background: #eaf1fb;
  color: var(--blue-dark);
  border: 1px solid #c5dbf5;
  border-radius: 9999px;
  padding: 3px 10px;
  white-space: nowrap;
}

.cw-thread {
  flex: 1;
  padding: 20px 18px;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 12px;
  background: #fff;
  scrollbar-width: none;
}
.cw-thread::-webkit-scrollbar { display: none; }
.cw-msg { opacity: 0; transform: translateY(10px); transition: opacity 0.34s ease, transform 0.34s ease; }
.cw-msg.on { opacity: 1; transform: none; }
.cw-msg.me { text-align: right; }
.cw-msg.me .cw-bub {
  display: inline-block;
  text-align: left;
  max-width: 84%;
  background: var(--blue);
  color: #fff;
  border-radius: 16px 16px 4px 16px;
  padding: 10px 15px;
  font-size: 15px;
  line-height: 1.4;
}
.cw-msg.ai .cw-bub { font-size: 14.5px; }

.cw-think { display: flex; gap: 5px; padding: 12px 4px; }
.cw-think i { width: 7px; height: 7px; border-radius: 50%; background: #c7c7cc; display: block; animation: cw-bounce 1.15s infinite ease-in-out; }
.cw-think i:nth-child(2) { animation-delay: 0.16s; }
.cw-think i:nth-child(3) { animation-delay: 0.32s; }
@keyframes cw-bounce { 0%, 60%, 100% { transform: translateY(0); opacity: 0.5; } 30% { transform: translateY(-5px); opacity: 1; } }

.cw-answer { border-left: 3px solid var(--blue); padding-left: 14px; }
.cw-answer .cw-h { font-size: 12.5px; font-weight: 600; color: var(--ink); margin: 0 0 7px; }
.cw-answer ul { margin: 0; padding-left: 17px; }
.cw-answer li { font-size: 14px; line-height: 1.5; margin-bottom: 5px; color: var(--ink); opacity: 0; transform: translateY(4px); transition: opacity 0.3s ease, transform 0.3s ease; }
.cw-answer li.on { opacity: 1; transform: none; }
.cw-cite { font-size: 11.5px; color: var(--gray-2); margin: 11px 0 0; line-height: 1.5; opacity: 0; transition: opacity 0.4s ease; }
.cw-cite.on { opacity: 1; }
.cw-cite b { color: var(--gray); font-weight: 600; }

.cw-input { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-top: 1px solid var(--line-soft); background: #fff; }
.cw-box {
  flex: 1;
  min-height: 40px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 9999px;
  padding: 9px 17px;
  font-size: 14.5px;
  color: var(--ink);
  background: #fff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.chatwin.typing .cw-box { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.14); }
.cw-box .ph { color: var(--gray-2); }
.chatwin.typing .cw-box .ph { display: none; }
.cw-caret { display: none; width: 1.5px; height: 17px; background: var(--blue); margin-left: 1px; border-radius: 1px; animation: cw-blink 1.05s step-end infinite; }
.chatwin.typing .cw-caret { display: inline-block; }
@keyframes cw-blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } }
.cw-send {
  width: 32px;
  height: 32px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  cursor: default;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.chatwin.typing .cw-send { background: var(--blue); }

@media (max-width: 600px) {
  .cw-thread { padding: 16px 14px; }
  .cw-badge { display: none; }
}
