/*
Theme Name: Package
Theme URI: https://example.com/package-theme
Author: Your Name
Author URI: https://example.com
Description: A minimal theme for hosting and distributing your own APK builds directly. Real version/size/checksum metadata, a focused verification-style download screen, and no ad-redirect chain.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: package-theme
*/

/* ==========================================================================
   PACKAGE THEME — design tokens
   A theme for hosting your own APK builds: direct downloads, real metadata,
   no ad-redirect maze. Visual language borrows from packing slips and
   technical manifests, since an APK is, literally, a package.
   ========================================================================== */

:root {
  --ink: #142733;
  --ink-soft: #1d3543;
  --paper: #f5f1e8;
  --paper-dim: #ece6d8;
  --amber: #e2832a;
  --amber-dark: #b5631a;
  --slate: #5b6b76;
  --slate-soft: #8b9aa3;
  --line: #cfc6b0;
  --line-on-ink: #2c4350;
  --mint: #3f8f5c;
  --mint-bg: #e4efe6;

  --display: "Space Grotesk", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", "Courier New", monospace;

  --radius: 10px;
  --container: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--body);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 28px;
}

/* ---------- focus & motion ---------- */
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 3px;
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------- nav ---------- */
.site-nav {
  background: var(--ink);
  color: var(--paper);
}
.site-nav .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 28px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand .mark {
  width: 28px; height: 28px;
  background: var(--amber);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink);
  font-family: var(--mono);
  font-weight: 700;
  font-size: 13px;
}
.nav-links { display: flex; gap: 26px; font-size: 14.5px; color: var(--slate-soft); }
.nav-links a:hover { color: var(--paper); }

/* ---------- hero ---------- */
.hero {
  background: var(--ink);
  color: var(--paper);
  padding: 76px 0 64px;
  border-bottom: 1px solid var(--line-on-ink);
}
.hero .eyebrow {
  font-family: var(--mono);
  font-size: 12.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--amber);
  margin: 0 0 14px;
}
.hero h1 {
  font-family: var(--display);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
  margin: 0 0 18px;
  max-width: 760px;
  letter-spacing: -0.01em;
}
.hero p.lede {
  max-width: 560px;
  color: var(--slate-soft);
  font-size: 17px;
  margin: 0;
}

/* ---------- filter chips ---------- */
.filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  padding: 28px 0 8px;
}
.chip {
  font-family: var(--mono);
  font-size: 13px;
  padding: 7px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--slate);
  cursor: pointer;
}
.chip[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ---------- app grid & card ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  padding: 20px 0 70px;
}
@media (max-width: 880px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid { grid-template-columns: 1fr; } }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -16px rgba(20,39,51,0.4); }

.card-top { display: flex; gap: 12px; align-items: flex-start; }
.icon-tile {
  width: 52px; height: 52px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 19px;
  color: #fff;
}
.card-top .meta { min-width: 0; }
.card-top h3 { margin: 0 0 2px; font-family: var(--display); font-size: 17px; }
.card-top .cat { font-size: 12.5px; color: var(--slate); }

.card .tagline { font-size: 14px; color: var(--slate); margin: 0; }

.spec-line {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate);
  display: flex;
  gap: 12px;
  border-top: 1px dashed var(--line);
  padding-top: 10px;
}
.spec-line b { color: var(--ink); font-weight: 600; }

.card .btn { margin-top: auto; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--body);
  font-weight: 600;
  font-size: 14.5px;
  padding: 11px 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: var(--amber); color: var(--ink); }
.btn-primary:hover { background: var(--amber-dark); }
.btn-block { width: 100%; }
.btn-ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover { border-color: var(--slate); }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 10px; }

