/* ============================================
   COSMIC CASSY THEME (design system layer)
   Loaded on EVERY page, after global.css and the page's own CSS.
   Purpose: one modern, consistent look (lavender and purple, soft cards,
   rounded controls) matching the 2026-11-04 mockup. It works by retuning the
   shared color, radius and shadow tokens that the whole site already uses,
   so pages inherit the new look without being rewritten one by one.
   Mobile first. Respects reduced motion.
   ============================================ */

:root {
  /* Brand. The variable names keep "blue" so existing CSS keeps working. */
  --primary-blue: #5b2fb8;
  --primary-blue-hover: #4a2496;
  --primary-blue-light: #7c5cd6;
  --primary-blue-lighter: #c4b3f0;

  --brand: var(--primary-blue);
  --brand-dark: #3f1f86;
  --brand-soft: #f4effe;
  --brand-softer: #ebe2fc;
  --brand-ink: #1f1636;

  /* Surfaces */
  --bg-white: #ffffff;
  --bg-cream: #f7f3ff;
  --bg-light: #f1ecfb;
  --card-bg: #fbf9ff;

  /* Text */
  --text-dark: #1f1636;
  --text-medium: #4b4266;
  --text-light: #6b6385;
  --text-lighter: #9a93b3;

  /* Shape and depth */
  --radius-small: 8px;
  --radius-medium: 12px;
  --radius-large: 16px;
  --radius-xlarge: 22px;
  --shadow-sm: 0 1px 3px rgba(63, 31, 134, 0.08);
  --shadow-md: 0 6px 18px rgba(63, 31, 134, 0.1);
  --shadow-lg: 0 12px 32px rgba(63, 31, 134, 0.14);
  --shadow-xl: 0 18px 44px rgba(63, 31, 134, 0.18);
}

body {
  color: var(--text-dark);
  background: #ffffff;
}

h1, h2, h3, h4 { color: var(--text-dark); letter-spacing: -0.01em; }

a { color: var(--primary-blue); }

/* Keyboard focus is always visible, in the brand color. */
:focus-visible {
  outline: 3px solid rgba(91, 47, 184, 0.45);
  outline-offset: 2px;
}

/* Shared buttons: rounded, solid brand for the main action. */
.btn, .btn-primary, .btn-secondary {
  border-radius: 12px;
  font-weight: 700;
}
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }

/* Form controls: roomy, soft border, clear focus. */
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="search"], input[type="password"], input[type="date"], select, textarea {
  border-radius: 12px;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 47, 184, 0.18);
  outline: none;
}

/* The slide-out social tab overlaps page content on phones and tablets (it
   clipped the first letters of text). Social links stay in the footer; the
   tab only appears on wide screens where there is room beside the content. */
@media (max-width: 1299px) {
  .social-sidebar { display: none !important; }
}

/* Cards inherit the soft purple shadow instead of a grey one. */
.card, .resource-card { border-radius: var(--radius-large); }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ============================================
   FOOTER in the brand palette (deep purple ink, lavender accents)
   ============================================ */
