:root {
  --bg: #0a0908;
  --bg-elevated: #14110f;
  --surface: #1c1814;
  --surface-hover: #252019;
  --border: rgba(201, 162, 39, 0.18);
  --border-strong: rgba(201, 162, 39, 0.38);
  --gold: #d4af37;
  --gold-soft: #c9a227;
  --amber: #e8b84a;
  --copper: #b87333;
  --text: #f3ece2;
  --text-muted: #a89b8c;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --radius: 18px;
  --radius-sm: 12px;
  --font-display: "Cinzel", "Times New Roman", serif;
  --font-body: "Manrope", system-ui, sans-serif;
  --max-width: 680px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.bg-art {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.bg-art.is-active {
  opacity: var(--bg-art-opacity, 0.22);
}

.bg-glow {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 80% 50% at 50% -10%, rgba(201, 162, 39, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 100%, rgba(184, 115, 51, 0.08), transparent 50%);
  z-index: 0;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.35;
  background-image:
    linear-gradient(rgba(201, 162, 39, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(201, 162, 39, 0.04) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse at center, black 20%, transparent 75%);
  z-index: 0;
}

.page {
  position: relative;
  z-index: 1;
  width: min(100% - 2rem, var(--max-width));
  margin: 0 auto;
  padding: 2.5rem 0 3rem;
}

.hero {
  text-align: center;
  margin-bottom: 2.75rem;
}

.hero-mascot {
  width: min(72vw, 260px);
  max-height: 230px;
  object-fit: contain;
  margin: 0 auto 0.85rem;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(0, 0, 0, 0.45));
}

.avatar {
  width: 108px;
  height: 108px;
  margin: 0 auto 1.25rem;
  color: var(--gold);
  background: linear-gradient(145deg, var(--surface), var(--bg-elevated));
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.avatar svg {
  width: 72px;
  height: 72px;
}

.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--copper);
}

.hero h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 8vw, 3rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(180deg, #f5e6c8 0%, var(--gold) 55%, var(--copper) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 1rem auto 0.5rem;
  max-width: 34ch;
  color: var(--text-muted);
  font-size: 1rem;
}

.handle {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--gold-soft);
}

.section {
  margin-bottom: 2.5rem;
}

.section-links-primary {
  position: relative;
  padding: 1.2rem;
  border: 1px solid var(--border-strong);
  border-radius: calc(var(--radius) + 4px);
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.14), rgba(28, 24, 20, 0.95));
  box-shadow: var(--shadow);
}

.section-links-primary::before {
  content: "PRIORITY";
  position: absolute;
  top: -0.62rem;
  left: 1rem;
  font-size: 0.62rem;
  letter-spacing: 0.16em;
  color: var(--bg);
  background: linear-gradient(180deg, var(--amber), var(--gold-soft));
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-weight: 700;
}

.section-links-primary .section-head h2 {
  font-size: clamp(1.45rem, 3.5vw, 1.9rem);
  letter-spacing: 0.08em;
}

.section-links-primary .section-head p {
  color: #d9cdbf;
}

.section-links-primary .link-card {
  border-color: rgba(201, 162, 39, 0.34);
  background: linear-gradient(135deg, rgba(36, 29, 21, 0.98), rgba(20, 17, 15, 0.98));
}

.section-links-primary .link-card:hover,
.section-links-primary .link-card:focus-visible {
  border-color: rgba(232, 184, 74, 0.75);
}

.section-links-primary .qr-thumb {
  width: 100px;
  height: 100px;
}

.section-head {
  margin-bottom: 1.1rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.8rem;
}

.section-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  letter-spacing: 0.06em;
}

.section-head p {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.collapse-toggle {
  flex-shrink: 0;
  margin-top: 0.12rem;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  font-size: 0.76rem;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  cursor: pointer;
}

.collapse-toggle:hover {
  border-color: var(--border-strong);
  color: var(--text);
}

.collapse-chevron {
  display: inline-block;
  transition: transform 0.2s ease;
}

.section.is-collapsed .collapse-chevron {
  transform: rotate(-90deg);
}

.section-content[hidden] {
  display: none;
}

.faq-list {
  display: grid;
  gap: 0.75rem;
}

.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  padding: 0.65rem 0.85rem;
}

.faq-item summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--text);
}

.faq-item p {
  margin: 0.6rem 0 0.15rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.works-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 0.8rem;
}

.work-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.work-shot {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  background: #0f0d0b;
}

.work-title {
  margin: 0;
  padding: 0.1rem 0 0.3rem;
  font-size: 0.8rem;
  color: var(--text);
  font-weight: 700;
}

.work-body {
  padding: 0.55rem 0.65rem 0.7rem;
  border-top: 1px solid var(--border);
}

.work-desc {
  margin: 0 0 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  min-height: 2.1em;
}

.work-link {
  font-size: 0.76rem;
  color: var(--gold);
  text-decoration: none;
  font-weight: 600;
}

.work-link:hover {
  text-decoration: underline;
}

.works-page {
  max-width: 980px;
}

