:root {
  --paper: #f7f2e8;
  --paper-deep: #ede4d4;
  --ink: #1e252b;
  --muted: #5f6a70;
  --line: #c8bfae;
  --blue: #1d5f9f;
  --green: #2f7d57;
  --tab: #dce8ef;
  --note: #fff1a8;
  --stamp: #8c2f39;
  --shadow: 0 14px 36px rgba(49, 43, 34, 0.13);
  --small-shadow: 0 8px 18px rgba(49, 43, 34, 0.1);
  --radius: 6px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  background:
    linear-gradient(rgba(255,255,255,0.42), rgba(255,255,255,0.42)),
    radial-gradient(circle at 20% 10%, rgba(47, 125, 87, 0.08), transparent 24rem),
    radial-gradient(circle at 80% 30%, rgba(29, 95, 159, 0.08), transparent 28rem),
    repeating-linear-gradient(0deg, rgba(30,37,43,0.018) 0 1px, transparent 1px 5px),
    var(--paper);
  line-height: 1.6;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(30,37,43,0.035) 1px, transparent 1px),
    linear-gradient(rgba(30,37,43,0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  opacity: 0.38;
  mix-blend-mode: multiply;
  z-index: -1;
}

a {
  color: inherit;
  text-decoration: none;
}

.progress-line {
  position: fixed;
  top: 0;
  left: 0;
  width: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--green));
  z-index: 50;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(247, 242, 232, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 14px 22px 0;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid var(--ink);
  background: var(--paper-deep);
  display: grid;
  place-items: center;
  box-shadow: 4px 4px 0 rgba(29, 95, 159, 0.18);
}

.brand-mark svg {
  width: 25px;
  height: 25px;
}

.brand small {
  display: block;
  color: var(--muted);
  font: 600 12px/1.2 Arial, sans-serif;
  text-transform: uppercase;
}

.brand strong {
  display: block;
  font-size: 20px;
}

.header-contact {
  display: flex;
  gap: 14px;
  color: var(--muted);
  font: 600 13px/1.3 Arial, sans-serif;
}

.tabs {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-top: 8px;
}

.tab {
  position: relative;
  min-width: max-content;
  padding: 11px 16px 12px;
  background: var(--tab);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 6px 6px 0 0;
  color: #26343b;
  font: 700 13px/1.2 Arial, sans-serif;
  transition: transform 220ms ease, background 220ms ease;
}

.tab:hover,
.tab:focus-visible {
  transform: translateY(-4px);
  outline: none;
  background: #eef6f7;
}

.tab.active {
  background: var(--paper);
  color: var(--blue);
  box-shadow: inset 0 4px 0 var(--green);
}

.archive-shell {
  max-width: 1180px;
  margin: 34px auto 0;
  padding: 0 22px 70px;
}

.folder-hero {
  position: relative;
  min-height: 420px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #fffaf0, var(--paper));
  box-shadow: var(--shadow);
  padding: 48px;
  overflow: hidden;
  animation: folderOpen 700ms ease both;
}

.folder-hero::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 34px;
  width: 260px;
  height: 38px;
  background: #cddfcf;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 7px 7px 0 0;
}

.folder-hero::after {
  content: "KZ / Алматы";
  position: absolute;
  right: 28px;
  top: 28px;
  color: var(--stamp);
  border: 2px solid var(--stamp);
  transform: rotate(4deg);
  padding: 7px 14px;
  font: 800 14px/1 Arial, sans-serif;
  text-transform: uppercase;
  opacity: 0.72;
}

.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 34px;
  align-items: end;
}

.archive-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 12px;
  background: var(--note);
  border: 1px solid #d4bb58;
  transform: rotate(-1deg);
  font: 800 12px/1 Arial, sans-serif;
  text-transform: uppercase;
  color: #3d381b;
}

.archive-label::before {
  content: "";
  width: 9px;
  height: 9px;
  background: var(--green);
  border-radius: 50%;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.08;
  letter-spacing: 0;
}

