:root {
  --ink: #17222f;
  --muted: #5e6b78;
  --paper: #f5f7f8;
  --surface: #ffffff;
  --line: #dbe1e6;
  --brand: #005d68;
  --brand-deep: #073b46;
  --lime: #c7e55a;
  --gold: #e7bd56;
  --shadow: 0 22px 65px rgba(16, 35, 48, 0.1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 94% -5%, rgba(199, 229, 90, 0.24), transparent 28rem),
    radial-gradient(circle at 5% 18%, rgba(0, 93, 104, 0.09), transparent 30rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button, input { font: inherit; }
a { color: inherit; }
img { display: block; max-width: 100%; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -5rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  color: white;
  background: var(--brand-deep);
  border-radius: 0.5rem;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid rgba(219, 225, 230, 0.92);
  background: rgba(245, 247, 248, 0.9);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1440px, calc(100% - 2.5rem));
  min-height: 4.8rem;
  margin: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-decoration: none;
  font-size: 0.88rem;
}
.brand img { width: 2.65rem; height: auto; }
.nav-links { display: flex; align-items: center; gap: 1.4rem; }
.nav-links a { color: #3d4b58; text-decoration: none; font-weight: 650; }
.nav-links a:hover, .nav-links a:focus-visible { color: var(--brand); }
.library-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.8rem;
  padding: 0 1rem;
  color: white !important;
  border-radius: 999px;
  background: var(--brand-deep);
}

.hero {
  width: min(1440px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: clamp(3.5rem, 7vw, 7rem) 0 3.3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 0.65fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: end;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--brand);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  max-width: 13ch;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(3.4rem, 8vw, 7.7rem);
  font-weight: 500;
  line-height: 0.91;
  letter-spacing: -0.058em;
}
.hero-copy { max-width: 46rem; }
.hero-copy > p:not(.eyebrow) {
  max-width: 41rem;
  margin: 1.6rem 0 0;
  color: var(--muted);
  font-size: clamp(1.08rem, 2vw, 1.32rem);
}

.price-panel {
  position: relative;
  overflow: hidden;
  padding: 1.7rem;
  color: white;
  border-radius: 1.5rem;
  background: linear-gradient(145deg, var(--brand-deep), #006e78);
  box-shadow: var(--shadow);
}
.price-panel::after {
  content: "";
  position: absolute;
  right: -4rem;
  bottom: -5rem;
  width: 13rem;
  height: 13rem;
  border: 2rem solid rgba(199, 229, 90, 0.16);
  border-radius: 50%;
}
.price-panel span { display: block; color: #c9e2e2; font-size: 0.82rem; font-weight: 750; letter-spacing: 0.08em; text-transform: uppercase; }
.price-panel strong { display: block; margin: 0.1rem 0 0.4rem; font-size: clamp(2.7rem, 5vw, 4.6rem); letter-spacing: -0.055em; }
.price-panel p { position: relative; z-index: 1; margin: 0; max-width: 28rem; color: #e4f1f1; }

.store-shell {
  width: min(1440px, calc(100% - 2.5rem));
  margin: 0 auto 6rem;
}
.store-tools {
  position: sticky;
  top: 4.8rem;
  z-index: 20;
  padding: 1rem 0;
  background: linear-gradient(var(--paper) 78%, transparent);
}
.tools-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem;
  border: 1px solid var(--line);
  border-radius: 1.1rem;
  background: rgba(255,255,255,0.94);
  box-shadow: 0 10px 36px rgba(16, 35, 48, 0.06);
}
.search-wrap { position: relative; flex: 1 1 19rem; }
.search-wrap svg { position: absolute; left: 0.95rem; top: 50%; width: 1.1rem; transform: translateY(-50%); color: #70808d; }
.search-wrap input {
  width: 100%;
  min-height: 3rem;
  padding: 0 1rem 0 2.8rem;
  border: 0;
  border-radius: 0.75rem;
  color: var(--ink);
  background: #eef2f3;
  outline: none;
}
.search-wrap input:focus { box-shadow: 0 0 0 3px rgba(0, 93, 104, 0.2); }
.category-tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.category-tabs button {
  min-height: 2.6rem;
  padding: 0 0.85rem;
  border: 0;
  border-radius: 999px;
  color: #4d5a66;
  background: transparent;
  font-weight: 700;
  cursor: pointer;
}
.category-tabs button[aria-pressed="true"] { color: white; background: var(--brand); }

.catalog-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.4rem 0 1.1rem;
}
.catalog-heading h2 { margin: 0; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.2rem); font-weight: 500; letter-spacing: -0.035em; }
.catalog-heading p { margin: 0; color: var(--muted); }

.app-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.app-card {
  min-width: 0;
  padding: 1.2rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(255,255,255,0.95);
  box-shadow: 0 8px 28px rgba(16,35,48,0.045);
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.app-card:hover { transform: translateY(-3px); border-color: #c5d0d7; box-shadow: 0 18px 42px rgba(16,35,48,0.1); }
.app-top { display: flex; gap: 1rem; align-items: flex-start; }
.app-art {
  width: 4.4rem;
  height: 4.4rem;
  flex: 0 0 4.4rem;
  padding: 0.15rem;
  border-radius: 1rem;
  object-fit: cover;
  background: #edf1f3;
  box-shadow: inset 0 0 0 1px rgba(17,34,47,0.06);
}
.app-meta { min-width: 0; }
.category-label { display: flex; align-items: center; gap: 0.45rem; color: var(--muted); font-size: 0.76rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; }
.category-dot { width: 0.48rem; height: 0.48rem; border-radius: 50%; background: var(--category); }
.app-card h3 { margin: 0.22rem 0 0; font-size: 1.16rem; line-height: 1.2; letter-spacing: -0.02em; }
.platforms { margin: 0.35rem 0 0; color: #6b7884; font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.description { flex: 1; margin: 1rem 0 1.1rem; color: #53606c; font-size: 0.92rem; }
.card-action { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; padding-top: 0.95rem; border-top: 1px solid #e8ecef; }
.card-buttons { display: flex; align-items: center; flex-wrap: wrap; justify-content: flex-end; gap: 0.5rem; }
.detail-button { min-height: 2.75rem; padding: 0 0.8rem; display: inline-flex; align-items: center; border: 1px solid #cbd5da; border-radius: 0.72rem; color: var(--brand-deep); background: white; font-size: 0.86rem; font-weight: 750; text-decoration: none; }
.detail-button:hover { border-color: var(--brand); color: var(--brand); }
.price { font-weight: 850; letter-spacing: -0.02em; }
.free-price { color: var(--brand); }
.buy-button, .primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  padding: 0 1rem;
  border: 0;
  border-radius: 0.72rem;
  color: white;
  background: var(--brand-deep);
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}
.buy-button:hover, .primary-button:hover { background: var(--brand); }
.buy-button[disabled] { color: #66727b; background: #e4e9eb; cursor: not-allowed; }
.buy-button:focus-visible, .primary-button:focus-visible, .secondary-button:focus-visible, .close-button:focus-visible { outline: 3px solid rgba(0,93,104,0.28); outline-offset: 2px; }

.empty-state { display: none; padding: 4rem 1rem; text-align: center; color: var(--muted); }
.empty-state.visible { display: block; }

.installer-strip {
  width: min(1440px, calc(100% - 2.5rem));
  margin: 0 auto 6rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2rem;
  color: white;
  border-radius: 1.5rem;
  background: #172d38;
}
.installer-strip h2 { margin: 0 0 0.45rem; font-family: Georgia, serif; font-size: clamp(2rem, 4vw, 3.5rem); font-weight: 500; }
.installer-strip p { margin: 0; max-width: 48rem; color: #bfd0d5; }
.installer-strip a { display: inline-flex; align-items: center; min-height: 3.2rem; padding: 0 1.25rem; border-radius: 999px; color: #17222f; background: var(--lime); text-decoration: none; font-weight: 850; white-space: nowrap; }

.site-footer { border-top: 1px solid var(--line); background: white; }
.footer-inner { width: min(1440px, calc(100% - 2.5rem)); min-height: 7rem; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a { text-decoration: none; }

.status-banner {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  z-index: 70;
  width: min(42rem, calc(100% - 2rem));
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  color: white;
  background: #163841;
  box-shadow: var(--shadow);
  transform: translate(-50%, 150%);
  transition: transform 220ms ease;
}
.status-banner.visible { transform: translate(-50%, 0); }
.status-banner.error { background: #8d302c; }

.dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(10, 24, 33, 0.58);
  backdrop-filter: blur(8px);
}
.dialog-backdrop[hidden] { display: none; }
.checkout-dialog { width: min(35rem, 100%); padding: 1.4rem; border-radius: 1.35rem; background: white; box-shadow: 0 28px 90px rgba(0,0,0,0.28); }
.dialog-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.dialog-header h2 { margin: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; letter-spacing: -0.035em; }
.dialog-header p { margin: 0.4rem 0 0; color: var(--muted); }
.close-button { width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: #edf1f3; cursor: pointer; font-size: 1.35rem; }
.checkout-product { margin: 1.2rem 0; padding: 1rem; display: flex; align-items: center; gap: 0.9rem; border-radius: 1rem; background: #f1f4f5; }
.checkout-product img { width: 3.7rem; height: 3.7rem; border-radius: 0.8rem; object-fit: cover; }
.checkout-product strong, .checkout-product span { display: block; }
.checkout-product span { color: var(--muted); font-size: 0.9rem; }
.field-label { display: block; margin: 0 0 0.4rem; font-weight: 750; }
.email-input { width: 100%; min-height: 3.2rem; padding: 0 0.9rem; border: 1px solid #bac5cc; border-radius: 0.75rem; color: var(--ink); background: white; outline: none; }
.email-input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(0,93,104,0.14); }
.dialog-note { margin: 0.7rem 0 0; color: var(--muted); font-size: 0.82rem; }
.dialog-actions { margin-top: 1.2rem; display: flex; justify-content: flex-end; gap: 0.7rem; }
.secondary-button { min-height: 2.9rem; padding: 0 1rem; border: 1px solid var(--line); border-radius: 0.72rem; color: var(--ink); background: white; font-weight: 700; cursor: pointer; }
.primary-button[disabled] { opacity: 0.62; cursor: wait; }

@media (max-width: 1120px) {
  .app-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tools-row { align-items: flex-start; flex-direction: column; }
  .search-wrap { width: 100%; }
}
@media (max-width: 820px) {
  .nav-links a:not(.library-link) { display: none; }
  .hero { grid-template-columns: 1fr; align-items: start; }
  .hero h1 { max-width: 9ch; }
  .price-panel { max-width: 34rem; }
  .app-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .installer-strip { grid-template-columns: 1fr; }
  .installer-strip a { justify-self: start; }
}
@media (max-width: 560px) {
  .nav-wrap, .hero, .store-shell, .installer-strip, .footer-inner { width: min(100% - 1.2rem, 1440px); }
  .brand span { max-width: 10rem; line-height: 1.1; }
  .hero { padding-top: 2.6rem; }
  .hero h1 { font-size: clamp(3.15rem, 17vw, 5rem); }
  .store-tools { top: 4.8rem; }
  .category-tabs { overflow-x: auto; width: 100%; flex-wrap: nowrap; padding-bottom: 0.2rem; }
  .category-tabs button { flex: 0 0 auto; }
  .catalog-heading { align-items: flex-start; flex-direction: column; }
  .app-grid { grid-template-columns: 1fr; }
  .footer-inner { padding: 1.5rem 0; align-items: flex-start; flex-direction: column; }
  .dialog-actions { flex-direction: column-reverse; }
  .dialog-actions button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