.works-hero {
  margin-bottom: 1.4rem;
}

.gallery-section {
  margin-bottom: 1.7rem;
}

.gallery-images-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.85rem;
}

.gallery-image-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface);
}

.gallery-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.gallery-original-link {
  display: block;
  text-align: center;
  padding: 0.5rem 0.45rem;
  font-size: 0.78rem;
  color: var(--gold);
  text-decoration: none;
  border-top: 1px solid var(--border);
}

.gallery-original-link:hover {
  text-decoration: underline;
}

.link-grid {
  display: grid;
  gap: 0.85rem;
}

.link-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  padding: 1rem 1rem 1rem 1.15rem;
  background: linear-gradient(135deg, var(--surface) 0%, var(--bg-elevated) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
}

.link-card:hover,
.link-card:focus-visible {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  background: var(--surface-hover);
  box-shadow: var(--shadow);
  outline: none;
}

.link-card-main {
  min-width: 0;
}

.link-card-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin-bottom: 0.2rem;
  font-weight: 700;
  font-size: 1rem;
  flex-wrap: wrap;
}

.link-icon {
  width: 1.35rem;
  height: 1.35rem;
  flex-shrink: 0;
  color: var(--gold);
}

.link-media {
  display: block;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.35);
}

.link-card-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
}

.link-card-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.qr-thumb {
  width: 92px;
  height: 92px;
  padding: 4px;
  background: #fff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.15s ease;
}

.qr-thumb:hover {
  transform: scale(1.05);
}

.qr-thumb canvas,
.qr-thumb img {
  display: block;
  width: 100% !important;
  height: 100% !important;
}

.qr-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.apps-banner {
  display: grid;
  gap: 1rem;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.1), rgba(28, 24, 20, 0.9));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
}

@media (min-width: 560px) {
  .apps-banner {
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 1.15rem;
  }
}

.apps-banner-icon {
  width: 52px;
  height: 52px;
  color: var(--gold);
  padding: 0.65rem;
  background: rgba(0, 0, 0, 0.25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.apps-banner-icon svg {
  width: 100%;
  height: 100%;
}

.apps-banner h3 {
  margin: 0 0 0.4rem;
  font-size: 1.05rem;
}

.apps-banner p {
  margin: 0 0 0.85rem;
  font-size: 0.92rem;
  color: var(--text-muted);
}

.cta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.65rem 1rem;
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--bg);
  background: linear-gradient(180deg, var(--amber), var(--gold-soft));
  border-radius: 999px;
  transition: filter 0.2s ease, transform 0.2s ease;
}

.cta:hover {
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.portfolio-grid {
  display: grid;
  gap: 1rem;
}

.portfolio-card {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.portfolio-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

.portfolio-shot {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  object-position: top center;
  background: #0f0d0b;
  border-bottom: 1px solid var(--border);
}

.portfolio-body {
  padding: 1rem 1.1rem 1.15rem;
}

.portfolio-body h3 {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
}

.portfolio-body p {
  margin: 0 0 0.85rem;
  font-size: 0.88rem;
  color: var(--text-muted);
}

.portfolio-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.portfolio-links a {
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--gold);
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.portfolio-links a:hover {
  background: rgba(201, 162, 39, 0.1);
  border-color: var(--border-strong);
}

.footer {
  text-align: center;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
}

.footer p {
  margin: 0.25rem 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.footer-brand {
  color: var(--gold-soft);
  font-weight: 600;
}

.qr-modal {
  width: min(92vw, 320px);
  padding: 1.5rem 1.25rem 1.25rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  box-shadow: var(--shadow);
}

.qr-modal::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.qr-modal h3 {
  margin: 0 0 1rem;
  font-family: var(--font-display);
  font-size: 1.1rem;
  text-align: center;
}

.qr-modal-body {
  display: grid;
  place-items: center;
  padding: 0.75rem;
  background: #fff;
  border-radius: var(--radius-sm);
}

.qr-modal-body canvas {
  display: block;
  max-width: 100%;
  height: auto !important;
}

.qr-modal-body img {
  display: block;
  max-width: 100%;
  height: auto;
}

.qr-modal-url {
  margin: 0.85rem 0 0;
  font-size: 0.78rem;
  text-align: center;
  word-break: break-all;
  color: var(--text-muted);
}

.qr-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.qr-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.welcome-modal {
  width: min(92vw, 420px);
  padding: 1.35rem 1.2rem 1.15rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(28, 22, 16, 0.98), rgba(14, 11, 9, 0.98));
  color: var(--text);
  box-shadow: var(--shadow);
}

.welcome-modal::backdrop {
  background: rgba(0, 0, 0, 0.76);
  backdrop-filter: blur(4px);
}

.welcome-eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold-soft);
}

.welcome-modal h2 {
  margin: 0 0 0.65rem;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 5vw, 1.55rem);
  line-height: 1.2;
}

.welcome-modal-text {
  margin: 0 0 1rem;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-muted);
}

.welcome-modal-actions {
  display: grid;
  gap: 0.55rem;
}

