:root {
  --bg: #e8e3d8;
  --surface: rgba(255, 255, 255, 0.58);
  --surface-strong: rgba(255, 255, 255, 0.78);
  --text: #202020;
  --muted: #746f66;
  --line: rgba(89, 76, 38, 0.08);
  --chip: #f1e6c8;
  --chip-active: #e9d08a;
  --chip-text: #6b5a2f;
  --card-shadow: 0 20px 40px rgba(60, 48, 24, 0.08);
  --radius-xl: 32px;
  --radius-lg: 24px;
  --radius-md: 20px;
  --radius-sm: 16px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(180deg, #ece7dc 0%, var(--bg) 32%, #e6e1d6 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

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

img {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
}

.page-shell {
  position: relative;
  min-height: 100vh;
  overflow-x: clip;
}

.container {
  width: min(calc(100% - 40px), var(--container));
  margin: 0 auto;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 20px;
}

.header__left {
  display: flex;
  align-items: center;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 1.05rem;
  font-weight: 500;
  letter-spacing: -0.02em;
}

.brand__emoji {
  font-size: 1.35rem;
}

.icon-button {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.48);
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #3b372f;
  background: var(--surface-strong);
  box-shadow: 0 6px 18px rgba(47, 38, 17, 0.06);
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.92);
}

.icon-button svg {
  width: 22px;
  height: 22px;
}

.button {
  border: none;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.button:hover,
.catalog__cta:hover,
.catalog__load-more:hover,
.card__action:hover,
.filter-chip:hover {
  transform: translateY(-1px);
}

.button--ghost {
  min-height: 48px;
  padding: 0 22px;
  color: #4b463d;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 10px 18px rgba(60, 48, 24, 0.05);
}

.button--secondary {
  min-height: 46px;
  padding: 0 20px;
  background: rgba(255, 255, 255, 0.9);
  color: #35312b;
}

.hero {
  padding-top: 54px;
}

.eyebrow {
  margin: 0 0 10px;
  color: rgba(49, 47, 43, 0.38);
  font-size: 1rem;
  font-weight: 500;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 4.25rem);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.hero__heading-row {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
}

.hero__hint {
  max-width: 420px;
  padding-bottom: 8px;
  color: var(--muted);
  line-height: 1.45;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.filter-chip {
  min-height: 46px;
  padding: 0 18px;
  border-radius: 999px;
  border: 1px solid rgba(225, 197, 114, 0.36);
  background: rgba(248, 240, 216, 0.72);
  color: var(--chip-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.filter-chip.is-active {
  background: var(--chip-active);
  border-color: rgba(194, 154, 44, 0.5);
  color: #3d3008;
}

.filter-chip__count {
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  font-size: 0.82rem;
}

.catalog {
  padding-top: 42px;
  padding-bottom: 84px;
}

.catalog__topline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-height: 20px;
  margin-bottom: 20px;
}

.catalog__stats {
  color: var(--muted);
  font-size: 0.95rem;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px;
}

.card {
  position: relative;
  min-height: 0;
  aspect-ratio: 0.78;
  border: none;
  padding: 0;
  border-radius: 32px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.24);
  box-shadow: var(--card-shadow);
  isolation: isolate;
}

.card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card__badge {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 1;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(12px);
  color: #443f38;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
}

.card__overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 18px;
  padding: 22px;
  opacity: 0;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(9, 11, 16, 0.12) 6%, rgba(9, 11, 16, 0.26) 38%, rgba(9, 11, 16, 0.62) 100%);
  backdrop-filter: blur(18px) saturate(1.08);
  transition: opacity 180ms ease;
}

.card:hover .card__overlay,
.card:focus-within .card__overlay,
.card.is-touch-active .card__overlay {
  opacity: 1;
  pointer-events: auto;
}

.card__prompt {
  margin: 0;
  color: #fff;
  font-size: 0.98rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.24);
}

.card__actions {
  display: flex;
  gap: 10px;
}

.card__action {
  flex: 1 1 0;
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(18px);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, box-shadow 180ms ease, color 180ms ease;
}

.card__action:hover {
  background: rgba(255, 255, 255, 0.22);
}

