/* soso/faces — modern view
   Dark, quiet surfaces; one lime accent; payment colours as small signals. */

:root {
  --bg: #0d0e10;
  --surface: #15171a;
  --surface-2: #1c1f23;
  --line: #262a2f;
  --line-2: #323840;
  --text: #ecebe6;
  --muted: #8d9198;
  --faint: #5c6168;
  --accent: #c8f04b;
  --accent-ink: #10130a;

  --free: #5fd6a0;
  --freemium: #f3c454;
  --trial: #56c8dc;
  --garmin: #ff7d5c;

  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --bar-h: 68px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }

body {
  font: 14px/1.55 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--text);
  background: var(--bg);
  display: flex; flex-direction: column;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ---------- top bar ---------- */
.bar {
  height: var(--bar-h); flex: none;
  display: flex; align-items: center; gap: 20px;
  padding: 0 28px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none !important; }
.brand-mark {
  width: 26px; height: 26px; border-radius: 50%;
  border: 2px solid var(--text);
  position: relative;
}
.brand-mark::before, .brand-mark span {
  content: ""; position: absolute; left: 50%; bottom: 50%;
  width: 2px; background: var(--text); border-radius: 2px; transform-origin: bottom;
}
.brand-mark::before { height: 8px; margin-left: -1px; }
.brand-mark span { height: 6px; margin-left: -1px; background: var(--accent); transform: rotate(120deg); }
.brand-word { font: 700 19px/1 "Space Grotesk", Inter, sans-serif; letter-spacing: -.02em; }
.brand-word i { font-style: normal; color: var(--accent); margin: 0 1px; }

.seg {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  margin-left: 12px;
}
.seg button {
  border: 0; background: none; cursor: pointer;
  padding: 7px 14px; border-radius: 999px;
  color: var(--muted); font-weight: 500; font-size: 13px;
  display: flex; align-items: center; gap: 7px;
  transition: color .15s, background .15s;
}
.seg button:hover { color: var(--text); }
.seg button[aria-selected="true"] { background: var(--text); color: var(--bg); }
.seg .n { font-size: 11px; opacity: .6; font-variant-numeric: tabular-nums; }

.search {
  margin-left: auto;
  display: flex; align-items: center; gap: 8px;
  height: 38px; width: 260px; padding: 0 10px 0 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  color: var(--muted);
  transition: border-color .15s;
}
.search:focus-within { border-color: var(--line-2); color: var(--text); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; color: var(--text); font: inherit; }
.search input::placeholder { color: var(--faint); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.4); }
kbd {
  font: 500 11px Inter, sans-serif; color: var(--faint);
  border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 6px;
}
.bar-links { display: flex; gap: 6px; }
.ghost {
  padding: 8px 14px; border-radius: 999px; color: var(--muted);
  font-size: 13px; font-weight: 500; white-space: nowrap;
}
.ghost:hover { color: var(--text); background: var(--surface); text-decoration: none; }
.ghost.accent { color: var(--accent); }

/* ---------- layout ---------- */
.layout { flex: 1; min-height: 0; display: flex; }

.rail {
  width: 270px; flex: none;
  border-right: 1px solid var(--line);
  padding: 22px 22px 28px;
  overflow-y: auto;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
}
.rail-head {
  display: flex; justify-content: space-between; align-items: center;
  font: 600 13px "Space Grotesk", Inter, sans-serif; letter-spacing: .02em;
  margin-bottom: 18px;
}
.text-btn { border: 0; background: none; color: var(--accent); cursor: pointer; font-size: 12px; padding: 0; }
.group { margin-bottom: 26px; }
.group h4 {
  margin: 0 0 10px;
  font-size: 11px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
  color: var(--faint);
}

.pay-list { display: flex; flex-direction: column; gap: 2px; }
.pay {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 8px 10px; margin: 0 -10px; width: calc(100% + 20px);
  border: 0; border-radius: var(--r-sm); background: none; cursor: pointer;
  text-align: left; color: var(--muted);
  transition: background .15s, color .15s;
}
.pay:hover { background: var(--surface); color: var(--text); }
.pay .sw {
  width: 16px; height: 16px; flex: none; border-radius: 5px;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  transition: background .15s, border-color .15s;
}
.pay[aria-pressed="true"] { color: var(--text); }
.pay[aria-pressed="true"] .sw { background: var(--c); border-color: var(--c); }
.pay[aria-pressed="true"] .sw::after {
  content: ""; width: 4px; height: 8px; margin-top: -2px;
  border: solid var(--bg); border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.pay .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); flex: none; }
