@font-face {
  font-family: "RetroFunk";
  src: url("./assets/retrofunk.ttf") format("truetype");
  font-display: swap;
}

:root {
  --bg: #203d57;
  --panel: #912a2d;
  --panel-soft: #357d77;
  --line: #fbcb3e;
  --text: #f8e2b9;
  --muted: #f8e2b9;
  --sidebar-width: 244px;
  --sidebar-collapsed: 78px;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Instrument Sans", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, rgba(12, 10, 12, 0.28), rgba(12, 10, 12, 0.28)),
    url("./assets/background.jpg") center top / cover no-repeat fixed;
}

button {
  font: inherit;
}

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

.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: var(--sidebar-width);
  height: 100vh;
  padding: 1rem 0.75rem 1.5rem;
  border-right: 3px solid var(--line);
  background: #203d57;
  transition: width 220ms ease, padding 220ms ease;
}

.sidebar.is-collapsed {
  width: var(--sidebar-collapsed);
  padding-inline: 0.55rem;
  border-right-color: transparent;
  background: transparent;
}

.brand-row {
  display: flex;
  align-items: center;
  min-height: 2.5rem;
}

.brand {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
  height: 2.5rem;
  flex: 1;
  overflow: hidden;
}

.brand-image,
.nav-label {
  transition: opacity 180ms ease, transform 180ms ease;
}

.brand-image {
  position: absolute;
  left: 0;
  top: 50%;
  display: block;
  height: auto;
  transform: translateY(-50%);
}

.brand-image-full {
  width: 170px;
  opacity: 1;
}

.brand-image-icon {
  width: 34px;
  opacity: 0;
  pointer-events: none;
}

.sidebar-nav {
  display: grid;
  gap: 0.2rem;
}

.nav-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.8rem 0.85rem;
  border: 2px solid transparent;
  border-radius: 14px;
}

.nav-link.is-active {
  border-color: var(--line);
  background: #912a2d;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.9rem;
  height: 1.9rem;
}

.nav-icon-image {
  display: block;
  width: 1.3rem;
  height: 1.3rem;
  object-fit: contain;
}

.nav-icon-plus {
  font-size: 1.9rem;
  line-height: 1;
  font-weight: 300;
}

.sidebar-account-row {
  margin-top: auto;
  padding: 0.35rem 0.85rem 0;
}

.sidebar-auth-button,
.preview-apply-button,
.ghost-button {
  border: 2px solid var(--line);
  cursor: pointer;
}

.sidebar-auth-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  width: 100%;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  border-radius: 999px;
  background: #912a2d;
  color: var(--text);
  font-weight: 700;
}

.sidebar-auth-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.2rem;
  height: 1.2rem;
}

.theme-back-link {
  display: inline-flex;
  align-items: center;
  font-family: "Instrument Sans", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text);
}

.theme-back-link:hover,
.theme-back-link:focus-visible {
  color: #ffffff;
}

.sidebar-auth-image {
  display: block;
  width: 1.15rem;
  height: 1.15rem;
  object-fit: contain;
}

.sidebar.is-collapsed .sidebar-account-row {
  padding-inline: 0.15rem;
}

.sidebar.is-collapsed .sidebar-auth-button {
  padding-inline: 0;
}

.sidebar.is-collapsed .sidebar-auth-label,
.sidebar.is-collapsed .nav-label,
.sidebar.is-collapsed .brand-image-full {
  opacity: 0;
  pointer-events: none;
}

