/* CrappleBlox site. Colours come from the app's own themes (Appearance.swift);
   site.js swaps them when a theme is picked. Default is "Dark" (orchard). */
:root {
  --base: rgb(17 13 11);
  --text: rgb(250 242 232);
  --accent: rgb(232 48 74);
  --accent-soft: rgb(179 20 51);
  --leaf: rgb(61 196 107);
  --bark: rgb(122 82 56);
  --on-accent: #fff;

  --surface: color-mix(in srgb, var(--text) 5%, var(--base));
  --surface-2: color-mix(in srgb, var(--text) 9%, var(--base));
  --line: color-mix(in srgb, var(--text) 12%, transparent);
  --muted: color-mix(in srgb, var(--text) 64%, var(--base));
  --faint: color-mix(in srgb, var(--text) 45%, var(--base));

  --round: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --wide: 1120px;
  --radius: 14px;
  color-scheme: dark;
}
:root.is-light { color-scheme: light; }

* { box-sizing: border-box; }
html { scroll-padding-top: 80px; }  /* links scroll smoothly through site.js */
body {
  margin: 0;
  background: var(--base);
  color: var(--text);
  font: 17px/1.6 var(--body);
  -webkit-font-smoothing: antialiased;
  transition: background-color .35s, color .35s;
}
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--round); line-height: 1.12; margin: 0; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); font-weight: 800; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.5rem); font-weight: 750; }
h3 { font-size: 1.12rem; font-weight: 700; }
p { margin: 0 0 1em; }
strong { font-weight: 650; }

.eyebrow {
  font: 600 .78rem/1 var(--round);
  text-transform: uppercase; letter-spacing: .14em;
  color: var(--accent); margin-bottom: 14px;
}
.fine { font-size: .88rem; color: var(--faint); }

/* ── Buttons ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  background: var(--accent); color: var(--on-accent);
  font: 650 1rem/1 var(--round); text-decoration: none;
  border: 1px solid transparent; cursor: pointer;
  transition: transform .15s, background-color .2s, border-color .2s;
}
.btn:hover { background: var(--accent-soft); }
.btn:active { transform: scale(.97); }
.btn:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px;
}
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-small { padding: 9px 16px; font-size: .92rem; }
.btn[aria-disabled="true"] { opacity: .55; cursor: not-allowed; }

/* ── Preview bar ── */
.preview-bar {
  background: repeating-linear-gradient(-45deg, var(--accent) 0 12px, var(--accent-soft) 12px 24px);
  color: var(--on-accent); text-align: center;
  font: 600 .82rem/1.3 var(--round); padding: 7px 16px;
}

/* ── Nav ── */
.nav {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 24px;
  padding: 12px max(16px, calc((100% - var(--wide)) / 2));
  background: color-mix(in srgb, var(--base) 82%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 800 1.08rem/1 var(--round); }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .94rem; }
.nav-links a:hover { color: var(--text); }
@media (max-width: 760px) {
  .nav-links { display: none; }
  .nav .btn { margin-left: auto; }
}

/* ── Layout ── */
.hero, .section, .footer { width: min(var(--wide), 100% - 32px); margin-inline: auto; }
.section { padding: 96px 0 0; }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head p:not(.eyebrow) { color: var(--muted); }
.section-head h2 { margin-bottom: 16px; }

/* ── Hero ── */
.hero {
  display: grid; grid-template-columns: 1.25fr 1fr; align-items: center; gap: 40px;
  padding: 72px 0 24px;
}
.hero h1 { margin-bottom: 22px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 34em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 30px 0 16px; }
.hero-apple { display: grid; justify-items: center; gap: 10px; position: relative; }
.hero-apple::before {
  content: ""; position: absolute; inset: 8% 12% 18%; border-radius: 50%;
  /* A halo around the apple only: nothing glows through the hole in the middle. */
  background: radial-gradient(circle, transparent 34%, color-mix(in srgb, var(--accent) 30%, transparent) 52%, transparent 72%);
  filter: blur(10px); z-index: -1;
}
.apple {
  background: none; border: 0; padding: 0; cursor: pointer; border-radius: 50%;
  width: min(300px, 70vw); aspect-ratio: 1;
  transition: transform .18s cubic-bezier(.3,1.6,.6,1);
}
.apple img { width: 100%; height: 100%; user-select: none; -webkit-user-drag: none; }
.apple:hover { transform: scale(1.02); }
.apple.bite { animation: bite .22s ease-out; }
.apple.refill { animation: refill .62s cubic-bezier(.2,.8,.3,1); }
.apple.clack { animation: clack .16s ease-out; }
@keyframes bite { 40% { transform: scale(.93) rotate(3deg); } }
/* Spins in with the swoosh, then settles. */
@keyframes refill { from { transform: rotate(-540deg) scale(.5); opacity: .4; } to { transform: rotate(0) scale(1); opacity: 1; } }
/* The final click: a quick press down and back. */
@keyframes clack { 40% { transform: scale(.94); } }
/* Reduce motion: no spinning or bouncing, just a soft fade on refill. */
@keyframes refill-calm { from { opacity: .4; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .apple, .apple.bite, .apple.clack { animation: none; transition: none; }
  .apple.refill { animation: refill-calm .4s ease-out; transition: none; }
}
.apple-hint { font: 500 .85rem/1 var(--round); color: var(--faint); margin: 0; }

@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; padding-top: 40px; text-align: left; }
  .hero-apple { order: -1; }
  .apple { width: min(190px, 52vw); }
}

