/* ======================================================
   MMM Altai — атлас мечты Маши
   Дизайн-система v2 «Сказочный Алтай»
   ====================================================== */

:root {
  /* Бумага и чернила */
  --paper: #f3ecdc;
  --paper-2: #ece3cf;
  --paper-3: #e3d7bd;
  --ink: #1c2a26;
  --ink-2: #2f3f3a;
  --muted: #6b6657;
  --hair: #c8b994;

  /* Природа */
  --moss: #3f5b3a;
  --moss-deep: #2a3f28;
  --water: #3a6b87;
  --water-deep: #1f4358;
  --sky: #a9c7d6;
  --ochre: #c8772f;
  --ember: #a14323;
  --sakura: #d97a8a;
  --snow: #fbf6e9;

  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 20px;

  --max: 1180px;

  --font-display: "Cormorant Garamond", "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Geist Mono", ui-monospace, Menlo, monospace;
}

/* ---------- Reset ---------- */
* { box-sizing: border-box; }
*::selection { background: var(--moss); color: var(--snow); }

html, body { margin: 0; padding: 0; }

html {
  background: var(--paper);
}

body {
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(200, 119, 47, 0.06), transparent 36%),
    radial-gradient(circle at 88% 92%, rgba(63, 91, 58, 0.07), transparent 42%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='420' height='420'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.11  0 0 0 0 0.16  0 0 0 0 0.14  0 0 0 0.05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='0.6'/></svg>");
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* Hide native cursor on desktop where custom one runs */
@media (hover: hover) and (pointer: fine) {
  body.has-cursor, body.has-cursor * { cursor: none !important; }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: clamp(48px, 7vw, 96px); line-height: 0.98; letter-spacing: -0.02em; }
h2 { font-size: clamp(32px, 4vw, 52px); line-height: 1.05; }
h3 { font-size: clamp(22px, 2vw, 28px); line-height: 1.15; }

p { margin: 0 0 12px; text-wrap: pretty; }

.mono {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.italic { font-family: var(--font-display); font-style: italic; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--hair); transition: color .2s, border-color .2s; }
a:hover { color: var(--ember); border-color: var(--ember); }

/* ---------- Custom cursor ---------- */
.cursor-dot, .cursor-ring { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 9999; mix-blend-mode: multiply; }
.cursor-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink);
  transform: translate(-50%, -50%);
  transition: width .2s, height .2s, background .2s;
}
.cursor-ring {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--ink);
  transform: translate(-50%, -50%);
  transition: width .25s ease, height .25s ease, border-color .25s, background .25s;
}
body.cursor-hover .cursor-ring { width: 64px; height: 64px; border-color: var(--ember); background: rgba(200,119,47,.08); }
body.cursor-hover .cursor-dot { background: var(--ember); }
body.cursor-press .cursor-ring { width: 24px; height: 24px; }

/* ---------- Top nav (newspaper masthead) ---------- */
.masthead {
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 28px 18px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 24px;
  align-items: center;
  border-bottom: 1px solid var(--hair);
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display);
  font-size: 22px;
  font-style: italic;
  color: var(--ink);
  border: 0;
}
.brand .logo {
  width: 32px; height: 32px;
}
.masthead-meta {
  display: flex; gap: 18px; justify-content: center;
}
.masthead-meta a {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border: 0;
  color: var(--ink-2);
  padding: 6px 0;
  position: relative;
}
.masthead-meta a:hover { color: var(--ember); }
.masthead-meta a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: var(--ember);
  transition: right .3s ease;
}
.masthead-meta a:hover::after { right: 0; }
.masthead-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--snow);
  border: 0;
  padding: 12px 18px;
  border-radius: 999px;
  white-space: nowrap;
}
.masthead-cta:hover {
  background: var(--ember);
  color: var(--snow);
}