.welcome-cta {
  display: inline-flex;
  justify-content: center;
  width: 100%;
  text-align: center;
}

.welcome-dismiss {
  border: 1px solid rgba(201, 162, 39, 0.22);
  border-radius: 999px;
  background: transparent;
  color: var(--text-muted);
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  cursor: pointer;
}

.welcome-dismiss:hover {
  color: var(--text);
  border-color: rgba(201, 162, 39, 0.42);
}

.welcome-modal-close {
  position: absolute;
  top: 0.65rem;
  right: 0.75rem;
  width: 2rem;
  height: 2rem;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.welcome-modal-close:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 420px) {
  .page {
    width: min(100% - 1.25rem, var(--max-width));
    padding-top: 1.75rem;
  }

  .link-card {
    grid-template-columns: 1fr;
    padding-bottom: 0.85rem;
  }

  .link-card-actions {
    flex-direction: row;
    justify-content: flex-start;
    padding-left: 0.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Mobile-first visual redesign overrides */
:root {
  --max-width: 860px;
  --radius: 20px;
  --radius-sm: 14px;
}

body {
  background: radial-gradient(circle at 50% -20%, #1c170f 0%, #0a0908 48%);
}

.bg-grid {
  opacity: 0.18;
}

.page {
  width: min(100% - 1rem, var(--max-width));
  padding: 1.15rem 0 2.2rem;
}

.hero {
  margin-bottom: 1.4rem;
  padding: 0.8rem 0.8rem 1rem;
  border: 1px solid rgba(201, 162, 39, 0.2);
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(24, 19, 14, 0.86), rgba(15, 12, 10, 0.8));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.hero-mascot {
  width: min(64vw, 220px);
  margin-bottom: 0.55rem;
}

.avatar {
  width: 74px;
  height: 74px;
  margin-bottom: 0.75rem;
}

.avatar svg {
  width: 46px;
  height: 46px;
}

.hero h1 {
  font-size: clamp(1.9rem, 9vw, 2.8rem);
  line-height: 1.1;
}

.tagline {
  margin-top: 0.6rem;
  font-size: 0.95rem;
  max-width: 38ch;
}

.section {
  margin-bottom: 1.2rem;
}

.section-links-primary {
  padding: 0.85rem;
  border-radius: var(--radius);
  background: linear-gradient(160deg, rgba(201, 162, 39, 0.16), rgba(22, 18, 14, 0.95));
}

.section-links-primary::before {
  content: "ГЛАВНЫЕ КОНТАКТЫ";
  top: -0.55rem;
  font-size: 0.58rem;
}

.section-head {
  align-items: center;
  margin-bottom: 0.7rem;
}

.section-head h2 {
  font-size: 1.18rem;
}

.section-head p {
  margin-top: 0.2rem;
  font-size: 0.82rem;
}

.section-head p:empty {
  display: none;
}

.collapse-toggle {
  font-size: 0.68rem;
  padding: 0.28rem 0.55rem;
}

.link-grid {
  gap: 0.65rem;
}

.link-card {
  grid-template-columns: 1fr auto;
  gap: 0.55rem;
  padding: 0.8rem 0.8rem 0.8rem 0.9rem;
  border-radius: 16px;
}

.link-card-label {
  font-size: 0.95rem;
}

.link-card-desc {
  font-size: 0.8rem;
  line-height: 1.45;
}

.link-card-actions {
  align-self: center;
}

.qr-thumb {
  width: 74px;
  height: 74px;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
}

.section-links-primary .qr-thumb {
  width: 82px;
  height: 82px;
}

.works-grid,
.gallery-images-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
}

.work-body {
  padding: 0.5rem 0.6rem 0.6rem;
}

.work-title {
  font-size: 0.76rem;
}

.work-desc {
  min-height: auto;
  font-size: 0.72rem;
  margin-bottom: 0.35rem;
}

.work-link {
  font-size: 0.72rem;
}

.apps-banner {
  padding: 0.95rem;
  margin-bottom: 0.8rem;
}

.apps-banner h3 {
  font-size: 0.98rem;
}

.apps-banner p {
  font-size: 0.84rem;
}

.portfolio-body {
  padding: 0.75rem 0.85rem 0.9rem;
}

.portfolio-body h3 {
  font-size: 0.96rem;
}

.portfolio-body p {
  font-size: 0.82rem;
}

.portfolio-links a {
  font-size: 0.76rem;
  padding: 0.34rem 0.65rem;
}

.faq-item {
  padding: 0.55rem 0.75rem;
}

.faq-item summary {
  font-size: 0.88rem;
}

.faq-item p {
  font-size: 0.8rem;
}

.footer {
  margin-top: 0.5rem;
  padding-top: 0.85rem;
}

.footer p {
  font-size: 0.76rem;
}

@media (min-width: 700px) {
  .page {
    width: min(100% - 2rem, var(--max-width));
    padding-top: 1.8rem;
  }

  .hero {
    padding: 1.15rem 1.2rem 1.3rem;
  }

  .link-card {
    padding: 0.95rem 1rem;
  }

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