/* ==========================================================================
   Boomout — static feed site (ad-network review build)
   Visual system ported from social-app/web-pwa (src/lib/brand.ts +
   tailwind.config.ts). Keep tokens in sync with the PWA.
   ========================================================================== */

:root {
  /* ink (neutrals) */
  --ink-950: #0e0e10;
  --ink-900: #1a1a1a;
  --ink-800: #2d2d2d;
  --ink-700: #333333;
  --ink-600: #4a4a4a;
  --ink-500: #666666;
  --ink-400: #999999;
  --ink-300: #c7c7cc;
  /* lines / fills / surfaces */
  --line: #e8e8ea;
  --line-strong: #d9d9de;
  --fill: #f4f4f5;
  --fill-strong: #ececee;
  --surface: #ffffff;
  --canvas: #fafafa;
  /* gold — the soul */
  --gold-50: #fbf3de;
  --gold-500: #d4a017;
  --gold-600: #8c6a0f;
  /* red — the alert */
  --heart: #e53935;
  --crimson: #b71c1c;
  --crimson-soft: #fdecea;
  /* purple — the premium */
  --royal: #9b59b6;
  --royal-soft: #f3e5f5;
  --success: #17a673;
  --warning: #f5a524;

  --nav-h: 60px;
  --tab-h: 56px;
  --radius-lg: 18px;
  --shadow-card: 0 1px 2px rgba(14, 14, 16, 0.04), 0 8px 24px -16px rgba(14, 14, 16, 0.24);
}

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

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

body {
  font-family: 'Inter', ui-sans-serif, system-ui, 'Segoe UI', Roboto,
    'Helvetica Neue', Arial, sans-serif;
  background: var(--canvas);
  color: var(--ink-900);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

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

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   App shell — vertical single column, capped and centred on large screens
   -------------------------------------------------------------------------- */

.shell {
  max-width: 480px;
  margin: 0 auto;
  background: var(--canvas);
  min-height: 100vh;
  box-shadow: 0 0 0 1px rgba(14, 14, 16, 0.04);
}

/* --------------------------------------------------------------------------
   Home header (frosted, sticky) + sub tabs
   -------------------------------------------------------------------------- */

.glass-bar {
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  border-bottom: 1px solid var(--line);
}

.home-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding-top: env(safe-area-inset-top);
}

.home-header__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: var(--nav-h);
  padding: 0 16px;
}

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

.brand__mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--ink-900);
  color: var(--gold-500);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.brand__name {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.home-header__actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--ink-600);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:hover {
  background: var(--fill);
  color: var(--ink-900);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
}

/* underline tabs (Boom Circle / Discover / Following) */

.tabs {
  display: flex;
  gap: 24px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  position: relative;
  padding: 0 2px 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-400);
  transition: color 0.15s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

.tab:hover {
  color: var(--ink-600);
}

.tab.is-active {
  color: var(--ink-900);
}

.tab.is-active::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 3px;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 999px 999px 0 0;
  background: var(--gold-500);
}

/* --------------------------------------------------------------------------
   Feed
   -------------------------------------------------------------------------- */

.feed {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
}

.post {
  background: var(--surface);
}

.post[hidden] {
  display: none;
}

/* author row */

.post__author {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px 0;
}

.avatar {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  flex-shrink: 0;
  object-fit: cover;
}

.avatar--ring-gold {
  box-shadow: 0 0 0 2px var(--gold-500);
}

.avatar--ring-royal {
  box-shadow: 0 0 0 2px var(--royal);
}

.avatar--ring-panther {
  box-shadow: 0 0 0 2px var(--ink-900);
}

.post__author-main {
  min-width: 0;
  flex: 1;
}

.post__name-line {
  display: flex;
  align-items: center;
  gap: 6px;
}

