/* CardComet site. Tokens mirror the app's Sky palette (Design/Tokens.swift):
   open sky ground, ink text, gold only as a fill that carries ink, never as text.
   Light only, like the app. */

:root {
  --sky-top: #0ca5f1;
  --sky-bottom: #46b9e6;
  --sky-deep: #0a8fd6; /* pill text: 3.4:1 on white, display sizes only */
  --ink: #042f57;
  --ink-soft: #0b4273;
  --gold: #f2b134;
  --paper: #ffffff;
  --deep: #01245a;
  --field: #f1f7fc;
  --field-border: #d6e7f5;
  --hairline: rgba(4, 47, 87, 0.14);
  --shadow: 0 18px 40px rgba(5, 60, 102, 0.28);
  --display: ui-rounded, "Nunito", "SF Pro Rounded", system-ui, sans-serif;
  --text: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 22px;
  --wrap: 1120px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 17px;
  line-height: 1.6;
}

a { color: var(--ink); text-decoration-color: var(--sky-top); text-underline-offset: 3px; }
img, video { max-width: 100%; height: auto; display: block; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.02em;
  margin: 0 0 0.45em;
}
h1 { font-size: clamp(2.2rem, 4.6vw, 3.5rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); }
h3 { font-size: 1.2rem; font-weight: 800; letter-spacing: -0.01em; }

.muted { color: var(--ink-soft); }
main { display: block; }
section { padding: 0 20px; margin: 0 auto 96px; max-width: var(--wrap); }
.section-sub { color: var(--ink-soft); margin: -4px 0 32px; font-size: 1.08rem; max-width: 56ch; }

.eyebrow {
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  margin: 0 0 14px;
}

/* Sky ground: the hero, the slim band behind inner-page headers, the closing CTA */
.sky, .topbar, .sky-band {
  background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
}
.sky {
  position: relative;
  overflow: hidden;
  padding-bottom: 72px;
}
/* Clouds sit low, behind the content, as in the app's login sky. */
.sky-section::before, .sky-band::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48%;
  background: url("/media/clouds.webp") center bottom / cover no-repeat;
  -webkit-mask: linear-gradient(180deg, transparent 0%, #000 60%);
  mask: linear-gradient(180deg, transparent 0%, #000 60%);
  pointer-events: none;
}
.sky-section > *, .sky-band > * { position: relative; }
.sky .topbar { background: none; }

/* Header */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 20px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-family: var(--display);
  font-weight: 900;
  font-size: 1.15rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: none;
  text-shadow: 0 2px 0 rgba(1, 36, 90, 0.3);
}
.brand-glyph { width: 50px; height: auto; }
.site-nav { display: flex; align-items: center; gap: 22px; font-weight: 700; }
.site-nav a { color: #fff; text-decoration: none; text-shadow: 0 1px 0 rgba(1, 36, 90, 0.3); }
.site-nav a:hover { text-decoration: underline; }
.site-nav .nav-cta {
  background: var(--paper);
  color: var(--ink);
  text-shadow: none;
  padding: 9px 16px;
  border-radius: 999px;
  box-shadow: 0 6px 16px rgba(1, 36, 90, 0.2);
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 420px);
  gap: 48px;
  align-items: center;
  padding-top: 40px;
  margin-bottom: 0;
}
.hero h1 {
  color: #fff;
  text-shadow: 0 4px 0 rgba(1, 36, 90, 0.28);
}
.pill {
  display: inline-block;
  background: var(--paper);
  color: var(--sky-deep);
  text-shadow: none;
  padding: 0.04em 0.32em 0.1em;
  border-radius: 0.38em;
  margin-top: 0.12em;
  box-shadow: 0 6px 0 rgba(1, 36, 90, 0.18);
  transform: rotate(-1.5deg);
  white-space: nowrap;
}
.hero-sub { font-size: 1.15rem; max-width: 50ch; margin: 22px 0 30px; color: var(--ink); }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
.hero-note { font-weight: 600; font-size: 0.95rem; color: var(--ink); }
.facts {
  list-style: none;
  display: flex;
  gap: 32px;
  padding: 0;
  margin: 40px 0 0;
  flex-wrap: wrap;
}
.facts li { font-size: 0.95rem; font-weight: 600; }
.facts b {
  display: block;
  font-family: var(--display);
  font-weight: 900;
  font-size: 2rem;
  line-height: 1;
  color: var(--ink);
}