.pay .lbl { flex: 1; }
.pay .lbl small { display: block; font-size: 11px; color: var(--faint); line-height: 1.3; }
.pay .n, .chip .n { font-size: 11px; color: var(--faint); font-variant-numeric: tabular-nums; }

.tag-sub { font-size: 11px; color: var(--faint); margin: 14px 0 8px; }
.tag-sub:first-of-type { margin-top: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 11px; border-radius: 999px;
  border: 1px solid var(--line-2); background: none; cursor: pointer;
  color: var(--muted); font-size: 12.5px; font-weight: 500;
  transition: all .15s var(--ease);
}
.chip:hover { color: var(--text); border-color: var(--faint); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chip[aria-pressed="true"] .n { color: var(--accent-ink); opacity: .6; }
.chip:disabled { opacity: .3; cursor: default; }

.sort { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------- main ---------- */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 22px 28px 0; }
.main-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; flex: none; min-height: 34px; }
.main-head h1 { margin: 0; font: 600 26px/1.1 "Space Grotesk", Inter, sans-serif; letter-spacing: -.02em; }
.count { color: var(--faint); font-variant-numeric: tabular-nums; }
.active { display: flex; gap: 6px; flex-wrap: wrap; margin-left: 6px; }
.active .chip { padding: 3px 8px 3px 10px; font-size: 12px; color: var(--text); background: var(--surface-2); border-color: transparent; }
.active .chip svg { width: 12px; height: 12px; opacity: .6; }
.filters-toggle { display: none; }

.grid {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: repeat(var(--cols, 5), minmax(0, 1fr));
  grid-auto-rows: var(--row-h, 280px);
  gap: var(--gap, 16px);
  align-content: start;
  overflow-y: auto;
  /* room so the hover lift and focus ring aren't clipped */
  margin: -6px -10px 0; padding: 6px 10px 28px;
  scrollbar-width: thin; scrollbar-color: var(--line-2) transparent;
  overscroll-behavior: contain;
}
.grid::-webkit-scrollbar { width: 10px; }
.grid::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 5px; border: 3px solid var(--bg); }

.card {
  position: relative;
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background: var(--surface);
  padding: 0; overflow: hidden;
  cursor: pointer; text-align: left;
  transition: transform .25s var(--ease), border-color .2s, background .2s;
  animation: rise .45s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }
.card:hover { transform: translateY(-3px); border-color: var(--line-2); background: var(--surface-2); }

