:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-strong: #eef1f6;
  --ink: #14181f;
  --muted: #5b6472;
  --line: #e3e7ed;
  --accent: #2952e3;
  --accent-deep: #1d3fbd;
  --accent-tint: #eef1fd;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.08);
  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
}

button,
a {
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease, background-color 0.15s ease;
}

.page-shell {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 24px 16px 40px;
}

.app {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.topbar {
  display: flex;
  justify-content: center;
  padding: 4px 0 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* hero */

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  padding: 12px 0 4px;
}

.hero-title {
  margin: 0;
  font-size: clamp(1.7rem, 4.6vw, 2.5rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.hero-sub {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.55;
  max-width: 46ch;
}

.primary-button {
  position: relative;
  overflow: hidden;
  display: inline-block;
  width: min(100%, 420px);
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: #fff;
  padding: 1rem 1.5rem;
  font-size: clamp(1.02rem, 2vw, 1.15rem);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 0 0 0 rgba(41, 82, 227, 0.35), var(--shadow-sm);
  animation: buttonPulse 2.6s ease-in-out infinite;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, background-color 0.15s ease;
}

.primary-button::after {
  content: "";
  position: absolute;
  top: 0;
  left: -60%;
  width: 40%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.35), transparent);
  transform: skewX(-20deg);
  animation: buttonShimmer 3.2s ease-in-out infinite;
}

@keyframes buttonPulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(41, 82, 227, 0.35), var(--shadow-sm);
  }
  50% {
    box-shadow: 0 0 0 10px rgba(41, 82, 227, 0), var(--shadow-sm);
  }
}

@keyframes buttonShimmer {
  0% {
    left: -60%;
  }
  50%,
  100% {
    left: 130%;
  }
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--accent-deep);
  transform: translateY(-2px) scale(1.015);
  box-shadow: 0 10px 24px rgba(29, 63, 189, 0.32);
  animation-play-state: paused;
}

.primary-button:active {
  transform: translateY(0) scale(0.96);
  transition-duration: 0.1s;
}

.primary-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  animation: none;
}

.primary-button:disabled::after {
  display: none;
}

/* discovery card */

.card-wrap {
  min-height: 40px;
}

.product-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  animation: slideIn 0.22s ease forwards;
}

.product-link {
  display: block;
  color: var(--ink);
  text-decoration: none;
}

.product-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}

.product-media {
  aspect-ratio: 4 / 3;
  background: var(--panel-strong);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-body {
  padding: 18px 20px 6px;
}

.product-topline {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.product-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.tag {
  background: var(--accent-tint);
  color: var(--accent-deep);
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.product-title {
  margin: 0;
  font-size: clamp(1.25rem, 3vw, 1.6rem);
  line-height: 1.2;
  font-weight: 700;
}

.product-tagline {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.5;
}

.product-more {
  margin: 0;
  padding: 14px 20px 20px;
  border-top: 1px solid var(--line);
}

.product-more a {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
}

.product-more a:hover {
  color: var(--accent-deep);
  text-decoration: underline;
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

/* crawlable index (used by the "Related products" block on /p/{slug} pages) */

.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.index-item a {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 14px;
  align-items: center;
  padding: 10px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--ink);
}

.index-item a:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-sm);
}

.index-item img {
  width: 84px;
  height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--panel-strong);
}

.index-item h3 {
  margin: 0 0 3px;
  font-size: 0.96rem;
  font-weight: 700;
  line-height: 1.25;
}

.index-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* article pages */

.article {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 20px 26px;
  box-shadow: var(--shadow-md);
}

.crumbs {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 12px;
}

.crumbs a {
  color: var(--muted);
}

.crumbs a:hover {
  color: var(--accent);
}

.article h1 {
  margin: 0 0 10px;
  font-size: clamp(1.5rem, 4.2vw, 2.1rem);
  line-height: 1.15;
  letter-spacing: -0.02em;
  font-weight: 700;
}

.article h2 {
  margin: 30px 0 10px;
  font-size: 1.15rem;
  font-weight: 700;
}

.article p {
  margin: 0 0 16px;
  line-height: 1.65;
  font-size: 1rem;
}

.lede {
  color: var(--muted);
  font-size: 1.05rem !important;
}

.article-media {
  margin: 0 0 18px;
}

.article-media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  background: var(--panel-strong);
}

.article-media figcaption {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--muted);
}

.article-price {
  font-size: 0.95rem !important;
}

.price-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.buy {
  margin: 6px 0 26px;
}

.ticks {
  margin: 0 0 18px;
  padding-left: 20px;
}

.ticks li {
  margin-bottom: 8px;
  line-height: 1.55;
}

.back-link {
  margin-top: 28px !important;
  font-size: 0.92rem !important;
}

.back-link a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}

.back-link a:hover {
  color: var(--accent-deep);
}

/* footer */

.site-footer {
  text-align: center;
  padding-top: 28px;
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.site-footer p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
}

.site-footer p:last-child {
  margin-bottom: 0;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@media (min-width: 680px) {
  .page-shell {
    padding-top: 40px;
  }

  .product-link {
    display: grid;
    grid-template-columns: 1.08fr 0.92fr;
  }

  .article {
    padding: 32px 34px 36px;
  }

  .index-list {
    grid-template-columns: 1fr 1fr;
  }
}