/* ---------- detail header ---------- */
.detail-hero {
  background: var(--ink);
  color: var(--paper);
  padding: 48px 0;
}
.detail-head { display: flex; gap: 22px; align-items: flex-start; flex-wrap: wrap; }
.detail-head .icon-tile { width: 88px; height: 88px; border-radius: 18px; font-size: 30px; }
.detail-head h1 { font-family: var(--display); font-size: 32px; margin: 0 0 4px; }
.detail-head .cat { font-family: var(--mono); font-size: 12.5px; color: var(--amber); text-transform: uppercase; letter-spacing: 0.08em; }
.detail-head .tagline { color: var(--slate-soft); margin: 10px 0 0; max-width: 520px; }
.detail-actions { margin-left: auto; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.detail-actions .trust { font-family: var(--mono); font-size: 11.5px; color: var(--slate-soft); }

/* ---------- manifest strip (signature element) ---------- */
.manifest {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin: -28px 0 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
@media (max-width: 760px) { .manifest { grid-template-columns: repeat(2, 1fr); } }
.manifest .field {
  padding: 18px 20px;
  border-right: 1px dashed var(--line);
}
.manifest .field:last-child { border-right: none; }
.manifest .field .k {
  font-family: var(--mono);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin: 0 0 6px;
}
.manifest .field .v {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  word-break: break-all;
}
.manifest .field .v.ok { color: var(--mint); }

/* ---------- prose / sections ---------- */
.section { padding: 48px 0; }
.section h2 {
  font-family: var(--display);
  font-size: 22px;
  margin: 0 0 14px;
}
.section p { color: var(--slate); max-width: 680px; }

.shots { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 6px; }
.shots .shot {
  flex: 0 0 200px;
  height: 360px;
  border-radius: 14px;
  border: 1px solid var(--line);
}

/* ---------- footer ---------- */
.site-footer {
  background: var(--ink);
  color: var(--slate-soft);
  padding: 36px 0;
  font-size: 13.5px;
}
.site-footer .wrap { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.site-footer a:hover { color: var(--paper); }

/* ==========================================================================
   DOWNLOAD PAGE
   ========================================================================== */
.dl-page {
  min-height: 100vh;
  background: var(--ink);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
}
.dl-card {
  width: 100%;
  max-width: 440px;
  background: var(--ink-soft);
  border: 1px solid var(--line-on-ink);
  border-radius: 16px;
  padding: 36px 32px 30px;
  text-align: center;
}
.dl-icon {
  width: 64px; height: 64px;
  border-radius: 16px;
  margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--display);
  font-weight: 700;
  font-size: 22px;
  color: #fff;
}
.dl-card h1 {
  font-family: var(--display);
  font-size: 21px;
  margin: 0 0 4px;
}
.dl-card .file {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--slate-soft);
  margin: 0 0 26px;
}

.dl-progress-track {
  height: 6px;
  border-radius: 999px;
  background: var(--line-on-ink);
  overflow: hidden;
  margin-bottom: 16px;
}
.dl-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--amber);
  border-radius: 999px;
  transition: width 0.4s linear;
}

.dl-status {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--paper);
  min-height: 20px;
  margin-bottom: 4px;
}
.dl-countdown {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate-soft);
  margin-bottom: 22px;
}

.dl-checklist {
  list-style: none;
  margin: 0 0 26px;
  padding: 0;
  text-align: left;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--slate-soft);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dl-checklist li { display: flex; gap: 10px; align-items: center; }
.dl-checklist .box {
  width: 15px; height: 15px;
  border: 1px solid var(--slate-soft);
  border-radius: 3px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px;
  color: var(--mint);
}
.dl-checklist li.done { color: var(--paper); }
.dl-checklist li.done .box { border-color: var(--mint); background: var(--mint-bg); }

.dl-ready { display: none; }
.dl-ready.show { display: block; }
.dl-ready .mark-ok {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: var(--mint-bg);
  color: var(--mint);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 20px;
}
.dl-ready p { color: var(--slate-soft); font-size: 13.5px; margin: 10px 0 18px; }

.dl-fallback {
  margin-top: 18px;
  font-size: 12.5px;
  color: var(--slate-soft);
}
.dl-fallback a { color: var(--amber); text-decoration: underline; }

.dl-back {
  display: block;
  margin: 22px auto 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--slate-soft);
  width: fit-content;
}
.dl-back:hover { color: var(--paper); }
