/* Autopauser: site styles
   Palette comes from the logo: navy, cyan, peach. */

:root {
  --bg: #0e1020;
  --cyan: #68bfd8;
  --peach: #f4bf80;
  --text: #e8ebf7;
  --text-soft: #cfd5ee;
  --muted: #9ba3c6;
  --panel: rgba(10, 12, 30, .55);
  --line: rgba(255, 255, 255, .1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Background: the slow blue-to-green gradient from the original site, with the waveform canvas on top */
.backdrop {
  position: fixed; inset: 0; z-index: -2;
  background: linear-gradient(45deg, #1c2760, #1d5a2f, #1c2760);
  background-size: 400% 400%;
  opacity: .75;
  animation: drift 20s ease infinite;
}
@keyframes drift { 50% { background-position: 100% 50%; } }
/* Explicit size: the canvas bitmap is in device pixels, so without this it renders dpr times too big on phones and scaled displays */
/* Lives inside the hero, so the browser scrolls it together with the logo (no JS tracking, no lag) */
#wave { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; }

/* Hero */
.hero {
  position: relative;
  min-height: 100vh; min-height: 100svh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center;
  padding: 20px;
}
.hero-logo { width: 150px; height: auto; border-radius: 34px; filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .5)); }
h1 { font-size: clamp(3rem, 9vw, 6rem); margin: 20px 0 4px; letter-spacing: -.03em; }
.tagline { font-size: 1.3rem; color: var(--text-soft); max-width: 640px; margin: 0 0 28px; }
.meta { margin: 16px 0 0; font-size: .85rem; color: var(--muted); }
.meta-tight { margin-top: 4px; }
.dl-count { white-space: nowrap; } /* "· 1,234 downloads" wraps as one piece on narrow screens */
.meta-note { font-size: .78rem; opacity: .85; }
.meta a { color: inherit; text-decoration: underline dotted; text-underline-offset: 3px; }
.meta a:hover { color: var(--text); }

.btn {
  display: inline-block; padding: 14px 30px; border-radius: 8px;
  font-weight: 600; text-decoration: none;
  color: #101225; background: var(--cyan);
  transition: background .2s, transform .2s;
}
@media (hover: hover) { .btn:hover { background: var(--peach); transform: scale(1.04); } }
.btn:active { background: var(--peach); }

/* Secondary action: outlined, so the Download button stays the main one */
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
/* The two buttons are the same size: a good bit taller than before and the same width, so the pair looks balanced and centred */
.actions .btn { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; width: 208px; padding: 17px 14px; font-size: 1rem; white-space: nowrap; }
.actions .btn-secondary { padding: 16px 14px; } /* its 1px border makes up the rest, so both are exactly as tall */
.btn-secondary {
  padding: 9px 24px;
  color: var(--text); background: transparent; border: 1px solid var(--cyan);
}
@media (hover: hover) { .btn-secondary:hover { color: #101225; } }
.btn-secondary:active { color: #101225; }

.scroll-cue {
  position: absolute; bottom: 28px;
  width: 14px; height: 14px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); opacity: .7;
  animation: nudge 2.4s ease-in-out infinite;
}
@keyframes nudge { 50% { transform: rotate(45deg) translate(5px, 5px); opacity: .3; } }

/* About */
.about { max-width: 720px; margin: 0 auto; padding: 96px 24px 24px; text-align: center; }
.about h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 16px; }
.about p { color: var(--text-soft); font-size: 1.1rem; margin: 0; }

.tile {
  padding: 22px; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  transition: border-color .25s, transform .25s;
}
@media (hover: hover) { .tile:hover { border-color: var(--peach); transform: translateY(-4px); } }
.tile h3 { margin: 0 0 6px; font-size: 1.05rem; color: var(--text); }
.tile p { margin: 0; font-size: .92rem; color: var(--muted); }

/* Settings window */
.settings {
  max-width: 900px; margin: 0 auto; padding: 20px 24px 110px;
  display: grid; grid-template-columns: 1fr minmax(0, 380px); gap: 64px; align-items: center;
}
.settings h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 12px; }
.settings p { color: var(--text-soft); font-size: 1.1rem; line-height: 1.55; margin: 0; }
.settings-shot {
  display: block; width: 100%; height: auto; border-radius: 12px 12px 0 0;   /* square at the bottom so the side lines end straight instead of curving round a corner */
  /* a stroke on the top and sides only (no bottom line at all); it is part of the element, so the mask below fades the sides out with the image */
  border: 2px solid var(--peach); border-bottom: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .45);
  /* show the top of the window only and let it fade out, instead of ending on the app's footer buttons */
  aspect-ratio: 476 / 700; object-fit: cover; object-position: top;
  -webkit-mask-image: linear-gradient(#000 72%, transparent 94%); mask-image: linear-gradient(#000 72%, transparent 94%);
}

/* Use it your way: the app, the extension, and both */
.ways { max-width: 1000px; margin: 0 auto; padding: 72px 24px 110px; text-align: center; }
.ways h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 16px; }
.ways-intro { max-width: 640px; margin: 0 auto 44px; color: var(--text-soft); font-size: 1.1rem; }
.ways-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; text-align: left; }
.ways-grid .tile { padding: 28px 26px; }
.way-label { display: block; margin-bottom: 12px; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--cyan); }
.tile-together { border-color: rgba(244, 191, 128, .45); }
.tile-together .way-label { color: var(--peach); }


