:root {
  color-scheme: light dark;
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-soft: #eef1f7;
  --sidebar: #f8f9fc;
  --text: #171923;
  --text-muted: #687083;
  --border: #dfe3ec;
  --accent: #7c5cff;
  --accent-strong: #6545ed;
  --accent-soft: #eeeaff;
  --green: #2dbd86;
  --shadow: 0 18px 50px rgba(35, 42, 68, 0.1);
  --sidebar-width: 264px;
  --radius-lg: 22px;
  --radius-md: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1117;
    --surface: #181b24;
    --surface-soft: #20242f;
    --sidebar: #13161d;
    --text: #f2f3f7;
    --text-muted: #9ba3b6;
    --border: #2b303d;
    --accent: #8b72ff;
    --accent-strong: #9c87ff;
    --accent-soft: #29243e;
    --green: #3bd49b;
    --shadow: 0 18px 50px rgba(0, 0, 0, 0.28);
  }
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button,
input,
select {
  font: inherit;
}

button,
a,
input,
select {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

svg {
  display: block;
  width: 1.25em;
  fill: currentColor;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  display: flex;
  width: var(--sidebar-width);
  flex-direction: column;
  padding: 28px 18px 20px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 10px 30px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}

.brand strong {
  color: var(--accent);
}

.brand small {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  color: white;
  background: linear-gradient(145deg, var(--accent), #5a39d9);
  border-radius: 13px;
  box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 28%, transparent);
}

.brand-mark svg {
  width: 24px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 650;
  text-decoration: none;
  border-radius: 11px;
  transition: 160ms ease;
}

.nav-item:hover {
  color: var(--text);
  background: var(--surface-soft);
}

.nav-item.is-active {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.nav-item svg {
  width: 19px;
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.theme-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
}

.theme-status > span:last-child {
  display: flex;
  flex-direction: column;
}

.theme-status strong {
  font-size: 12px;
}

.theme-status small {
  color: var(--text-muted);
  font-size: 10px;
}

.theme-icon {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 50%;
}

.theme-icon svg {
  width: 17px;
}

.icon-moon {
  display: none;
}

@media (prefers-color-scheme: dark) {
  .icon-sun {
    display: none;
  }

  .icon-moon {
    display: block;
  }
}

.main-content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
}

.mobile-header {
  display: none;
}

.hero {
  position: relative;
  display: flex;
  min-height: 330px;
  align-items: center;
  overflow: hidden;
  padding: 64px clamp(28px, 6vw, 84px);
  color: white;
  background:
    radial-gradient(circle at 82% 45%, rgba(175, 157, 255, 0.42), transparent 25%),
    linear-gradient(120deg, #161422 5%, #272039 48%, #6b4be3 140%);
}

.hero::after {
  position: absolute;
  inset: auto 0 0;
  height: 1px;
  content: "";
  background: rgba(255, 255, 255, 0.1);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 630px;
}

.eyebrow {
  display: block;
  margin-bottom: 18px;
  color: #b9a9ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.hero h1 {
  max-width: 610px;
  margin: 0;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 0.99;
  letter-spacing: -0.055em;
}

.hero h1 span {
  color: #a68dff;
}

.hero p {
  max-width: 540px;
  margin: 24px 0 0;
  color: #c5c2ce;
  font-size: clamp(14px, 1.4vw, 17px);
}

.hero-orbit {
  position: absolute;
  top: 50%;
  right: clamp(26px, 8vw, 130px);
  width: 220px;
  height: 220px;
  transform: translateY(-50%);
}

.orbit {
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 50%;
}

.orbit::before,
.orbit::after {
  position: absolute;
  width: 7px;
  height: 7px;
  content: "";
  background: #b9a8ff;
  border-radius: 50%;
  box-shadow: 0 0 18px #a88dff;
}

.orbit::before {
  top: 20px;
  left: 44px;
}

.orbit::after {
  right: 1px;
  bottom: 83px;
}

.orbit-two {
  inset: 24px;
  border-style: dashed;
  transform: rotate(36deg);
}

.hero-glyph {
  position: absolute;
  inset: 50% auto auto 50%;
  color: rgba(255, 255, 255, 0.94);
  font-size: 94px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 45px rgba(173, 148, 255, 0.45);
  transform: translate(-50%, -50%);
}

.catalog {
  max-width: 1480px;
  margin: 0 auto;
  padding: 42px clamp(22px, 5vw, 68px) 80px;
}

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

.catalog-heading h2 {
  margin: 0;
  font-size: 25px;
  letter-spacing: -0.025em;
}

.catalog-heading p {
  margin: 3px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.search-field,
.select-field {
  position: relative;
  display: flex;
  align-items: center;
  color: var(--text-muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-field:focus-within,
.select-field:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent);
}

.search-field {
  width: min(100%, 470px);
}

.search-field svg,
.select-field svg {
  position: absolute;
  left: 14px;
  width: 18px;
  pointer-events: none;
}

.search-field input,
.select-field select {
  width: 100%;
  min-height: 45px;
  color: var(--text);
  background: transparent;
  border: 0;
  outline: 0;
}

.search-field input {
  padding: 0 50px 0 43px;
}

.search-field input::placeholder {
  color: var(--text-muted);
}

.search-field kbd {
  position: absolute;
  right: 12px;
  display: grid;
  width: 25px;
  height: 25px;
  place-items: center;
  color: var(--text-muted);
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 6px;
  font-family: inherit;
  font-size: 11px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.select-field select {
  min-width: 175px;
  padding: 0 34px 0 42px;
  cursor: pointer;
}

.clear-button {
  min-height: 43px;
  padding: 0 14px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 22px;
}

.project-card {
  min-width: 0;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 18px rgba(30, 36, 58, 0.04);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

.cover-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 25%, rgba(139, 114, 255, 0.42), transparent 28%),
    linear-gradient(145deg, #272b39, #151820);
}

.project-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.project-cover[hidden] {
  display: none;
}

.cover-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: rgba(255, 255, 255, 0.62);
}

.cover-placeholder[hidden],
.project-detail-placeholder[hidden] {
  display: none;
}

.cover-placeholder svg {
  width: 62px;
  filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.3));
}

.status-badge {
  position: absolute;
  top: 13px;
  right: 13px;
  padding: 6px 9px;
  color: #fff;
  background: rgba(20, 22, 29, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.status-badge.is-complete {
  background: rgba(29, 157, 111, 0.9);
}

.card-body {
  padding: 19px;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  margin-bottom: 8px;
  color: var(--accent-strong);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.project-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.project-meta span[aria-hidden] {
  flex: 0 0 auto;
  color: var(--text-muted);
}

.project-title {
  overflow: hidden;
  margin: 0;
  font-size: 18px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.project-description {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  margin: 7px 0 18px;
  color: var(--text-muted);
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.progress-block {
  margin-bottom: 17px;
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 650;
  text-transform: uppercase;
}

.progress-label strong {
  color: var(--text);
  font-size: 11px;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: var(--surface-soft);
  border-radius: 99px;
}

.progress-fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--accent), #aa91ff);
  border-radius: inherit;
  transition: width 350ms ease;
}

.download-button {
  display: flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: white;
  background: var(--accent);
  border-radius: 11px;
  font-size: 12px;
  font-weight: 750;
  text-decoration: none;
  transition: background 160ms ease, transform 160ms ease;
}

.download-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.download-button[hidden] {
  display: none;
}

.project-open-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 10px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
}

.project-open-hint svg {
  width: 14px;
}

.project-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 38px clamp(20px, 5vw, 68px) 80px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 24px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.back-link:hover {
  color: var(--accent-strong);
}

.back-link svg {
  width: 17px;
}

.project-detail {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.project-detail-hero {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 75% 30%, rgba(139, 114, 255, 0.4), transparent 28%),
    linear-gradient(145deg, #272b39, #151820);
}

.project-detail-cover {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
}

.project-detail-cover[hidden] {
  display: none;
}

.project-detail-placeholder {
  display: grid;
  min-height: 360px;
  place-items: center;
  color: rgba(255, 255, 255, 0.64);
}

.project-detail-placeholder svg {
  width: 84px;
}

.project-detail-overlay {
  position: absolute;
  inset: auto 0 0;
  padding: 80px clamp(24px, 5vw, 58px) 38px;
  color: white;
  background: linear-gradient(transparent, rgba(8, 9, 14, 0.94));
}

.project-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  color: #c6baff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.project-detail-title {
  margin: 0;
  font-size: clamp(34px, 5vw, 64px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.project-detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  padding: clamp(24px, 5vw, 56px);
}

.project-section + .project-section {
  margin-top: 34px;
}

.project-section h2,
.project-sidebar-card h2 {
  margin: 0 0 13px;
  font-size: 20px;
  letter-spacing: -0.02em;
}

.project-section p {
  margin: 0;
  color: var(--text-muted);
  white-space: pre-line;
}

.installation-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: install-step;
}

.installation-list li {
  position: relative;
  min-height: 38px;
  padding: 8px 0 8px 52px;
  color: var(--text-muted);
  counter-increment: install-step;
}

.installation-list li::before {
  position: absolute;
  top: 2px;
  left: 0;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  content: counter(install-step);
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: 11px;
  font-size: 13px;
  font-weight: 800;
}

.project-sidebar-card {
  position: sticky;
  top: 30px;
  padding: 22px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 18px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.status-row span {
  color: var(--text-muted);
  font-size: 12px;
}

.status-value {
  color: var(--green);
  font-size: 13px;
}

.project-download {
  min-height: 48px;
}

.project-error {
  display: grid;
  min-height: 420px;
  place-items: center;
  padding: 40px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: 24px;
}

.project-error h1 {
  margin: 0 0 8px;
}

.project-error p {
  margin: 0 0 18px;
  color: var(--text-muted);
}

.empty-state {
  display: grid;
  min-height: 260px;
  grid-column: 1 / -1;
  place-items: center;
  padding: 48px 20px;
  text-align: center;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

.empty-state svg {
  width: 48px;
  margin: 0 auto 16px;
  color: var(--accent);
}

.empty-state h3 {
  margin: 0;
  font-size: 18px;
}

.empty-state p {
  max-width: 440px;
  margin: 7px auto 0;
  color: var(--text-muted);
  font-size: 13px;
}

.sidebar-backdrop {
  display: none;
}

@media (max-width: 1080px) {
  .hero-orbit {
    right: -35px;
    opacity: 0.7;
  }

  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .filter-group {
    margin-left: 0;
  }

  .select-field {
    flex: 1;
  }

  .select-field select {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: min(82vw, 286px);
  }

  body.menu-open {
    overflow: hidden;
  }

  .sidebar {
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.28);
    transform: translateX(-105%);
    transition: transform 220ms ease;
  }

  body.menu-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: block;
    visibility: hidden;
    background: rgba(5, 6, 10, 0.56);
    opacity: 0;
    transition: opacity 220ms ease, visibility 220ms ease;
  }

  body.menu-open .sidebar-backdrop {
    visibility: visible;
    opacity: 1;
  }

  .main-content {
    margin-left: 0;
  }

  .mobile-header {
    position: sticky;
    top: 0;
    z-index: 15;
    display: flex;
    height: 60px;
    align-items: center;
    gap: 12px;
    padding: 0 18px;
    background: color-mix(in srgb, var(--sidebar) 92%, transparent);
    border-bottom: 1px solid var(--border);
    backdrop-filter: blur(14px);
  }

  .icon-button {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    color: var(--text);
    background: var(--surface-soft);
    border: 0;
    border-radius: 10px;
  }

  .mobile-brand {
    font-weight: 800;
    letter-spacing: -0.025em;
  }

  .mobile-brand span {
    color: var(--accent);
  }

  .hero {
    min-height: 310px;
    padding: 48px 22px;
  }

  .hero-orbit {
    top: 35%;
    right: -90px;
    width: 190px;
    height: 190px;
    opacity: 0.45;
  }

  .hero-copy {
    max-width: 95%;
  }

  .hero h1 {
    font-size: clamp(40px, 13vw, 58px);
  }

  .hero p {
    max-width: 90%;
    font-size: 14px;
  }

  .catalog {
    padding: 30px 16px 60px;
  }

  .filter-group {
    display: grid;
    width: 100%;
    grid-template-columns: 1fr;
  }

  .clear-button {
    grid-column: auto;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-page {
    padding: 24px 16px 60px;
  }

  .project-detail-hero,
  .project-detail-cover,
  .project-detail-placeholder {
    min-height: 280px;
  }

  .project-detail-content {
    grid-template-columns: 1fr;
  }

  .project-sidebar-card {
    position: static;
  }
}

@media (max-width: 430px) {
  .select-field select {
    min-height: 48px;
  }
}

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