/* Jollyjack site styles.
   Colours follow the app's design tokens (Jollyjack/DesignSystem/Chunky/DesignSystem.swift: DS.*).
   The app is dark only; the light theme below is the same palette on a warm white page.
   Font: Nunito (SIL Open Font License 1.1, see assets/fonts/OFL.txt), served from this site. */

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Nunito";
  src: url("fonts/Nunito-Black.ttf") format("truetype");
  font-weight: 900;
  font-style: normal;
  font-display: swap;
}

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

/* Light theme (default) */
:root {
  color-scheme: light dark;
  --font: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1080px;
  --gutter: 24px;
  --radius: 16px;

  --bg: #f7f6f1;
  --surface: #ffffff;
  --surface-2: #f0efe8;
  --stroke: #dedcd3;
  --text: #0b0b0c;
  --text-2: #45444b;
  --text-3: #616067;
  --accent: #edc92c;          /* DS.accent */
  --accent-lip: #c99a00;      /* DS.accentLip */
  --on-accent: #0b0b0c;       /* DS.onAccent */
  --accent-soft: #fbf0c2;
  --accent-edge: #e6cf72;
  --link: #745700;
  --focus: #745700;
  --success: #17a85b;         /* DS.successLip */
  --danger: #c0263d;
  --jolly-red: #e0252e;       /* DS.jollyRed */
  --header-bg: rgba(247, 246, 241, 0.88);
  --stage: #fbf0c2;
  --hl-color: var(--text);
  --hl-bg: linear-gradient(transparent 62%, #f3d75a 62%, #f3d75a 92%, transparent 92%);
}

/* Dark theme: the app's own palette */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000000;            /* DS.bgCanvas */
    --surface: #1a191e;       /* DS.surface1 */
    --surface-2: #242328;     /* DS.surface2 */
    --stroke: #3a393f;        /* DS.stroke */
    --text: #ffffff;          /* DS.textPrimary */
    --text-2: #ababad;        /* DS.textSecondary */
    --text-3: #7c7b82;        /* DS.textTertiary */
    --accent-soft: #2a2618;   /* DS.selectedFill */
    --accent-edge: #5c4f17;
    --link: #edc92c;
    --focus: #edc92c;
    --success: #30d076;       /* DS.success */
    --danger: #ff5a6e;        /* DS.dangerText */
    --header-bg: rgba(0, 0, 0, 0.84);
    --stage: #1a191e;
    --hl-color: #edc92c;
    --hl-bg: none;
  }
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font: 600 17px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-wrap: break-word;
}

img { display: block; max-width: 100%; height: auto; }
p { margin: 0; }

a { color: inherit; }

h1, h2, h3 {
  margin: 0;
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

h1 { font-weight: 900; }
h2, h3 { font-weight: 800; }
strong, b { font-weight: 800; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.skip-link {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
  text-decoration: none;
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

/* Header */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 2px solid var(--stroke);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "brand nav";
  align-items: center;
  gap: 12px 28px;
  min-height: 68px;
}

.brand {
  grid-area: brand;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 900;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 36px;
  height: 36px;
  border-radius: 9px;
}

.nav {
  grid-area: nav;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px 24px;
  font-size: 16px;
  font-weight: 800;
}

.nav a {
  color: var(--text-2);
  text-decoration: none;
  padding: 6px 0;
  border-bottom: 3px solid transparent;
}

.nav a:hover { color: var(--text); }

.nav a[aria-current="page"] {
  color: var(--text);
  border-bottom-color: var(--accent);
}

/* Buttons and pills */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 22px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 4px 0 var(--accent-lip);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.04); }
.btn:active { transform: translateY(4px); box-shadow: none; }

.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--stroke);
  box-shadow: 0 2px 0 var(--stroke);
}

.btn-secondary:hover { background: var(--surface-2); filter: none; }
.btn-secondary:active { transform: translateY(2px); box-shadow: none; }