.post__name {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post__name:hover {
  text-decoration: underline;
}

.verified {
  display: inline-grid;
  place-items: center;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  background: var(--gold-500);
  color: #fff;
  flex-shrink: 0;
}

.verified svg {
  width: 9px;
  height: 9px;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.tier-badge--gold {
  background: var(--gold-50);
  color: var(--gold-600);
}

.tier-badge--royal {
  background: var(--royal-soft);
  color: var(--royal);
}

.tier-badge--panther {
  background: #ededed;
  color: var(--ink-900);
}

.post__meta {
  font-size: 12px;
  color: var(--ink-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.post__overflow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  color: var(--ink-400);
}

.post__overflow:hover {
  background: var(--fill);
  color: var(--ink-600);
}

/* body / tags */

.post__body {
  display: block;
  padding: 10px 14px 0;
}

.post__text {
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink-900);
  white-space: pre-wrap;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tag {
  font-size: 13px;
  font-weight: 500;
  color: var(--gold-600);
}

.tag:hover {
  text-decoration: underline;
}

/* media grid (mirrors PWA MediaGrid: single / 2 / 3 / 4 with +N overlay) */

.post__media {
  display: block;
  padding: 12px 14px 0;
}

.media-grid {
  display: grid;
  gap: 4px;
  border-radius: 18px;
  overflow: hidden;
  background: var(--fill-strong);
}

.media-grid--single {
  display: flex;
}

.media-grid--single img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 18px;
  background: var(--fill-strong);
}

.media-grid--single.portrait {
  max-width: 66%;
}

.media-grid--single.portrait img {
  aspect-ratio: 3 / 4;
}

.media-grid--2,
.media-grid--4 {
  grid-template-columns: 1fr 1fr;
}

.media-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.media-cell {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
}

.media-cell img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--fill-strong);
}

.media-cell .more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(14, 14, 16, 0.55);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
}

/* action bar */

.post__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  padding: 6px 6px;
  margin-top: 4px;
}

.action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-500);
  transition: background 0.15s ease, color 0.15s ease;
}

.action:hover {
  background: var(--fill);
  color: var(--ink-900);
}

.action svg {
  width: 18px;
  height: 18px;
}

.action--views {
  color: var(--ink-400);
  cursor: default;
  font-variant-numeric: tabular-nums;
}

.action.is-liked {
  color: var(--heart);
}

.action.is-liked svg {
  fill: var(--heart);
}

.action .count {
  font-variant-numeric: tabular-nums;
}

@keyframes like-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

.action.pop svg {
  animation: like-pop 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* --------------------------------------------------------------------------
   In-feed ad slot (same insertion rule as PWA AdInsertPolicy: first at idx 3)
   -------------------------------------------------------------------------- */

.ad-slot {
  background: var(--surface);
  padding: 12px 14px 16px;
}

.ad-slot__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 8px;
}

.ad-slot__box {
  display: grid;
  place-items: center;
  min-height: 220px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  color: var(--ink-300);
  font-size: 13px;
  text-align: center;
  padding: 16px;
}

/* Self-serve promo card in the in-feed slot (Boomout app ad) */

.ad-promo {
  background: var(--surface);
  padding: 12px 14px 14px;
}

.ad-promo[hidden] {
  display: none;
}

.ad-promo__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-400);
  margin-bottom: 8px;
}

.ad-promo__body {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(212, 160, 23, 0.14) 0%, transparent 60%),
    var(--ink-950);
}

.ad-promo__mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--ink-900);
  border: 1px solid rgba(212, 160, 23, 0.5);
  color: var(--gold-500);
  font-size: 22px;
  font-weight: 900;
  flex-shrink: 0;
}

.ad-promo__text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.ad-promo__text strong {
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
}

.ad-promo__text span {
  color: rgba(255, 255, 255, 0.65);
  font-size: 12px;
  line-height: 1.4;
}

.ad-promo__cta {
  flex: 0 0 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border-radius: 999px;
  background: var(--gold-500);
  color: var(--ink-950);
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s ease;
}

.ad-promo__cta:hover {
  background: var(--gold-400, #e5b62e);
}

.feed-end {
  text-align: center;
  font-size: 12px;
  color: var(--ink-400);
  padding: 16px 0 8px;
  background: var(--surface);
}

/* --------------------------------------------------------------------------
   Site footer (legal links — required for ad-network review)
   -------------------------------------------------------------------------- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 20px 16px 28px;
  font-size: 12px;
  color: var(--ink-400);
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-bottom: 10px;
}

.site-footer a:hover {
  color: var(--ink-600);
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Bottom tab bar
   -------------------------------------------------------------------------- */

.bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: blur(14px) saturate(1.6);
  backdrop-filter: blur(14px) saturate(1.6);
  padding-bottom: env(safe-area-inset-bottom);
}

