@import url("https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap");

:root {
  --color-primary: #18181b;
  --color-on-primary: #ffffff;
  --color-secondary: #3f3f46;
  --color-on-secondary: #ffffff;
  --color-accent: #18181b;
  --color-on-accent: #ffffff;
  --color-background: #fafafa;
  --color-foreground: #09090b;
  --color-card: #ffffff;
  --color-card-foreground: #09090b;
  --color-muted: #f4f4f5;
  --color-muted-foreground: #52525b;
  --color-border: #e4e4e7;
  --color-destructive: #dc2626;
  --color-on-destructive: #ffffff;
  --color-ring: #18181b;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px rgba(0, 0, 0, 0.15);
  --font-heading: "Playfair Display", "Iowan Old Style", Georgia, serif;
  --font-body: "Inter", "Segoe UI", sans-serif;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --nav-h: 72px;
  --wrap: 72rem;
  --ease: cubic-bezier(0.25, 0.1, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--color-background);
  color: var(--color-foreground);
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.55;
  letter-spacing: -0.011em;
  -webkit-font-smoothing: antialiased;
}

body {
  padding-top: var(--nav-h);
}

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

h1,
h2,
h3,
.brand,
.section-title,
.step-title {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: var(--color-foreground);
}

h1 {
  font-size: clamp(2.5rem, 6vw, 4.75rem);
  margin: 0 0 var(--space-md);
}

h2 {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0 0 var(--space-sm);
}

h3 {
  font-size: 1.5rem;
  margin: 0 0 var(--space-sm);
}

p {
  margin: 0 0 var(--space-md);
}

a {
  color: var(--color-primary);
  text-underline-offset: 0.18em;
}

a,
button,
[type="submit"],
[type="button"],
label[for],
.card,
.session-row {
  cursor: pointer;
}

button,
[type="submit"] {
  font: inherit;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-ring);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--space-md);
  top: -4rem;
  z-index: 80;
  background: var(--color-primary);
  color: var(--color-on-primary);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-sm);
}

.skip-link:focus {
  top: var(--space-sm);
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: 0 0 auto;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-lg {
  width: 1.75rem;
  height: 1.75rem;
}

.icon-flip {
  transform: rotate(180deg);
}

.wrap {
  width: min(var(--wrap), calc(100% - 2.5rem));
  margin-inline: auto;
}

.wrap--narrow {
  width: min(40rem, calc(100% - 2.5rem));
}

.topbar {
  position: fixed;
  inset: 0 0 auto;
  z-index: 40;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 1.5rem;
  background: rgba(250, 250, 249, 0.78);
  border-bottom: 1px solid transparent;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  transition: border-color 220ms var(--ease), background 220ms var(--ease);
}

.topbar.is-scrolled {
  border-bottom-color: var(--color-border);
  background: rgba(250, 250, 249, 0.92);
}

.topbar a,
.topbar .linkish {
  color: var(--color-foreground);
  text-decoration: none;
}

.topbar nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-lg);
}

.nav-link {
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: opacity 200ms var(--ease);
}

.nav-link:hover {
  opacity: 0.62;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
  text-decoration: none;
}

.brand-mark {
  width: 1.35rem;
  height: 1.35rem;
  border: 1.5px solid currentColor;
}

.eyebrow {
  margin: 0 0 var(--space-sm);
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}

.lead {
  max-width: 36rem;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  font-weight: 300;
  color: var(--color-secondary);
}

.muted {
  color: var(--color-muted-foreground);
}

.hero {
  min-height: auto;
  display: grid;
  align-items: end;
  padding: var(--space-2xl) 0 var(--space-xl);
  background: var(--color-background);
}

.hero .wrap {
  padding-bottom: var(--space-xl);
}

.hero h1,
.hero-kicker {
  max-width: 16ch;
}

.hero-kicker {
  margin: 0;
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.75rem);
  line-height: 1.1;
}

.chapters {
  display: grid;
  gap: var(--space-2xl);
  padding: var(--space-2xl) 0;
}

.chapter {
  display: grid;
  gap: var(--space-md);
  max-width: 40rem;
}

.chapter--wide {
  max-width: none;
}

.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

@media (min-width: 768px) {
  .steps {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-lg);
  }
}

.step {
  padding: var(--space-md) 0;
  border-top: 1px solid var(--color-border);
}

.step-index {
  display: block;
  margin-bottom: var(--space-sm);
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-secondary);
}

.step h3,
.step-title {
  font-size: 1.75rem;
  margin: 0 0 var(--space-sm);
  color: var(--color-foreground);
}

.step p {
  margin: 0;
  color: var(--color-muted-foreground);
}

.climax {
  display: grid;
  justify-items: start;
  gap: var(--space-md);
  padding: var(--space-2xl) 0 var(--space-3xl);
  border-top: 1px solid var(--color-border);
}