.card__action--primary {
  color: #4f3d0a;
  background: linear-gradient(180deg, #f4da72 0%, #e7c85a 100%);
  border-color: rgba(122, 92, 16, 0.18);
  box-shadow: 0 10px 22px rgba(151, 118, 18, 0.26), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.card__action--primary:hover {
  color: #473507;
  background: linear-gradient(180deg, #f7e08a 0%, #edcf67 100%);
  border-color: rgba(122, 92, 16, 0.22);
}

.card__icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.card__action-text {
  min-width: 0;
  white-space: nowrap;
}

.catalog__actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 44px;
}

.catalog__load-more {
  border: none;
  padding: 0;
  background: transparent;
  color: #403c37;
  font-size: 1.05rem;
  cursor: pointer;
}

.catalog__cta {
  border: none;
  padding: 0;
  background: transparent;
  color: #3f3a33;
  font-size: clamp(1.15rem, 2.2vw, 1.7rem);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
}

.catalog__cta-icon {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  background: #e7cb6d;
  color: #5d4a0d;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(151, 118, 18, 0.22);
}

.catalog__cta-icon svg {
  width: 20px;
  height: 20px;
}

.empty-state {
  margin-top: 12px;
  padding: 36px;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.52);
  box-shadow: var(--card-shadow);
}

.empty-state h3 {
  margin: 0 0 8px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.5;
}

.hidden {
  display: none !important;
}

.footer {
  border-top: 1px solid rgba(129, 118, 90, 0.14);
  padding-top: 28px;
  padding-bottom: 40px;
  color: rgba(60, 54, 44, 0.66);
}

.footer__meta {
  margin-bottom: 14px;
}

.footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 26px;
  margin-bottom: 14px;
  font-size: 0.95rem;
}

.footer__links a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer__legal {
  max-width: 1100px;
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.55;
}

.drawer {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 30;
  width: min(420px, calc(100vw - 24px));
  padding: 24px;
  background: rgba(238, 233, 223, 0.96);
  backdrop-filter: blur(26px);
  border-right: 1px solid rgba(103, 89, 45, 0.08);
  box-shadow: 24px 0 42px rgba(39, 31, 13, 0.12);
  transform: translateX(calc(-100% - 16px));
  transition: transform 220ms ease;
  display: flex;
  flex-direction: column;
}

.drawer.is-open {
  transform: translateX(0);
}

.drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.drawer__nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 36px;
}

.drawer__link {
  min-height: 58px;
  border-radius: 20px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid rgba(141, 124, 74, 0.08);
  font-size: 1.02rem;
}

.drawer__link--button {
  width: 100%;
  text-align: left;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.drawer__link--current {
  background: rgba(231, 203, 109, 0.24);
  color: #473507;
}

.drawer__footer {
  margin-top: auto;
  padding-top: 24px;
  color: var(--muted);
  line-height: 1.5;
}

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(20, 20, 24, 0.28);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.backdrop.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 40;
  transform: translate(-50%, 24px);
  min-width: 220px;
  max-width: calc(100vw - 32px);
  padding: 14px 18px;
  border-radius: 16px;
  color: #fff;
  background: rgba(18, 18, 22, 0.9);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
  opacity: 0;
  pointer-events: none;
  transition: transform 180ms ease, opacity 180ms ease;
  text-align: center;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (max-width: 1180px) {
  .cards-grid {
    gap: 22px;
  }

  .card__overlay {
    padding: 20px;
  }

  .card__prompt {
    font-size: 0.94rem;
    line-height: 1.48;
  }

  .card__action {
    min-height: 46px;
    padding: 0 12px;
    gap: 8px;
  }

  .card__action-text {
    font-size: 0.92rem;
  }
}

@media (max-width: 900px) {
  .hero__heading-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero__hint {
    max-width: 100%;
    padding-bottom: 0;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }

  .card {
    aspect-ratio: 0.76;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(calc(100% - 24px), var(--container));
  }

  .header {
    padding-top: 12px;
  }

  .header__left {
    gap: 12px;
  }

  .button--ghost,
  .icon-button {
    min-height: 44px;
    height: 44px;
  }

  .hero {
    padding-top: 32px;
  }

  .hero h1 {
    font-size: clamp(2.05rem, 9vw, 3rem);
  }

  .filters {
    gap: 10px;
    margin-top: 24px;
  }

  .filter-chip {
    min-height: 42px;
    padding: 0 14px;
    font-size: 0.93rem;
  }

  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card {
    border-radius: 24px;
    aspect-ratio: 0.72;
  }

  .card__badge {
    display: none;
  }

  .card__overlay {
    opacity: 0;
    pointer-events: none;
    gap: 12px;
    padding: 14px;
    background: linear-gradient(180deg, rgba(9, 11, 16, 0.04) 0%, rgba(9, 11, 16, 0.1) 36%, rgba(9, 11, 16, 0.58) 100%);
  }

  .card.is-touch-active .card__overlay,
  .card:focus-within .card__overlay {
    opacity: 1;
    pointer-events: auto;
  }

  .card__prompt {
    font-size: 0.82rem;
    line-height: 1.38;
    -webkit-line-clamp: 4;
  }

  .card__actions {
    gap: 8px;
  }

  .card__action {
    min-height: 42px;
    padding: 0;
    border-radius: 14px;
  }

  .card__icon {
    width: 18px;
    height: 18px;
  }

  .card__action-text {
    display: none;
  }

  .catalog__actions {
    flex-direction: column;
    align-items: flex-start;
  }

  .catalog__cta {
    font-size: 1.25rem;
  }

  .footer__links {
    flex-direction: column;
    gap: 8px;
  }
}

@media (max-width: 390px) {
  .card__prompt {
    -webkit-line-clamp: 3;
  }
}

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