/* ==========================================================================
   RekoGen: shared-link pages, homepage, about page, footer.
   Mobile-first. Uses the theme tokens from styles.css (dark first, light supported).
   ========================================================================== */

:root {
  --rk-gradient: linear-gradient(120deg, #8E2DE2 0%, #FF6FD8 100%);
  --score-gold: #FFC83D;
  --score-green: #34C759;
  --score-sky: #5AC8FA;
  --score-orange: #FF9F0A;
  --score-neutral: #A0A0A5;
}

body { background: var(--rk-bg); }

/* ---------- Buttons ---------- */
.btn-brand {
  background: var(--rk-gradient);
  color: #fff;
  border: 0;
  font-weight: 700;
  border-radius: 14px;
  padding: 0.8rem 1.4rem;
  box-shadow: 0 10px 24px rgba(142, 45, 226, 0.35);
}
.btn-brand:hover, .btn-brand:focus-visible { color: #fff; filter: brightness(1.08); }
.btn-brand-outline {
  color: var(--rk-fg);
  border: 2px solid var(--rk-primary);
  font-weight: 700;
  border-radius: 14px;
  padding: calc(0.8rem - 2px) 1.4rem;
  background: transparent;
}
.btn-brand-outline:hover, .btn-brand-outline:focus-visible { color: #fff; background: var(--rk-primary); border-color: var(--rk-primary); }
.btn-brand:focus-visible, .btn-brand-outline:focus-visible { outline: 3px solid var(--rk-accent); outline-offset: 3px; }
.app-store-badge-sm { height: 45px; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--rk-border); padding: 40px 0 28px; margin-top: 24px; }
.site-footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.site-footer-brand { font-weight: 800; font-size: 1.35rem; color: var(--rk-fg); text-decoration: none; }
.site-footer-tagline { color: var(--rk-muted); margin: 0.25rem 0 0; font-size: 0.95rem; }
.site-footer-links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 24px 0 18px; }
.site-footer-links a { color: var(--rk-muted); text-decoration: none; font-size: 0.95rem; }
.site-footer-links a:hover { color: var(--rk-fg); text-decoration: underline; }
.site-footer-legal { color: var(--rk-muted); font-size: 0.82rem; margin: 0; }
.site-footer-legal a { color: inherit; }

/* ---------- Shared-link pages (post / forum / profile / messages) ---------- */
.share-page { padding: 56px 0 40px; min-height: 60vh; }
.share-container { max-width: 560px; }
.share-app-icon { border-radius: 18px; box-shadow: 0 10px 30px rgba(142, 45, 226, 0.35); margin-bottom: 20px; }
.share-kicker { color: var(--rk-accent); font-weight: 700; font-size: 0.85rem; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 8px; }
.share-title { font-size: clamp(28px, 7vw, 40px); font-weight: 800; line-height: 1.15; margin-bottom: 14px; }
.share-lead { color: var(--rk-muted); font-size: 1.05rem; line-height: 1.6; margin-bottom: 24px; }
.share-actions { display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 576px) {
  .share-actions { flex-direction: row; justify-content: center; }
  .anime-cta .share-actions { justify-content: flex-start; }
}

/* Quoted share message: clearly user text, not RekoGen's copy */
.share-quote {
  text-align: left;
  margin: 0 0 24px;
  padding: 16px 18px;
  border-radius: 16px;
  background: var(--rk-card);
  border: 1px solid var(--rk-border);
  border-left: 4px solid var(--rk-accent);
}
.share-quote-who { font-weight: 700; color: var(--rk-fg); display: flex; align-items: center; gap: 8px; }
.share-quote-icon { font-size: 1rem; }
.share-quote-note { margin: 8px 0 0; }
.share-quote-note p { margin: 0; font-size: 1.1rem; font-style: italic; color: var(--rk-fg); overflow-wrap: anywhere; }
.share-quote-disclaimer { margin: 10px 0 0; font-size: 0.78rem; color: var(--rk-muted); }

/* ---------- Anime page ---------- */
.anime-page { --anime-color: #8E2DE2; padding-bottom: 32px; }
.anime-banner {
  height: 180px;
  background-color: var(--anime-color);
  background-size: cover;
  background-position: center;
  position: relative;
}
.anime-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 11, 13, 0.15) 0%, var(--rk-bg) 100%);
}
.anime-banner-empty { background-image: linear-gradient(135deg, var(--anime-color), #8E2DE2 60%, #FF6FD8); }
.anime-container { max-width: 880px; position: relative; margin-top: -110px; }
.anime-head { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; margin-bottom: 24px; }
.anime-cover {
  width: 170px;
  height: auto;
  aspect-ratio: 230 / 325;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border: 1px solid var(--rk-border);
  background: var(--rk-card);
}
.anime-title { font-size: clamp(26px, 6.5vw, 40px); font-weight: 800; line-height: 1.12; margin: 0; }
.anime-alt-title { color: var(--rk-muted); margin: 6px 0 0; }
.anime-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; }
.anime-meta-text { color: var(--rk-muted); font-size: 0.95rem; }
.anime-genres { list-style: none; padding: 0; margin: 14px 0 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.anime-genres li { padding: 4px 12px; border-radius: 999px; border: 1px solid var(--rk-border); background: var(--rk-card); font-size: 0.85rem; color: var(--rk-fg); }
@media (min-width: 768px) {
  .anime-banner { height: 260px; }
  .anime-container { margin-top: -140px; }
  .anime-head { flex-direction: row; align-items: flex-end; text-align: left; gap: 28px; }
  .anime-cover { width: 230px; }
  .anime-meta, .anime-genres { justify-content: flex-start; }
}

.score-badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 0.95rem; color: #0B0B0D; }
.score-gold { background: var(--score-gold); }
.score-green { background: var(--score-green); }
.score-sky { background: var(--score-sky); }
.score-orange { background: var(--score-orange); }
.score-neutral { background: var(--score-neutral); }

.anime-cta {
  padding: 20px;
  border-radius: 20px;
  background: var(--rk-card);
  border: 1px solid var(--rk-border);
  margin-bottom: 28px;
}
.anime-cta-hook { font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; }

.anime-section { margin-bottom: 28px; padding: 0; }
.anime-section-title { font-size: 1.25rem; font-weight: 800; margin-bottom: 12px; }
.anime-synopsis p { color: var(--rk-muted); line-height: 1.7; margin-bottom: 0.9rem; }

.trailer-thumb {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  cursor: pointer;
}
.trailer-thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: opacity 0.2s ease; }
.trailer-thumb:hover img { opacity: 1; }
.trailer-thumb:focus-visible { outline: 3px solid var(--rk-accent); outline-offset: 3px; }
.trailer-play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 72px;
  height: 72px;
  margin: -36px 0 0 -36px;
  border-radius: 50%;
  background: var(--rk-gradient);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}
