:root {
  --bg:     #000;
  --bg1:    #1c1c1e;
  --bg2:    #2c2c2e;
  --t1:     #fff;
  --t2:     rgba(235,235,245,.6);
  --t3:     rgba(235,235,245,.3);
  --sep:    rgba(84,84,88,.6);
  --fill:   rgba(118,118,128,.24);
  --fill2:  rgba(120,120,128,.36);
  --nav-bg: rgba(0,0,0,.85);
  color-scheme: dark;
}

[data-theme="light"] {
  --bg:     #f2f2f7;
  --bg1:    #fff;
  --bg2:    #e5e5ea;
  --t1:     #000;
  --t2:     rgba(60,60,67,.6);
  --t3:     rgba(60,60,67,.3);
  --sep:    rgba(60,60,67,.29);
  --fill:   rgba(118,118,128,.12);
  --fill2:  rgba(120,120,128,.2);
  --nav-bg: rgba(242,242,247,.85);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--t1);
  font-family: -apple-system, "SF Pro Text", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }

/* NAV */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99;
  height: 52px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: .5px solid var(--sep);
  transition: background .25s;
}

.nav-logo {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.022em;
}

/* THEME TOGGLE */
.toggle-wrap {
  display: flex; align-items: center; gap: 12px;
}

/* LANGUAGE SWITCH (nav) */
.lang-switch {
  display: inline-flex;
  background: var(--fill);
  border-radius: 8px;
  padding: 2px;
}
.lang-switch button {
  font-size: 12px; font-weight: 600;
  color: var(--t2);
  padding: 5px 10px;
  border-radius: 6px;
  transition: background .15s, color .15s;
}
.lang-switch button.active {
  background: var(--bg2);
  color: var(--t1);
}

.toggle-icon {
  font-size: 15px;
  line-height: 1;
  color: var(--t2);
  user-select: none;
}

.toggle {
  width: 44px; height: 26px;
  border-radius: 100px;
  background: #3a3a3c;
  position: relative;
  cursor: pointer;
  flex-shrink: 0;
  transition: background .25s;
}

[data-theme="light"] .toggle { background: #e5e5ea; }

.toggle::after {
  content: "";
  position: absolute;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform .25s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}

[data-theme="light"] .toggle::after { transform: translateX(18px); }

/* HERO */
main { padding-top: 52px; }

.hero { padding: 40px 20px 28px; }

.hero-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--t2);
  margin-bottom: 12px;
}

.hero-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #30d158;
  flex-shrink: 0;
}

.hero h1 {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.25;
}

/* APPS CONTAINER */
.apps-container {
  padding: 8px 20px 60px;
}

.apps-title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  padding: 0 4px;
  margin-bottom: 16px;
}

.section-head {
  font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--t3);
  padding: 0 4px;
  margin: 24px 0 8px;
}
.section-head:first-child { margin-top: 0; }

/* LIST */
.list {
  background: var(--bg1);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 8px;
}

.app-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  position: relative;
  transition: background .12s;
}

.app-row:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: 0; left: 74px; right: 0;
  height: .5px;
  background: var(--sep);
}

.app-row:active { background: var(--fill); }

.app-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.app-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 12px;
}

.app-info { flex: 1; min-width: 0; }

.app-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}

.app-sub {
  font-size: 13px;
  color: var(--t3);
}

.app-btn {
  font-size: 13px;
  font-weight: 700;
  background: var(--fill2);
  color: var(--t1);
  padding: 6px 14px;
  border-radius: 100px;
  flex-shrink: 0;
}

.app-btn--dim { background: var(--fill); color: var(--t3); }
.app-row--dim { opacity: .55; cursor: default; }

/* GROUPS ROW — sections side by side, stack on narrow screens */
.groups-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
}

.group-col {
  flex: 1;
  min-width: 0;
}

@media (max-width: 680px) {
  .groups-row { flex-direction: column; gap: 0; }
}

/* PUBLISHED CARDS */
.cards-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 8px;
}

.app-card {
  background: var(--bg1);
  border-radius: 16px;
  padding: 14px 16px 16px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: background .12s;
}

.app-card:active { background: var(--fill); }
.app-card--dim { opacity: .55; cursor: default; }

.card-head { display: flex; align-items: center; gap: 10px; }

.card-icon {
  width: 52px; height: 52px;
  border-radius: 12px;
  overflow: hidden;
  flex-shrink: 0;
}

.card-info { flex: 1; min-width: 0; }

.card-name {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.01em;
  margin-bottom: 2px;
}

.card-cat { font-size: 12px; color: var(--t3); }

.card-desc {
  font-size: 13px;
  color: var(--t2);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.card-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--t2);
  background: var(--fill);
  padding: 4px 10px;
  border-radius: 100px;
}

/* OVERLAY */
.overlay {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: flex-end;
  justify-content: center;
}

.overlay.open { display: flex; }