/* edition line */
.edition {
  max-width: var(--max);
  margin: 0 auto;
  padding: 6px 28px 14px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- Hero (Алтай — куда едем) ---------- */
.hero-altai {
  max-width: var(--max);
  margin: 0 auto;
  padding: 28px 28px 8px;
}
.hero-title {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: 18px;
}
.hero-title h1 {
  flex: 1;
}
.hero-title h1 em { font-style: italic; color: var(--ember); font-weight: 500; }
.hero-aside {
  width: 280px;
  flex-shrink: 0;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
  color: var(--ink-2);
  border-top: 1px solid var(--hair);
  padding-top: 12px;
}
.hero-aside .mono { display: block; margin-bottom: 6px; font-style: normal; }

.hero-canvas {
  position: relative;
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 16/8;
  background: linear-gradient(180deg, #d6e3eb 0%, #c5d6dd 35%, #98aa9b 70%, #6b8466 100%);
}
.hero-canvas svg { display: block; width: 100%; height: 100%; }
.hero-canvas .corner-tag {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  padding: 6px 10px;
  border-radius: 4px;
}
.hero-canvas .tl { top: 14px; left: 14px; }
.hero-canvas .tr { top: 14px; right: 14px; }
.hero-canvas .bl { bottom: 14px; left: 14px; }
.hero-canvas .br { bottom: 14px; right: 14px; }

.hero-caption {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  margin-top: 14px;
}
.hero-caption > div {
  padding: 16px 18px;
  border-right: 1px solid var(--hair);
}
.hero-caption > div:last-child { border-right: 0; }
.hero-caption .label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.hero-caption .value { font-family: var(--font-display); font-size: 26px; line-height: 1; color: var(--ink); }
.hero-caption .value small { font-size: 14px; color: var(--muted); margin-left: 4px; }

/* ---------- Progress section ---------- */
.section { max-width: var(--max); margin: 0 auto; padding: 60px 28px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: 28px; border-bottom: 1px solid var(--hair); padding-bottom: 14px; }
.section-head h2 { flex: 1; }
.section-head .lead { max-width: 360px; color: var(--ink-2); font-size: 14px; }

.progress-card {
  background: var(--paper-2);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 28px 28px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 32px;
  align-items: center;
}
.progress-headline {
  font-family: var(--font-display);
  font-size: 56px;
  line-height: 1;
  margin: 0 0 10px;
}
.progress-headline em { font-style: italic; color: var(--ember); }
.progress-stats { display: flex; gap: 28px; font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.progress-stats strong { display: block; font-family: var(--font-display); font-size: 22px; letter-spacing: 0; text-transform: none; color: var(--ink); margin-top: 4px; font-weight: 500; }

.progress-bar {
  position: relative;
  height: 18px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 16px;
}
.progress-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, var(--moss) 0%, var(--water) 60%, var(--ochre) 100%);
  border-radius: 999px;
  transition: width 1.4s cubic-bezier(.2,.7,.2,1);
}
.progress-fill::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,.35), transparent);
  animation: shine 3s ease-in-out infinite;
}
@keyframes shine {
  0%,100% { transform: translateX(-100%); }
  50% { transform: translateX(120%); }
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 10px;
}

.progress-marker {
  position: absolute;
  top: -22px;
  transform: translateX(-50%);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ember);
  white-space: nowrap;
}
.progress-marker::after {
  content: ""; position: absolute; left: 50%; top: 100%;
  width: 1px; height: 8px; background: var(--ember);
  transform: translateX(-50%);
}

.progress-side {
  border-left: 1px solid var(--hair);
  padding-left: 28px;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
  color: var(--ink-2);
}
.progress-side .mono { font-style: normal; display: block; margin-bottom: 8px; }

