:root {
  --uart-purple: #5200ff;
  --uart-purple-dark: #3d00c2;
  --uart-magenta: #fb50ff;
  --uart-yellow: #ffe924;
  --uart-pink: #ff6aa0;
  --uart-orange: #fea048;
  --uart-black: #0a0a0a;
  --uart-white: #ffffff;
  --uart-bg: #f5f5f7;
  --uart-grey: #6b6b76;
  --uart-border: #e7e7ec;
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--uart-bg);
  color: var(--uart-black);
  font-family: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, .brand, .btn {
  font-family: "Unbounded", "Inter", sans-serif;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 20px 64px;
}

/* --- top bar --- */
.topbar {
  max-width: 720px;
  margin: 0 auto;
  padding: 20px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  font-weight: 700;
  font-size: 20px;
  color: var(--uart-purple);
  letter-spacing: 0.02em;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.open-app-btn {
  font-size: 13px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--uart-black);
  color: var(--uart-white);
  white-space: nowrap;
}

.lang-switch a {
  font-size: 13px;
  font-weight: 600;
  color: var(--uart-grey);
  padding: 6px 10px;
  border-radius: 999px;
}

.lang-switch a.active {
  color: var(--uart-white);
  background: var(--uart-black);
}

/* --- hero / cover --- */
.hero {
  margin-top: 20px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--uart-purple) 0%, var(--uart-magenta) 100%);
  height: 160px;
  position: relative;
  overflow: hidden;
}

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

.hero .spark {
  position: absolute;
  top: 18px;
  left: 24px;
  width: 22px;
  height: 22px;
  background: var(--uart-yellow);
  clip-path: polygon(50% 0%, 61% 39%, 100% 50%, 61% 61%, 50% 100%, 39% 61%, 0% 50%, 39% 39%);
  opacity: 0.9;
  animation: uart-spark-twinkle 2.4s ease-in-out infinite;
  transform-origin: center;
}

/* Placeholder motion for the brand mark until the animated logo export from
   Figma is wired in — swap this for the real asset when available. */
.brand {
  animation: uart-brand-glow 3.2s ease-in-out infinite;
}

@keyframes uart-spark-twinkle {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.85; }
  50% { transform: scale(1.3) rotate(18deg); opacity: 1; }
}

@keyframes uart-brand-glow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(82, 0, 255, 0)); }
  50% { filter: drop-shadow(0 0 8px rgba(82, 0, 255, 0.45)); }
}

@media (prefers-reduced-motion: reduce) {
  .hero .spark, .brand { animation: none; }
}

.profile-head {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 18px;
  margin-top: -48px;
  padding: 0;
}

.avatar {
  width: 96px;
  height: 96px;
  border-radius: 50%;
  border: 4px solid var(--uart-bg);
  background: var(--uart-white);
  object-fit: cover;
  flex-shrink: 0;
}

.avatar.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--uart-yellow);
  color: var(--uart-black);
  font-weight: 700;
  font-size: 34px;
}

.name-block { padding-bottom: 8px; }

.display-name {
  font-size: 24px;
  font-weight: 700;
  margin: 0;
}

.bio {
  margin-top: 14px;
  padding: 0 4px;
  color: #333;
  font-size: 15px;
  line-height: 1.5;
}

.socials {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 4px;
}

.socials a {
  font-size: 13px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--uart-white);
  border: 1px solid var(--uart-border);
}

/* --- action buttons --- */
.actions {
  margin-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
}

.actions .btn {
  flex: 1 1 140px;
  min-width: 0;
  white-space: nowrap;
}

.btn-primary { background: var(--uart-purple); color: var(--uart-white); }
.btn-primary:hover { background: var(--uart-purple-dark); }
.btn-outline { background: transparent; color: var(--uart-black); border: 1.5px solid var(--uart-black); }

/* --- products --- */
.section-title {
  margin: 36px 0 14px;
  padding: 0 4px;
  font-size: 18px;
  font-weight: 700;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--uart-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--uart-border);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.card-cover {
  height: 140px;
  background: linear-gradient(135deg, var(--uart-yellow), var(--uart-pink));
  display: flex;
  align-items: center;
  justify-content: center;
}

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

