:root {
  --bg: #ffffff;
  --panel: #f7f8fa;
  --border: #e4e7ec;
  --text: #1d2433;
  --text-mute: #667085;
  --accent: #2f6fed;
  --accent-ink: #ffffff;
  --danger: #d92d20;
  --radius: 10px;
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
}

main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

a { color: var(--accent); text-decoration: none; }

h1, h2 { margin: 0; font-weight: 600; letter-spacing: -0.01em; }

/* ---------- header ---------- */

header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  margin-bottom: 32px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border);
}

header .logo { display: block; height: 96px; width: auto; }

header nav { display: flex; align-items: center; justify-content: flex-end; gap: 18px; }

header nav a:not(.button) { color: var(--text-mute); font-size: 0.9rem; }
header nav a:not(.button):hover { color: var(--text); }

/* ---------- buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-size: 0.92rem;
  font-family: var(--font);
  transition: background 0.12s ease;
}
.button:hover { background: #2559c9; }

/* ---------- grid + cards ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 20px;
}

.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
}
.card:hover {
  box-shadow: 0 4px 12px rgba(16, 24, 40, 0.08);
  border-color: #d0d5dd;
}

.card .thumb {
  aspect-ratio: 16 / 10;
  width: 100%;
  object-fit: cover;
  display: block;
  background: var(--panel);
}

.card .thumb.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 600;
  color: #b0b8c4;
  background: var(--panel);
}

.gallery {
  display: flex;
  gap: 6px;
  padding: 8px 12px 0;
}
.gallery img {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.cardbody {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.cardbody h2 { font-size: 1rem; }

.cardbody p {
  color: var(--text-mute);
  font-size: 0.87rem;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
}

.cardfoot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.cardfoot .open { font-weight: 600; font-size: 0.88rem; }
.cardfoot form { margin: 0; }

.iconbtn {
  background: none;
  border: none;
  color: var(--text-mute);
  cursor: pointer;
  font-size: 0.82rem;
  padding: 2px;
  font-family: var(--font);
}
.iconbtn:hover { color: var(--danger); }

/* ---------- empty state ---------- */

.empty {
  text-align: center;
  padding: 90px 20px;
  color: var(--text-mute);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--panel);
}
.empty p { margin: 0 0 18px; }

/* ---------- forms ---------- */

.formpage, .login { max-width: 440px; margin: 0 auto; }

.formpage > a {
  display: inline-block;
  color: var(--text-mute);
  font-size: 0.87rem;
  margin-bottom: 18px;
}

.formpage h1 { margin-bottom: 24px; }

form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 16px;
}

form input[type="text"],
form input[type="url"],
form input[type="password"],
form textarea {
  display: block;
  width: 100%;
  margin-top: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-family: var(--font);
  font-size: 0.95rem;
  font-weight: 400;
}

form input:focus, form textarea:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

form input[type="file"] {
  margin-top: 6px;
  width: 100%;
  color: var(--text-mute);
  font-size: 0.85rem;
  font-weight: 400;
}

form textarea { resize: vertical; font-family: var(--font); }

.error {
  background: #fef3f2;
  border: 1px solid #fda29b;
  color: #b42318;
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-top: 6px;
}

/* ---------- login ---------- */

.login { margin-top: 14vh; text-align: center; }
.login h1 { font-size: 1.5rem; }
.login p { color: var(--text-mute); margin: 8px 0 26px; font-size: 0.92rem; }
.login form { display: flex; flex-direction: column; gap: 12px; }
.login input { text-align: center; }
.login .button { width: 100%; justify-content: center; }

@media (max-width: 480px) {
  main { padding: 28px 16px 60px; }
}

/* ---------- view toggle ---------- */

.viewtoggle, .pill {
  display: inline-flex;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 3px;
}
.pill a, .pill span {
  font-size: 0.82rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}
.pill a:hover { color: var(--accent); }
.pill .disabled { color: #b0b8c4; background: none; box-shadow: none; cursor: not-allowed; }
.viewtoggle button {
  border: none;
  background: none;
  font-family: var(--font);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-mute);
  padding: 5px 12px;
  border-radius: 999px;
  cursor: pointer;
}
html:not([data-view="store"]) .viewtoggle [data-set="classic"],
html[data-view="store"] .viewtoggle [data-set="store"] {
  background: var(--bg);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.12);
}

.store { display: none; }
html[data-view="store"] .store { display: block; }
html[data-view="store"] .grid { display: none; }