/* ---------- Route map ---------- */
.route {
  margin-top: 36px;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 32px 28px 24px;
}
.route-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 18px; }
.route-head h3 { font-size: 28px; }
.route-svg {
  width: 100%; height: 220px;
  display: block;
}
.route-stops {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 8px;
}
.route-stops > div {
  border-top: 1px solid var(--hair);
  padding-top: 12px;
}
.route-stops .stop-label { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.route-stops .stop-name { font-family: var(--font-display); font-size: 24px; }
.route-stops .stop-meta { font-size: 13px; color: var(--ink-2); }

/* ---------- Story / About ---------- */
.story {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
}
.story-text p:first-of-type::first-letter {
  font-family: var(--font-display);
  font-size: 88px;
  line-height: 0.85;
  float: left;
  margin: 4px 12px 0 0;
  color: var(--ember);
  font-weight: 500;
}
.story-text p { font-size: 17px; line-height: 1.65; color: var(--ink-2); }
.story-photo {
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--paper-2);
  position: relative;
}
.story-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-photo .caption {
  position: absolute; left: 12px; bottom: 12px;
  background: var(--paper);
  border: 1px solid var(--hair);
  padding: 6px 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.facts {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  overflow: hidden;
}
.facts > div { padding: 18px; border-right: 1px solid var(--hair); background: var(--paper); }
.facts > div:last-child { border-right: 0; }
.facts .k { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.facts .v { font-family: var(--font-display); font-size: 28px; line-height: 1; margin-top: 6px; }

/* ---------- Diary (журнал-дневник) ---------- */
.diary-list { display: grid; gap: 0; }
.diary-entry {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  gap: 24px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--hair);
}
.diary-entry:hover { background: var(--paper-2); padding-left: 8px; padding-right: 8px; transition: padding .25s; }
.diary-date { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding-top: 4px; }
.diary-body h3 { font-size: 26px; margin-bottom: 4px; }
.diary-body p { font-size: 15px; color: var(--ink-2); margin: 0; }
.diary-tag { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ember); padding-top: 6px; }

/* ---------- Gallery ---------- */
.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
.art {
  border: 1px solid var(--hair);
  background: var(--paper-2);
  border-radius: var(--r-md);
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: zoom-in;
  padding: 0;
  position: relative;
  transition: transform .35s cubic-bezier(.2,.7,.2,1), box-shadow .35s;
}
.art:hover { transform: translateY(-4px); box-shadow: 0 14px 30px rgba(28, 42, 38, 0.18); }
.art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.art .caption {
  position: absolute; left: 10px; bottom: 10px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  background: var(--paper);
  border: 1px solid var(--hair);
  padding: 4px 8px;
}
.art.is-rotated-90 img { transform: rotate(90deg) scale(0.74); }
.art.is-rotated-270 img { transform: rotate(270deg) scale(0.74); }

/* ---------- Catalog shelves (horizontal scroll) ---------- */
.shelf { padding: 36px 0 28px; border-bottom: 1px solid var(--hair); }
.shelf:last-child { border-bottom: 0; }
.shelf-head {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 28px 16px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.shelf-head h2 { font-size: 36px; }
.shelf-head .count { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.shelf-track {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 28px 18px;
  max-width: 100%;
  scrollbar-width: thin;
  scrollbar-color: var(--hair) transparent;
}
.shelf-track::-webkit-scrollbar { height: 8px; }
.shelf-track::-webkit-scrollbar-thumb { background: var(--hair); border-radius: 999px; }
.product {
  flex: 0 0 280px;
  scroll-snap-align: start;
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform .3s, box-shadow .3s, border-color .3s;
}
.product:hover { transform: translateY(-4px); border-color: var(--ink); box-shadow: 0 16px 36px rgba(28,42,38,.14); }
.product-photo {
  aspect-ratio: 4/3;
  background: var(--paper-2);
  display: grid; place-items: center;
  border-bottom: 1px solid var(--hair);
  overflow: hidden;
}
.product-photo svg { width: 56%; height: 56%; opacity: 0.65; }
.product-photo .product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-gallery { position: relative; width: 100%; height: 100%; }
.photo-gallery .product-img { position: absolute; inset: 0; opacity: 0; transition: opacity .25s; }
.photo-gallery .product-img.is-active { opacity: 1; position: relative; }
.photo-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(28,42,38,.55); color: var(--snow);
  border: 0; cursor: pointer; display: grid; place-items: center;
  font-size: 18px; line-height: 1; font-family: var(--font-display);
  opacity: 0; transition: opacity .2s, background .2s;
}
.photo-arrow-prev { left: 8px; }
.photo-arrow-next { right: 8px; }
.product:hover .photo-arrow { opacity: 1; }
.photo-arrow:hover { background: var(--ink); }
.photo-dots {
  position: absolute; left: 0; right: 0; bottom: 8px;
  display: flex; justify-content: center; gap: 5px;
  pointer-events: none;
}
.photo-dot {
  width: 6px; height: 6px; border-radius: 999px;
  background: rgba(255,255,255,.55);
  pointer-events: auto; cursor: pointer;
  transition: background .2s, transform .2s;
}
.photo-dot.is-active { background: var(--snow); transform: scale(1.25); }
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-meta { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.product-meta .qty { color: var(--ember); }
.product h3 { font-size: 19px; line-height: 1.15; }
.product-desc { font-size: 13px; color: var(--ink-2); margin: 0; flex: 1; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.product-bottom {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--hair);
  padding-top: 10px;
  margin-top: 4px;
}
.product-price { font-family: var(--font-display); font-size: 26px; }
.product-price small { font-size: 14px; color: var(--muted); margin-left: 2px; }
.product-link { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink); border: 0; }
.product-link:hover { color: var(--ember); }

/* shelf nav */
.shelf-nav { display: flex; gap: 8px; }
.shelf-nav button {
  width: 32px; height: 32px; border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--paper);
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  transition: background .2s, border-color .2s;
}
.shelf-nav button:hover { background: var(--ink); color: var(--snow); border-color: var(--ink); }