/* Hero reel: unframed, standing in front of the deck it came from */
.hero-media { justify-self: center; width: 100%; max-width: 420px; padding: 0 60px; }
.stage { position: relative; }
.reel {
  position: relative;
  z-index: 2;
  width: 100%;
  aspect-ratio: 9 / 16;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: 0 40px 80px rgba(1, 36, 90, 0.45);
  transform: rotate(-3deg);
}
.deck img {
  position: absolute;
  z-index: 1;
  width: 62%;
  border-radius: 10px;
  box-shadow: 0 18px 36px rgba(1, 36, 90, 0.35);
}
.deck img:nth-child(1) { left: -30%; top: 12%; transform: rotate(-18deg); }
.deck img:nth-child(2) { left: -22%; top: 50%; transform: rotate(-8deg); }
.deck img:nth-child(3) { right: -30%; top: 8%; transform: rotate(14deg); }
.deck img:nth-child(4) { right: -24%; top: 52%; transform: rotate(22deg); }
.sound {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: -22px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  white-space: nowrap;
  border: 0;
  cursor: pointer;
  font: 800 1rem var(--display);
  color: var(--ink);
  background: var(--paper);
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 10px 24px rgba(1, 36, 90, 0.28);
}
.sound::before {
  content: "";
  width: 20px;
  height: 20px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
  mask: var(--icon) center / contain no-repeat;
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M17 9l5 6M22 9l-5 6'/%3E%3C/svg%3E");
}
.sound[aria-pressed="true"]::before {
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9v6h4l5 4V5L8 9z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E");
}
.sound-on, .sound[aria-pressed="true"] .sound-off { display: none; }
.sound[aria-pressed="true"] .sound-on { display: inline; }

/* Store badge: Apple's own artwork */
.store-badge { display: inline-block; line-height: 0; border-radius: 10px; }
.store-badge img { display: block; }
.store-badge:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Panels: the App Store creatives on the sky, captioned in real text */
.sky-section {
  position: relative;
  overflow: hidden;
  max-width: none;
  background: var(--sky-bottom);
  padding: 24px 20px 220px;
}
.sky-section > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.sky-section h2 { color: #fff; text-shadow: 0 4px 0 rgba(1, 36, 90, 0.28); }
.sky-section .section-sub { color: var(--ink); font-weight: 600; }
.sky-section .panel p { color: var(--ink); }
.sky-section .panel img { box-shadow: 0 16px 34px rgba(1, 36, 90, 0.3); }
.panels.sky-section { margin-bottom: 0; padding-bottom: 96px; }
.panels.sky-section::before { display: none; }
.split.sky-section { padding-top: 0; }
.split.sky-section > .split-media, .split.sky-section > .split-copy { max-width: none; margin: 0; }
.split.sky-section .split-copy p { color: var(--ink); }
.panel-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 18px;
}
.panel { margin: 0; }
.panel img {
  width: 100%;
  border-radius: 20px;
  box-shadow: 0 12px 28px rgba(5, 60, 102, 0.18);
}
.panel figcaption { padding: 16px 4px 0; }
.panel h3 { margin-bottom: 6px; }
.panel p { margin: 0; color: var(--ink-soft); font-size: 0.95rem; line-height: 1.5; }

/* Split: the sets video beside its copy */
.split {
  display: grid;
  grid-template-columns: minmax(0, 660px) minmax(0, 420px);
  justify-content: center;
  gap: 48px;
  align-items: center;
}
.split-media video {
  width: 100%;
  border-radius: var(--radius);
  aspect-ratio: 3 / 2;
  object-fit: cover;
  box-shadow: var(--shadow);
}
.split-copy p { color: var(--ink-soft); font-size: 1.08rem; }
.eyebrow-ink {
  display: inline-block;
  background: var(--gold);
  padding: 4px 12px;
  border-radius: 999px;
}

/* Guides */
.guide-grid {
  display: grid;
  gap: 22px;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  margin-bottom: 24px;
}
.guide-card {
  display: block;
  background: var(--paper);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  overflow: hidden;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.guide-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(5, 60, 102, 0.14); }
.guide-card-img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.guide-card-body { display: block; padding: 18px 20px 22px; }
.guide-card-title {
  display: block;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.12rem;
  line-height: 1.25;
  margin-bottom: 8px;
}
.guide-card-desc { display: block; color: var(--ink-soft); font-size: 0.94rem; line-height: 1.5; }
.text-link { font-family: var(--display); font-weight: 800; text-decoration: none; }
.text-link:hover { text-decoration: underline; }

/* FAQ */
.faq { max-width: 820px; }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  cursor: pointer;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 18px 36px 18px 0;
  list-style: none;
  position: relative;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 14px;
  font-size: 1.5rem;
  color: var(--sky-deep);
}
.faq-item[open] summary::after { content: "−"; }
.faq-body { color: var(--ink-soft); padding-bottom: 16px; }
.faq-body p { margin: 0 0 8px; }