.bottom-bar__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  height: var(--tab-h);
  max-width: 480px;
  margin: 0 auto;
  list-style: none;
}

.bottom-bar__item {
  display: flex;
  position: relative;
}

.bottom-bar__link {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 100%;
  color: var(--ink-400);
  transition: color 0.15s ease;
}

.bottom-bar__link svg {
  width: 22px;
  height: 22px;
}

.bottom-bar__link span {
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}

.bottom-bar__link.is-active {
  color: var(--ink-900);
}

.bottom-bar__link.is-active::before {
  content: '';
  position: absolute;
  top: -1px;
  left: 50%;
  transform: translateX(-50%);
  width: 32px;
  height: 3px;
  border-radius: 0 0 999px 999px;
  background: var(--gold-500);
}

/* --------------------------------------------------------------------------
   Static content pages (About / Privacy / Terms / Contact)
   -------------------------------------------------------------------------- */

.page-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--nav-h);
  padding: 0 8px;
  padding-top: env(safe-area-inset-top);
}

.page-header h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.page-body {
  background: var(--surface);
  padding: 8px 20px 40px;
  min-height: calc(100vh - var(--nav-h) - 200px);
}

.page-body h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 24px 0 8px;
}

.page-body h3 {
  font-size: 15px;
  font-weight: 600;
  margin: 18px 0 6px;
}

.page-body p,
.page-body li {
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-700);
}

.page-body ul {
  padding-left: 20px;
  margin: 8px 0;
}

.page-body li {
  margin: 4px 0;
}

.page-body .updated {
  font-size: 12px;
  color: var(--ink-400);
  margin-top: 4px;
}

.page-body a {
  color: var(--gold-600);
  text-decoration: underline;
}

.hero-card {
  margin: 12px 0 4px;
  padding: 20px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(212, 160, 23, 0.18) 0%, transparent 60%),
    var(--ink-950);
  color: #fff;
}

.hero-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  color: #fff;
}

.hero-card p {
  color: rgba(255, 255, 255, 0.75);
}

.contact-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.contact-row strong {
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Toast
   -------------------------------------------------------------------------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 16px);
  transform: translate(-50%, 8px);
  z-index: 60;
  max-width: 420px;
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(14, 14, 16, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* fade-up entrance for cards */

@keyframes fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.post,
.ad-slot {
  animation: fade-up 380ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

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

/* ============================ Guides section ============================ */

.guide-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.guide-card {
  display: flex;
  gap: 12px;
  background: var(--surface);
  padding: 14px;
}

.guide-card__thumb {
  width: 92px;
  height: 92px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
}

.guide-card__main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.guide-card__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-600);
}

.guide-card__title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink-900);
}

.guide-card__meta {
  font-size: 12px;
  color: var(--ink-400);
}

/* Article page */

.article {
  background: var(--surface);
  padding: 18px 16px 26px;
}

.article__kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-600);
  margin-bottom: 8px;
}

.article__title {
  font-size: 22px;
  font-weight: 900;
  line-height: 1.25;
  letter-spacing: -0.01em;
  color: var(--ink-950);
}

.article__byline {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 14px;
  font-size: 13px;
  color: var(--ink-400);
}

.article__byline .avatar {
  width: 32px;
  height: 32px;
}

.article__byline strong {
  color: var(--ink-900);
  font-weight: 700;
}

.article__hero {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 18px;
}

.article__hero img {
  width: 100%;
  display: block;
}

.article__body p {
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink-700);
  margin-bottom: 14px;
}

.article__body h2 {
  font-size: 17px;
  font-weight: 800;
  color: var(--ink-950);
  margin: 24px 0 8px;
}

.article__body ul {
  margin: 0 0 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 15px;
  line-height: 1.65;
  color: var(--ink-700);
}

.article__tip {
  border-left: 3px solid var(--gold-500);
  background: var(--fill);
  border-radius: 0 12px 12px 0;
  padding: 10px 12px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-700);
  margin: 0 0 16px;
}

.article__tip strong {
  color: var(--ink-900);
}

.article__related {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.7;
  color: var(--ink-400);
}

.article__related a {
  color: var(--gold-600);
  font-weight: 600;
}
