@import './tokens.css';

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-1);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ── */
.site-header {
  height: 57px;
  min-height: 57px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  padding: 0 24px;
  background: var(--bg-card);
  flex-shrink: 0;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text-0);
  text-decoration: none;
}
.brand-logo {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand-logo img { width: 100%; height: 100%; display: block; object-fit: cover; }
.brand-name { font-size: 13px; font-weight: 600; }
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-muted);
  border-radius: 8px;
  background: var(--bg-muted);
  color: var(--text-2);
  font-size: 13px;
  text-decoration: none;
  margin-left: auto;
  transition: border-color .15s, color .15s;
  flex-shrink: 0;
}
.back-btn:hover { border-color: var(--border-bold); color: var(--text-1); }

/* ── Breadcrumbs ── */
.breadcrumbs {
  padding: 16px 24px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.breadcrumbs a, .breadcrumbs span {
  font-size: 12px; color: var(--text-6); text-decoration: none; white-space: nowrap;
}
.breadcrumbs a:hover { color: var(--text-2); }
.breadcrumbs .sep { color: var(--border); }
.breadcrumbs .current { color: var(--text-3); }

/* ── Main ── */
main {
  flex: 1;
  padding: 32px 24px 64px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* ── Two-column layout ── */
.logo-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 40px;
  align-items: start;
}

/* ── Preview card ── */
.preview-card {
  border: 1px solid var(--border);
  border-radius: 16px;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  position: sticky;
  top: 24px;
  background: var(--checker-sq), var(--bg-card);
  transition: background .2s;
  overflow: hidden;
  cursor: zoom-in;
}
.preview-card.light-bg { background: var(--checker-full), var(--light); }

.preview-card .preview-icon img,
.preview-card .preview-icon svg {
  width: 160px; height: 160px;
  display: block;
  border-radius: 22px;
  object-fit: contain;
  overflow: hidden;
}
.preview-card .preview-wide {
  width: 100%;
  display: flex; align-items: center; justify-content: center;
}
.preview-card .preview-wide img,
.preview-card .preview-wide svg {
  width: 100%; height: auto;
  max-height: 120px;
  display: block;
}

/* Expand button */
.preview-expand-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.4);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 7px;
  color: var(--text-3);
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, color .15s;
  backdrop-filter: blur(4px);
}
.preview-card:hover .preview-expand-btn { opacity: 1; }
.preview-expand-btn:hover { color: var(--text-0); }
.preview-card.light-bg .preview-expand-btn {
  background: rgba(255,255,255,.6);
  border-color: rgba(0,0,0,.1);
  color: var(--text-5);
}
.preview-card.light-bg .preview-expand-btn:hover { color: var(--bg); }

/* ── Lightbox ── */
.lightbox {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.85);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  cursor: zoom-out;
  backdrop-filter: blur(6px);
  animation: lb-in .18s ease;
}
.lightbox.hidden { display: none; }

.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 10px;
  color: var(--text-2);
  cursor: pointer;
  transition: background .15s, color .15s;
  backdrop-filter: blur(4px);
  z-index: 1;
}
.lightbox-close:hover { background: rgba(255,255,255,.15); color: var(--text-0); }
@keyframes lb-in { from { opacity: 0 } to { opacity: 1 } }
.lightbox-inner {
  display: flex; align-items: center; justify-content: center;
  cursor: default;
}

/* Square icon — большой квадрат */
.lightbox-inner img,
.lightbox-inner svg {
  width: min(80vh, 80vw);
  height: min(80vh, 80vw);
  border-radius: 22px;
  display: block;
  object-fit: contain;
}

/* Wide logo — широкий формат */
.lightbox-inner.wide {
  background: var(--checker-full), var(--light);
  border-radius: 16px;
  padding: 32px 40px;
}
.lightbox-inner.wide img,
.lightbox-inner.wide svg {
  width: min(900px, 90vw);
  height: auto;
  border-radius: 0;
}

/* ── Info column ── */
.logo-info { display: flex; flex-direction: column; gap: 20px; }

.logo-category {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px; color: var(--text-5);
  background: var(--bg-muted); border: 1px solid var(--border-muted);
  border-radius: 6px; padding: 4px 10px;
  width: fit-content;
}