/* Closing CTA on the sky */
.cta-final { text-align: center; }
.sky-band {
  position: relative;
  overflow: hidden;
  max-width: none;
  margin: 0;
  padding: 80px 20px 180px;
}
.sky-band::before { height: 55%; }
.sky-band h2 { color: #fff; text-shadow: 0 4px 0 rgba(1, 36, 90, 0.28); }
.sky-band p { max-width: 48ch; margin: 0 auto 26px; font-size: 1.1rem; font-weight: 600; }
.card-fan { display: flex; justify-content: center; margin: 0 auto 36px; }
.card-fan img {
  width: 150px;
  border-radius: 10px;
  margin: 0 -18px;
  box-shadow: 0 16px 30px rgba(1, 36, 90, 0.35);
}
.card-fan img:nth-child(1) { transform: rotate(-16deg) translateY(28px); }
.card-fan img:nth-child(2) { transform: rotate(-8deg) translateY(8px); }
.card-fan img:nth-child(3) { transform: scale(1.12); z-index: 1; }
.card-fan img:nth-child(4) { transform: rotate(8deg) translateY(8px); }
.card-fan img:nth-child(5) { transform: rotate(16deg) translateY(28px); }

/* Articles and legal pages */
.topbar { margin-bottom: 40px; }
.article-wrap { max-width: 760px; margin: 0 auto; padding: 0 20px 40px; }
.article-wrap section { padding: 0; margin-bottom: 40px; }
.breadcrumb { color: var(--ink-soft); font-size: 0.92rem; margin: 0 0 20px; }
.breadcrumb a { text-decoration: none; font-weight: 600; }
.article h1 { font-size: clamp(2rem, 4.6vw, 3rem); }
.article h2 { margin-top: 1.6em; font-size: clamp(1.45rem, 2.8vw, 1.9rem); }
.article p, .article li { color: var(--ink); }
.lede { font-size: 1.18rem; }
.feature-img {
  width: 100%;
  border-radius: var(--radius);
  margin-bottom: 28px;
  box-shadow: 0 14px 30px rgba(5, 60, 102, 0.16);
}
.inline-figure { margin: 28px 0; }
.inline-figure img { width: 100%; max-width: 300px; border-radius: 26px; box-shadow: var(--shadow); }
figcaption { color: var(--ink-soft); font-size: 0.92rem; margin-top: 12px; }
.article ul, .article ol { padding-left: 1.35em; }
.article ul { list-style: disc; }
.article ol { list-style: decimal; }
.article li { margin-bottom: 8px; }
.howto {
  background: var(--field);
  border: 1px solid var(--field-border);
  border-radius: var(--radius);
  padding: 22px 22px 14px 2.6em !important;
}
.howto li { margin-bottom: 12px; }
.legal p, .legal li { color: var(--ink-soft); font-size: 0.97rem; }

.cta-callout {
  background: var(--field);
  border: 1px solid var(--field-border);
  border-left: 6px solid var(--gold);
  border-radius: 16px;
  padding: 20px 22px;
  margin: 28px 0;
}
.cta-callout p { margin: 0 0 14px; font-weight: 600; }
.article-wrap .cta-final { background: var(--field); border-radius: var(--radius); padding: 36px 20px; }
.related ul { padding-left: 1.2em; }
.related li { margin-bottom: 6px; }

/* Footer */
.site-footer {
  background: var(--deep);
  color: #d8e8f5;
  padding: 48px 20px 32px;
}
.site-footer > * { max-width: var(--wrap); margin-left: auto; margin-right: auto; }
.footer-cols {
  display: grid;
  gap: 28px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  margin-bottom: 28px;
}
.footer-h { font-size: 1rem; font-weight: 800; margin-bottom: 10px; color: #fff; letter-spacing: 0; }
.site-footer .muted { color: #d8e8f5; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 7px; }
.site-footer a { color: #d8e8f5; text-decoration: none; font-size: 0.94rem; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.disclaimer, .copyright { color: #a8c4dc; font-size: 0.82rem; line-height: 1.6; }
.copyright { margin-bottom: 0; }

@media (prefers-reduced-motion: reduce) {
  .guide-card { transition: none; }
  .guide-card:hover { transform: none; }
}

@media (max-width: 980px) {
  .panel-row {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 62%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding-bottom: 12px;
    margin: 0 -20px;
    padding-inline: 20px;
    scroll-padding-inline: 20px;
  }
  .panel { scroll-snap-align: start; }
}

@media (max-width: 960px) {
  .hero { grid-template-columns: 1fr; gap: 56px; padding-top: 16px; }
  .hero-media { max-width: 360px; }
  .split { grid-template-columns: 1fr; gap: 28px; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  section { margin-bottom: 72px; }
  .site-nav { gap: 14px; font-size: 0.92rem; }
  .site-nav a:nth-child(2) { display: none; }
  .brand { font-size: 1rem; }
  .facts { gap: 22px; }
  .facts b { font-size: 1.6rem; }
  .card-fan img { width: 96px; margin: 0 -14px; }
  .panel-row { grid-auto-columns: 74%; }
  .sky-band { padding-bottom: 200px; }
}