/* Closing call to action */
.cta { max-width: 720px; margin: 0 auto; padding: 20px 24px 80px; text-align: center; }
.cta h2 { font-size: clamp(1.6rem, 4vw, 2.2rem); margin: 0 0 24px; }

/* Donation link: deliberately quieter than the download buttons */
.support { margin-top: 44px; }
.support::before { content: ''; display: block; width: 48px; height: 1px; margin: 0 auto 28px; background: var(--line); }
.support p { margin: 0 0 14px; font-size: .95rem; color: var(--muted); }
.btn-coffee {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px; border-radius: 999px;
  font-size: .95rem; font-weight: 600; text-decoration: none;
  color: var(--text); background: var(--panel); border: 1px solid rgba(255, 255, 255, .22);
  transition: border-color .2s, background .2s;
}
.btn-coffee svg { width: 18px; height: 18px; color: var(--peach); }
@media (hover: hover) { .btn-coffee:hover { border-color: var(--peach); background: rgba(244, 191, 128, .14); } }
.btn-coffee:active { border-color: var(--peach); }

/* Donation window (Ko-fi form, loaded only when opened) */
.coffee-dialog {
  width: min(480px, calc(100vw - 24px)); max-height: calc(100svh - 24px);
  padding: 0; border: 1px solid var(--line); border-radius: 16px;
  background: #12152b; color: var(--text); overflow: hidden;
}
.coffee-dialog::backdrop { background: rgba(5, 6, 16, .72); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.coffee-dialog[open] { display: flex; flex-direction: column; }
html:has(.coffee-dialog[open]) { overflow: hidden; }
.coffee-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.coffee-head h2 { margin: 0; font-size: 1.05rem; }
.coffee-close { font: inherit; font-size: 1.6rem; line-height: 1; color: var(--muted); background: none; border: 0; padding: 0 4px; cursor: pointer; }
.coffee-close:hover { color: var(--text); }
.coffee-body { flex: 1; min-height: 0; overflow: auto; background: #f9f9f9; padding-top: 10px; }
.coffee-body iframe { display: block; width: 100%; height: min(590px, calc(100svh - 200px)); min-height: 420px; border: 0; }
.coffee-note { margin: 0; padding: 12px 18px; font-size: .78rem; color: var(--muted); border-top: 1px solid var(--line); }
.coffee-note a { color: var(--text); }

/* Footer */
footer { text-align: center; padding: 20px 20px calc(20px + env(safe-area-inset-bottom)); font-size: .78rem; color: var(--muted); }
footer p { margin: 0; }
/* Footer links (Privacy, and Support which opens the visitor's email app addressed to us) sit on their own line above the copyright */
.footer-links { margin-bottom: 8px; }
footer a { color: var(--text); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* Privacy page */
.doc { max-width: 720px; margin: 0 auto; padding: 56px 24px 24px; }
.doc h1 { font-size: clamp(2rem, 6vw, 3rem); margin: 0 0 6px; }
.doc h2 { font-size: 1.3rem; margin: 34px 0 8px; }
.doc p, .doc li { color: var(--text-soft); line-height: 1.65; }
.doc ul { padding-left: 22px; }
.doc a { color: var(--cyan); }
.doc .updated { color: var(--muted); font-size: .9rem; margin: 0 0 24px; }
.doc .back { display: inline-block; margin-bottom: 24px; color: var(--muted); text-decoration: none; font-size: .9rem; }

/* Phones and small tablets */
@media (max-width: 600px) {
  .hero { padding: 20px 20px 56px; }
  .hero-logo { width: 110px; border-radius: 25px; }
  h1 { margin-top: 16px; }
  .tagline { font-size: 1.15rem; margin-bottom: 24px; }
  .btn { padding: 14px 26px; }
  .actions { flex-direction: column; align-items: center; }
  .actions .btn { width: 100%; max-width: 280px; }
  .about { padding-top: 56px; }
  .about p { font-size: 1.02rem; }
  .settings { grid-template-columns: 1fr; gap: 32px; padding-bottom: 72px; text-align: center; }
  .settings-shot { max-width: 320px; margin: 0 auto; }
  .ways { padding: 48px 24px 72px; }
  .ways-grid { text-align: center; gap: 18px; }
  .cta { padding-bottom: 48px; }
}
/* Landscape phones: not much height to spare */
@media (max-height: 500px) {
  .hero { padding-bottom: 48px; }
  .hero-logo { width: 90px; border-radius: 20px; }
  h1 { font-size: 2.6rem; margin: 10px 0 2px; }
  .tagline { font-size: 1rem; margin-bottom: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  .backdrop, .scroll-cue { animation: none; }
  html { scroll-behavior: auto; }
}

/* Easter egg: five clicks on the logo open a rhythm game (assets/js/game.js) */
.hero-logo { filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .5)) drop-shadow(0 0 0 rgba(104, 191, 216, 0)); -webkit-user-select: none; user-select: none; -webkit-user-drag: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.hero > :not(#wave):not(#logo) { transition: opacity .5s, transform .5s; }
#wave { transition: opacity .5s; }
body.egg-on #wave { opacity: 0; }
body.egg-on .hero > :not(#wave):not(#logo) { opacity: 0; transform: translateY(14px); pointer-events: none; }
html.egg-lock { overflow: hidden; }
.egg {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(14, 16, 32, 0);
  -webkit-backdrop-filter: blur(0); backdrop-filter: blur(0);
  transition: background .7s, backdrop-filter .7s, -webkit-backdrop-filter .7s;
  touch-action: none; -webkit-user-select: none; user-select: none;
}
.egg[hidden] { display: none; }
.egg.on { background: rgba(14, 16, 32, .94); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px); }
.egg canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Everything but the gliding logo fades in and out together with the dimmed background, so leaving is as soft as entering */
.egg > :not(.egg-logo) { opacity: 0; transition: opacity .5s; }
.egg.on > :not(.egg-logo) { opacity: 1; }
.egg-logo {
  position: absolute; border-radius: 23%; pointer-events: none;
  filter: drop-shadow(0 10px 40px rgba(0, 0, 0, .5));
  transition: left .8s cubic-bezier(.65, 0, .2, 1), top .8s cubic-bezier(.65, 0, .2, 1), width .8s cubic-bezier(.65, 0, .2, 1), height .8s cubic-bezier(.65, 0, .2, 1);
}
.egg-exit {
  position: absolute; top: 14px; left: 14px; width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel); color: var(--muted); font-size: 1rem; cursor: pointer;
}
.egg-exit:hover, .egg-exit:focus-visible { color: var(--text); border-color: var(--cyan); }
.egg-results { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; }
.egg-results[hidden] { display: none; }
.egg-card { text-align: center; padding: 28px 36px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); animation: egg-pop .5s cubic-bezier(.2, 1.4, .4, 1); }
.egg-card h2 { margin: 4px 0 12px; font-size: 1.8rem; }
.egg-grade { font-size: 5rem; font-weight: 800; line-height: 1; color: var(--peach); }
.egg-stats { margin: 4px 0; color: var(--text-soft); }
.egg-dim { color: var(--muted); font-size: .9rem; }
.egg-best { color: var(--peach); font-weight: 600; }
.egg-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 22px; }
.egg-row .btn { border: 1px solid var(--cyan); cursor: pointer; font: inherit; font-weight: 600; }
.egg-row .btn-secondary { padding: 14px 24px; }
@keyframes egg-pop { from { opacity: 0; transform: scale(.9) translateY(10px); } }
@media (prefers-reduced-motion: reduce) {
  .egg, .egg-logo, .hero > :not(#wave):not(#logo), #wave { transition-duration: .1s; }
  .egg-card { animation: none; }
}
