/* funappgame.com — single stylesheet, no external resources. */

:root {
  color-scheme: light dark;
  --bg: #fff9f3;
  --surface: #ffffff;
  --ink: #1c1530;
  --muted: #5e5670;
  --line: #ece3da;
  --brand: #5b3fd6;
  --brand-ink: #ffffff;
  --focus: #5b3fd6;
  --shadow: 0 1px 2px rgb(28 21 48 / 6%), 0 12px 32px -12px rgb(28 21 48 / 22%);

  --pixel: #e6188a;
  --ama: #e8b53a;
  --circle: #e0287f;
  --jigsaw: #78c21e;
  --orange: #f4782a;
  --violet: #b98cf5;

  --round: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --r-lg: 28px;
  --r-md: 18px;
  --wrap: 1180px;
  --measure: 37.5rem; /* ~70 characters of 17px body text */
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #16121f;
    --surface: #1f1a2b;
    --ink: #f3eef9;
    --muted: #b4abc6;
    --line: #2f2840;
    --brand: #b9a6ff;
    --brand-ink: #16121f;
    --focus: #b9a6ff;
    --shadow: 0 1px 2px rgb(0 0 0 / 30%), 0 16px 40px -16px rgb(0 0 0 / 70%);
  }
}

/* Per-app accents: --a is text-safe (AA on --a-soft and --bg), --a-ink sits on --a. */
.app--pixel  { --a: #b01268; --a-soft: #fceaf3; --a-ink: #fff; --a-glow: var(--pixel); }
.app--ama    { --a: #1e6b57; --a-soft: #eaf4ef; --a-ink: #fff; --a-glow: var(--ama); }
.app--circle { --a: #7a2a9e; --a-soft: #f4eaf8; --a-ink: #fff; --a-glow: var(--circle); }
.app--jigsaw { --a: #b04e0c; --a-soft: #fff0e3; --a-ink: #fff; --a-glow: var(--jigsaw); }
.app--site   { --a: var(--brand); --a-soft: #efeafd; --a-ink: var(--brand-ink); --a-glow: var(--violet); }

@media (prefers-color-scheme: dark) {
  .app--pixel  { --a: #ff7dbf; --a-soft: #2a1724; --a-ink: #16121f; }
  .app--ama    { --a: #e8b53a; --a-soft: #1a2320; --a-ink: #16121f; }
  .app--circle { --a: #d9a0f5; --a-soft: #241a2c; --a-ink: #16121f; }
  .app--jigsaw { --a: #f7a35c; --a-soft: #2a1e14; --a-ink: #16121f; }
  .app--site   { --a-soft: #221c33; }
}

*, *::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(--ink);
  font: 400 1.0625rem/1.6 var(--sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--brand); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

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

h1, h2, h3 {
  font-family: var(--round);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0;
}

.wrap { width: min(100% - 32px, var(--wrap)); margin-inline: auto; }

.skip {
  position: absolute; left: 16px; top: -100px; z-index: 10;
  background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: 10px;
}
.skip:focus { top: 12px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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

.site-header {
  position: sticky; top: 0; z-index: 5;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 64px;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--ink); text-decoration: none;
  font: 800 1.125rem/1 var(--round); letter-spacing: 0.02em;
}
.brand svg { width: 30px; height: 30px; flex: none; }
.brand small { font-weight: 600; color: var(--muted); letter-spacing: 0; font-size: 0.8125rem; }
.site-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: 8px 12px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 600; font-size: 0.9375rem;
}
.site-nav a:hover { background: var(--line); }
.site-nav a[aria-current="page"] { background: var(--ink); color: var(--bg); }
@media (max-width: 520px) {
  .brand small { display: none; }
  .site-nav a { padding: 8px 9px; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 20px; border-radius: 999px;
  font: 700 1rem/1.2 var(--round);
  text-decoration: none;
  background: var(--a, var(--brand)); color: var(--a-ink, var(--brand-ink));
  border: 2px solid transparent;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn--ghost { background: transparent; color: var(--ink); border-color: currentColor; }
.btn svg { width: 18px; height: 18px; flex: none; }
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } .btn:hover { transform: none; } }

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

.hero { position: relative; overflow: hidden; padding: clamp(40px, 8vw, 96px) 0 clamp(48px, 8vw, 104px); }
.hero::before {
  content: ""; position: absolute; inset: -20% -10% auto auto; width: 70vw; height: 70vw; max-width: 900px; max-height: 900px;
  background:
    radial-gradient(closest-side at 30% 35%, color-mix(in srgb, var(--pixel) 26%, transparent), transparent),
    radial-gradient(closest-side at 70% 30%, color-mix(in srgb, var(--ama) 26%, transparent), transparent),
    radial-gradient(closest-side at 35% 75%, color-mix(in srgb, var(--jigsaw) 22%, transparent), transparent),
    radial-gradient(closest-side at 75% 72%, color-mix(in srgb, var(--violet) 30%, transparent), transparent);
  filter: blur(10px); pointer-events: none;
}
.hero .wrap { position: relative; display: grid; gap: 48px; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.15fr 0.85fr; } }

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px; margin: 0 0 18px;
  font: 700 0.8125rem/1.2 var(--round); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted);
}
.eyebrow::before {
  content: ""; width: 28px; height: 8px; border-radius: 99px;
  background: linear-gradient(90deg, var(--pixel) 0 25%, var(--ama) 25% 50%, var(--jigsaw) 50% 75%, var(--violet) 75%);
}
.hero h1 { font-size: clamp(2.4rem, 1.4rem + 4.6vw, 4.6rem); font-weight: 800; max-width: 14ch; }
.hero h1 .hl {
  background: linear-gradient(100deg, var(--pixel), var(--orange) 45%, var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
@media (prefers-color-scheme: light) {
  .hero h1 .hl { background: linear-gradient(100deg, #b01268, #b04e0c 50%, #5b3fd6); -webkit-background-clip: text; background-clip: text; }
}
.hero p.lead { font-size: clamp(1.0625rem, 1rem + 0.4vw, 1.25rem); color: var(--muted); max-width: 52ch; margin: 22px 0 30px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 12px; }

.icon-stack {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 26px);
  width: min(100%, 400px); margin-inline: auto; padding: 0; list-style: none;
}
.icon-stack li { transform: rotate(var(--rot, 0deg)) translateY(var(--dy, 0)); }
.icon-stack li:nth-child(1) { --rot: -6deg; }
.icon-stack li:nth-child(2) { --rot: 5deg; --dy: 22px; }
.icon-stack li:nth-child(3) { --rot: 4deg; --dy: -6px; }
.icon-stack li:nth-child(4) { --rot: -4deg; --dy: 16px; }
.icon-stack a { display: block; border-radius: 23%; }
.icon-stack img {
  width: 100%; aspect-ratio: 1; border-radius: 23%;
  box-shadow: var(--shadow); transition: transform 0.2s ease;
}
.icon-stack a:hover img { transform: scale(1.04) rotate(-2deg); }
@media (prefers-reduced-motion: reduce) { .icon-stack img { transition: none; } }
@media (max-width: 899px) { .icon-stack { width: min(100%, 300px); } }

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

.section { padding: clamp(56px, 8vw, 96px) 0; }
.section--tight { padding-block: 16px; }
.section--tight:last-child { padding-bottom: clamp(40px, 6vw, 64px); }
#apps { padding-bottom: 16px; }
.section-head { max-width: 640px; margin-bottom: clamp(28px, 4vw, 44px); }
.section-head h2 { font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.8rem); font-weight: 800; }
.section-head p { color: var(--muted); margin: 12px 0 0; font-size: 1.125rem; }

/* ---------- App panels ---------- */

.apps { display: grid; gap: clamp(20px, 3vw, 32px); }

.app {
  position: relative; overflow: hidden;
  display: grid; gap: 28px;
  padding: clamp(22px, 4vw, 48px);
  border-radius: var(--r-lg);
  background: var(--a-soft);
  border: 1px solid color-mix(in srgb, var(--a) 14%, transparent);
  scroll-margin-top: 80px;
}
.app::after {
  content: ""; position: absolute; width: 360px; height: 360px; right: -120px; top: -140px;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--a-glow) 22%, transparent), transparent);
  pointer-events: none;
}
@media (min-width: 960px) {
  .app { grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr); align-items: center; gap: 48px; }
  .app:nth-child(even) .app__info { order: 2; }
}
.app > * { position: relative; z-index: 1; }

.app__head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.app__icon { width: 88px; height: 88px; border-radius: 22%; box-shadow: var(--shadow); flex: none; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; }
.chips li {
  font: 700 0.75rem/1 var(--round); letter-spacing: 0.04em; text-transform: uppercase;
  padding: 6px 10px; border-radius: 99px; color: var(--a);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid color-mix(in srgb, var(--a) 22%, transparent);
}
.app h3 { font-size: clamp(1.45rem, 1.1rem + 1.4vw, 2rem); font-weight: 800; }
.app__lede { margin: 0 0 18px; font-size: 1.0625rem; }

.highlights { list-style: none; margin: 0 0 26px; padding: 0; display: grid; gap: 10px; }
.highlights li { position: relative; padding-left: 30px; }
.highlights li::before {
  content: ""; position: absolute; left: 0; top: 0.3em; width: 18px; height: 18px; border-radius: 6px;
  background: var(--a);
}
.highlights li::after {
  content: ""; position: absolute; left: 6.5px; top: calc(0.3em + 3.5px); width: 5px; height: 9px;
  border: solid var(--a-ink); border-width: 0 2.4px 2.4px 0; transform: rotate(45deg);
}

.app__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }
.doclinks { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; font-size: 0.9375rem; }
.doclinks a { color: var(--a); font-weight: 600; }

/* Screenshot strip: CSS scroll-snap, no JS. */
.shots {
  display: flex; gap: 14px;
  overflow-x: auto; overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory; scroll-padding-inline: 4px;
  padding: 6px 4px 18px; margin: 0; list-style: none;
  scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--a) 45%, transparent) transparent;
  border-radius: var(--r-md);
}
.shots li { flex: none; scroll-snap-align: start; }
.shots img {
  height: clamp(300px, 38vw, 420px); width: auto;
  border-radius: 20px; background: var(--surface);
  box-shadow: var(--shadow);
}
/* Phones: two screenshots plus a ~28px peek of the third, on every panel. */
@media (max-width: 600px) {
  .shots { gap: 12px; }
  .shots li { flex: 0 0 calc((100% - 2 * 12px - 24px) / 2); }
  .shots img { width: 100%; height: auto; }
}
.shots-hint { margin: 6px 0 0; font-size: 0.8125rem; color: var(--muted); }

/* ---------- About / contact ---------- */

.about { display: grid; gap: 28px; }
@media (min-width: 860px) { .about { grid-template-columns: 1.2fr 0.8fr; gap: 56px; align-items: start; } }
.about p { margin: 0 0 14px; max-width: 62ch; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 22px 24px; box-shadow: var(--shadow);
}
.card h3 { font-size: 1.125rem; margin-bottom: 10px; }
.card address { font-style: normal; color: var(--muted); }

.contact-band {
  border-radius: var(--r-lg); padding: clamp(28px, 5vw, 56px);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--pixel) 20%, transparent), transparent 55%),
    radial-gradient(120% 140% at 100% 100%, color-mix(in srgb, var(--jigsaw) 18%, transparent), transparent 55%),
    var(--surface);
  border: 1px solid var(--line);
  display: grid; gap: 20px;
}
@media (min-width: 860px) { .contact-band { grid-template-columns: 1fr auto; align-items: center; } }
.contact-band h2 { font-size: clamp(1.7rem, 1.2rem + 2vw, 2.4rem); font-weight: 800; }
.contact-band p { margin: 10px 0 0; color: var(--muted); max-width: 56ch; }
.mail { font: 700 clamp(1.05rem, 0.9rem + 0.8vw, 1.35rem)/1.3 var(--round); word-break: break-word; }

