:root {
  color-scheme: dark;
  --bg: #101113;
  --bg-soft: #17191d;
  --panel: #202227;
  --panel-2: #292c32;
  --text: #f4f0e8;
  --muted: #b8b0a5;
  --line: rgba(244, 240, 232, 0.12);
  --red: #ff4d4f;
  --cyan: #42d9ff;
  --lime: #c7ff4a;
  --gold: #ffbf47;
  --ink: #101113;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(115deg, rgba(255, 77, 79, 0.12), transparent 28%),
    linear-gradient(290deg, rgba(66, 217, 255, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
select,
a {
  font: inherit;
}

a {
  color: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--line);
  background: rgba(16, 17, 19, 0.88);
  backdrop-filter: blur(18px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0;
}

.brand,
.primary-link,
.ghost-link,
.tab-btn,
.chip,
.tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
}

.brand {
  flex: 0 0 auto;
  font-weight: 850;
}

.brand-avatar {
  display: block;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid var(--text);
  object-fit: cover;
  box-shadow: 4px 4px 0 var(--red);
}

.nav-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.tab-btn,
.chip,
.tool-button,
.primary-link,
.ghost-link {
  min-height: 40px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
  cursor: pointer;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.tab-btn {
  padding: 0 13px;
  background: rgba(255, 255, 255, 0.04);
  white-space: nowrap;
}

.tab-btn svg,
.primary-link svg,
.ghost-link svg,
.tool-button svg,
.feature-card svg {
  width: 18px;
  height: 18px;
}

.tab-btn:hover,
.chip:hover,
.tool-button:hover,
.primary-link:hover,
.ghost-link:hover {
  transform: translateY(-1px);
  border-color: rgba(244, 240, 232, 0.34);
}

.tab-btn.is-active,
.chip.is-active {
  background: var(--text);
  color: var(--ink);
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.tab-panel {
  display: none;
  padding: 32px 0 52px;
}

.tab-panel.is-active {
  display: block;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.72fr);
  gap: clamp(24px, 5vw, 72px);
  align-items: center;
  min-height: calc(100vh - 112px);
  padding: 32px 0;
}

.hero-copy {
  max-width: 720px;
}

.kicker {
  margin: 0 0 12px;
  color: var(--lime);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(2.4rem, 6vw, 5.7rem);
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: clamp(1.5rem, 2.8vw, 2.6rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h3 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.hero p,
.page-title p,
.feature-card p,
.timeline p,
.phrase-card p,
.meme-card p {
  color: var(--muted);
  line-height: 1.65;
}

.hero p {
  max-width: 680px;
  margin: 24px 0 0;
  font-size: 1.08rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 30px;
}

.primary-link,
.ghost-link {
  min-width: 172px;
  padding: 0 18px;
}

.primary-link {
  background: var(--red);
  border-color: transparent;
  color: #fff;
  box-shadow: 6px 6px 0 rgba(199, 255, 74, 0.95);
}

.ghost-link {
  background: rgba(255, 255, 255, 0.06);
}

.hero-visual {
  width: min(100%, 470px);
  justify-self: end;
}

.hero-visual canvas,
.profile-art canvas,
.profile-art img,
.meme-preview {
  display: block;
  width: 100%;
  height: auto;
}

.hero-visual canvas {
  filter: drop-shadow(0 24px 50px rgba(0, 0, 0, 0.45));
}

.stat-band {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-bottom: 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--line);
}

.stat-band div {
  min-height: 112px;
  padding: 20px;
  background: rgba(32, 34, 39, 0.86);
}

.stat-band strong {
  display: block;
  font-size: clamp(1.5rem, 3vw, 2.4rem);
  line-height: 1;
}

.stat-band span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.section-block {
  padding: 38px 0 8px;
}

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

.feature-grid,
.phrase-grid,
.meme-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-card,
.phrase-card,
.meme-card,
.bio-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 34, 39, 0.82);
  box-shadow: var(--shadow);
}

.feature-card {
  min-height: 176px;
  padding: 22px;
}

.feature-card svg {
  margin-bottom: 18px;
  color: var(--cyan);
}

.page-title {
  max-width: 850px;
  padding: 38px 0 26px;
}

.page-title h1 {
  font-size: clamp(2.2rem, 5vw, 4.4rem);
}

.page-title p:last-child {
  max-width: 760px;
  margin: 18px 0 0;
}

.bio-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  gap: 24px;
  align-items: start;
}

.timeline {
  display: grid;
  gap: 14px;
}

.timeline article {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 18px;
  padding: 22px 0;
  border-top: 1px solid var(--line);
}

.timeline span {
  color: var(--gold);
  font-weight: 900;
}

.timeline h2 {
  font-size: clamp(1.25rem, 2vw, 1.85rem);
}

.timeline p {
  grid-column: 2;
  margin: -8px 0 0;
}

.bio-card {
  position: sticky;
  top: 90px;
  overflow: hidden;
}

.profile-art {
  position: relative;
  background: #f4f0e8;
}

.profile-art img {
  aspect-ratio: 1 / 1;
  object-fit: cover;
}

.profile-art img + canvas {
  display: none;
}

.profile-art img.is-hidden {
  display: none;
}

.profile-art img.is-hidden + canvas {
  display: block;
}

.profile-art span {
  position: absolute;
  left: 10px;
  bottom: 10px;
  max-width: calc(100% - 20px);
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(16, 17, 19, 0.72);
  color: #f4f0e8;
  font-size: 0.74rem;
  font-weight: 800;
}

.bio-card dl {
  margin: 0;
  padding: 18px;
}

.bio-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}

