:root {
  color-scheme: light;
  --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);
  --line-strong: rgba(141, 124, 74, 0.08);
  --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;
  --drawer-bg: rgba(238, 233, 223, 0.96);
  --drawer-link-bg: rgba(255, 255, 255, 0.45);
  --drawer-link-hover: rgba(231, 203, 109, 0.18);
  --theme-option-bg: rgba(255, 255, 255, 0.58);
  --theme-option-border: rgba(141, 124, 74, 0.08);
  --page-gradient:
    radial-gradient(circle at top center, rgba(255, 255, 255, 0.42), transparent 28%),
    linear-gradient(180deg, #ece7dc 0%, var(--bg) 32%, #e6e1d6 100%);
}

:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #13110e;
  --surface: rgba(255, 255, 255, 0.06);
  --surface-strong: rgba(255, 255, 255, 0.08);
  --text: #f4ede2;
  --muted: rgba(238, 229, 214, 0.66);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(245, 195, 56, 0.14);
  --chip-active: rgba(245, 195, 56, 0.18);
  --chip-text: #f4d67f;
  --card-shadow: 0 24px 56px rgba(0, 0, 0, 0.32);
  --drawer-bg: rgba(18, 16, 13, 0.96);
  --drawer-link-bg: rgba(255, 255, 255, 0.04);
  --drawer-link-hover: rgba(245, 195, 56, 0.08);
  --theme-option-bg: rgba(255, 255, 255, 0.04);
  --theme-option-border: rgba(255, 255, 255, 0.08);
  --page-gradient:
    radial-gradient(circle at top center, rgba(245, 195, 56, 0.12), transparent 28%),
    linear-gradient(180deg, #171410 0%, #13110e 38%, #100e0c 100%);
}

:root[data-theme='light'] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--page-gradient);
  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: var(--text);
  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,
.card__action:hover,
.icon-button:hover {
  transform: translateY(-1px);
}

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

.hero {
  padding-top: 54px;
}

.hero--promo {
  padding-bottom: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 500;
}

.hero h1,
.catalog h2 {
  margin: 0;
  letter-spacing: -0.05em;
  font-weight: 500;
}

.hero h1 {
  font-size: clamp(1.22rem, 5.4vw, 4rem);
  line-height: 0.98;
  max-width: none;
  white-space: nowrap;
}

.hero-demo {
  position: relative;
  margin-top: 34px;
  border-radius: 36px;
  overflow: hidden;
  aspect-ratio: 896 / 563;
  box-shadow: var(--card-shadow);
  background: rgba(255, 255, 255, 0.18);
  isolation: isolate;
}

.hero-demo::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: radial-gradient(circle at center, rgba(20, 16, 4, 0.08) 0%, rgba(20, 16, 4, 0.18) 36%, rgba(10, 10, 12, 0.34) 100%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease;
}

.hero-demo:hover::after,
.hero-demo:focus-within::after {
  opacity: 1;
}

.hero-demo__media {
  position: absolute;
  inset: 0;
}

.hero-demo__media--light {
  display: block;
}

.hero-demo__media--dark {
  display: none;
}

.hero-demo img,
.hero-demo__video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.hero-demo__cta {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  padding: 0 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f6d769 0%, #e7cb6d 100%);
  color: #3f2d00;
  font-size: clamp(1rem, 1.5vw, 1.08rem);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.01em;
  box-shadow: 0 16px 34px rgba(231, 203, 109, 0.32), 0 0 0 1px rgba(255, 241, 193, 0.55) inset;
  transform: translate(-50%, calc(-50% + 14px)) scale(0.94);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms ease, transform 220ms ease, box-shadow 220ms ease;
}

.hero-demo:hover .hero-demo__cta,
.hero-demo:focus-within .hero-demo__cta {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.hero-demo__cta:hover,
.hero-demo__cta:focus-visible {
  box-shadow: 0 18px 42px rgba(231, 203, 109, 0.42), 0 0 28px rgba(245, 214, 99, 0.34), 0 0 0 1px rgba(255, 245, 210, 0.72) inset;
}

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

.catalog__intro {
  margin-bottom: 32px;
}

.catalog h2 {
  font-size: clamp(2rem, 4.7vw, 3.7rem);
  line-height: 0.97;
}

.cards-grid {
  display: grid;
  gap: 26px;
}

.cards-grid--landing {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.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: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  object-position: center center;
}

.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-width: 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;
  overflow: hidden;
  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:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(231, 203, 109, 0.32);
}

.card__action:active {
  transform: translateY(1px);
}

.card__action--primary {
  color: #2f2507;
  background: #e7cb6d;
  border-color: rgba(151, 118, 18, 0.28);
  box-shadow: 0 10px 24px rgba(151, 118, 18, 0.24);
}

.card__action--primary:hover {
  background: #efd57e;
  border-color: rgba(151, 118, 18, 0.38);
}

.card__action--primary:focus-visible {
  box-shadow: 0 0 0 3px rgba(255, 245, 196, 0.8), 0 0 0 6px rgba(231, 203, 109, 0.38);
}

.card__action--primary:active {
  background: #dcc05f;
  box-shadow: 0 6px 14px rgba(151, 118, 18, 0.22);
}

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

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

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

.catalog__actions--promo {
  justify-content: flex-start;
}

.catalog__cta {
  border: none;
  padding: 0;
  background: transparent;
  color: var(--text);
  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;
}

.footer {
  border-top: 1px solid var(--line);
  padding-top: 28px;
  padding-bottom: 40px;
  color: var(--muted);
}

.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: var(--drawer-bg);
  backdrop-filter: blur(26px);
  border-right: 1px solid var(--line);
  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: var(--drawer-link-bg);
  border: 1px solid var(--line-strong);
  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: var(--chip-text);
}

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