.pill-soon {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 10px 20px;
  border: 2px solid var(--stroke);
  border-bottom-width: 4px;
  border-radius: 14px;
  background: var(--surface);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Cards (the app's bordered tile: 2 pt border, 4 pt lip) */

.card {
  padding: 24px;
  border: 2px solid var(--stroke);
  border-bottom-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
}

/* Landing */

.hero { padding: 56px 0 32px; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 40px;
}

.hero h1 { font-size: clamp(36px, 5.4vw, 60px); }

.hl {
  color: var(--hl-color);
  background: var(--hl-bg);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

.lead {
  max-width: 560px;
  margin-top: 20px;
  color: var(--text-2);
  font-size: clamp(18px, 1.7vw, 20px);
  line-height: 1.55;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 32px;
}

.hero-meta {
  margin-top: 20px;
  color: var(--text-3);
  font-size: 15px;
}

.hero-visual {
  position: relative;
  justify-self: center;
  width: 100%;
  max-width: 380px;
}

.stage {
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--stage);
  border: 2px solid var(--stroke);
  border-bottom-width: 6px;
}

.stage img {
  width: 100%;
  transform: translateY(-4%);
}

.bubble {
  position: absolute;
  top: 2%;
  left: -6%;
  max-width: 62%;
  padding: 10px 14px;
  border: 2px solid var(--stroke);
  border-bottom-width: 4px;
  border-radius: 16px 16px 16px 4px;
  background: var(--surface);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
}

.section { padding: 56px 0; }

.section-head {
  max-width: 680px;
  margin-bottom: 32px;
}

.section-head h2 { font-size: clamp(28px, 3.6vw, 40px); }

.section-head p {
  margin-top: 12px;
  color: var(--text-2);
  font-size: 18px;
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.feature h3 {
  margin: 16px 0 8px;
  font-size: 22px;
}

.feature p { color: var(--text-2); }

.feature-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 3px 0 var(--accent-lip);
}

.feature-icon svg { width: 26px; height: 26px; }

.tab-name {
  color: var(--text-3);
  font-size: 15px;
  font-weight: 800;
}

.notice {
  padding: 24px;
  border: 2px solid var(--accent-edge);
  border-bottom-width: 4px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

.notice h2 {
  font-size: 22px;
  margin-bottom: 12px;
}

.notice ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.notice li {
  position: relative;
  padding-left: 30px;
}

.notice li::before {
  content: "";
  position: absolute;
  top: 0.32em;
  left: 0;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2.6 6.3l2.2 2.2 4.6-4.9' fill='none' stroke='%230b0b0c' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat;
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.link-card {
  display: block;
  color: var(--text);
  text-decoration: none;
}

.link-card:hover { background: var(--surface-2); }

.link-card h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 20px;
}

.link-card h3::after {
  content: "›";
  color: var(--text-3);
  font-size: 26px;
  line-height: 1;
}

.link-card p {
  margin-top: 6px;
  color: var(--text-2);
  font-size: 16px;
}

/* Inner pages */

.page { padding: 48px 0 80px; }

.page-hero { margin-bottom: 32px; }
.page-hero h1 { font-size: clamp(34px, 5vw, 52px); }

.page-hero .meta {
  margin-top: 12px;
  color: var(--text-3);
  font-size: 16px;
}

.page-hero .lead { margin-top: 14px; }

.prose { max-width: 760px; }
.prose > :first-child { margin-top: 0; }

.prose h2 {
  margin: 44px 0 12px;
  font-size: 24px;
}

.prose h3 {
  margin: 28px 0 8px;
  font-size: 19px;
}

.prose p,
.prose li {
  color: var(--text-2);
  font-size: 16.5px;
  line-height: 1.75;
}

.prose p + p { margin-top: 12px; }

.prose ul {
  margin: 12px 0;
  padding-left: 22px;
}

.prose li { margin: 6px 0; }
.prose strong { color: var(--text); }

.prose a,
.help-card a,
.notice a,
.not-found a,
.footer-note a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.prose .box {
  margin: 28px 0;
  padding: 20px 24px;
  border: 2px solid var(--stroke);
  border-bottom-width: 4px;
  border-radius: var(--radius);
  background: var(--surface);
}

.prose .box > :first-child { margin-top: 0; }
.prose .box ul { margin-bottom: 0; }

.prose .box.notice-box {
  border-color: var(--accent-edge);
  background: var(--accent-soft);
}

.path {
  color: var(--text);
  font-weight: 800;
  white-space: normal;
}

/* Support */

.contact-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: var(--accent-edge);
  background: var(--accent-soft);
}

.contact-card h2 { font-size: 24px; }

.contact-card p {
  margin-top: 6px;
  color: var(--text-2);
}

/* The address is one unbreakable word: let it wrap instead of pushing the page sideways at 320 px. */
.contact-card .btn {
  max-width: 100%;
  min-width: 0;
  overflow-wrap: anywhere;
}

.help-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.help-card h2 {
  margin-bottom: 10px;
  font-size: 20px;
}

.help-card p,
.help-card li {
  color: var(--text-2);
  font-size: 16px;
}

.help-card p + p { margin-top: 10px; }

.help-card ul {
  margin: 10px 0 0;
  padding-left: 20px;
}

.help-card li + li { margin-top: 6px; }

.help-more {
  margin-top: 32px;
  color: var(--text-2);
}

.help-more a {
  color: var(--text);
  font-weight: 800;
}

/* Footer */

.site-footer {
  padding: 48px 0 40px;
  border-top: 2px solid var(--stroke);
  color: var(--text-2);
  font-size: 15px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(2, minmax(0, 1fr));
  gap: 28px;
}

.footer-brand p { margin-top: 12px; max-width: 320px; }

.footer-title {
  margin-bottom: 12px;
  color: var(--text);
  font-weight: 800;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { color: var(--text); text-decoration: underline; }

.footer-note {
  display: grid;
  gap: 6px;
  margin-top: 40px;
  padding-top: 20px;
  border-top: 2px solid var(--stroke);
  color: var(--text-3);
  font-size: 13.5px;
}

/* 404 */

.not-found {
  display: grid;
  justify-items: center;
  gap: 16px;
  padding: 64px 0 96px;
  text-align: center;
}

.not-found img { width: 200px; }
.not-found h1 { font-size: clamp(32px, 5vw, 48px); }
.not-found p { color: var(--text-2); max-width: 520px; }

/* Responsive */

@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: 28px; }
  .hero-visual { max-width: 300px; order: -1; }
  .link-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  :root { --gutter: 16px; }
  body { font-size: 16px; }

  .site-header { position: static; }

  .header-inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav";
    padding-top: 12px;
    padding-bottom: 8px;
  }

  .nav { justify-content: flex-start; gap: 4px 20px; }

  .hero { padding-top: 28px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-visual { max-width: 240px; }
  .bubble { left: -14%; font-size: 14px; }

  .section { padding: 40px 0; }
  .feature-grid,
  .help-grid { grid-template-columns: 1fr; }

  .card,
  .notice { padding: 20px 18px; }
  .contact-card .btn { width: 100%; padding: 10px 16px; }

  .page { padding: 32px 0 64px; }
  .prose h2 { margin-top: 36px; font-size: 22px; }
  .prose .box { padding: 18px; }

  .footer-grid { grid-template-columns: 1fr; gap: 24px; }
}

@media (max-width: 360px) {
  .brand { font-size: 19px; gap: 8px; }
  .brand img { width: 32px; height: 32px; }
  .bubble { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .btn:active,
  .btn-secondary:active { transform: none; }
}

@media print {
  :root { color-scheme: light; }
  body { background: #fff; color: #000; }
  .site-header { position: static; backdrop-filter: none; background: #fff; }
  .nav, .skip-link, .site-footer .footer-grid { display: none; }
  .prose p, .prose li, .help-card p { color: #000; }
  .card, .prose .box, .notice { border-color: #999; background: #fff; }
}