h1 {
  margin-top: 26px;
  max-width: 760px;
  font-size: clamp(42px, 6vw, 78px);
}

.lead {
  max-width: 770px;
  margin: 24px 0 0;
  font-size: 19px;
  color: #334047;
}

.photo-strip,
.archive-photo {
  margin-top: 24px;
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 10px;
  box-shadow: var(--small-shadow);
}

.photo-strip {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 10px;
}

.photo-strip img,
.archive-photo img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
  filter: sepia(0.08) saturate(0.88) contrast(1.03);
}

.archive-photo figcaption,
.photo-strip figcaption {
  padding: 8px 4px 0;
  color: var(--muted);
  font: 700 12px/1.4 Arial, sans-serif;
}

.hero-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 30px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 12px 17px;
  border: 1px solid var(--ink);
  background: #fffdf7;
  color: var(--ink);
  font: 800 13px/1 Arial, sans-serif;
  cursor: pointer;
  box-shadow: 4px 4px 0 rgba(47, 125, 87, 0.2);
  transition: transform 200ms ease, box-shadow 200ms ease;
}

.button:hover,
.button:focus-visible {
  transform: translate(-2px, -3px);
  box-shadow: 7px 7px 0 rgba(47, 125, 87, 0.24);
  outline: 2px solid rgba(29, 95, 159, 0.25);
}

.button.primary {
  background: var(--blue);
  color: #fff;
}

.case-stack {
  min-height: 310px;
  position: relative;
}

.case-card {
  position: absolute;
  width: min(100%, 410px);
  padding: 24px;
  border: 1px solid var(--line);
  background: #fffdf8;
  box-shadow: var(--small-shadow);
  transition: transform 240ms ease;
  animation: sheetIn 620ms ease both;
}

.case-card:hover {
  transform: translateY(-8px) rotate(0deg) !important;
}

.case-card:nth-child(1) {
  right: 28px;
  top: 6px;
  transform: rotate(2deg);
}

.case-card:nth-child(2) {
  right: 0;
  top: 112px;
  transform: rotate(-3deg);
  animation-delay: 110ms;
}

.case-card:nth-child(3) {
  right: 54px;
  top: 212px;
  transform: rotate(1deg);
  animation-delay: 210ms;
}

.case-card small,
.doc small,
.file small,
.record small {
  color: var(--muted);
  font: 800 11px/1 Arial, sans-serif;
  text-transform: uppercase;
}

.case-card h3 {
  margin-top: 10px;
  font-size: 25px;
}

.case-card p {
  margin: 10px 0 0;
  color: var(--muted);
}

.section {
  margin-top: 34px;
  padding: 32px;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--small-shadow);
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 16px;
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-code {
  color: var(--green);
  font: 800 12px/1 Arial, sans-serif;
  text-transform: uppercase;
}

.doc-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.doc,
.file,
.record,
.contact-card,
.answer {
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 22px;
  transition: transform 220ms ease, box-shadow 220ms ease;
}

.doc:hover,
.file:hover,
.record:hover,
.contact-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--small-shadow);
}

.doc h3,
.file h3,
.record h3 {
  margin-top: 12px;
  font-size: 23px;
}

.doc p,
.file p,
.record p,
.answer p {
  color: var(--muted);
}

.note-row {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 20px;
  align-items: start;
}

.sticky-note {
  background: var(--note);
  border: 1px solid #d4bb58;
  padding: 24px;
  transform: rotate(-1deg);
  box-shadow: var(--small-shadow);
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  background: #fffdf8;
  font-family: Arial, sans-serif;
  font-size: 14px;
}

.archive-text {
  display: grid;
  gap: 18px;
  color: #303a40;
}

.archive-text p {
  margin: 0;
}

.archive-text h3 {
  margin-top: 10px;
  font-size: 26px;
}

