/* Serloko Downloads — same system as gate.serloko.com: tokens, layout, components. Dark default; light via [data-theme="light"]. */

:root {
  --bg: #0d0d12;
  --surface: #15151c;
  --surface-2: #1c1c25;
  --line: #2a2a35;
  --ink: #f3f2ef;
  --muted: #a3a2ad;
  --accent: #8a5cf0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(138, 92, 240, .16);
  --ok: #3ccf8e;
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 40px -24px rgba(0, 0, 0, .6);

  --tone-orange: #3a2418; --tone-orange-ink: #ffb27a;
  --tone-green: #16302a;  --tone-green-ink: #6fe0b4;
  --tone-blue: #172638;   --tone-blue-ink: #82b8ff;
  --tone-pink: #3a1a2a;   --tone-pink-ink: #ff9cc6;
  --tone-purple: #261c3d; --tone-purple-ink: #b99bff;

  --font-display: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --header-h: 68px;
  --shell: min(1200px, calc(100% - 48px));
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: dark;
}

:root[data-theme="light"] {
  --bg: #f6f5f2;
  --surface: #ffffff;
  --surface-2: #efede8;
  --line: #e2dfd8;
  --ink: #16151a;
  --muted: #5f5d68;
  --accent: #6b3fd6;
  --accent-soft: rgba(107, 63, 214, .1);
  --ok: #138a57;
  --shadow: 0 1px 2px rgba(22, 21, 26, .05), 0 18px 40px -26px rgba(22, 21, 26, .25);

  --tone-orange: #fbe6d6; --tone-orange-ink: #b4531b;
  --tone-green: #d8f1e5;  --tone-green-ink: #12704b;
  --tone-blue: #dde9fb;   --tone-blue-ink: #2457a6;
  --tone-pink: #f9dfeb;   --tone-pink-ink: #a8326a;
  --tone-purple: #e8e0fa; --tone-purple-ink: #5a33b8;

  color-scheme: light;
}

/* ---------- Base ---------- */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-width: 320px;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
svg { flex: none; }
h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: 600; letter-spacing: -.025em; line-height: 1.08; text-wrap: balance; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.skip-link {
  position: fixed; z-index: 100; top: 12px; left: 12px;
  padding: 10px 16px; border-radius: var(--r-sm);
  background: var(--accent); color: var(--accent-ink); font-weight: 600;
  transform: translateY(-200%);
}
.skip-link:focus { transform: none; }

.section-shell { width: var(--shell); margin-inline: auto; }
.section { padding-block: clamp(72px, 10vw, 128px); }
.section-tinted { background: var(--surface); border-block: 1px solid var(--line); }

.eyebrow { margin-bottom: 14px; color: var(--accent); font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.section-heading { max-width: 640px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-heading h2 { font-size: clamp(2rem, 4.2vw, 3.25rem); }
.section-heading > p:not(.eyebrow) { margin-top: 16px; color: var(--muted); font-size: 18px; }
.section-heading-row { display: flex; max-width: none; align-items: end; justify-content: space-between; gap: 24px; }
.catalog-count { color: var(--muted); font-size: 15px; }

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

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 999px;
  font-size: 15px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: transform .15s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(1px) scale(.98); }
.button:disabled { cursor: not-allowed; opacity: .45; transform: none; box-shadow: none; }
.button svg { transition: transform .25s var(--ease); }
.button:hover svg:last-child:not(:first-child) { transform: translateX(3px); }
.button-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 24px -10px var(--accent); }
.button-primary:hover { background: color-mix(in srgb, var(--accent) 88%, white); }
.button-ghost { border-color: var(--line); color: var(--ink); }
.button-ghost:hover { border-color: var(--ink); }
.button-small { min-height: 44px; padding: 0 16px; font-size: 14px; background: var(--ink); color: var(--bg); }
.button-small:hover { background: var(--accent); color: var(--accent-ink); }
.button-block { width: 100%; }
.button-download:hover svg { transform: translateY(2px); }