/* ---------- store mode ---------- */

html[data-view="store"],
html[data-view="store"] body {
  background: linear-gradient(180deg, #eef1f6 0%, #f7f8fa 420px, #f7f8fa 100%);
}
html[data-view="store"] header { border-bottom: none; }
html[data-view="store"] .button { background: #0a84ff; border-radius: 999px; }
html[data-view="store"] .viewtoggle, html[data-view="store"] .pill { background: #e3e7ee; border-color: transparent; }

.stage {
  position: relative;
  height: 560px;
  perspective: 1600px;
  margin: 0 -24px;
  overflow: hidden;
}
.phones {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}
.phone {
  position: absolute;
  left: 50%;
  top: 20px;
  width: 250px;
  margin-left: -125px;
  aspect-ratio: 9 / 19.5;
  padding: 11px;
  border-radius: 46px;
  background: #111214;
  box-shadow:
    0 0 0 2px #c7cbd1,
    0 0 0 4px #e6e8ec,
    0 30px 60px -20px rgba(16, 24, 40, 0.45);
  cursor: pointer;
  transition: transform 0.6s cubic-bezier(.22,.8,.26,1), opacity 0.6s ease;
}
.phone::before {
  content: "";
  position: absolute;
  top: 21px;
  left: 50%;
  width: 78px;
  height: 22px;
  margin-left: -39px;
  background: #000;
  border-radius: 999px;
  z-index: 2;
}
.phone .screen {
  width: 100%;
  height: 100%;
  border-radius: 36px;
  overflow: hidden;
  background: #fff;
}
.phone .screen img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.2s ease;
}
.phone .placeholder {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, #5ac8fa, #0a84ff);
}

.arrow {
  position: absolute;
  top: 50%;
  z-index: 20;
  width: 44px;
  height: 44px;
  margin-top: -22px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 14px rgba(16, 24, 40, 0.15);
  font-size: 1.7rem;
  line-height: 1;
  color: var(--text);
  cursor: pointer;
}
.arrow.prev { left: 24px; }
.arrow.next { right: 24px; }

.feature {
  display: none;
  text-align: center;
  margin: 8px auto 48px;
  max-width: 520px;
  animation: rise 0.45s ease;
}
.feature.on { display: block; }
.feature h2 { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; }
.feature p { color: var(--text-mute); margin: 6px 0 0; }

.shots {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
}
.shot {
  padding: 0;
  border: 2px solid transparent;
  border-radius: 12px;
  background: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}
.shot.on, .shot:hover { opacity: 1; }
.shot.on { border-color: #0a84ff; }
.shot img {
  display: block;
  width: 44px;
  height: 80px;
  object-fit: cover;
  border-radius: 9px;
}

.get {
  display: inline-block;
  background: #0a84ff;
  color: #fff;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 7px 26px;
  border-radius: 999px;
  margin-top: 18px;
  transition: transform 0.12s ease, background 0.12s ease;
}
.get:hover { background: #0070e0; transform: scale(1.04); }

.rowtitle {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}
.rows {
  background: #fff;
  border-radius: 22px;
  padding: 6px 18px;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06), 0 10px 30px -12px rgba(16, 24, 40, 0.12);
}
.row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.row:last-child { border-bottom: none; }
.row .icon {
  width: 62px;
  height: 62px;
  flex: none;
  border-radius: 15px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.row .icon.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(160deg, #5ac8fa, #0a84ff);
}
.rowtext { flex: 1; min-width: 0; }
.rowtext h4 { margin: 0; font-size: 1rem; font-weight: 600; }
.rowtext p {
  margin: 2px 0 0;
  color: var(--text-mute);
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row .get {
  margin: 0;
  padding: 5px 20px;
  background: #eef1f6;
  color: #0a84ff;
}
.row .get:hover { background: #e1e6ee; }
.row.on .rowtext h4 { color: #0a84ff; }
.row form { margin: 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

@media (max-width: 600px) {
  .stage { height: 440px; margin: 0 -16px; }
  .phone { width: 190px; margin-left: -95px; border-radius: 36px; padding: 8px; }
  .phone .screen { border-radius: 29px; }
  .phone::before { top: 16px; width: 60px; height: 18px; margin-left: -30px; }
  .arrow { display: none; }
  header { grid-template-columns: 1fr 1fr; }
  header .logo { grid-column: 1 / -1; grid-row: 1; justify-self: center; height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  .phone, .feature { transition: none; animation: none; }
}