/* ---------- CTA ---------- */
.cta-strip {
  max-width: var(--max);
  margin: 24px auto;
  padding: 36px 32px;
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  background: var(--ink);
  color: var(--snow);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
}
.cta-strip h2 { color: var(--snow); }
.cta-strip h2 em { color: var(--ochre); font-style: italic; }
.cta-strip p { color: rgba(251, 246, 233, 0.8); margin: 8px 0 0; max-width: 60ch; }
.cta-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.btn {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 14px 22px;
  border-radius: 999px;
  border: 1px solid currentColor;
  text-decoration: none;
  transition: background .25s, color .25s;
}
.btn-light { background: var(--snow); color: var(--ink); border-color: var(--snow); }
.btn-light:hover { background: var(--ochre); color: var(--snow); border-color: var(--ochre); }
.btn-ghost { color: var(--snow); border-color: rgba(251,246,233,.4); }
.btn-ghost:hover { background: var(--snow); color: var(--ink); }
.btn-dark { background: var(--ink); color: var(--snow); border-color: var(--ink); }
.btn-dark:hover { background: var(--ember); border-color: var(--ember); }

/* ---------- Footer ---------- */
.colophon {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 28px 40px;
  border-top: 1px solid var(--hair);
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}
.colophon h4 { font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin-bottom: 14px; }
.colophon a { display: block; margin-bottom: 6px; font-size: 14px; }
.colophon-brand { font-family: var(--font-display); font-size: 32px; line-height: 1.1; }
.colophon-brand em { font-style: italic; color: var(--ember); }
.colophon-bottom {
  max-width: var(--max);
  margin: 0 auto;
  padding: 14px 28px 28px;
  display: flex;
  justify-content: space-between;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- About page ---------- */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1.3fr;
  gap: 48px;
  align-items: start;
}
.about-photo-stack { display: grid; gap: 14px; }
.about-photo-stack img {
  width: 100%; border: 1px solid var(--hair); border-radius: var(--r-md); display: block;
}
.about-quote {
  margin-top: 20px;
  padding: 18px 20px;
  border-left: 2px solid var(--ember);
  font-family: var(--font-display);
  font-style: italic;
  font-size: 22px;
  line-height: 1.4;
  color: var(--ink);
}

/* ---------- Catalog page intro ---------- */
.catalog-intro {
  max-width: var(--max);
  margin: 0 auto;
  padding: 36px 28px 8px;
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
  align-items: end;
}
.catalog-intro h1 em { font-style: italic; color: var(--ember); }
.catalog-intro p { font-family: var(--font-display); font-style: italic; font-size: 20px; color: var(--ink-2); }
.catalog-filters {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 28px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  margin-top: 24px;
}
.chip {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--hair);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
  transition: all .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-active { background: var(--ink); color: var(--snow); border-color: var(--ink); }