.bio-card dl div:last-child {
  border-bottom: 0;
}

.bio-card dt {
  color: var(--muted);
}

.bio-card dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.source-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.source-strip a {
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--cyan);
  text-decoration: none;
}

.filter-row,
.toolbar,
.searchbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 18px;
}

.searchbar {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 34, 39, 0.76);
}

.searchbar label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-weight: 850;
}

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

.searchbar input {
  flex: 1 1 320px;
  min-height: 44px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111316;
  color: var(--text);
  padding: 0 14px;
}

.chip {
  min-width: 104px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.05);
}

.phrase-card {
  min-height: 190px;
  padding: 20px;
}

.phrase-card mark {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(66, 217, 255, 0.16);
  color: var(--cyan);
}

.phrase-card blockquote {
  margin: 18px 0;
  font-size: clamp(1.35rem, 2.8vw, 2.15rem);
  font-weight: 900;
  line-height: 1.05;
}

.phrase-card p {
  margin: 0;
}

.toolbar {
  justify-content: space-between;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 34, 39, 0.76);
}

.toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-weight: 700;
}

select {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111316;
  color: var(--text);
  padding: 0 38px 0 12px;
}

.tool-button {
  padding: 0 14px;
  background: var(--lime);
  color: var(--ink);
  border: 0;
  font-weight: 850;
}

.meme-card {
  overflow: hidden;
}

.video-card {
  background: rgba(20, 22, 26, 0.9);
}

.meme-card.is-busy {
  outline: 2px solid var(--lime);
  outline-offset: -2px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  height: clamp(260px, 30vw, 340px);
  background: #050607;
}

.meme-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050607;
}

.missing-video {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(255, 77, 79, 0.18), transparent 42%),
    #0a0b0d;
  text-align: center;
}

.missing-video strong {
  font-size: clamp(1.6rem, 4vw, 2.8rem);
  line-height: 1;
}

.missing-video span {
  color: var(--muted);
  font-weight: 800;
}

.has-video .missing-video {
  display: none;
}

.is-missing .meme-video {
  visibility: hidden;
}

.meme-preview {
  aspect-ratio: 16 / 9;
  background: #0a0b0d;
}

.meme-meta {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.video-card .meme-meta {
  grid-template-columns: 1fr auto;
  align-items: center;
}

.download-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  font-weight: 900;
}

.download-link svg {
  width: 17px;
  height: 17px;
}

.empty-state {
  grid-column: 1 / -1;
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(32, 34, 39, 0.82);
  color: var(--muted);
}

.meme-meta p {
  min-height: 48px;
  margin: 0;
}


.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 920px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-tabs {
    width: 100%;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    justify-self: start;
    width: min(100%, 360px);
  }

  .stat-band,
  .feature-grid,
  .phrase-grid,
  .meme-grid,
  .bio-layout {
    grid-template-columns: 1fr 1fr;
  }

  .bio-card {
    position: static;
  }
}

@media (max-width: 640px) {
  main,
  .topbar,
  .site-footer {
    width: min(100% - 22px, 1180px);
  }

  .tab-btn {
    padding: 0 11px;
  }

  .tab-btn svg {
    display: none;
  }

  h1 {
    font-size: clamp(2.1rem, 13vw, 3.4rem);
  }

  .hero-actions,
  .source-strip,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .primary-link,
  .ghost-link,
  .tool-button,
  .toolbar label {
    width: 100%;
  }

  .toolbar label {
    justify-content: space-between;
  }

  .stat-band,
  .feature-grid,
  .phrase-grid,
  .meme-grid,
  .bio-layout {
    grid-template-columns: 1fr;
  }

  .timeline article {
    grid-template-columns: 1fr;
  }

  .timeline p {
    grid-column: auto;
    margin-top: 0;
  }

  .video-shell {
    height: min(112vw, 620px);
  }

  .video-card .meme-meta {
    grid-template-columns: 1fr;
  }

  .site-footer {
    flex-direction: column;
  }
}
