:root {
  --bg: #070c14;
  --bg-card: #0e1624;
  --bg-card-hover: #131e30;
  --bg-coupon: #09101b;
  --bg-pill: rgba(56, 189, 248, 0.09);
  --border: rgba(148, 197, 255, 0.14);
  --border-strong: rgba(56, 189, 248, 0.34);
  --text: #f4f8fd;
  --text-muted: #9cb3ce;
  --accent: #38bdf8;
  --accent-cobalt: #2f6cb5;
  --cta-bg: #1e60cf;
  --cta-bg-hover: #256ee8;
  --cta-ink: #ffffff;
  --success: #34d399;
  --success-text: #6ee7b7;
  --success-soft: rgba(52, 211, 153, 0.14);
  --shadow-card: 0 12px 32px rgba(2, 6, 14, 0.42);
  --shadow-toast: 0 14px 36px rgba(2, 6, 14, 0.55);
  --radius-card: 20px;
  --radius-control: 13px;
  --font-sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

html[data-theme="light"] {
  --bg: #eef4fb;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fbff;
  --bg-coupon: #f2f7fd;
  --bg-pill: rgba(37, 99, 235, 0.08);
  --border: rgba(30, 64, 175, 0.12);
  --border-strong: rgba(37, 99, 235, 0.28);
  --text: #0b172a;
  --text-muted: #475e7b;
  --accent: #2563eb;
  --accent-cobalt: #2f6cb5;
  --cta-bg: #1b57bd;
  --cta-bg-hover: #16489e;
  --cta-ink: #ffffff;
  --success: #059669;
  --success-text: #047857;
  --success-soft: rgba(5, 150, 105, 0.12);
  --shadow-card: 0 8px 24px rgba(15, 23, 42, 0.07);
  --shadow-toast: 0 12px 30px rgba(15, 23, 42, 0.18);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: dark;
}

html[data-theme="light"] {
  color-scheme: light;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-sans);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background:
    radial-gradient(circle at 50% -6%, rgba(47, 108, 181, 0.34), transparent 48%),
    radial-gradient(circle at 78% 18%, rgba(56, 189, 248, 0.14), transparent 40%),
    radial-gradient(circle at 18% 62%, rgba(30, 96, 207, 0.1), transparent 45%);
}

html[data-theme="light"] .backdrop {
  background:
    radial-gradient(circle at 50% -8%, rgba(47, 108, 181, 0.2), transparent 52%),
    radial-gradient(circle at 82% 22%, rgba(56, 189, 248, 0.14), transparent 42%);
}