.archive-text blockquote {
  margin: 0;
  border-left: 4px solid var(--green);
  background: #f4efe3;
  padding: 18px 20px;
  color: #39454b;
}

.ledger th,
.ledger td {
  border: 1px solid var(--line);
  padding: 12px;
  text-align: left;
}

.ledger th {
  color: var(--blue);
  background: #edf5f6;
}

.timeline {
  display: grid;
  gap: 15px;
  border-left: 2px solid var(--green);
  padding-left: 20px;
}

.timeline-item {
  position: relative;
  padding: 18px;
  background: #fffdf8;
  border: 1px solid var(--line);
}

.timeline-item::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 22px;
  width: 12px;
  height: 12px;
  background: var(--blue);
  border-radius: 50%;
}

.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.folder-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.folder-list li {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px dashed var(--line);
}

.folder-list b {
  color: var(--blue);
  font-family: Arial, sans-serif;
  font-size: 13px;
}

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

.faq details {
  border: 1px solid var(--line);
  background: #fffdf8;
  overflow: hidden;
}

.faq summary {
  cursor: pointer;
  padding: 18px 20px;
  font: 800 16px/1.3 Arial, sans-serif;
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  float: right;
  color: var(--green);
  font-size: 24px;
  line-height: 18px;
}

.faq details[open] summary::after {
  content: "-";
}

.faq p {
  margin: 0;
  padding: 0 20px 20px;
  color: var(--muted);
}

.map-frame {
  width: 100%;
  height: 380px;
  border: 1px solid var(--line);
  filter: saturate(0.86) contrast(1.02);
  background: var(--paper-deep);
}

.footer {
  border-top: 1px solid var(--line);
  background: #ebe1cf;
  padding: 30px 22px;
}

.footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  color: #30373b;
}

.socials {
  display: flex;
  gap: 10px;
}

.socials a {
  border: 1px solid var(--line);
  background: #fffdf8;
  padding: 8px 11px;
  font: 800 12px/1 Arial, sans-serif;
}

.cookie {
  position: fixed;
  left: 22px;
  bottom: 22px;
  max-width: 420px;
  z-index: 60;
  border: 1px solid var(--ink);
  background: #fffdf8;
  box-shadow: var(--shadow);
  padding: 18px;
  display: none;
}

.cookie.visible {
  display: block;
  animation: sheetIn 260ms ease both;
}

.cookie p {
  margin: 0 0 12px;
  color: var(--muted);
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  width: 46px;
  height: 46px;
  border: 1px solid var(--ink);
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 200ms ease, transform 200ms ease;
  z-index: 55;
}

.back-top.visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 560ms ease, transform 560ms ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

@keyframes folderOpen {
  from {
    transform: perspective(1200px) rotateX(5deg) translateY(18px);
    opacity: 0;
  }
  to {
    transform: perspective(1200px) rotateX(0) translateY(0);
    opacity: 1;
  }
}

@keyframes sheetIn {
  from {
    opacity: 0;
    translate: 0 18px;
  }
  to {
    opacity: 1;
    translate: 0 0;
  }
}

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

@media (max-width: 920px) {
  .hero-grid,
  .note-row,
  .split {
    grid-template-columns: 1fr;
  }

  .case-stack {
    min-height: auto;
    display: grid;
    gap: 14px;
  }

  .case-card {
    position: static;
    width: 100%;
    transform: none !important;
  }

  .doc-grid {
    grid-template-columns: 1fr 1fr;
  }

  .photo-strip {
    grid-template-columns: 1fr;
  }

  .header-contact {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-inner,
  .archive-shell {
    padding-left: 14px;
    padding-right: 14px;
  }

  .folder-hero,
  .section {
    padding: 24px;
  }

  h1 {
    font-size: 40px;
  }

  .doc-grid {
    grid-template-columns: 1fr;
  }

  .folder-list li {
    grid-template-columns: 1fr;
  }

  .cookie {
    left: 14px;
    right: 14px;
    max-width: none;
  }
}
