:root {
  --page: var(--bg);
  --surface: var(--bg-card);
  --soft: var(--bg-1);
  --text: var(--ink);
  --muted: var(--ink-2);
  --quiet: var(--ink-3);
  --brand: var(--accent);
  --brand-deep: var(--bg-blue);
  --brand-hover: var(--accent-ink);
  --white: #ffffff;
  --container: min(1376px, calc(100vw - 64px));
}

* { box-sizing: border-box; }

html {
  overflow-x: clip;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: clip;
  background: var(--page);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  padding: 12px 16px;
  background: var(--brand-deep);
  color: var(--white);
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }

.catalog-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: 100%;
  min-height: 72px;
  padding: 0 32px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 94%, transparent);
  backdrop-filter: blur(18px);
}

.catalog-logo {
  width: fit-content;
  color: var(--text);
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.045em;
}

.catalog-header nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.catalog-header nav a {
  color: var(--muted);
  font-size: 14px;
  transition: color 160ms ease;
}

.catalog-header nav a:hover,
.catalog-header nav a[aria-current="page"] {
  color: var(--brand);
}

.catalog-header__cta {
  justify-self: end;
  display: inline-flex;
  min-height: 42px;
  padding: 0 18px;
  align-items: center;
  justify-content: center;
  gap: 20px;
  border: 1px solid var(--brand);
  background: var(--brand);
  color: var(--white);
  font-size: 13px;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease;
}

.catalog-header__cta:hover {
  border-color: var(--brand-hover);
  background: var(--brand-hover);
}

.catalog-logo:focus-visible,
.catalog-header nav a:focus-visible,
.catalog-header__cta:focus-visible,
.catalog-controls button:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 3px;
}

.catalog-hero {
  width: var(--container);
  margin: 0 auto;
  padding: clamp(50px, 5vw, 76px) 0;
  border-bottom: 1px solid var(--line);
}

.catalog-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 0.62fr);
  gap: clamp(48px, 8vw, 128px);
  align-items: end;
}

.catalog-kicker {
  display: block;
  margin-bottom: 22px;
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.catalog-hero h1 {
  max-width: 960px;
  margin: 0;
  color: var(--text);
  font-size: clamp(44px, 5vw, 72px);
  font-weight: 650;
  line-height: 0.96;
  letter-spacing: -0.068em;
}

.catalog-hero h1 span { color: var(--brand); }

.catalog-hero__grid > p {
  max-width: 470px;
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.58;
}

.catalog-controls {
  position: sticky;
  top: 72px;
  z-index: 50;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  width: var(--container);
  margin: 0 auto;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--page) 96%, transparent);
  backdrop-filter: blur(18px);
}

.catalog-view-switch {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  width: max-content;
  border: 1px solid var(--line);
  background: var(--soft);
}

.catalog-view-switch button,
.catalog-tabs button {
  min-height: 44px;
  border: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
}

.catalog-view-switch button { padding: 0 16px; }

.catalog-view-switch button + button { border-left: 1px solid var(--line); }

.catalog-view-switch button.is-active {
  background: var(--brand-deep);
  color: var(--white);
}

.catalog-tabs {
  display: flex;
  min-width: 0;
  gap: 0;
  overflow-x: auto;
  border-left: 1px solid var(--line);
  scrollbar-width: none;
}

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

.catalog-tabs button {
  flex: 0 0 auto;
  display: inline-flex;
  padding: 0 14px;
  align-items: center;
  gap: 7px;
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.catalog-tabs button:hover { color: var(--brand); }

.catalog-tabs button.is-active {
  background: var(--surface);
  color: var(--brand);
  box-shadow: inset 0 -2px var(--brand);
}

.catalog-tabs button span {
  color: var(--quiet);
  font-size: 12px;
}

.catalog-count {
  margin: 0;
  color: var(--quiet);
  white-space: nowrap;
  font-size: 12px;
}

.catalog-count strong {
  color: var(--text);
  font-weight: 700;
}

.catalog-results {
  width: var(--container);
  min-height: 520px;
  margin: 0 auto;
  padding: 32px 0 clamp(64px, 7vw, 104px);
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.catalog-card__top > span,
.catalog-card__bottom span { white-space: normal; }

.catalog-noscript {
  padding: 28px;
  border: 1px solid var(--line);
  color: var(--muted);
}

@media (max-width: 1100px) {
  .catalog-header { grid-template-columns: 1fr auto; }
  .catalog-header nav { display: none; }
  .catalog-hero__grid { grid-template-columns: 1fr; gap: 26px; }
  .catalog-hero__grid > p { max-width: 680px; }
  .catalog-controls { grid-template-columns: auto minmax(0, 1fr); }
  .catalog-count { display: none; }
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  :root { --container: calc(100vw - 36px); }

  .catalog-header {
    min-height: 64px;
    padding: 0 18px;
  }

  .catalog-logo { font-size: 17px; }

  .catalog-header__cta {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    padding: 0;
    overflow: hidden;
    font-size: 0;
  }

  .catalog-header__cta span { font-size: 18px; }

  .catalog-hero { padding: 34px 0 36px; }
  .catalog-kicker { margin-bottom: 16px; font-size: 12px; }

  .catalog-hero h1 {
    font-size: clamp(39px, 11.3vw, 44px);
    line-height: 0.98;
  }

  .catalog-hero__grid { gap: 22px; }
  .catalog-hero__grid > p { font-size: 15px; line-height: 1.55; }

  .catalog-controls {
    position: static;
    grid-template-columns: 1fr;
    width: 100%;
    padding: 14px 18px 16px;
    gap: 12px;
  }

  .catalog-view-switch { width: 100%; }
  .catalog-view-switch button { min-height: 46px; }

  .catalog-tabs {
    margin: 0 -18px;
    padding: 0 18px;
    border-left: 0;
  }

  .catalog-tabs button:first-child { border-left: 1px solid var(--line); }

  .catalog-results {
    padding: 24px 0 52px;
  }

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

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