.page-shell {
  width: 100%;
  max-width: 520px;
  margin: 0 auto;
  padding:
    max(16px, env(safe-area-inset-top))
    16px
    max(40px, calc(env(safe-area-inset-bottom) + 28px));
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.instagram-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.instagram-pill:hover {
  border-color: var(--border-strong);
}

.instagram-pill:active {
  transform: scale(0.98);
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 999px;
  background: var(--bg-pill);
  border: 1px solid var(--border);
  color: var(--text);
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.icon-btn:hover {
  border-color: var(--border-strong);
}

.icon-btn:active {
  transform: scale(0.94);
}

.icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.icon-sm {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

html[data-theme="dark"] .icon-moon {
  display: none;
}

html[data-theme="light"] .icon-sun {
  display: none;
}

.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  margin-bottom: 28px;
}

.avatar-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #2f6cb5, #0b84d8);
  border: 2.5px solid var(--accent);
  box-shadow: 0 0 0 5px rgba(47, 108, 181, 0.24), 0 14px 32px rgba(2, 6, 14, 0.42);
  overflow: hidden;
}

html[data-theme="light"] .avatar-wrap {
  box-shadow: 0 0 0 5px rgba(47, 108, 181, 0.16), 0 12px 26px rgba(15, 23, 42, 0.14);
}

.avatar-initials {
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #ffffff;
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
  opacity: 0;
  transition: opacity 0.2s ease;
  display: block;
}

.avatar-img.is-loaded {
  opacity: 1;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.profile-name {
  margin: 0;
  font-size: clamp(1.5rem, 5vw, 1.8rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.profile-bio {
  margin: 0 auto;
  max-width: 36ch;
  font-size: 0.9375rem;
  color: var(--text-muted);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.section-title {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.section-count {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--accent);
}

.helper-tip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 16px;
  font-size: 0.84375rem;
  color: var(--text-muted);
}

.partners-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.partner-card {
  --brand-accent: var(--accent);
  display: flex;
  flex-direction: column;
  gap: 13px;
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  .partner-card:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-strong);
    transform: translateY(-1px);
  }
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.brand-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-badge {
  position: relative;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  background: var(--bg-coupon);
  background: color-mix(in srgb, var(--brand-accent) 18%, var(--bg-coupon));
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--brand-accent) 42%, var(--border));
  overflow: hidden;
}

.brand-badge.has-logo {
  background: #ffffff;
  border-color: rgba(148, 197, 255, 0.26);
  box-shadow: 0 4px 12px rgba(2, 6, 14, 0.22);
}

html[data-theme="light"] .brand-badge.has-logo {
  border-color: rgba(30, 64, 175, 0.14);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
}

.brand-logo {
  position: absolute;
  inset: 6px;
  width: calc(100% - 12px);
  height: calc(100% - 12px);
  object-fit: contain;
  display: block;
  border-radius: 7px;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.brand-badge.has-logo .brand-logo {
  opacity: 1;
}

.brand-text {
  min-width: 0;
}

.brand-heading {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.brand-name {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.brand-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--text-muted);
  background: var(--bg-pill);
  border: 1px solid var(--border);
}

.brand-tag:empty {
  display: none;
}

.brand-desc {
  margin: 3px 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.brand-desc:empty {
  display: none;
}

.coupon-box {
  width: 100%;
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius-control);
  background: var(--bg-coupon);
  border: 1px dashed var(--border-strong);
  color: var(--text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.14s ease;
}

.coupon-box:hover {
  border-color: var(--accent);
}

.coupon-box:active {
  transform: scale(0.99);
}

.coupon-box[data-copied="true"] {
  border-style: solid;
  border-color: var(--success);
  background: var(--success-soft);
}

.coupon-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  flex: 1;
}

.coupon-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.coupon-code {
  font-family: var(--font-mono);
  font-size: clamp(0.875rem, 3.6vw, 0.96875rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text);
  overflow-wrap: anywhere;
}

.coupon-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 6px 10px;
  border-radius: 9px;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--bg-pill);
  border: 1px solid var(--border);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.coupon-box[data-copied="true"] .coupon-action {
  color: var(--success-text);
  border-color: var(--success);
  background: transparent;
}

.coupon-action svg {
  width: 14px;
  height: 14px;
}

.icon-check {
  display: none;
}

.coupon-box[data-copied="true"] .icon-copy {
  display: none;
}

.coupon-box[data-copied="true"] .icon-check {
  display: block;
}

.store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  padding: 11px 16px;
  border-radius: var(--radius-control);
  background: var(--cta-bg);
  color: var(--cta-ink);
  font-size: 0.9375rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(30, 96, 207, 0.28);
  touch-action: manipulation;
  transition: background-color 0.18s ease, transform 0.14s ease, box-shadow 0.18s ease;
}

.store-link:hover {
  background: var(--cta-bg-hover);
  box-shadow: 0 8px 22px rgba(37, 110, 232, 0.36);
}

.store-link:active {
  transform: scale(0.985);
}

.instagram-pill:focus-visible,
.icon-btn:focus-visible,
.coupon-box:focus-visible,
.store-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.page-footer {
  margin-top: 28px;
  text-align: center;
  font-size: 0.78125rem;
  color: var(--text-muted);
}

.page-footer p {
  margin: 0;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
  transform: translate(-50%, 16px);
  max-width: calc(100vw - 32px);
  padding: 11px 16px;
  border-radius: 999px;
  background: #0e1624;
  color: #f4f8fd;
  border: 1px solid rgba(56, 189, 248, 0.45);
  box-shadow: var(--shadow-toast);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

html[data-theme="light"] .toast {
  background: #0b172a;
  color: #ffffff;
}

.toast[data-visible="true"] {
  opacity: 1;
  transform: translate(-50%, 0);
}

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