.drawer__footer p {
  margin: 0;
}


.drawer__scroll {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 34px;
}

.drawer__section {
  display: grid;
  gap: 12px;
}

.drawer__section--settings {
  gap: 10px;
}

.drawer__section-label {
  font-size: 0.84rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.drawer__link {
  width: 100%;
  justify-content: flex-start;
  gap: 12px;
}

.drawer__link:hover {
  background: var(--drawer-link-hover);
}

.drawer__link-side {
  margin-left: auto;
  font-size: 0.82rem;
  color: var(--muted);
}

.theme-group {
  display: grid;
  gap: 8px;
  margin-top: 2px;
}

.theme-option {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--theme-option-border);
  background: var(--theme-option-bg);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background-color 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.theme-option:hover {
  background: var(--drawer-link-hover);
}

.theme-option.is-selected {
  border-color: rgba(245, 195, 56, 0.24);
  background: rgba(245, 195, 56, 0.12);
}

.hidden {
  display: none !important;
}

.icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  display: inline-block;
}

.icon-theme::before,
.icon-grid::before,
.icon-arrow::before {
  content: '';
  position: absolute;
  display: block;
}

.icon-theme::before {
  inset: 2px;
  border-radius: 50%;
  border: 2px solid currentColor;
}

.icon-grid::before {
  inset: 1px;
  border-radius: 5px;
  border: 2px solid currentColor;
  box-shadow:
    7px 0 0 -5px currentColor,
    0 7px 0 -5px currentColor,
    7px 7px 0 -5px currentColor;
}

.icon-arrow::before {
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  top: 4px;
  left: 3px;
  transform: rotate(45deg);
}

:root[data-theme='light'] .hero-demo__media--light {
  display: block;
}

:root[data-theme='light'] .hero-demo__media--dark {
  display: none;
}

:root[data-theme='dark'] .hero-demo__media--light {
  display: none;
}

:root[data-theme='dark'] .hero-demo__media--dark {
  display: block;
}

:root[data-theme='dark'] .button--ghost {
  background: rgba(255, 255, 255, 0.08);
}

:root[data-theme='dark'] .icon-button,
:root[data-theme='dark'] .hero-demo,
:root[data-theme='dark'] .card,
:root[data-theme='dark'] .footer {
  border-color: var(--line);
}

:root[data-theme='dark'] .catalog__cta-icon {
  background: rgba(245, 195, 56, 0.92);
  color: #342401;
}

:root[data-theme='dark'] .hero-demo__cta {
  background: linear-gradient(180deg, #f6d769 0%, #efc94d 100%);
  color: #342401;
  box-shadow: 0 18px 40px rgba(239, 201, 77, 0.36), 0 0 0 1px rgba(255, 234, 160, 0.28) inset;
}

:root[data-theme='dark'] .hero-demo__cta:hover,
:root[data-theme='dark'] .hero-demo__cta:focus-visible {
  box-shadow: 0 20px 48px rgba(239, 201, 77, 0.44), 0 0 30px rgba(245, 214, 99, 0.4), 0 0 0 1px rgba(255, 238, 184, 0.4) inset;
}

:root[data-theme='dark'] .footer__links a {
  color: var(--text);
}

.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);
}

@media (max-width: 1180px) {
  .cards-grid--landing {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    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: 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(1.12rem, 5.3vw, 2.05rem);
  }

  .hero-demo {
    margin-top: 24px;
    border-radius: 24px;
  }

  .catalog {
    padding-top: 0;
    padding-bottom: 64px;
  }

  .cards-grid--landing {
    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 {
    padding-top: 28px;
  }

  .catalog__cta {
    font-size: 1.25rem;
  }

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


@media (max-width: 640px) {
  .drawer {
    width: min(392px, calc(100vw - 16px));
    padding: 20px;
  }

  .drawer__scroll {
    gap: 24px;
    padding-top: 26px;
  }

  .drawer__link {
    min-height: 54px;
    border-radius: 18px;
  }

  .theme-option {
    min-height: 40px;
  }
}


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


@media (max-width: 480px) {
  .hero h1 {
    white-space: normal;
    line-height: 1.02;
  }
}

@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;
  }
}


/* prompt archive refresh: numbered cards with visible titles */
.card::after {
  content: '';
  position: absolute;
  inset: auto 0 0;
  height: 42%;
  background: linear-gradient(180deg, rgba(8, 10, 14, 0) 0%, rgba(8, 10, 14, 0.18) 34%, rgba(8, 10, 14, 0.78) 100%);
  z-index: 1;
  pointer-events: none;
}
.card__footer {
  position: absolute;
  inset: auto 18px 18px;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  gap: 12px;
}
.card__index,
.card__overlay-index {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.18);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(14px);
}
.card__meta { min-width: 0; }
.card__title {
  margin: 0;
  color: #fff;
  font-size: 1.08rem;
  line-height: 1.2;
  text-shadow: 0 2px 14px rgba(0,0,0,.38);
}
.card__subtitle {
  margin: 6px 0 0;
  color: rgba(255,255,255,.78);
  font-size: 0.86rem;
  line-height: 1.3;
}
.card__overlay-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card__title--overlay { font-size: 1.06rem; }
.card__subtitle--overlay { color: rgba(255,255,255,.7); }
.card__overlay { justify-content: space-between; }
.card__prompt {
  -webkit-line-clamp: 8;
  font-size: 0.95rem;
}
@media (max-width: 767px) {
  .card__footer { inset: auto 14px 14px; }
  .card__index, .card__overlay-index { min-width: 40px; height: 40px; padding: 0 10px; }
  .card__title { font-size: 1rem; }
  .card__prompt { font-size: 0.9rem; -webkit-line-clamp: 7; }
}