h1 {
  font-size: 32px; font-weight: 700; color: var(--text-0);
  letter-spacing: -0.02em; line-height: 1.15;
}

.logo-desc { font-size: 15px; color: var(--text-4); line-height: 1.65; }

/* ── Section label ── */
.section-label {
  font-size: 12px; font-weight: 500; color: var(--text-6);
  text-transform: uppercase; letter-spacing: 0.06em;
}

/* ── Buttons ── */
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-start; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  border-radius: 9px;
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  cursor: pointer; border: none; line-height: 1;
  transition: background .12s, border-color .12s, color .12s, opacity .12s;
  position: relative;
  white-space: nowrap;
}
.btn:disabled { cursor: default; }

.btn-primary { background: var(--text-0); color: var(--bg); }
.btn-primary:hover:not(:disabled) { background: var(--light-hover); }
.btn-primary:disabled { background: var(--bg-raised); border: 1px solid var(--border-base); color: var(--text-3); }

.btn-secondary { background: var(--bg-raised); border: 1px solid var(--border-base); color: var(--text-1); }
.btn-secondary:hover:not(:disabled) { background: var(--bg-active); border-color: var(--border-focus); }

.btn-zip { background: var(--bg-raised); border: 1px solid var(--border-base); color: var(--text-1); }
.btn-zip:hover:not(:disabled) { background: var(--bg-active); border-color: var(--border-focus); }
.btn-zip:disabled { opacity: .55; }

.btn-size { font-size: 11px; color: var(--text-6); margin-left: 2px; }
.btn-primary .btn-size { color: var(--text-hint); }

.btn-progress {
  position: absolute; bottom: 0; left: 0;
  height: 2px; background: var(--border-bold);
  border-radius: 0 0 9px 9px;
  width: 0%; transition: width .1s linear;
}

/* ── Variants ── */
.variants-grid { display: flex; gap: 8px; flex-wrap: wrap; }

.variant-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 10px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer; user-select: none;
  transition: border-color .12s, background .12s;
}
.variant-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.variant-card.active { border-color: var(--border-bold); background: var(--bg-raised); }

.variant-preview-icon {
  width: 48px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; border-radius: 11px;
}
.variant-preview-icon img,
.variant-preview-icon svg { width: 48px; height: 48px; display: block; border-radius: 11px; }

.variant-card.variant-wide { width: 120px; }
.variant-preview-wide {
  width: 100px; height: 48px;
  display: flex; align-items: center; justify-content: center;
  background: var(--checker-full), var(--light); border-radius: 8px;
  padding: 6px 8px; overflow: hidden;
}
.variant-preview-wide img,
.variant-preview-wide svg { width: 100%; height: 100%; display: block; }

.variant-label { font-size: 11px; color: var(--text-5); white-space: nowrap; }
.variant-card.active .variant-label { color: var(--text-2); }

/* ── Divider ── */
.divider { border: none; border-top: 1px solid var(--line); }

/* ── Meta ── */
.meta-table { display: flex; flex-direction: column; gap: 8px; }
.meta-row { display: flex; gap: 12px; font-size: 13px; }
.meta-key { color: var(--text-6); min-width: 90px; flex-shrink: 0; }
.meta-val { color: var(--text-2); }
.meta-val a { color: var(--text-2); text-decoration: underline; text-decoration-color: var(--border-eco); }
.meta-val a:hover { color: var(--text-1); }

/* ── Ecosystem ── */
.ecosystem-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.ecosystem-card {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  padding: 10px 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px;
  text-decoration: none;
  width: 72px;
  transition: border-color .12s, background .12s;
}
.ecosystem-card:hover { border-color: var(--border-hover); background: var(--bg-hover); }

/* Current page — highlighted, not dimmed */
.ecosystem-card.current {
  border-color: var(--text-2);
  background: var(--bg-raised);
  pointer-events: none;
  position: relative;
}