.climax h2 {
  max-width: 16ch;
}

.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

[data-ajax-src]:empty {
  min-height: 6rem;
}

.chapter .section-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  margin: 0 0 var(--space-sm);
}

.catalog-head h2,
.catalog-head .section-title {
  margin: 0;
  font-family: var(--font-heading);
  font-size: 1.65rem;
}

.catalog-filters {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
  align-items: end;
}

@media (min-width: 768px) {
  .catalog-filters {
    grid-template-columns: 1.4fr 0.8fr auto;
  }
}

.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding-bottom: var(--space-2xl);
}

.prose {
  max-width: 40rem;
  margin: 0 0 var(--space-lg);
  color: var(--color-secondary);
  font-weight: 300;
  font-size: 1.05rem;
}

.btn,
.btn-primary,
.btn-secondary,
button[type="submit"]:not(.linkish) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  min-height: 3rem;
  padding: 0.75rem 1.5rem;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--color-primary);
  color: var(--color-on-primary);
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease), background 200ms var(--ease),
    color 200ms var(--ease), border-color 200ms var(--ease);
}

.btn:hover,
.btn-primary:hover,
button[type="submit"]:not(.linkish):hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.btn-accent {
  background: var(--color-primary);
  color: var(--color-on-primary);
}

.btn-secondary,
.btn.ghost {
  background: transparent;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-secondary:hover,
.btn.ghost:hover {
  background: var(--color-primary);
  color: var(--color-on-primary);
  opacity: 1;
}

.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  padding-bottom: var(--space-3xl);
}

@media (min-width: 768px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--color-card);
  color: var(--color-card-foreground);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  text-decoration: none;
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card .body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  flex: 1;
}

.card h2,
.card .card-title {
  margin: 0;
  font-size: 1.65rem;
}

.card-meta,
.card-price {
  margin: 0;
}

.card-price {
  margin-top: auto;
  font-size: 0.95rem;
  font-weight: 600;
}

.cover {
  aspect-ratio: 4 / 3;
  width: 100%;
  object-fit: cover;
  background:
    linear-gradient(180deg, rgba(24, 24, 27, 0.04), rgba(24, 24, 27, 0.1)),
    repeating-linear-gradient(90deg, transparent, transparent 47px, rgba(24, 24, 27, 0.045) 48px),
    #f4f4f5;
}

.badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  min-height: 1.5rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-family: var(--font-body);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.badge.warn {
  background: var(--color-destructive);
  color: var(--color-on-destructive);
}

.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.detail {
  display: grid;
  gap: var(--space-xl);
  padding: var(--space-xl) 0 var(--space-3xl);
}

@media (min-width: 900px) {
  .detail {
    grid-template-columns: 1.15fr 0.85fr;
    align-items: start;
  }
}

.detail-cover {
  position: relative;
  margin: 0 0 var(--space-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

.detail-cover .cover,
.detail-cover img {
  aspect-ratio: 16 / 10;
  width: 100%;
  display: block;
}

.detail-cover.gallery .cover:not(.is-active) {
  display: none;
}

.gallery-nav {
  position: absolute;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-foreground);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  transform: translateY(-50%);
}

.gallery-prev {
  left: 0.75rem;
}

.gallery-next {
  right: 0.75rem;
}

.gallery-count {
  position: absolute;
  right: 0.75rem;
  bottom: 2.5rem;
  z-index: 2;
  margin: 0;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: rgba(24, 24, 27, 0.72);
  color: #fff;
  font-size: 0.75rem;
}

.gallery-dots {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.7rem;
  z-index: 2;
  display: flex;
  justify-content: center;
  gap: 0.35rem;
}

.gallery-dot {
  width: 0.45rem;
  height: 0.45rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.gallery-dot.is-on {
  background: #fff;
}

html.prm .gallery-nav {
  transform: none;
  top: calc(50% - 1.25rem);
}

.fact-list {
  display: grid;
  gap: var(--space-md);
  margin: var(--space-lg) 0 0;
  padding: 0;
  list-style: none;
}

.fact {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: var(--space-sm);
  align-items: start;
  color: var(--color-secondary);
}

.panel {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  box-shadow: var(--shadow-md);
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
}

.panel-head h2 {
  font-size: 2rem;
  margin: 0;
}

.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.session-list > li,
.session-row {
  display: grid;
  gap: var(--space-sm);
  padding: 1rem 0;
  border-top: 1px solid var(--color-border);
}

.session-list > li:first-child,
.session-row:first-child {
  border-top: 0;
  padding-top: 0;
}

.checkout {
  display: grid;
  gap: var(--space-xl);
  padding: var(--space-xl) 0 var(--space-3xl);
}

@media (min-width: 900px) {
  .checkout {
    grid-template-columns: 0.9fr 1.1fr;
    align-items: start;
  }
}

.checkout-summary {
  display: grid;
  gap: 1rem;
}

.price-xl {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1;
  margin: 0;
}

.stack {
  display: grid;
  gap: 1rem;
}

.stack p {
  margin: 0;
  display: grid;
  gap: 0.35rem;
}

.field,
.stack p {
  display: grid;
  gap: 0.4rem;
}

label,
.stack label {
  font-size: 0.8125rem;
  font-weight: 600;
}

.input,
.stack input,
.stack textarea,
.stack select,
.auth-card input {
  width: 100%;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-sm);
  background: var(--color-card);
  color: var(--color-foreground);
  font: inherit;
  font-size: 16px;
  transition: border-color 200ms var(--ease), box-shadow 200ms var(--ease);
}

.stack textarea {
  min-height: 8rem;
  resize: vertical;
}

.stack input[type="checkbox"],
.auth-card input[type="checkbox"],
.check {
  width: auto;
  min-height: 1.15rem;
  min-width: 1.15rem;
  padding: 0;
  accent-color: var(--color-primary);
}

.input:focus,
.stack input:focus,
.stack textarea:focus,
.stack select:focus,
.auth-card input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px #18181b20;
}