.icon-button {
  display: inline-grid; place-items: center;
  width: 44px; height: 44px; flex: none;
  border: 1px solid var(--line); border-radius: 999px; background: transparent;
  transition: border-color .2s, transform .15s;
}
.icon-button:hover { border-color: var(--ink); }
.icon-button:active { transform: scale(.94); }
:root[data-theme="light"] .when-dark, :root:not([data-theme="light"]) .when-light { display: none; }

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

.site-header {
  position: sticky; z-index: 40; top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(1.4) blur(16px);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
}
.header-inner { display: flex; width: var(--shell); height: var(--header-h); margin-inline: auto; align-items: center; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 21px; font-weight: 700; letter-spacing: -.03em; }
.brand-sub { color: var(--muted); font-weight: 600; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-right: auto; }
.main-nav a { padding: 10px 14px; border-radius: 999px; color: var(--muted); font-size: 15px; font-weight: 500; transition: color .2s, background-color .2s; }
.main-nav a:hover { color: var(--ink); background: var(--surface-2); }

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

.hero { position: relative; overflow: hidden; padding-block: clamp(56px, 9vw, 112px) clamp(72px, 10vw, 128px); }
.hero::before {
  content: ""; position: absolute; z-index: -1; top: 0; right: 0; bottom: 0;
  width: 42%; background: var(--surface); border-left: 1px solid var(--line);
}
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: clamp(40px, 6vw, 96px); align-items: center; }
.hero h1 { font-size: clamp(2.6rem, 6vw, 4.75rem); letter-spacing: -.035em; }
.hero-description { max-width: 540px; margin-top: 24px; color: var(--muted); font-size: clamp(17px, 1.6vw, 19px); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.hero-facts { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 40px; color: var(--muted); font-size: 15px; }
.hero-facts li { display: inline-flex; align-items: center; gap: 8px; }
.hero-facts svg { color: var(--ok); }

.hero-card { padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--bg); box-shadow: var(--shadow); }
.hero-card-head { display: flex; justify-content: space-between; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.hero-card-head span:first-child { display: inline-flex; align-items: center; gap: 8px; color: var(--ink); font-weight: 600; }
#hero-list { margin-bottom: 20px; }
#hero-list li { border-bottom: 1px solid var(--line); }
#hero-list a, #hero-list .hero-row {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 14px; align-items: center;
  padding-block: 14px; border-radius: var(--r-sm);
}
#hero-list a:hover strong { color: var(--accent); }
#hero-list strong { display: block; overflow: hidden; font-size: 15px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; transition: color .2s; }
#hero-list small { color: var(--muted); font-size: 13px; }
#hero-list b { color: var(--muted); font-size: 14px; font-weight: 500; font-variant-numeric: tabular-nums; }

/* entrance: once on load */
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-content > * { animation: rise .7s var(--ease) both; }
.hero-content > :nth-child(2) { animation-delay: .06s; }
.hero-content > :nth-child(3) { animation-delay: .12s; }
.hero-content > :nth-child(4) { animation-delay: .18s; }
.hero-content > :nth-child(5) { animation-delay: .24s; }
.hero-card { animation: rise .9s .2s var(--ease) both; }
#hero-list li { animation: rise .6s var(--ease) both; }
#hero-list li:nth-child(1) { animation-delay: .45s; }
#hero-list li:nth-child(2) { animation-delay: .55s; }
#hero-list li:nth-child(3) { animation-delay: .65s; }

/* ---------- App artwork ---------- */