.site-footer { background-color: #1f1636; color: rgba(255, 255, 255, 0.78); }
.footer-mission-band { background-color: #170f29; border-bottom-color: rgba(196, 179, 240, 0.14); }
.footer-heading { color: #ffffff; }
.footer-links a { color: rgba(255, 255, 255, 0.72); }
.footer-links a:hover { color: #ffffff; }
.footer-join-link { color: #c4b3f0 !important; }
.footer-join-link:hover { color: #ffffff !important; }
.footer-bottom { border-top-color: rgba(196, 179, 240, 0.14); }

/* Balanced headings: no single word left alone on the last line. */
h1, h2, h3 { text-wrap: balance; }

/* Sign-in family of pages: the real logo, and the brand background instead of the old blue. */
.auth-logo .logo-icon-img { width: 40px; height: 40px; object-fit: contain; }

/* ---------- Continue with Google ---------- */
.google-signin { margin-bottom: 16px; }
.google-signin-button { display: flex; justify-content: center; min-height: 44px; }
.google-signin-error { margin: 8px 0 0; color: #b42318; font-size: 14px; text-align: center; }
.google-signin-terms { margin: 8px 0 0; font-size: 13px; line-height: 1.45; color: var(--text-light, #6b6385); text-align: center; }
.google-signin-terms a { color: var(--brand, #5b2fb8); }
.google-signin-divider { display: flex; align-items: center; gap: 12px; margin-top: 16px; color: var(--text-light, #6b6385); font-size: 13px; }
.google-signin-divider::before, .google-signin-divider::after { content: ""; flex: 1; height: 1px; background: rgba(91, 47, 184, 0.16); }

/* ---------- Phone notifications panel (account page) ---------- */
.push-panel { margin-top: 24px; padding-top: 20px; border-top: 1px solid rgba(91, 47, 184, 0.14); }
.push-title { font-size: 17px; margin: 0 0 6px; }
.push-desc { margin: 0 0 10px; color: var(--text-medium, #4b4266); line-height: 1.55; }
.push-status { margin: 0 0 12px; font-weight: 700; color: var(--brand-dark, #3f1f86); }
.push-topic { display: flex; align-items: center; gap: 10px; margin-top: 14px; }

/* ---------- Safety net: sections that wait for a script to fade in ----------
   About, team and tools hide these until their script adds a class. If the script is
   blocked or fails, show them anyway after 2.5 seconds so a page is never left blank.
   Only opacity is animated; the script's own class still wins when it runs first. */
@keyframes ccRevealFallback { to { opacity: 1; } }
.about-hero, .story-content, .team-card, .why-content,
.tools-hero, .tools-how-to-use, .tools-features, .tools-disclaimers, .tools-request,
.contact-hero, .contact-content, .contact-faq, .blog-hero, .blog-list-hero, .blog-hero-section {
  animation: ccRevealFallback 0.01s linear 2.5s forwards;
}


/* ---------- Cookie box and install card (shared look) ---------- */
.cc-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(65px + env(safe-area-inset-bottom, 0px) + 12px);
  max-width: 460px;
  margin: 0 auto;
  padding: 18px;
  background: #fff;
  color: var(--text-dark, #1b1440);
  border: 1px solid rgba(91, 47, 184, 0.2);
  border-radius: 18px;
  box-shadow: 0 14px 44px rgba(27, 20, 64, 0.3);
  z-index: 2000;
  animation: ccSheetIn 0.25s ease both;
}
@media (min-width: 1200px) { .cc-sheet { left: 20px; right: auto; bottom: 20px; margin: 0; } }
/* Phones: the same words in a tighter sheet, so more of the page stays visible behind it. */
@media (max-width: 599px) {
  .cc-sheet { padding: 14px 14px 12px; left: 8px; right: 8px; border-radius: 16px; }
  .cc-sheet-title { font-size: 16px; margin-bottom: 4px; }
  .cc-sheet-text { font-size: 13.5px; line-height: 1.45; }
  .cc-sheet-actions { margin-top: 10px; gap: 8px; }
  .cc-btn { min-height: 44px; flex-basis: 120px; padding: 0 10px; font-size: 15px; }
  .cc-sheet-link { margin-top: 8px; font-size: 13.5px; }
}
@keyframes ccSheetIn { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }
.cc-sheet-title { margin: 0 0 6px; font-size: 18px; line-height: 1.25; }
.cc-sheet-text { margin: 0; color: var(--text-medium, #4b4266); font-size: 15px; line-height: 1.55; }
.cc-sheet-note { margin: 10px 0 0; color: var(--text-medium, #4b4266); font-size: 13px; line-height: 1.5; }
.cc-sheet-link { display: inline-block; margin-top: 10px; font-size: 14px; font-weight: 700; color: var(--brand-dark, #3f1f86); text-decoration: underline; }
.cc-sheet-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.cc-btn { flex: 1 1 140px; min-height: 46px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--brand, #5b2fb8); font: inherit; font-weight: 700; cursor: pointer; }
.cc-btn-primary { background: var(--brand, #5b2fb8); color: #fff; }
.cc-btn-secondary { background: #fff; color: var(--brand-dark, #3f1f86); }
.cc-btn:focus-visible, .cc-sheet-link:focus-visible { outline: 3px solid #1b1440; outline-offset: 2px; }
.cc-consent-rows { display: grid; gap: 10px; margin-top: 12px; }
.cc-consent-row { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; background: var(--brand-soft, #f4effe); border-radius: 12px; font-size: 14px; line-height: 1.45; }
.cc-consent-row-choice { flex-direction: row; align-items: flex-start; gap: 12px; cursor: pointer; }
.cc-consent-row-choice input { width: 22px; height: 22px; margin-top: 2px; flex: 0 0 22px; accent-color: var(--brand, #5b2fb8); }
.cc-consent-row-text { display: flex; flex-direction: column; gap: 2px; }
.cc-install-head { display: flex; gap: 12px; align-items: flex-start; }
.cc-install-icon { border-radius: 12px; flex: 0 0 44px; }
.cc-install-steps { margin: 12px 0 0; padding-left: 22px; line-height: 1.7; font-size: 15px; }

/* ---------- Page-change progress bar ---------- */
.cc-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--brand, #5b2fb8); opacity: 0; z-index: 3000; pointer-events: none; transition: width 8s cubic-bezier(0.1, 0.7, 0.2, 1), opacity 0.2s ease; }
.cc-progress-run { width: 85%; opacity: 1; }

/* ---------- Footer cookie link and menu install entry look like their neighbours ---------- */
.footer-cookie-btn, .overlay-install-btn { background: none; border: 0; padding: 0; margin: 0; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.footer-cookie-btn:hover { text-decoration: underline; }
.overlay-install-btn { width: 100%; }
.overlay-install-btn[hidden] { display: none; }

/* ---------- Feels like an app on a phone ---------- */
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
a, button, [role="button"], label, summary, select { touch-action: manipulation; }
.bottom-nav-item:active { background-color: var(--brand-soft, #f4effe); }
html.is-standalone body { overscroll-behavior-y: contain; }

/* Smooth cross-fade between pages (Chrome and Safari). The menus stay put while the page changes. */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: ccFadeOut 0.14s ease both; }
::view-transition-new(root) { animation: ccFadeIn 0.22s ease both; }
@keyframes ccFadeOut { to { opacity: 0; } }
@keyframes ccFadeIn { from { opacity: 0; } }
.navbar { view-transition-name: cc-nav; }
.bottom-nav { view-transition-name: cc-bottom; }
::view-transition-group(cc-nav), ::view-transition-group(cc-bottom) { animation-duration: 0s; }
@media (prefers-reduced-motion: reduce) {
  @view-transition { navigation: none; }
  .cc-sheet, .cc-progress { animation: none; transition: none; }
}
.cc-consent-row, .cc-consent-row span { font-weight: 400; }
.cc-consent-row strong { font-weight: 700; }

/* Big screens and projectors: scale the whole site up so it fills the screen the way it does on a laptop,
   instead of sitting in a narrow column. The layout itself is unchanged, everything is simply larger. */
@media (min-width: 1680px) { html { zoom: 1.15; } }
@media (min-width: 1920px) { html { zoom: 1.3; } }
@media (min-width: 2400px) { html { zoom: 1.6; } }
@media (min-width: 3200px) { html { zoom: 2; } }

/* Comfortable tap targets for the long lists of links on phones. */
@media (max-width: 767px) {
  .footer-links a, .overlay-link-sm { display: inline-block; padding: 8px 0; min-height: 36px; }
}

/* Tap targets: every footer link and the cookie-box link are at least 24px tall (WCAG 2.2 target size, audit page sweep). */
.footer-social-link, .footer-cookie-btn, .footer-copyright a, .cc-sheet-link, .footer-links a, .footer-column a {
  display: inline-flex; align-items: center; min-height: 24px;
}
.footer-copyright a { padding: 2px 0; }