/* ---------- Simple pages (contact, 404) ---------- */

.page { padding: clamp(40px, 7vw, 88px) 0 clamp(56px, 8vw, 96px); }
.page h1 { font-size: clamp(2.2rem, 1.4rem + 3.4vw, 3.6rem); font-weight: 800; }
.page .lead { color: var(--muted); font-size: 1.1875rem; max-width: 56ch; margin: 16px 0 36px; }
.contact-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.contact-grid .card { border-top: 6px solid var(--a, var(--brand)); }
.contact-grid .card p { margin: 0 0 8px; color: var(--muted); font-size: 0.9375rem; }
.contact-grid .card a.mail { color: var(--a, var(--brand)); font-size: 1.0625rem; }
.contact-grid .app-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.contact-grid .app-row img { width: 44px; height: 44px; border-radius: 22%; }
.contact-grid .app-row h2 { font-size: 1.0625rem; letter-spacing: -0.01em; }

/* ---------- Legal documents ---------- */

.doc-hero { background: var(--a-soft); border-bottom: 1px solid var(--line); padding: 28px 0 24px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 18px; padding: 0; list-style: none; font-size: 0.875rem; color: var(--muted); }
.crumbs li + li::before { content: "/"; margin-right: 6px; opacity: 0.6; }
.crumbs a { color: inherit; }
.doc-app { display: flex; align-items: center; gap: 14px; }
.doc-app img { width: 56px; height: 56px; border-radius: 22%; box-shadow: var(--shadow); }
.doc-app p { margin: 0; font: 700 1.125rem/1.25 var(--round); }
.doc-app span { display: block; font: 400 0.875rem/1.4 var(--sans); color: var(--muted); }
.doc-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 0; padding: 0; list-style: none; }
.doc-tabs a {
  display: inline-block; padding: 8px 14px; border-radius: 99px; text-decoration: none; font-weight: 600; font-size: 0.9375rem;
  color: var(--a); border: 1px solid color-mix(in srgb, var(--a) 35%, transparent); background: var(--surface);
}
.doc-tabs a[aria-current="page"] { background: var(--a); color: var(--a-ink); border-color: var(--a); }

