/* Down to Clown: downtoclown.app
   One stylesheet, no build step. Tokens mirror the app's theme (down_to_clown/src/ui/theme.ts). */

@font-face {
  font-family: 'Bricolage Grotesque';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/fonts/bricolage-grotesque-latin.woff2') format('woff2');
}

:root {
  color-scheme: light dark;

  --bg: #F5EAD6;
  --surface: #FFFAF0;
  --surface-alt: #EADCC0;
  --text: #1A1411;
  --text-soft: #5C4E44;
  --hairline: rgba(26, 20, 17, 0.12);
  --down: #C63D32;
  --on-down: #FFF6E6;
  --down-edge: #1A1411;
  --accent: #3F5F5C;
  --accent-soft: rgba(81, 112, 109, 0.14);
  --mustard: #AD9F5D;
  --mustard-text: #735E12;
  --focus: #3F5F5C;

  --display: 'Bricolage Grotesque', ui-sans-serif, system-ui, sans-serif;
  --body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --edge: 6px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16110F;
    --surface: #221B17;
    --surface-alt: #2E2520;
    --text: #F5EAD6;
    --text-soft: #C4B6A2;
    --hairline: rgba(245, 234, 214, 0.12);
    --down-edge: #D9C47A;
    --accent: #8FB5B0;
    --accent-soft: rgba(143, 181, 176, 0.16);
    --mustard: #E8C866;
    --mustard-text: #E8C866;
    --focus: #8FB5B0;
  }
}

/* ---------- Base ---------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 1.0625rem/1.55 var(--body);
  overflow-wrap: break-word;
}

img, svg { display: block; max-width: 100%; height: auto; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.025em;
  margin: 0 0 0.5em;
  text-wrap: balance;
}
h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); letter-spacing: -0.035em; }
h2 { font-size: clamp(1.9rem, 4.5vw, 2.9rem); }
h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }

p { margin: 0 0 1em; }
p, li { text-wrap: pretty; }

a { color: var(--accent); text-decoration-thickness: 2px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--down); }

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

strong { font-weight: 650; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.prose { max-width: 68ch; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -100px; z-index: 10;
  background: var(--surface); color: var(--text); padding: 10px 16px;
  border: 2px solid var(--text); border-radius: var(--radius-sm);
  font: 600 1rem var(--display);
}
.skip-link:focus { top: 12px; }

.eyebrow {
  display: inline-block;
  font: 600 0.8125rem/1.2 var(--display);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mustard-text);
  margin: 0 0 0.9rem;
}

.lead { font-size: clamp(1.125rem, 2.2vw, 1.3rem); color: var(--text-soft); max-width: 36ch; }
.soft { color: var(--text-soft); }

/* ---------- The "I'm Down" keycap ---------- */

.key {
  --travel: 0px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 28px;
  margin-bottom: var(--edge);         /* room for the edge below */
  border: 2px solid var(--down-edge);
  border-radius: var(--radius-lg);
  background: var(--down);
  color: var(--on-down);
  font: 700 1.375rem/1 var(--display);
  letter-spacing: -0.01em;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 calc(var(--edge) - var(--travel)) 0 0 var(--down-edge);
  transform: translateY(var(--travel));
  transition: transform 90ms cubic-bezier(.3, .7, .4, 1), box-shadow 90ms cubic-bezier(.3, .7, .4, 1);
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}
.key:hover { color: var(--on-down); --travel: 1px; }
.key:active { --travel: var(--edge); transition-duration: 40ms; }
.key:focus-visible { outline-offset: calc(var(--edge) + 3px); border-radius: var(--radius-lg); }
.key svg { width: 24px; height: 24px; flex: none; }
.key--small { min-height: 44px; padding: 0 18px; font-size: 1.0625rem; border-radius: var(--radius-md); --edge: 4px; }

@media (prefers-reduced-motion: reduce) {
  .key { transition: none; }
}

/* ---------- Header ---------- */