/* Coming soon — dimmed + badge */
.ecosystem-card.soon {
  opacity: .6;
  pointer-events: none;
  position: relative;
}
.ecosystem-soon-badge {
  position: absolute;
  top: 5px; right: 5px;
  padding: 2px 4px;
  border-radius: 4px;
  background: #2b2412;
  border: 1px solid #4a3810;
  color: #d8ad38;
  font-size: 7px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  text-transform: uppercase;
  pointer-events: none;
}
.ecosystem-card img,
.ecosystem-card svg {
  width: 48px; height: 48px;
  display: block; border-radius: 11px;
  object-fit: contain;
}
.ecosystem-label { font-size: 11px; color: var(--text-5); text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 64px; }

/* ── Catalog CTA ── */
.catalog-cta {
  margin-top: 48px; padding: 22px 24px;
  background: linear-gradient(135deg, #1a1f3a 0%, #0f1729 100%);
  border: 1px solid rgba(99, 130, 255, 0.35); border-radius: 14px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  box-shadow: 0 0 0 1px rgba(99, 130, 255, 0.1), inset 0 1px 0 rgba(255,255,255,0.05);
}
.catalog-cta-text { display: flex; flex-direction: column; gap: 4px; }
.catalog-cta-title { font-size: 15px; font-weight: 600; color: #fff; }
.catalog-cta-sub { font-size: 13px; color: rgba(255,255,255,0.55); }
.catalog-cta-link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  background: #4f6ef7; border: none;
  border-radius: 9px; color: #fff;
  font-size: 13px; font-weight: 600;
  text-decoration: none; white-space: nowrap; flex-shrink: 0;
  transition: background .15s, transform .1s;
}
.catalog-cta-link:hover { background: #6b85ff; transform: translateY(-1px); }

/* ── Brand colors ── */
.colors-grid { display: flex; gap: 8px; flex-wrap: wrap; }
.color-swatch {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 7px 11px 7px 8px;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 9px; cursor: pointer; font: inherit;
  transition: border-color .12s, background .12s;
}
.color-swatch:hover { border-color: var(--border-hover); background: var(--bg-hover); }
.color-swatch-dot {
  width: 18px; height: 18px; border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.12); flex-shrink: 0;
}
.color-swatch-hex {
  font-size: 12px; font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em; color: var(--text-2);
}

/* ── FAQ ── */
.faq-section { width: 100%; margin-top: 48px; }
.faq-title {
  font-size: 18px; font-weight: 600; color: var(--text-1);
  margin-bottom: 14px; letter-spacing: -0.01em;
}
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item {
  background: var(--bg-card); border: 1px solid var(--border-base);
  border-radius: 12px; overflow: hidden;
}
.faq-q {
  list-style: none; cursor: pointer; padding: 14px 16px;
  font-size: 14px; font-weight: 500; color: var(--text-1);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q::after {
  content: '+'; font-size: 18px; line-height: 1; color: var(--text-5);
  flex-shrink: 0; transition: transform .15s;
}
.faq-item[open] .faq-q::after { transform: rotate(45deg); }
.faq-a { padding: 0 16px 14px; font-size: 13px; line-height: 1.65; color: var(--text-4); }

/* ── Footer ── */
footer {
  text-align: center; padding: 20px 24px;
  font-size: 12px; color: var(--text-dim);
  border-top: 1px solid var(--bg-muted);
}

/* ── Mobile ── */
@media (max-width: 640px) {
  .logo-layout { grid-template-columns: 1fr; gap: 24px; }
  .preview-card { max-width: 200px; margin: 0 auto; position: static; }
  main { padding: 24px 16px 48px; }
  .site-header { padding: 0 16px; }
  .breadcrumbs { padding: 12px 16px 0; }
  h1 { font-size: 26px; }
}

.info-section    { display: flex; flex-direction: column; gap: 8px; }
.info-section-lg { display: flex; flex-direction: column; gap: 10px; }
.footer-link     { color: var(--text-dim); text-decoration: none; }
.footer-copyright { margin-top: 10px; color: var(--text-4); max-width: 560px; margin-inline: auto; line-height: 1.5; }
.footer-copyright a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* Toast */
#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: #fff;
  color: #111;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  border-radius: 8px;
  opacity: 0;
  transition: opacity .18s, transform .18s;
  pointer-events: none;
  white-space: nowrap;
  z-index: 999;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