/* ── Screenshots ── */
.shot { margin: 0; }
.shot img, .shot .shot-missing {
  width: 100%; height: auto; border-radius: var(--radius);
  border: 1px solid var(--line);
  box-shadow: 0 30px 60px -30px rgb(0 0 0 / .6);
  background: var(--surface);
}
.shot-missing {
  aspect-ratio: 16 / 10; display: grid; place-content: center; gap: 6px; text-align: center;
  color: var(--faint); font: 500 .9rem/1.4 var(--round); padding: 20px;
  background:
    repeating-linear-gradient(45deg, transparent 0 14px, color-mix(in srgb, var(--text) 3%, transparent) 14px 28px),
    var(--surface) !important;
}
.shot-missing code { color: var(--muted); font-size: .85rem; }
.shot-wide .shot-missing { aspect-ratio: 21 / 9; }
.shot figcaption { font-size: .88rem; color: var(--faint); margin-top: 12px; }

/* ── Feature list ── */
.features {
  list-style: none; counter-reset: f; padding: 0; margin: 56px 0 0;
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 48px;
}
.features li {
  counter-increment: f; position: relative;
  padding: 20px 0 18px 40px; border-top: 1px solid var(--line);
}
.features li::before {
  content: counter(f);
  position: absolute; left: 0; top: 23px;
  font: 700 .82rem/1 var(--round); color: var(--accent);
}
.features h3 { margin-bottom: 8px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.features p { color: var(--muted); margin: 0; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

.tag, .status {
  display: inline-block; font: 650 .7rem/1 var(--round); letter-spacing: .04em;
  padding: 5px 8px; border-radius: 999px;
  color: var(--leaf); background: color-mix(in srgb, var(--leaf) 14%, transparent);
}

/* ── Splits ── */
.split { display: grid; grid-template-columns: 1fr 1.2fr; gap: 56px; align-items: center; }
.split > div p:not(.eyebrow) { color: var(--muted); }
.split h2 { margin-bottom: 18px; }
.split-flip { grid-template-columns: 1.2fr 1fr; }
@media (max-width: 860px) { .split, .split-flip { grid-template-columns: 1fr; gap: 32px; } }

.list { list-style: none; padding: 0; margin: 0; }
.list li { padding: 16px 0; border-bottom: 1px solid var(--line); color: var(--muted); }
.list li:first-child { padding-top: 0; }
.list strong { color: var(--text); }

/* ── Themes ── */
.themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.theme {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px 10px 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  color: var(--text); font: 600 .95rem/1 var(--round); cursor: pointer; text-align: left;
  transition: border-color .2s, transform .15s;
}
.theme img { width: 36px; height: 36px; border-radius: 9px; }
.theme:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.theme[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#theme-blurb { margin-top: 16px; min-height: 1.4em; }

/* ── Download ── */
.tabs {
  display: flex; gap: 4px; padding: 4px; width: fit-content; max-width: 100%;
  overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
}
.tabs button {
  border: 0; background: none; color: var(--muted); cursor: pointer; white-space: nowrap;
  font: 600 .92rem/1 var(--round); padding: 10px 16px; border-radius: 999px;
}
.tabs button[aria-selected="true"] { background: var(--surface-2); color: var(--text); }
.detected { font-size: .9rem; color: var(--muted); margin: 14px 0 0; }
.tab-panel { margin-top: 28px; }

.downloads { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 14px; }
@media (max-width: 860px) { .downloads { grid-template-columns: 1fr; } }
.dl {
  display: flex; flex-direction: column; gap: 10px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.dl.is-main { border-color: color-mix(in srgb, var(--accent) 55%, transparent); background: color-mix(in srgb, var(--accent) 7%, var(--surface)); }
.dl h3 { font-size: 1.25rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dl .fits { color: var(--muted); margin: 0; flex: 1; }
.dl .tech { font: 500 .8rem/1.3 ui-monospace, Menlo, monospace; color: var(--faint); margin: 0; }
.dl .btn { margin-top: 6px; }
.dl .sha { font: .72rem/1.4 ui-monospace, Menlo, monospace; color: var(--faint); word-break: break-all; margin: 0; }

.which {
  margin-top: 28px; padding: 26px; border-radius: var(--radius);
  border: 1px dashed color-mix(in srgb, var(--text) 20%, transparent);
}
.which h3 { margin-bottom: 10px; }
.which > p { color: var(--muted); }
.which-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 18px 0; }
.which-grid > div { background: var(--surface); border-radius: 12px; padding: 18px; }
.which-grid p { color: var(--muted); margin: 0; }
.which-grid .which-label { color: var(--text); margin-bottom: 8px; font-family: var(--round); }
@media (max-width: 680px) { .which-grid { grid-template-columns: 1fr; } }

.steps { counter-reset: s; list-style: none; padding: 0; margin: 28px 0 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.steps li { counter-increment: s; color: var(--muted); padding-top: 14px; border-top: 2px solid var(--line); }
.steps li::before { content: "Step " counter(s); display: block; font: 700 .78rem/1 var(--round); color: var(--accent); margin-bottom: 10px; text-transform: uppercase; letter-spacing: .1em; }
.steps strong { color: var(--text); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

.soon { padding: 36px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); max-width: 640px; }
.soon .status { color: var(--faint); background: var(--surface-2); margin-bottom: 14px; }
.soon h3 { font-size: 1.4rem; margin-bottom: 10px; }
.soon p { color: var(--muted); }

/* ── FAQ ── */
.faq { max-width: 780px; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  cursor: pointer; list-style: none; padding: 20px 36px 20px 0; position: relative;
  font: 650 1.05rem/1.35 var(--round);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  font-size: 1.4rem; color: var(--accent); transition: transform .2s;
}
.faq details[open] summary::after { transform: translateY(-50%) rotate(45deg); }
.faq details p { color: var(--muted); padding-right: 36px; }

/* ── Support ── */
.support {
  display: grid; grid-template-columns: auto 1fr; gap: 36px; align-items: start;
  margin-top: 96px; padding: 48px; border-radius: 22px;
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--line);
}
.support h2 { margin-bottom: 14px; }
.support p:not(.eyebrow):not(.fine) { color: var(--muted); max-width: 36em; }
.support-apple { transform: rotate(-12deg); }
.support-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 14px; }
@media (max-width: 680px) {
  .support { grid-template-columns: 1fr; padding: 28px; gap: 16px; }
  .support-apple { width: 84px; height: 84px; }
}

/* ── Footer ── */
.footer { padding: 64px 0 48px; color: var(--faint); font-size: .86rem; }
.footer p { margin: 0 0 6px; }
.footer-brand { display: flex; align-items: center; gap: 8px; font: 800 1rem/1 var(--round); color: var(--text); margin-bottom: 14px; }
.footer a { color: var(--muted); }

/* The creator's name: underlined, and clicking it opens his Roblox profile. */
.creator-link { color: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.creator-link:hover, .creator-link:focus-visible { color: var(--accent); }

/* ── Full-screen screenshot viewer ── */
.shot img { cursor: zoom-in; }
.no-scroll { overflow: hidden; }
.lightbox {
  position: fixed; inset: 0; z-index: 100; display: grid; place-items: center;
  background: rgb(0 0 0 / .88); cursor: zoom-out; padding: 2vh 2vw;
  animation: lightbox-in .16s ease-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 96vw; max-height: 94vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgb(0 0 0 / .6); }
.lightbox-close {
  position: absolute; top: 14px; right: 18px; width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgb(255 255 255 / .14); color: #fff; font-size: 26px; line-height: 1; cursor: pointer;
}
.lightbox-close:hover { background: rgb(255 255 255 / .26); }
@keyframes lightbox-in { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .lightbox { animation: none; } }

/* Close-ups inside the feature list */
.shot-inline { margin-top: 12px; }
.shot-inline img { width: auto; height: auto; max-width: 100%; max-height: 210px; border: 0; background: none; box-shadow: 0 14px 30px -14px rgb(0 0 0 / .7); }
.shot-wide + .shot-wide, .features + .shot-wide { margin-top: 56px; }

/* Side by side, each feature's title and text share rows with its neighbour so they line up.
   The picture sits right under its own text, wherever that ends. */
@media (min-width: 761px) {
  .features li { display: grid; grid-row: span 2; grid-template-rows: subgrid; align-content: start; }
}

/* ── Top donators ─────────────────────────────────────── */
.donor-list { list-style: none; margin: 0; padding: 0; max-width: 560px; border-top: 1px solid var(--line); counter-reset: donor; }
.donor-list li {
  display: grid; grid-template-columns: 2.2em minmax(0, 1fr) auto; align-items: center; gap: 12px;
  padding: 14px 4px; border-bottom: 1px solid var(--line); counter-increment: donor;
}
.donor-list li::before { content: counter(donor); font: 700 .9rem/1 var(--round); color: var(--faint); }
.donor-list li:nth-child(-n+3)::before { color: var(--accent); }
.donor-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donor-amount { font-variant-numeric: tabular-nums; color: var(--muted); }