.site-header { border-bottom: 1px solid var(--hairline); }
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap;
  gap: 12px 24px; padding-block: 14px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none;
  font: 800 1.3rem/1 var(--display); letter-spacing: -0.02em;
}
.brand img { width: 44px; height: auto; }
.site-nav ul { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 22px; margin: 0; padding: 0; list-style: none; }
.site-nav a:not(.key) {
  color: var(--text); text-decoration: none;
  font: 600 1rem/1 var(--display);
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}
.site-nav a:not(.key):hover, .site-nav a[aria-current="page"] { border-bottom-color: var(--down); }
.site-nav .key { margin-left: 4px; }

@media (max-width: 520px) {
  .site-nav .key { display: none; }  /* the hero keycap is right there on phones */
}

/* ---------- Sections ---------- */

.section { padding-block: clamp(56px, 9vw, 104px); }
.section--alt { background: var(--surface-alt); }
.section-head { max-width: 40rem; margin-bottom: clamp(28px, 5vw, 48px); }
.section-head p:not(.eyebrow) { color: var(--text-soft); font-size: 1.125rem; }

/* The ruffle: a mustard / teal stripe, borrowed from the clown's collar. */
.ruffle {
  height: 10px; border: 0; margin: 0;
  background: repeating-linear-gradient(90deg, var(--mustard) 0 28px, var(--accent) 28px 56px);
  opacity: 0.85;
}

/* ---------- Hero ---------- */

.hero { padding-block: clamp(40px, 7vw, 88px) clamp(56px, 8vw, 96px); overflow: hidden; }
.hero .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
@media (min-width: 860px) { .hero .wrap { grid-template-columns: 1.1fr 0.9fr; } }

.hero h1 { margin-bottom: 0.35em; font-size: clamp(2.4rem, 5.4vw, 3.85rem); }
.hero h1 .hl { color: var(--down); display: block; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 24px; margin-top: 28px; }
.hero-actions a:not(.key) { font: 600 1.0625rem var(--display); }
.hero-note { margin-top: 18px; font-size: 0.9375rem; color: var(--text-soft); }

.hero-art { position: relative; justify-self: center; width: min(100%, 460px); }
.hero-art::before {           /* a paper disc behind the clown */
  content: ''; position: absolute; inset: 8% 6% 4% 6%;
  border-radius: 50%;
  background: radial-gradient(circle, var(--surface-alt) 1.5px, transparent 1.6px) 0 0 / 14px 14px;
  opacity: 0.9;
}
.hero-art img { position: relative; width: 100%; }
@media (max-width: 859px) { .hero-art { order: -1; width: min(72%, 320px); } }

/* ---------- Steps ---------- */

.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px; counter-reset: step; }
@media (min-width: 640px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .steps { grid-template-columns: repeat(4, 1fr); } }
.steps li {
  counter-increment: step;
  position: relative;
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius-md);
  padding: 22px 22px 20px;
}
.steps li::before {
  content: counter(step);
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-bottom: 14px;
  border: 2px solid var(--text); border-radius: 50%;
  font: 800 1.125rem/1 var(--display);
  background: var(--bg);
}
.steps li:last-child { background: var(--down); color: var(--on-down); border-color: var(--down-edge); box-shadow: 0 var(--edge) 0 var(--down-edge); }
.steps li:last-child::before { background: var(--on-down); color: var(--down); border-color: var(--down-edge); }
.steps li:last-child p { color: var(--on-down); }
.steps h3 { margin-bottom: 6px; }
.steps p { margin: 0; color: var(--text-soft); }

/* ---------- Flyer to event demo ---------- */

.demo { display: grid; grid-template-columns: minmax(0, 1fr); gap: 28px; align-items: center; }
@media (min-width: 860px) { .demo { grid-template-columns: 1fr auto 1fr; gap: 36px; } }
.demo-arrow { justify-self: center; color: var(--down); width: 56px; }
@media (max-width: 859px) { .demo-arrow { transform: rotate(90deg); width: 44px; } }