.trailer-play::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 54%;
  transform: translate(-50%, -50%);
  border-style: solid;
  border-width: 13px 0 13px 22px;
  border-color: transparent transparent transparent #fff;
}
.trailer-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 16px; display: block; }

.watch-links { list-style: none; padding: 0; margin: 0 0 10px; display: flex; flex-wrap: wrap; gap: 10px; }
.watch-links a {
  display: inline-block;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--rk-card);
  border: 1px solid var(--rk-border);
  color: var(--rk-fg);
  font-weight: 600;
  text-decoration: none;
}
.watch-links a:hover { border-color: var(--rk-primary); }
.watch-note { color: var(--rk-muted); font-size: 0.88rem; margin: 0; }

/* ---------- Homepage ---------- */
.home-hero { padding: 48px 0 56px; overflow: hidden; position: relative; }
.home-hero::before {
  content: "";
  position: absolute;
  inset: -40% -20% auto auto;
  width: 640px;
  height: 640px;
  background: radial-gradient(circle, rgba(142, 45, 226, 0.35) 0%, rgba(255, 111, 216, 0.12) 45%, transparent 70%);
  pointer-events: none;
}
.home-hero-inner { position: relative; display: grid; gap: 40px; align-items: center; }
.home-hero h1 { font-size: clamp(38px, 10vw, 68px); font-weight: 800; line-height: 1.02; letter-spacing: -0.02em; margin-bottom: 16px; }
.home-hero h1 .grad { background: var(--rk-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.home-hero-sub { font-size: clamp(17px, 4.2vw, 20px); color: var(--rk-muted); line-height: 1.55; max-width: 520px; margin-bottom: 24px; }
.home-hero-note { color: var(--rk-muted); font-size: 0.85rem; margin-top: 12px; }
@media (min-width: 992px) {
  .home-hero { padding: 80px 0 88px; }
  .home-hero-inner { grid-template-columns: 1.1fr 0.9fr; }
}

/* Screenshot placeholders. Replace each .phone-placeholder with a real screenshot <img>. */
.phone-pair { display: flex; justify-content: center; gap: 16px; }
.phone-frame {
  width: min(42vw, 230px);
  aspect-ratio: 1179 / 2556;
  border-radius: 36px;
  padding: 7px;
  background: #1A1A1E;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
}
.phone-frame:nth-child(2) { transform: translateY(36px); }
.phone-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 30px; display: block; }
.phone-placeholder {
  width: 100%;
  height: 100%;
  border-radius: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
  padding: 16px;
  background: linear-gradient(160deg, rgba(142, 45, 226, 0.55), rgba(255, 111, 216, 0.35)), #0B0B0D;
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.8rem;
  font-weight: 600;
}
.phone-placeholder img { width: 56px; height: 56px; border-radius: 14px; }

.home-section { padding: 56px 0; }
.home-section-alt { background: var(--rk-surface); }
.home-kicker { color: var(--rk-accent); font-weight: 800; font-size: 0.8rem; letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 10px; }
[data-theme] .home-kicker { color: var(--rk-accent); }
:root:not([data-theme="dark"]) .home-kicker { color: var(--rk-primary); }
.home-h2 { font-size: clamp(28px, 6.5vw, 44px); font-weight: 800; line-height: 1.1; letter-spacing: -0.01em; margin-bottom: 12px; }
.home-lead { color: var(--rk-muted); font-size: 1.05rem; line-height: 1.6; max-width: 560px; }

.feature-row { display: grid; gap: 28px; align-items: center; }
.feature-row + .feature-row { margin-top: 64px; }
.feature-row h3 { font-size: clamp(24px, 5.5vw, 34px); font-weight: 800; line-height: 1.15; margin-bottom: 12px; }
.feature-row p { color: var(--rk-muted); font-size: 1.05rem; line-height: 1.65; margin-bottom: 12px; }
.feature-row .phone-frame { margin: 0 auto; width: min(44vw, 250px); }
.feature-row .phone-frame:nth-child(2) { transform: none; }
.feature-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  background: var(--rk-card);
  border: 1px solid var(--rk-border);
  margin-bottom: 16px;
}
.feature-chips { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.feature-chips li { padding: 5px 12px; border-radius: 999px; background: var(--rk-card); border: 1px solid var(--rk-border); font-size: 0.85rem; font-weight: 600; }
@media (min-width: 992px) {
  .feature-row { grid-template-columns: 1fr 1fr; gap: 64px; }
  .feature-row.reverse .feature-media { order: -1; }
}

/* Trending strip */
.trending-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 140px;
  gap: 14px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 16px;
  scrollbar-width: thin;
}
@media (min-width: 768px) { .trending-track { grid-auto-columns: 168px; } }
.trend-card { scroll-snap-align: start; text-decoration: none; color: var(--rk-fg); display: block; }
.trend-card:focus-visible { outline: 3px solid var(--rk-accent); outline-offset: 3px; border-radius: 14px; }
.trend-cover { position: relative; aspect-ratio: 230 / 325; border-radius: 14px; overflow: hidden; background: var(--rk-card); border: 1px solid var(--rk-border); }
.trend-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.25s ease; }
.trend-card:hover .trend-cover img { transform: scale(1.04); }
.trend-cover .score-badge { position: absolute; top: 8px; left: 8px; font-size: 0.78rem; padding: 2px 8px; }
.trend-title { font-weight: 700; font-size: 0.92rem; line-height: 1.3; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.trend-genre { color: var(--rk-muted); font-size: 0.8rem; }
.trend-skeleton { aspect-ratio: 230 / 325; border-radius: 14px; background: var(--rk-card); border: 1px solid var(--rk-border); }

/* Final CTA */
.final-cta {
  border-radius: 28px;
  padding: 44px 24px;
  text-align: center;
  background: radial-gradient(circle at 20% 0%, rgba(255, 111, 216, 0.35), transparent 55%), linear-gradient(135deg, #8E2DE2, #5B1BA8);
  color: #fff;
}
.final-cta h2 { font-size: clamp(28px, 6.5vw, 44px); font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.final-cta p { color: rgba(255, 255, 255, 0.85); font-size: 1.05rem; margin: 0 auto 24px; max-width: none; }

/* ---------- About page ---------- */
.about-page { padding: 48px 0 24px; }
.about-page .container { max-width: 760px; }
.about-photo { width: 120px; height: 120px; border-radius: 50%; object-fit: cover; border: 3px solid var(--rk-primary); }
.about-page h1 { font-size: clamp(30px, 7vw, 44px); font-weight: 800; margin: 18px 0 10px; }
.about-page h2 { font-size: 1.35rem; font-weight: 800; margin: 36px 0 12px; }
.about-page p, .about-page li { color: var(--rk-muted); line-height: 1.7; font-size: 1.03rem; }
.about-values { list-style: none; padding: 0; display: grid; gap: 12px; }
.about-values li { padding: 16px 18px; border-radius: 16px; background: var(--rk-card); border: 1px solid var(--rk-border); }
.about-values strong { color: var(--rk-fg); display: block; margin-bottom: 2px; }

/* Wordmark: "Gen" is an inline-block (for its gradient), which breaks kerning; pull it back in. */
.navbar-brand.brand-text, .site-footer-brand { letter-spacing: -0.02em; }
.navbar-brand .brand-accent, .site-footer-brand .brand-accent { margin-left: -0.05em; }