.card .media {
  flex: 1; min-height: 0; position: relative;
  background: radial-gradient(60% 60% at 50% 45%, #23272c 0%, var(--surface) 100%);
}
.card .media img {
  position: absolute; inset: 10px 10px 0;
  width: calc(100% - 20px); height: calc(100% - 10px);
  object-fit: contain;
  transition: opacity .35s var(--ease), transform .45s var(--ease);
}
.card .media img.alt { opacity: 0; }
.card:hover .media img.main { transform: scale(1.03); }
.card:hover .media img.alt { opacity: 1; transform: scale(1.03); }
.card:hover .media img.main.has-alt { opacity: 0; }

.badge {
  position: absolute; top: 10px; left: 10px; z-index: 1;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px 4px 8px; border-radius: 999px;
  background: rgba(13, 14, 16, .72); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  font-size: 11px; font-weight: 600; color: var(--text);
  border: 1px solid rgba(255,255,255,.06);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }

.card .info { padding: 10px 14px 13px; display: flex; flex-direction: column; gap: 2px; }
.card .row { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.card .name { font: 600 15px/1.25 "Space Grotesk", Inter, sans-serif; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card .price { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--text); white-space: nowrap; }
.card .price.free { color: var(--free); }
.card .meta { font-size: 12px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- pager ---------- */
.pager { flex: none; display: flex; align-items: center; gap: 14px; padding-top: 16px; }
.pager-track { flex: 1; display: flex; gap: 4px; }
.pager-track button {
  flex: 1; height: 22px; border: 0; background: none; cursor: pointer; padding: 0; position: relative;
}
.pager-track button::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 3px; margin-top: -1.5px;
  border-radius: 3px; background: var(--line-2); transition: background .2s, height .2s;
}
.pager-track button:hover::before { background: var(--faint); }
.pager-track button[aria-current="page"]::before { background: var(--accent); height: 4px; }
.pager-num { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }

.icon-btn {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--line-2);
  background: var(--surface); color: var(--text); cursor: pointer;
  transition: background .15s, border-color .15s, opacity .15s;
}
.icon-btn:hover { background: var(--surface-2); border-color: var(--faint); }
.icon-btn:disabled { opacity: .3; cursor: default; }

.empty { flex: 1; display: grid; place-content: center; text-align: center; gap: 14px; color: var(--muted); }
.empty p { margin: 0; font: 500 18px "Space Grotesk", Inter, sans-serif; color: var(--text); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none !important;
  transition: transform .15s var(--ease), background .15s, filter .15s;
}
.btn:hover { background: #262a30; }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn svg { width: 16px; height: 16px; }

/* ---------- drawer ---------- */
.drawer { position: fixed; inset: 0; z-index: 40; }
.scrim { position: absolute; inset: 0; background: rgba(5, 6, 7, .6); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); animation: fade .25s both; }
@keyframes fade { from { opacity: 0; } }
.sheet {
  position: absolute; top: 12px; right: 12px; bottom: 12px;
  width: min(560px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  animation: slide .4s var(--ease) both;
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }
.close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(13,14,16,.7); }

.stage {
  position: relative; flex: none; height: 46%; overflow: hidden;
  background: radial-gradient(55% 60% at 50% 50%, #262a30 0%, #121417 100%);
  display: grid; place-items: center;
}
.stage img { position: absolute; left: 7%; top: 5%; width: 86%; height: 90%; object-fit: contain; animation: fade .3s both; }
.stage .nav { position: absolute; top: 50%; margin-top: -18px; background: rgba(13,14,16,.7); }
.nav-prev { left: 14px; } .nav-next { right: 14px; }
.stage-count {
  position: absolute; bottom: 12px; right: 14px;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
  background: rgba(13,14,16,.7); padding: 2px 8px; border-radius: 999px;
}
.thumbs {
  flex: none; display: flex; gap: 8px; padding: 12px 22px;
  overflow-x: auto; border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.thumbs::-webkit-scrollbar { display: none; }
.thumbs button {
  flex: none; width: 52px; height: 52px; padding: 3px;
  border-radius: 12px; border: 1.5px solid transparent; background: var(--surface-2);
  cursor: pointer; opacity: .55; transition: opacity .15s, border-color .15s;
}
.thumbs button:hover { opacity: .85; }
.thumbs button[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; border-radius: 8px; display: block; }

.sheet-body { flex: 1; min-height: 0; overflow-y: auto; padding: 20px 26px 28px; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.eyebrow { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); }
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--c); }
.sheet-body h2 { margin: 0; font: 600 30px/1.1 "Space Grotesk", Inter, sans-serif; letter-spacing: -.025em; }
.price-line { margin: 8px 0 18px; color: var(--muted); }
.price-line b { color: var(--text); font-weight: 600; }
.cta { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 18px; margin-bottom: 18px; border-bottom: 1px solid var(--line); }
.tag-row .chip { font-size: 12px; padding: 4px 10px; }
.desc { color: #c4c6c9; font-size: 14px; }
.desc p { margin: 0 0 12px; }
.desc ul { margin: 0 0 12px; padding-left: 18px; }
.desc li { margin-bottom: 4px; }
.desc li::marker { color: var(--faint); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .bar-links .ghost:first-child { display: none; }
  .search { width: 200px; }
}
@media (max-width: 860px) {
  body { overflow: auto; }
  .bar { flex-wrap: wrap; height: auto; padding: 14px 16px; gap: 12px; }
  .seg { order: 3; width: 100%; margin: 0; overflow-x: auto; }
  .seg button { flex: 1; justify-content: center; padding: 7px 8px; white-space: nowrap; }
  .search { width: auto; flex: 1; }
  .bar-links { display: none; }
  .layout { flex-direction: column; }
  .rail {
    position: fixed; inset: auto 0 0 0; z-index: 30; width: auto; max-height: 75vh;
    border: 1px solid var(--line); border-radius: 22px 22px 0 0;
    background: var(--surface);
    transform: translateY(100%); transition: transform .35s var(--ease);
    box-shadow: 0 -20px 60px rgba(0,0,0,.5);
  }
  .rail.open { transform: none; }
  .main { padding: 16px; }
  .main-head h1 { font-size: 22px; }
  .filters-toggle {
    display: inline-flex; margin-left: auto;
    border: 1px solid var(--line-2); background: var(--surface); border-radius: 999px;
    padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer;
  }
  .active { display: none; }
  .grid { overflow: visible; }
  .sheet { top: auto; left: 0; right: 0; bottom: 0; width: 100%; height: 92vh; border-radius: 22px 22px 0 0; animation-name: up; }
  @keyframes up { from { transform: translateY(40px); opacity: 0; } }
}

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