.flyer {
  justify-self: center;
  width: min(88%, 340px);
  aspect-ratio: 3 / 4;
  display: flex; flex-direction: column; justify-content: center; gap: 10px;
  padding: 28px 24px;
  background: #1F3B39;
  color: #F5EAD6;
  border: 6px solid #E8C866;
  border-radius: 6px;
  text-align: center;
  transform: rotate(-2.5deg);
  box-shadow: 10px 12px 0 rgba(26, 20, 17, 0.18);
  font-family: Georgia, 'Times New Roman', serif;
}
.flyer-kicker { font: italic 400 0.95rem/1.2 Georgia, serif; color: #E8C866; }
.flyer-title { font: 800 2.35rem/0.95 var(--display); letter-spacing: -0.02em; text-transform: uppercase; }
.flyer-date { font: 700 1.1rem/1.2 var(--display); letter-spacing: 0.04em; text-transform: uppercase; margin-top: 6px; }
.flyer-place { font-size: 0.95rem; line-height: 1.35; color: #E6D8BE; }
.flyer-foot { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 8px; font: 600 0.85rem/1.2 var(--body); }
.flyer-qr {
  width: 42px; height: 42px; flex: none; border-radius: 3px;
  background:
    linear-gradient(90deg, #F5EAD6 0 30%, transparent 30% 40%, #F5EAD6 40% 50%, transparent 50% 70%, #F5EAD6 70%) 0 0 / 100% 33%,
    linear-gradient(0deg, #F5EAD6 0 20%, transparent 20% 45%, #F5EAD6 45% 60%, transparent 60%) 0 0 / 33% 100%;
  outline: 4px solid #F5EAD6; outline-offset: -4px;
  background-color: #1F3B39;
}

.event-card {
  justify-self: center;
  width: min(100%, 380px);
  background: var(--surface);
  border: 2px solid var(--text);
  border-radius: var(--radius-lg);
  padding: 22px;
}
.event-card h3 { font-size: 1.5rem; margin-bottom: 14px; }
.event-card dl { margin: 0 0 20px; display: grid; gap: 10px; }
.event-card dl div { display: grid; grid-template-columns: 5.5rem 1fr; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--hairline); }
.event-card dt { font: 600 0.8125rem/1.5 var(--display); letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-soft); }
.event-card dd { margin: 0; font-weight: 500; }
.event-card .key { width: 100%; pointer-events: none; }
.demo-caption { text-align: center; color: var(--text-soft); font-size: 0.9375rem; margin-top: 28px; }

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

.features { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
@media (min-width: 640px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .features { grid-template-columns: repeat(3, 1fr); } }
.features li {
  background: var(--surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  padding: 22px;
}
.features h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.features h3 img { width: 30px; flex: none; }
.features p { margin: 0; color: var(--text-soft); }

/* ---------- Privacy pitch ---------- */

.privacy-pitch .wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (min-width: 860px) { .privacy-pitch .wrap { grid-template-columns: 1fr 1fr; } }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.checks li {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 2px solid var(--text); border-radius: var(--radius-md);
  padding: 14px 18px;
}
.checks svg { width: 24px; height: 24px; flex: none; margin-top: 1px; color: var(--accent); }
.checks strong { display: block; font: 700 1.0625rem/1.3 var(--display); }
.checks span { color: var(--text-soft); font-size: 0.975rem; }

/* ---------- Screenshots (real captures from the Android emulator) ---------- */

.shots { list-style: none; margin: 0; padding: 0; display: grid; gap: 20px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 640px) { .shots { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .shots { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.shot { margin: 0; }
.shot img {
  width: 100%; height: auto; aspect-ratio: 9 / 20;
  border: 3px solid var(--text);
  border-radius: 26px;
  background: var(--surface);
}
.shot figcaption { padding: 12px 4px 0; }
.shot strong { display: block; font: 700 1rem/1.25 var(--display); }
.shot span { display: block; font-size: 0.875rem; color: var(--text-soft); margin-top: 2px; }

/* ---------- Download ---------- */


.badges { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; padding: 0; list-style: none; }
.badge {
  display: inline-flex; align-items: center; gap: 12px;
  min-height: 56px; padding: 8px 18px 8px 14px;
  border-radius: 12px;
  background: var(--text); color: var(--bg);
  text-decoration: none;
}
.badge svg { width: 26px; height: 26px; flex: none; }
.badge small { display: block; font: 600 0.6875rem/1.2 var(--display); letter-spacing: 0.06em; text-transform: uppercase; opacity: 0.8; }
.badge b { display: block; font: 700 1.1875rem/1.1 var(--display); letter-spacing: -0.01em; }
.badge--soon {
  background: transparent; color: var(--text-soft);
  border: 2px dashed var(--text-soft);
}
a.badge:hover { color: var(--bg); outline: 2px solid var(--down); outline-offset: 2px; }

/* ---------- Plain pages (privacy, support) ---------- */

.page-head { padding-block: clamp(40px, 7vw, 80px) clamp(24px, 4vw, 40px); }
.page-head h1 { font-size: clamp(2.4rem, 6vw, 3.75rem); }
.page-head p:not(.eyebrow) { color: var(--text-soft); font-size: 1.125rem; max-width: 42rem; }
.page-body { padding-bottom: clamp(56px, 9vw, 104px); }

.doc h2 { font-size: clamp(1.5rem, 3.2vw, 2rem); margin-top: 2.2em; }
.doc h3 { margin-top: 1.8em; }
.doc ul { padding-left: 1.25em; }
.doc li { margin-bottom: 0.4em; }
.doc li::marker { color: var(--down); }
.doc .summary {
  background: var(--surface); border: 2px solid var(--text); border-radius: var(--radius-md);
  padding: 20px 24px; margin-bottom: 1.5em;
}
.doc .summary p:last-child, .doc .summary ul:last-child { margin-bottom: 0; }

.toc { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 8px; padding: 0; list-style: none; }
.toc a {
  display: inline-block; padding: 8px 14px; border-radius: 99px;
  border: 1.5px solid var(--text); color: var(--text); text-decoration: none;
  font: 600 0.9375rem/1 var(--display);
}
.toc a:hover { background: var(--surface); }

.contact-card {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  background: var(--surface); border: 2px solid var(--text); border-radius: var(--radius-lg);
  padding: 24px clamp(20px, 4vw, 32px);
}
.contact-card h2 { font-size: 1.6rem; margin-bottom: 0.2em; }
.contact-card p { margin: 0; color: var(--text-soft); }

.faq { margin-top: 48px; }
.faq details {
  background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--radius-md);
  margin-bottom: 12px;
}
.faq summary {
  cursor: pointer; list-style: none;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 18px 22px;
  font: 700 1.125rem/1.3 var(--display);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ''; flex: none; width: 12px; height: 12px;
  border-right: 3px solid var(--down); border-bottom: 3px solid var(--down);
  transform: rotate(45deg) translateY(-3px);
  transition: transform 150ms;
}
.faq details[open] summary::after { transform: rotate(225deg) translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .faq summary::after { transition: none; } }
.faq .answer { padding: 0 22px 18px; color: var(--text-soft); }
.faq .answer p:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */

.site-footer { background: var(--surface-alt); padding-block: 40px 48px; font-size: 0.9375rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer .brand { font-size: 1.1rem; }
.site-footer .brand img { width: 34px; }
.site-footer p { margin: 6px 0 0; color: var(--text-soft); }
.site-footer ul { display: flex; flex-wrap: wrap; gap: 8px 22px; margin: 0; padding: 0; list-style: none; }
.site-footer a:not(.brand) { color: var(--text); font-weight: 500; }
.legal-contact { font-style: normal; margin-top: 1em; line-height: 1.6; }
.legal-block { margin-top: 28px; }
.legal-block p { margin-bottom: 0; }
.faq .answer ul { padding-left: 1.25em; }