.app-art {
  display: grid; place-items: center; overflow: hidden;
  aspect-ratio: 1; border-radius: 12px;
  font-family: var(--font-display); font-weight: 700; line-height: 1;
}
.app-art img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.app-art span { font-size: 24px; transition: transform .5s var(--ease); }
.tone-orange { background: var(--tone-orange); color: var(--tone-orange-ink); }
.tone-green { background: var(--tone-green); color: var(--tone-green-ink); }
.tone-blue { background: var(--tone-blue); color: var(--tone-blue-ink); }
.tone-pink { background: var(--tone-pink); color: var(--tone-pink-ink); }
.tone-purple { background: var(--tone-purple); color: var(--tone-purple-ink); }

/* ---------- Download cards ---------- */

.download-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 24px; }
.download-card {
  display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere;
  padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--bg);
  transition: transform .25s var(--ease), border-color .25s, box-shadow .25s;
}
.download-card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--ink) 25%, var(--line)); box-shadow: var(--shadow); }
.download-card:hover .app-art img, .download-card:hover .app-art span { transform: scale(1.03); }
.download-card-head { display: flex; align-items: center; gap: 18px; }
.download-card .app-art { width: 72px; border-radius: 18px; }
.download-card .app-art span { font-size: 32px; }
.download-kicker { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 6px; }
.badge { display: inline-block; padding: 3px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: 12px; font-weight: 600; line-height: 1.4; }
.badge-muted { background: var(--surface-2); color: var(--muted); }
.download-card h3 { font-size: 24px; }
.download-description { margin-top: 18px; color: var(--muted); font-size: 15px; line-height: 1.6; white-space: pre-line; }
.download-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.download-meta dt { color: var(--muted); font-size: 12px; }
.download-meta dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.download-card .download-action { margin-top: auto; padding-top: 24px; }
.status-pill { display: flex; align-items: center; justify-content: center; min-height: 48px; border: 1px dashed var(--line); border-radius: 999px; color: var(--muted); font-size: 15px; }
.empty-state { grid-column: 1 / -1; padding: 72px 24px; border: 1px dashed var(--line); border-radius: var(--r-lg); color: var(--muted); text-align: center; }

/* ---------- FAQ ---------- */

.faq-grid { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); gap: clamp(32px, 6vw, 96px); align-items: start; }
.faq-grid .section-heading { position: sticky; top: calc(var(--header-h) + 32px); margin-bottom: 0; }
.contact-detail { display: inline-flex; align-items: center; gap: 12px; min-height: 44px; margin-top: 24px; font-weight: 500; transition: color .2s; }
.contact-detail svg { color: var(--accent); }
.contact-detail:hover { color: var(--accent); }
.faq-list { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 72px; padding-block: 18px;
  font-size: 18px; font-weight: 600; cursor: pointer; list-style: none; transition: color .2s;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:hover { color: var(--accent); }
.faq-item summary svg { color: var(--muted); transition: transform .3s var(--ease); }
.faq-item[open] summary svg { transform: rotate(180deg); }
.faq-item p { max-width: 620px; padding-bottom: 24px; color: var(--muted); }
.faq-item strong { color: var(--ink); font-weight: 600; }

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

.site-footer { padding-top: 48px; border-top: 1px solid var(--line); background: var(--surface); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 4px 24px; }
.footer-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--muted); font-weight: 500; transition: color .2s; }
.footer-links a:hover { color: var(--accent); }
.footer-copy { margin-top: 32px; padding-block: 28px 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: 13px; }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  :root { --header-h: 64px; --shell: calc(100% - 40px); }
  .header-inner { gap: 12px; }
  .main-nav { margin-left: auto; margin-right: 0; }
  .hero::before { display: none; }
  .hero-grid, .faq-grid { grid-template-columns: 1fr; }
  .hero-card { max-width: 520px; background: var(--surface); }
  .faq-grid .section-heading { position: static; }
  .section-heading-row { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 600px) {
  :root { --shell: calc(100% - 32px); }
  .brand { margin-right: auto; font-size: 19px; }
  .main-nav { display: none; }
  .hero-actions .button { flex: 1 1 100%; }
  .hero-card { padding: 18px; }
  .download-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