.wrap--doc { width: min(100% - 32px, var(--measure)); }
.legal {
  margin-inline: auto; padding: clamp(32px, 6vw, 64px) 0 24px;
  font-size: 1.0625rem; line-height: 1.7; overflow-wrap: break-word;
}
.legal h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.6rem); font-weight: 800; margin-bottom: 28px; }
.legal h2, .legal h3, .legal h4, .legal h5 { font-family: var(--round); line-height: 1.25; letter-spacing: -0.01em; scroll-margin-top: 84px; }
.legal h2 { font-size: 1.5rem; margin: 2.2em 0 0.6em; }
.legal h3 { font-size: 1.25rem; margin: 2em 0 0.5em; }
.legal h4, .legal h5 { font-size: 1.0625rem; margin: 1.6em 0 0.4em; }
.legal h2 + h3, .legal h3 + h4 { margin-top: 0.8em; }
.legal p { margin: 0 0 1em; }
.legal ul, .legal ol { margin: 0 0 1.1em; padding-left: 1.4em; }
.legal li { margin: 0.3em 0; }
.legal li::marker { color: var(--a); }
.legal hr { border: 0; height: 1px; background: var(--line); margin: 2.2em 0; }
.legal a { color: var(--a); }
.legal table { border-collapse: collapse; width: 100%; margin: 0 0 1.2em; font-size: 0.9375rem; display: block; overflow-x: auto; }
.legal th, .legal td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal strong { font-weight: 700; }

.doc-foot { margin: 0 auto; padding: 24px 0 72px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 12px; }

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

.site-footer { border-top: 1px solid var(--line); padding: 48px 0 40px; font-size: 0.9375rem; color: var(--muted); }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); }
.site-footer h2 { font: 700 0.8125rem/1.2 var(--round); letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink); margin: 0 0 10px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.site-footer .legalname { margin: 36px 0 0; }

/* ---------- 404 ---------- */

.notfound { text-align: center; }
.notfound .big {
  font: 800 clamp(5rem, 3rem + 10vw, 10rem)/1 var(--round); margin: 0 0 8px;
  background: linear-gradient(100deg, var(--pixel), var(--orange), var(--violet));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.notfound .lead { margin-inline: auto; }
.notfound .actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