/* Wraps the cover + title + description in one tap target linking to the
   product page — kept separate from .card-footer below so the "Buy" link
   isn't nested inside this anchor (invalid HTML, breaks tap targets). */
.card-tap {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
}

.card-text { padding: 14px 16px 0; display: flex; flex-direction: column; gap: 6px; flex: 1; }

.card-title { font-weight: 700; font-size: 15px; margin: 0; }

.card-desc {
  color: var(--uart-grey);
  font-size: 13px;
  line-height: 1.4;
  flex: 1;
}

.card-footer {
  padding: 8px 16px 16px;
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.price { font-weight: 700; font-size: 15px; }

.buy-btn {
  background: var(--uart-purple);
  color: var(--uart-white);
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  border-radius: 999px;
}

.empty-state {
  padding: 32px 16px;
  text-align: center;
  color: var(--uart-grey);
  background: var(--uart-white);
  border-radius: var(--radius-md);
  border: 1px dashed var(--uart-border);
}

/* --- footer --- */
.site-footer {
  margin-top: 48px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--uart-grey);
  font-size: 12px;
}

.site-footer .brand { font-size: 13px; }

/* --- 404 --- */
.not-found {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 18px;
}

/* --- product page --- */
.product-detail {
  margin-top: 28px;
  padding: 0 4px;
}

.product-detail-title {
  font-size: 26px;
  font-weight: 700;
  margin: 0;
}

.product-author {
  display: inline-block;
  margin-top: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--uart-purple);
}

.product-detail-price {
  margin-top: 14px;
  font-size: 22px;
  font-weight: 700;
  color: var(--uart-purple);
}

.product-detail-desc {
  margin-top: 14px;
  color: #333;
  font-size: 15px;
  line-height: 1.6;
}

/* --- landing page --- */
.landing-hero {
  margin-top: 32px;
  padding: 56px 28px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--uart-purple) 0%, var(--uart-magenta) 100%);
  position: relative;
  overflow: hidden;
  text-align: center;
}

.landing-spark {
  position: absolute;
  top: 22px;
  left: 28px;
}

.landing-headline {
  color: var(--uart-white);
  font-size: 34px;
  line-height: 1.2;
  margin: 0 0 16px;
}

.landing-sub {
  color: rgba(255, 255, 255, 0.9);
  font-size: 16px;
  line-height: 1.5;
  max-width: 480px;
  margin: 0 auto 28px;
}

.landing-cta {
  background: var(--uart-white);
  color: var(--uart-purple);
  display: inline-flex;
}

.landing-features {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.feature-card {
  background: var(--uart-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--uart-border);
  padding: 22px 20px;
}

.feature-title {
  font-weight: 700;
  font-size: 16px;
  margin: 0 0 8px;
}

.feature-desc {
  color: var(--uart-grey);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.landing-footer-cta {
  margin-top: 40px;
  padding: 36px 24px;
  border-radius: var(--radius-lg);
  background: var(--uart-black);
  color: var(--uart-white);
  text-align: center;
}

.landing-footer-cta p {
  font-size: 18px;
  font-weight: 700;
  margin: 0 0 18px;
}

.landing-footer-btn {
  background: var(--uart-white);
  color: var(--uart-black);
  display: inline-flex;
}

/* --- TonConnect payment page --- */
.ton-pay-card {
  margin-top: 28px;
  background: var(--uart-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--uart-border);
  padding: 28px 24px;
  text-align: center;
}

.ton-amount {
  font-size: 34px;
  font-weight: 800;
  margin: 6px 0 2px;
}

.ton-amount-label {
  color: var(--uart-grey);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ton-connect-root {
  margin: 22px 0 10px;
  display: flex;
  justify-content: center;
}

.ton-pay-actions {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: center;
}

.ton-status {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--uart-bg);
  font-size: 13.5px;
  color: var(--uart-grey);
}

.ton-status.paid {
  background: rgba(82, 0, 255, 0.08);
  color: var(--uart-purple-dark);
  font-weight: 600;
}