.sidebar.is-collapsed .sidebar-nav,
.sidebar.is-collapsed .sidebar-account-row {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.sidebar.is-collapsed .brand {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  overflow: visible;
}

.sidebar.is-collapsed .brand-image-icon {
  opacity: 1;
  pointer-events: auto;
}

.theme-main {
  flex: 1;
  padding: 1.8rem 2rem 3rem;
  max-width: 1520px;
  margin: 0 auto;
}

.theme-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.page-kicker,
.summary-label,
.hero-kicker {
  margin: 0 0 0.45rem;
  color: #fbcb3e;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

.theme-header h1,
.preview-intro h2 {
  margin: 0;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  letter-spacing: 0.02em;
}

.theme-header h1 {
  font-size: clamp(2.2rem, 3vw, 3.4rem);
}

.page-copy,
.preview-handle,
.preview-copy,
.preview-theme-status {
  color: var(--text);
}

.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0.8rem 1.2rem;
  border-radius: 999px;
  background: #357d77;
  color: var(--text);
  font-weight: 700;
}

.preview-shell {
  padding: 0;
  background: transparent;
}

.preview-hero,
.preview-card,
.preview-link-stack span,
.preview-media-card,
.preview-gallery div {
  border: 2px solid var(--line);
}

.preview-hero {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 1.2rem;
  align-items: center;
  padding: 1.2rem;
  border: 3px solid #fbcb3e;
  border-radius: 28px;
  background: #912a2d;
  box-shadow: 8px 8px 0 #203d57;
}

.preview-avatar-card {
  width: 220px;
  aspect-ratio: 1 / 1;
  padding: 0;
  border: 3px solid var(--line);
  border-radius: 24px;
  background: transparent;
  box-shadow: 6px 6px 0 #203d57;
  overflow: hidden;
}

.preview-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.preview-intro h2 {
  margin: 0;
  font-size: clamp(2.6rem, 5vw, 4.4rem);
  line-height: 0.95;
  color: #f8e2b9;
}

.preview-intro {
  min-width: 0;
  display: grid;
  align-content: center;
}

.preview-handle {
  margin: 0.9rem 0 0;
  color: #fbcb3e;
  font-weight: 700;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-size: 0.9rem;
}

.preview-copy {
  max-width: 760px;
  margin: 0.8rem 0 0;
  line-height: 1.5;
  color: #f8e2b9;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-size: 0.9rem;
}

.preview-social-row {
  display: flex;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.preview-social-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 2px solid #fbcb3e;
  border-radius: 14px;
  background: #357d77;
  color: #f8e2b9;
}

.preview-social-icon .social-icon {
  width: 22px;
  height: 22px;
}

.preview-action-row {
  margin-top: 0.9rem;
}

.preview-apply-button {
  min-height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fbcb3e;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-weight: 700;
  box-shadow: none;
}

.preview-apply-button.is-applied {
  opacity: 0.72;
}

.preview-theme-status {
  min-height: 1.4rem;
  margin: 0.8rem 0 0;
}

.preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  grid-template-areas:
    "video posts"
    "gallery posts";
  gap: 0.9rem;
  margin-top: 0.9rem;
}

.preview-card {
  padding: 1rem;
  border-radius: 22px;
  border: 3px solid #fbcb3e;
  background: #912a2d;
  box-shadow: 6px 6px 0 #912a2d;
}

.preview-video-card {
  grid-area: video;
}

.preview-posts-card {
  grid-area: posts;
  align-self: start;
}

.preview-media-card {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 210px;
  border-radius: 18px;
  background: #000000;
  color: #f8e2b9;
  font-weight: 700;
}

.preview-stats {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.preview-hero-stats {
  width: 100%;
  max-width: 760px;
  margin-top: 1rem;
}

.preview-stats div {
  display: grid;
  gap: 0.3rem;
  min-width: 120px;
  flex: 1 1 120px;
}

.preview-stats strong {
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-size: 2rem;
  color: #fbcb3e;
}

.preview-stats span {
  color: #f8e2b9;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-size: 0.82rem;
}

.preview-gallery-card {
  grid-area: gallery;
}

.preview-gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  margin-top: 0.75rem;
}

.preview-gallery div {
  min-height: 220px;
  border-radius: 22px;
  background: #a12d31;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-gallery div span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1rem;
  border-radius: 999px;
  background: rgba(58, 18, 18, 0.88);
  color: #f8e2b9;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
  font-size: 0.8rem;
}

.preview-post-stack {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.preview-post-shell {
  display: grid;
  gap: 0.45rem;
  padding: 0.7rem;
  border: 2px solid #fbcb3e;
  border-radius: 18px;
  background: #203d57;
}

.preview-post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  color: #f8e2b9;
  font-family: "RetroFunk", "Instrument Sans", sans-serif;
}

.preview-post-meta strong {
  font-size: 0.92rem;
  font-weight: 700;
}

.preview-post-line {
  display: block;
  border-radius: 999px;
  background: #f8e2b9;
  width: 76%;
  height: 8px;
}

.preview-post-line.short {
  width: 54%;
}

.preview-post-counts {
  color: #f8e2b9;
  font-size: 0.82rem;
}

@media (max-width: 980px) {
  .preview-hero,
  .preview-grid {
    grid-template-columns: 1fr;
  }

  .preview-avatar-card {
    width: min(100%, 240px);
    margin-inline: auto;
  }

  .preview-grid {
    grid-template-areas:
      "video"
      "gallery"
      "posts";
  }
}

@media (max-width: 760px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    display: none;
  }

  .theme-main {
    padding: 1rem 1rem 2rem;
  }

  .theme-header {
    flex-direction: column;
  }

  .preview-shell {
    padding: 0.9rem;
    border-radius: 24px;
  }

  .preview-hero {
    grid-template-columns: 1fr;
  }

  .preview-gallery {
    grid-template-columns: 1fr;
  }
}
