/* =========================================================
   Arkoid — Neo-Brutalist theme, Play Store style UX
   Edit the tokens in :root to restyle the whole site.
   ========================================================= */
:root {
  --bg: #fff8e7;          /* page background (cream) */
  --surface: #ffffff;     /* cards */
  --text: #111111;
  --muted: #4a4a4a;
  --line: #111111;        /* border colour */
  --shadow-c: #111111;    /* hard shadow colour */
  --yellow: #ffd23f;
  --pink: #ff6b9d;
  --blue: #4d7cff;
  --green: #00b86b;       /* install button */
  --bw: 3px;              /* border width */
  --sh: 5px;              /* shadow offset */
  --radius: 14px;
  --max: 1180px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #141414; --surface: #1f1f1f; --text: #f4f4f4; --muted: #b5b5b5;
    --line: #f4f4f4; --shadow-c: #000000; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #141414; --surface: #1f1f1f; --text: #f4f4f4; --muted: #b5b5b5;
  --line: #f4f4f4; --shadow-c: #000000; color-scheme: dark;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", system-ui, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text); line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }
.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 16px; }

/* ---------- Brutal primitives ---------- */
.box {
  background: var(--surface); border: var(--bw) solid var(--line);
  border-radius: var(--radius); box-shadow: var(--sh) var(--sh) 0 var(--shadow-c);
}
.press { transition: transform .12s ease, box-shadow .12s ease; }
.press:hover { transform: translate(-2px, -2px); box-shadow: calc(var(--sh) + 2px) calc(var(--sh) + 2px) 0 var(--shadow-c); }
.press:active { transform: translate(var(--sh), var(--sh)); box-shadow: 0 0 0 var(--shadow-c); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; font-weight: 700; font-size: .95rem; cursor: pointer;
  border: var(--bw) solid var(--line); border-radius: 12px; background: var(--surface);
  box-shadow: 4px 4px 0 var(--shadow-c); transition: transform .12s, box-shadow .12s;
  white-space: nowrap;
}
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--shadow-c); }
.btn:active { transform: translate(4px, 4px); box-shadow: 0 0 0 var(--shadow-c); }
.btn-install { background: var(--green); color: #fff; border-color: var(--line); }
.btn-yellow { background: var(--yellow); color: #111; }
.btn[aria-disabled="true"] { background: var(--surface); color: var(--muted); cursor: not-allowed; box-shadow: 2px 2px 0 var(--shadow-c); transform: none; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 50; background: var(--bg); border-bottom: var(--bw) solid var(--line); }
.bar { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; height: 72px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.logo img { width: 38px; height: 38px; border: var(--bw) solid var(--line); border-radius: 10px; box-shadow: 3px 3px 0 var(--shadow-c); }
.search { position: relative; max-width: 560px; width: 100%; justify-self: center; }
.search input {
  width: 100%; padding: 11px 16px 11px 46px; font: inherit; font-size: 1rem; color: var(--text);
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: 999px; outline: none;
  box-shadow: 3px 3px 0 var(--shadow-c); transition: box-shadow .12s;
}
.search input:focus { box-shadow: 5px 5px 0 var(--blue); }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); pointer-events: none; }
.nav-links { display: flex; gap: 6px; list-style: none; }
.nav-links a { display: block; padding: 8px 12px; font-weight: 600; border: var(--bw) solid transparent; border-radius: 10px; }
.nav-links a:hover { border-color: var(--line); background: var(--surface); }
.nav-links a.active { background: var(--yellow); border-color: var(--line); color: #111; }
.menu-btn { display: none; width: 44px; height: 44px; border: var(--bw) solid var(--line); border-radius: 10px; background: var(--surface); font-size: 1.3rem; cursor: pointer; box-shadow: 3px 3px 0 var(--shadow-c); }

/* ---------- Category tabs ---------- */
.tabs { border-bottom: var(--bw) solid var(--line); background: var(--bg); position: sticky; top: 72px; z-index: 40; }
.chips { display: flex; gap: 10px; overflow-x: auto; padding: 14px 0; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; padding: 7px 16px; font-weight: 600; font-size: .9rem; cursor: pointer;
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: 999px;
  box-shadow: 3px 3px 0 var(--shadow-c); transition: transform .12s, box-shadow .12s, background .12s;
}
.chip:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); }
.chip.active { background: var(--text); color: var(--bg); }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 10px; }
.hero-inner { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: stretch; }
.hero-card { padding: 36px; background: var(--yellow); color: #111; position: relative; overflow: hidden; }
.hero-card .tag { display: inline-block; background: #fff; border: var(--bw) solid #111; border-radius: 999px; padding: 4px 12px; font-weight: 700; font-size: .8rem; margin-bottom: 18px; }
.hero-card h1 { font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.02; letter-spacing: -.035em; font-weight: 700; margin-bottom: 16px; }
.hero-card h1 mark { background: var(--pink); color: #111; padding: 0 8px; border: var(--bw) solid #111; border-radius: 10px; display: inline-block; transform: rotate(-2deg); }
.hero-card p { font-size: 1.08rem; max-width: 460px; margin-bottom: 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-card .btn { border-color: #111; box-shadow: 4px 4px 0 #111; }
.hero-stats { display: grid; grid-template-rows: repeat(3, 1fr); gap: 16px; }
.stat { padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; }
.stat strong { font-size: 2.2rem; font-weight: 700; letter-spacing: -.03em; }
.stat span { font-weight: 600; color: var(--muted); }
.stat:nth-child(1) { background: var(--pink); color: #111; }
.stat:nth-child(2) { background: var(--blue); color: #fff; }
.stat:nth-child(3) { background: var(--green); color: #fff; }
.stat:nth-child(n) span { color: inherit; opacity: .85; }

/* ---------- Sections ---------- */
section { padding: 36px 0; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.section-head h2::before { content: ""; width: 14px; height: 14px; background: var(--pink); border: var(--bw) solid var(--line); border-radius: 4px; }
.arrows { display: flex; gap: 8px; }
.arrow { width: 42px; height: 42px; border: var(--bw) solid var(--line); border-radius: 50%; background: var(--surface); cursor: pointer; font-size: 1.1rem; font-weight: 700; box-shadow: 3px 3px 0 var(--shadow-c); transition: transform .12s, box-shadow .12s; }
.arrow:active { transform: translate(3px, 3px); box-shadow: none; }

/* ---------- Featured carousel ---------- */
.rail { display: flex; gap: 20px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 8px 14px 4px; scrollbar-width: none; }
.rail::-webkit-scrollbar { display: none; }
.feat { flex: 0 0 min(420px, 85%); scroll-snap-align: start; overflow: hidden; display: flex; flex-direction: column; }
.feat-banner { height: 170px; display: flex; align-items: center; justify-content: center; border-bottom: var(--bw) solid var(--line); position: relative; overflow: hidden; }
.feat-banner::before, .feat-banner::after { content: ""; position: absolute; border: var(--bw) solid #111; border-radius: 50%; opacity: .35; }
.feat-banner::before { width: 220px; height: 220px; left: -60px; top: -80px; }
.feat-banner::after { width: 140px; height: 140px; right: -30px; bottom: -50px; border-radius: 24px; transform: rotate(20deg); }
.feat-banner .app-icon { width: 96px; height: 96px; border-radius: 24px; position: relative; z-index: 1; transform: rotate(-4deg); }
.feat-body { display: flex; align-items: center; gap: 14px; padding: 16px 18px; }
.feat-body .info { flex: 1; min-width: 0; }
.feat-body h3 { font-size: 1.1rem; }
.feat-body p { color: var(--muted); font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- App list (Top charts style) ---------- */
.list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 18px; }
.row { display: flex; align-items: center; gap: 14px; padding: 14px; animation: pop .35s both; }
@keyframes pop { from { opacity: 0; transform: translateY(10px); } }
.rank { font-weight: 700; font-size: 1.05rem; width: 26px; text-align: center; color: var(--muted); }
.app-icon { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; border: var(--bw) solid var(--line); object-fit: cover; background: var(--surface); }
.row .info { flex: 1; min-width: 0; }
.row h3 { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--muted); font-size: .85rem; }
.pill { display: inline-block; font-size: .75rem; font-weight: 700; padding: 2px 8px; border: 2px solid var(--line); border-radius: 999px; background: var(--yellow); color: #111; margin-top: 4px; }
.get { width: 44px; height: 44px; flex-shrink: 0; display: grid; place-items: center; border: var(--bw) solid var(--line); border-radius: 12px; background: var(--green); color: #fff; box-shadow: 3px 3px 0 var(--shadow-c); transition: transform .12s, box-shadow .12s; }
.get:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--shadow-c); }
.get:active { transform: translate(3px, 3px); box-shadow: none; }
.get[aria-disabled="true"] { background: var(--surface); color: var(--muted); }
.empty { text-align: center; padding: 50px 20px; grid-column: 1 / -1; font-weight: 600; }

/* ---------- Why section ---------- */
.why { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 18px; }
.why .box { padding: 22px; }
.why .ico { width: 48px; height: 48px; display: grid; place-items: center; font-size: 1.4rem; border: var(--bw) solid var(--line); border-radius: 12px; margin-bottom: 12px; color: #111; }
.why h3 { margin-bottom: 4px; }
.why p { color: var(--muted); font-size: .93rem; }

/* ---------- Contact ---------- */
.cta { padding: 40px; background: var(--blue); color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); letter-spacing: -.02em; line-height: 1.1; }
.cta p { opacity: .9; margin-top: 6px; }
.cta .btn { color: #111; border-color: #111; box-shadow: 4px 4px 0 #111; }

/* ---------- Detail page (Play Store layout) ---------- */
.crumbs { padding: 22px 0 0; font-weight: 600; font-size: .9rem; }
.crumbs a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.d-head { display: flex; gap: 24px; align-items: center; padding: 26px 0 22px; }
.d-head .app-icon { width: 112px; height: 112px; border-radius: 28px; box-shadow: var(--sh) var(--sh) 0 var(--shadow-c); }
.d-head h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.08; letter-spacing: -.03em; }
.dev { font-weight: 700; color: var(--green); }
.d-head .sub { margin-top: 2px; }
.d-stats { display: flex; overflow-x: auto; margin-bottom: 22px; }
.d-stats > div { flex: 1 0 120px; padding: 14px 10px; text-align: center; border-right: var(--bw) solid var(--line); }
.d-stats > div:last-child { border-right: 0; }
.d-stats strong { display: block; font-size: 1.05rem; }
.d-stats small { color: var(--muted); font-size: .8rem; font-weight: 600; }
.d-actions { display: flex; gap: 12px; margin-bottom: 34px; flex-wrap: wrap; }
.d-actions .btn-install { min-width: 220px; padding: 14px 28px; font-size: 1rem; }
.shots { display: flex; gap: 16px; overflow-x: auto; padding: 4px 8px 16px 4px; scroll-snap-type: x mandatory; }
.shot { flex: 0 0 auto; width: 210px; aspect-ratio: 9 / 19; overflow: hidden; scroll-snap-align: start; cursor: zoom-in; padding: 0; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.d-grid { display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; margin-top: 18px; align-items: start; }
.d-col { display: grid; gap: 24px; }
.panel { padding: 24px; }
.panel h2 { font-size: 1.25rem; margin-bottom: 10px; }
.panel p { color: var(--muted); }
.feature-list { list-style: none; display: grid; gap: 8px; margin-top: 14px; }
.feature-list li { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.feature-list li::before { content: "✓"; flex-shrink: 0; width: 22px; height: 22px; display: grid; place-items: center; font-size: .8rem; font-weight: 700; background: var(--green); color: #fff; border: 2px solid var(--line); border-radius: 6px; }
.tags { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
.info-table { width: 100%; border-collapse: collapse; }
.info-table td { padding: 9px 0; border-bottom: 2px dashed var(--line); }
.info-table tr:last-child td { border-bottom: 0; }
.info-table td:first-child { color: var(--muted); font-weight: 600; }
.info-table td:last-child { text-align: right; font-weight: 700; }
.note { background: var(--yellow); color: #111; }
.note p { color: #111; }
.mini { flex: 0 0 150px; padding: 14px; display: flex; flex-direction: column; gap: 8px; scroll-snap-align: start; }
.mini .app-icon { width: 100%; height: auto; aspect-ratio: 1; border-radius: 20px; }
.mini h3 { font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Lightbox & toast ---------- */
.lightbox { position: fixed; inset: 0; background: rgba(0, 0, 0, .85); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; cursor: zoom-out; }
.lightbox.open { display: flex; }
.lightbox img { max-height: 90vh; border: var(--bw) solid #fff; border-radius: 20px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 120px); z-index: 120; padding: 12px 20px; font-weight: 700; background: var(--yellow); color: #111; border: var(--bw) solid #111; border-radius: 12px; box-shadow: 4px 4px 0 #111; transition: transform .25s; }
.toast.show { transform: translate(-50%, 0); }

/* ---------- Prose pages ---------- */
.prose { max-width: 820px; padding: 40px 16px 20px; }
.prose .box { padding: clamp(22px, 4vw, 40px); }
.prose h1 { font-size: clamp(2rem, 4.5vw, 3rem); letter-spacing: -.03em; line-height: 1.05; margin-bottom: 10px; }
.prose h2 { margin: 28px 0 8px; font-size: 1.3rem; display: inline-block; background: var(--yellow); color: #111; padding: 2px 10px; border: var(--bw) solid var(--line); border-radius: 8px; }
.prose p, .prose li { margin-bottom: 10px; }
.prose ul { padding-left: 22px; }
.prose a { font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- Footer ---------- */
.footer { border-top: var(--bw) solid var(--line); margin-top: 40px; padding: 26px 0; font-weight: 600; background: var(--text); color: var(--bg); }
.footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; flex-wrap: wrap; }
.footer a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .hero-inner, .d-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); grid-template-rows: none; }
  .stat { flex-direction: column; align-items: flex-start; padding: 14px; }
  .stat strong { font-size: 1.6rem; }
}
@media (max-width: 760px) {
  .bar { grid-template-columns: 1fr auto; height: auto; padding: 12px 16px; gap: 12px; }
  .search { grid-column: 1 / -1; grid-row: 2; max-width: none; }
  .menu-btn { display: block; }
  .nav-links { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 10px 16px 16px; background: var(--bg); border-bottom: var(--bw) solid var(--line); }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px; }
  .tabs { top: 122px; }
  .hero { padding-top: 24px; }
  .hero-card { padding: 26px 22px; }
  .list { grid-template-columns: 1fr; }
  .rank { display: none; }
  .d-head { gap: 16px; }
  .d-head .app-icon { width: 84px; height: 84px; border-radius: 22px; }
  .d-actions .btn-install { flex: 1; min-width: 0; }
  .shot { width: 160px; }
  .cta { padding: 28px 22px; }
  .cta .hero-actions { width: 100%; }
  section { padding: 24px 0; }
  .hero-actions .btn { flex: 1; }
  .hero-stats { gap: 12px; }
  .stat strong { font-size: 1.4rem; }
  .feat { flex-basis: 88%; }
  .feat-banner { height: 140px; }
  /* App stats: 2x2 grid instead of sideways scroll */
  .d-stats { display: grid; grid-template-columns: 1fr 1fr; }
  .d-stats > div { border-right: 0; }
  .d-stats > div:nth-child(odd) { border-right: var(--bw) solid var(--line); }
  .d-stats > div:nth-child(-n+2) { border-bottom: var(--bw) solid var(--line); }
  .panel { padding: 20px; }
  .info-table td { font-size: .92rem; }
}
@media (max-width: 380px) {
  :root { --sh: 4px; }
  .logo span { font-size: 1.1rem; }
  .hero-card h1 { font-size: 1.9rem; }
  .stat { padding: 12px 10px; }
  .stat span { font-size: .8rem; }
  .row { padding: 12px; gap: 10px; }
  .app-icon { width: 56px; height: 56px; }
  .d-actions .btn { padding: 12px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Ratings ---------- */
.stars { position: relative; display: inline-block; font-size: 1.25rem; letter-spacing: 2px; line-height: 1; }
.stars::before { content: "★★★★★"; color: var(--muted); opacity: .3; }
.stars::after { content: "★★★★★"; position: absolute; left: 0; top: 0; width: var(--p, 0%); overflow: hidden; white-space: nowrap; color: #ffb400; }
.rt-wrap { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; margin-top: 6px; }
.rt-big { display: grid; justify-items: center; gap: 6px; text-align: center; }
.rt-big strong { font-size: 3.4rem; line-height: 1; letter-spacing: -.03em; }
.rt-big small { color: var(--muted); font-weight: 600; }
.rt-bars { display: grid; gap: 6px; }
.rt-bar { display: grid; grid-template-columns: 14px 1fr; gap: 10px; align-items: center; font-weight: 700; font-size: .85rem; }
.rt-track { height: 12px; border: 2px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--bg); }
.rt-fill { height: 100%; background: var(--yellow); border-right: 2px solid var(--line); transition: width .4s; }
.rate-title { margin-top: 22px; font-size: 1.05rem; }
.rate { display: flex; gap: 8px; margin: 10px 0 8px; }
.rate button {
  width: 50px; height: 50px; font-size: 1.5rem; line-height: 1; cursor: pointer; color: var(--muted);
  background: var(--surface); border: var(--bw) solid var(--line); border-radius: 12px;
  box-shadow: 3px 3px 0 var(--shadow-c); transition: transform .12s, box-shadow .12s, background .12s;
}
.rate button.on { background: var(--yellow); color: #111; }
.rate button:active { transform: translate(3px, 3px); box-shadow: none; }
.rate button:disabled { cursor: wait; }
.rt-pill { background: var(--surface); color: var(--text); }
@media (max-width: 760px) {
  .rt-wrap { gap: 18px; }
  .rt-big strong { font-size: 2.8rem; }
  .rate button { flex: 1; width: auto; }
}