.helptext,
.stack .helptext {
  font-size: 0.75rem;
  color: var(--color-muted-foreground);
}

.errorlist {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--color-destructive);
  font-size: 0.8125rem;
}

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg) 0;
}

.page-head h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 0;
}

.inline {
  display: inline;
}

button.linkish {
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.16em;
}

button.danger,
.linkish.danger {
  color: var(--color-destructive);
}

.grid {
  width: 100%;
  border-collapse: collapse;
  background: var(--color-card);
}

.grid th,
.grid td {
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  padding: 1rem 0.85rem;
  vertical-align: top;
}

.grid th {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-muted-foreground);
}

.table-wrap {
  overflow-x: auto;
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.table-wrap--spaced {
  margin-top: var(--space-lg);
}

.stack p:has(input[type="checkbox"]) {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.flash {
  list-style: none;
  margin: var(--space-md) 0 0;
  padding: 0;
  display: grid;
  gap: var(--space-sm);
}

.flash li {
  background: var(--color-card);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
}

.auth {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: var(--space-xl) 1.25rem;
  padding-top: calc(var(--nav-h) + var(--space-xl));
  background: var(--color-background);
}

.auth-card {
  width: min(28rem, 100%);
  background: var(--color-card);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.auth-card h1 {
  font-size: 2.75rem;
}

.auth-card form {
  display: grid;
  gap: 1rem;
}

.confirm {
  padding: var(--space-3xl) 0;
  max-width: 36rem;
}

.empty {
  padding: var(--space-xl) 0 var(--space-3xl);
  color: var(--color-muted-foreground);
}

.site-footer {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--color-border);
  color: var(--color-muted-foreground);
  font-size: 0.875rem;
}

.footer-grid {
  display: grid;
  gap: var(--space-lg);
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.4fr 1fr 1fr;
  }
}

.site-footer .brand {
  font-size: 1.5rem;
}

.cabinet .wrap {
  padding-bottom: var(--space-3xl);
}

.cabinet .topbar {
  background: rgba(250, 250, 249, 0.9);
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: var(--space-md);
  font-size: 0.8125rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-muted-foreground);
}

.back:hover {
  color: var(--color-foreground);
}

html.js:not(.prm) [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}

html.js:not(.prm) [data-reveal].is-in {
  opacity: 1;
  transform: none;
  transition: opacity 360ms var(--ease), transform 360ms var(--ease);
}

.doors {
  display: grid;
  gap: var(--space-lg);
  padding: 0 0 var(--space-3xl);
}

@media (min-width: 768px) {
  .doors {
    grid-template-columns: 1fr 1fr;
  }
}

.article-block,
.article-index {
  padding-bottom: var(--space-3xl);
}

.article-block h1 {
  margin: 0 0 var(--space-md);
}

.article-prose {
  max-width: 42rem;
}

.article-prose h2 {
  margin: 1.75rem 0 0.75rem;
}

.article-prose h3 {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.15rem;
}

.article-pairs {
  margin-top: var(--space-xl);
}

.article-cards .card-title {
  font-size: 1.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }

  html.js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .card:hover,
  .btn:hover,
  .btn-primary:hover,
  button[type="submit"]:not(.linkish):hover {
    transform: none;
  }
}

@media (max-width: 720px) {
  .topbar nav {
    gap: 1rem;
  }

  .page-head,
  .catalog-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .hero {
    min-height: auto;
    padding-top: var(--space-2xl);
  }
}