/* ---------- Payment ---------- */
.payment-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 36px;
  align-items: start;
}
.pay-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 28px;
}
.pay-card h2 { margin-bottom: 12px; }
.pay-card p { color: var(--ink-2); font-size: 15px; }
.pay-method {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-top: 1px solid var(--hair);
}
.pay-method:last-child { border-bottom: 1px solid var(--hair); }
.pay-method .pm-name { font-family: var(--font-display); font-size: 22px; }
.pay-method .pm-meta { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.pay-method .pm-num { font-family: var(--font-mono); font-size: 13px; color: var(--ink); letter-spacing: 0.05em; }
.pay-method svg { width: 28px; height: 28px; color: var(--ink); }

.qr-card {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
}
.qr-card img { width: 100%; max-width: 280px; border: 1px solid var(--hair); border-radius: var(--r-sm); }
.qr-card .mono { display: block; margin-top: 12px; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0;
  background: rgba(28, 42, 38, 0.92);
  display: grid; place-items: center;
  z-index: 100;
  padding: 32px;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: min(92vw, 1200px); max-height: 88vh; border-radius: var(--r-sm); }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 44px; height: 44px; border-radius: 999px;
  background: var(--snow); color: var(--ink); border: 0;
  font-size: 22px; cursor: pointer;
}

/* ---------- Tweaks panel ---------- */
.tweaks-fab {
  position: fixed; bottom: 24px; right: 24px;
  width: 48px; height: 48px; border-radius: 999px;
  background: var(--ink); color: var(--snow);
  border: 0;
  font-family: var(--font-mono);
  font-size: 18px;
  cursor: pointer;
  z-index: 50;
  box-shadow: 0 10px 28px rgba(28,42,38,.25);
}

.tweaks-panel {
  position: fixed; bottom: 84px; right: 24px;
  width: 280px;
  background: var(--paper);
  border: 1px solid var(--ink);
  border-radius: var(--r-md);
  padding: 18px;
  z-index: 51;
  box-shadow: 0 18px 40px rgba(28,42,38,.18);
}
.tweaks-panel h4 { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); margin: 0 0 10px; }
.tweaks-panel .row { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.tweaks-panel button {
  flex: 1;
  min-width: 60px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 8px 10px;
  border: 1px solid var(--hair);
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
}
.tweaks-panel button.is-active { background: var(--ink); color: var(--snow); border-color: var(--ink); }

/* ---------- Palette themes (tweaks) ---------- */
body.theme-altai { /* default */ }
body.theme-water {
  --paper: #e8edec;
  --paper-2: #dde4e3;
  --paper-3: #cbd6d4;
  --ink: #11242c;
  --ink-2: #213b46;
  --muted: #5d7079;
  --hair: #a8bbbf;
  --ember: #2e6b88;
  --ochre: #2e6b88;
  --moss: #2e5a47;
}
body.theme-paper {
  --paper: #fbf7ec;
  --paper-2: #f1ead6;
  --paper-3: #e6dcbe;
  --ink: #2a1f12;
  --ink-2: #4a3a26;
  --muted: #8a7860;
  --hair: #d3c39a;
  --ember: #a0421f;
  --ochre: #b25e21;
  --moss: #5a6a36;
}

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .masthead { grid-template-columns: 1fr auto; }
  .masthead-meta { display: none; }
  .hero-title { flex-direction: column; align-items: flex-start; }
  .hero-aside { width: 100%; }
  .hero-caption { grid-template-columns: repeat(2, 1fr); }
  .hero-caption > div:nth-child(2) { border-right: 0; }
  .progress-card { grid-template-columns: 1fr; }
  .progress-side { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 18px; }
  .story, .about-grid, .catalog-intro, .payment-grid { grid-template-columns: 1fr; gap: 24px; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .facts { grid-template-columns: repeat(2, 1fr); }
  .colophon { grid-template-columns: 1fr 1fr; }
  .cta-strip { grid-template-columns: 1fr; }
  .diary-entry { grid-template-columns: 90px 1fr; }
  .diary-tag { display: none; }
  .route-stops { grid-template-columns: 1fr; }
}