.overlay::before {
  content: "";
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.sheet {
  position: relative; z-index: 1;
  width: 100%;
  max-width: 480px;
  max-height: 90svh;
  background: var(--bg1);
  border-radius: 18px 18px 0 0;
  display: flex; flex-direction: column;
  animation: up .38s cubic-bezier(.32,.72,0,1);
  overflow: hidden;
}

@media (min-width: 540px) {
  .overlay { align-items: center; padding: 20px; }
  .sheet { border-radius: 20px; max-height: 85vh; }
}

@keyframes up { from { transform: translateY(100%); } }

.sheet-handle {
  width: 32px; height: 4px;
  background: var(--fill2);
  border-radius: 2px;
  margin: 8px auto 0;
  flex-shrink: 0;
}

.sheet-top {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 18px 0;
  flex-shrink: 0;
}

.sheet-icon {
  width: 60px; height: 60px;
  border-radius: 14px;
  background: var(--bg2);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.sheet-icon img {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 14px;
}

.sheet-name {
  font-size: 18px; font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 3px;
}

.sheet-cat {
  font-size: 13px;
  color: var(--t3);
}

.btn-close {
  margin-left: auto;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--fill2);
  color: var(--t2);
  font-size: 12px;
  display: flex; align-items: center; justify-content: center;
  align-self: flex-start;
  flex-shrink: 0;
}

/* SEGMENTED */
.seg {
  display: flex;
  margin: 16px 16px 0;
  background: var(--fill);
  border-radius: 9px;
  padding: 2px;
  flex-shrink: 0;
}

.seg-item {
  flex: 1;
  font-size: 12px; font-weight: 600;
  color: var(--t2);
  padding: 6px 3px;
  border-radius: 7px;
  transition: background .15s, color .15s;
  min-height: 32px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.seg-item.active {
  background: var(--bg2);
  color: var(--t1);
  box-shadow: 0 1px 4px rgba(0,0,0,.35);
}

/* SHEET BODY */
.sheet-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 40px;
  scrollbar-width: none;
}
.sheet-body::-webkit-scrollbar { display: none; }

.pane { display: none; }
.pane.active { display: block; }

/* Overview */
.pane-title {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -.02em;
  margin-bottom: 18px;
}

.s-desc {
  font-size: 15px;
  color: var(--t2);
  line-height: 1.7;
  margin-bottom: 24px;
}

.group-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--t3);
  margin-bottom: 10px;
}

.chips {
  display: flex; flex-wrap: wrap; gap: 7px;
  margin-bottom: 24px;
}

.chip {
  font-size: 13px; font-weight: 500;
  color: var(--t2);
  background: var(--fill);
  padding: 5px 13px;
  border-radius: 100px;
}

.lang-note {
  font-size: 12px;
  color: var(--t3);
  margin: -14px 0 24px;
}

/* SCREENSHOTS */
.screens-wrap {
  position: relative;
  margin-bottom: 24px;
}

.screens {
  display: flex; gap: 10px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.screens::-webkit-scrollbar { display: none; }
.screens img {
  height: 220px;
  width: auto;
  border-radius: 12px;
  flex-shrink: 0;
  scroll-snap-align: start;
  object-fit: cover;
  cursor: zoom-in;
}

.screens-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(0,0,0,.55);
  color: #fff;
  font-size: 18px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 2;
}
.screens-nav:active { background: rgba(0,0,0,.75); }
.screens-nav.prev { left: 6px; }
.screens-nav.next { right: 6px; }

/* LIGHTBOX */
.lightbox {
  position: fixed; inset: 0; z-index: 300;
  display: none;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,.92);
}
.lightbox.open { display: flex; }

.lightbox img {
  max-width: 92vw;
  max-height: 86vh;
  border-radius: 12px;
  object-fit: contain;
}

.lightbox-close {
  position: absolute;
  top: 18px; right: 18px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 14px;
  display: flex; align-items: center; justify-content: center;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
}
.lightbox-nav:active { background: rgba(255,255,255,.22); }
.lightbox-nav.prev { left: 14px; }
.lightbox-nav.next { right: 14px; }

/* SUGGESTION FORM */
.form-field { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px; font-weight: 600;
  color: var(--t2);
  margin-bottom: 6px;
}
.form-input, .form-textarea {
  width: 100%;
  background: var(--fill);
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--t1);
  font-family: inherit;
}
.form-textarea { min-height: 110px; resize: vertical; }
.form-input::placeholder, .form-textarea::placeholder { color: var(--t3); }
.form-submit {
  width: 100%;
  background: #f5c518;
  color: #1c1c1e;
  font-weight: 700;
  font-size: 15px;
  padding: 13px;
  border-radius: 10px;
  text-align: center;
  margin-top: 4px;
}
.form-submit:active { opacity: .8; }
.form-hint {
  font-size: 12px;
  color: var(--t3);
  line-height: 1.6;
  margin-top: 20px;
}

/* Privacy & Deletion */
.l-date {
  font-size: 12px;
  color: var(--t3);
  margin-bottom: 22px;
}

.l-block + .l-block {
  border-top: .5px solid var(--sep);
  padding-top: 18px;
  margin-top: 18px;
}

.l-title {
  font-size: 14px; font-weight: 600;
  color: var(--t1);
  margin-bottom: 6px;
}

.l-text {
  font-size: 14px;
  color: var(--t2);
  line-height: 1.7;
}

.d-card {
  background: var(--bg2);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 10px;
}

.d-card-head {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 12px;
}

.d-num {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--fill2);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  flex-shrink: 0;
}

.d-card-title { font-size: 14px; font-weight: 600; }

.d-steps { list-style: none; display: flex; flex-direction: column; }

.d-step {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 9px 0;
  border-top: .5px solid var(--sep);
  font-size: 13px; color: var(--t2);
  line-height: 1.5;
}

.d-step:first-child { border-top: none; padding-top: 0; }

.d-step-n {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: var(--t3);
  flex-shrink: 0; margin-top: 1px;
}

@media (prefers-reduced-motion: reduce) {
  .sheet { animation: none; }
}

/* CONTACT */
.contact { padding: 0 20px 60px; }
.contact > * { max-width: 520px; }
.contact-intro { font-size: 15px; color: var(--t2); line-height: 1.5; padding: 0 4px; margin-bottom: 16px; }
.contact-row {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  padding: 14px 16px; font-size: 15px;
}
.contact-row:not(:last-child) { border-bottom: .5px solid var(--sep); }
.contact-label { color: var(--t2); }
.contact-value { color: var(--t1); font-weight: 500; text-align: right; }
a.contact-value { color: #0a84ff; text-decoration: none; }
