/* AMIR — ЦПР · atlas/field-plate design system
   Grounded in the podcast house style (paper, graphite pencil, teal domes, Montserrat 800 + Noto Sans).
   Self-hosted fonts only — no external CDN, no trackers. */

@font-face {
  font-family: "Amir Display";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("fonts/montserrat-latin-800.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122;
}
@font-face {
  font-family: "Amir Display";
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  src: url("fonts/montserrat-cyrillic-800.woff2") format("woff2");
  unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
  font-family: "Amir Text";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/noto-sans-latin-500.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122;
}
@font-face {
  font-family: "Amir Text";
  font-weight: 500;
  font-style: normal;
  font-display: swap;
  src: url("fonts/noto-sans-cyrillic-500.woff2") format("woff2");
  unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}
@font-face {
  font-family: "Amir Text";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/noto-sans-latin-600.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F, U+2074, U+20AC, U+2122;
}
@font-face {
  font-family: "Amir Text";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("fonts/noto-sans-cyrillic-600.woff2") format("woff2");
  unicode-range: U+0400-04FF, U+0500-052F, U+2DE0-2DFF, U+A640-A69F;
}

:root {
  --paper:        #f3ecda;
  --paper-raised: #faf6ea;
  --paper-deep:   #e9dfc6;
  --ink:          #29241d;
  --ink-soft:     #58503f;
  --ink-faint:    #8a8066;
  --rule:         #d9cba7;
  --rule-strong:  #b9a978;

  --teal:         #2c655c;
  --teal-deep:    #1c4640;
  --teal-tint:    #dfe9e3;

  --ochre:        #a4553f;
  --ochre-soft:   #c98b63;

  --focus:        #1c5fa8;

  --font-display: "Amir Display", "Montserrat", "Noto Sans", system-ui, sans-serif;
  --font-body: "Amir Text", "Noto Sans", system-ui, sans-serif;

  --measure: 62ch;
  --wrap: 1180px;

  --space-3xs: 0.25rem;
  --space-2xs: 0.5rem;
  --space-xs: 0.75rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2.25rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;
  --space-3xl: 7rem;

  --radius-sm: 3px;
  --radius-md: 6px;

  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(41,36,29,0.05) 1px, transparent 0);
  background-size: 22px 22px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 1.25rem;
}

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.06;
  margin: 0;
  letter-spacing: -0.01em;
}

p { margin: 0; }

a { color: inherit; }

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

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

/* language toggling */
[data-lang="uz"] .lang-ru { display: none; }
[data-lang="ru"] .lang-uz { display: none; }

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(243,236,218,0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding-block: 0.85rem;
}
.brand {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  min-width: 0;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: 0.02em;
}
.brand-org {
  font-size: 0.8rem;
  color: var(--ink-soft);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lang-switch {
  display: flex;
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  overflow: hidden;
  flex: none;
}
.lang-switch button {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  background: transparent;
  color: var(--ink-soft);
  border: none;
  padding: 0.4rem 0.75rem;
  cursor: pointer;
}
.lang-switch button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper-raised);
}

/* ---------- hero ---------- */

.hero { padding-block: var(--space-xl) var(--space-2xl); }
.hero .wrap {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--space-2xl);
  align-items: center;
}
.hero-eyebrow {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--teal-deep);
  margin-bottom: var(--space-sm);
}
.hero h1 {
  font-size: clamp(1.6rem, 1.05rem + 2.6vw, 3rem);
  line-height: 1.08;
  color: var(--ink);
}
.hero-sub {
  margin-top: var(--space-md);
  max-width: 48ch;
  font-size: 1.08rem;
  color: var(--ink-soft);
}
.hero-figure {
  position: relative;
}
.hero-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-md);
}
.hero-figure figcaption {
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.stat-row {
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: var(--space-lg);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule-strong);
  position: relative;
}
.stat-row::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background-image: repeating-linear-gradient(90deg, var(--rule-strong) 0 1px, transparent 1px 12px);
}
.stat-num {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.7rem;
  color: var(--ink);
}
.stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
  max-width: 16ch;
}

.hero-actions {
  margin-top: var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  padding: 0.75rem 1.3rem;
  border-radius: var(--radius-sm);
  border: none;
  transition: transform var(--dur-base,180ms) var(--ease), background var(--dur-base,180ms) var(--ease), box-shadow var(--dur-base,180ms) var(--ease);
}
.btn--accent {
  background: var(--teal);
  color: var(--paper-raised);
}
.btn--accent:hover { background: var(--teal-deep); }
.btn--outline {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  color: var(--ink);
}
.btn--outline:hover { background: var(--ink); color: var(--paper-raised); }
.btn:active { transform: translateY(1px); }
.btn-arrow { transition: transform var(--dur-base,180ms) var(--ease); }
.btn:hover .btn-arrow { transform: translateX(2px); }

/* ---------- section shell ---------- */

section { padding-block: var(--space-2xl); }
section + section { border-top: 1px solid var(--rule); }
.section-head {
  max-width: 62ch;
  margin-bottom: var(--space-lg);
}
.section-tag {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--teal-deep);
  margin-bottom: 0.5rem;
}
.section-head h2 {
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
}
.section-head p {
  margin-top: 0.75rem;
  color: var(--ink-soft);
  font-size: 1rem;
}

/* ---------- process ---------- */

.process-list {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  list-style: none;
  margin: 0;
  padding: 0;
}
.process-item {
  border-top: 3px solid var(--ink);
  padding-top: 0.9rem;
}
.process-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.85rem;
  color: var(--ochre);
}
.process-item h3 {
  margin-top: 0.4rem;
  font-size: 1.05rem;
}
.process-item p {
  margin-top: 0.5rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
}

/* ---------- coverage / map ---------- */

.coverage-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.map-plate {
  background: var(--paper-raised);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-md);
}
.map-plate svg { width: 100%; height: auto; }
.map-legend {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: var(--space-sm);
  font-size: 0.78rem;
  color: var(--ink-soft);
}
.map-legend .swatch {
  height: 10px;
  flex: 1;
  border-radius: 2px;
  background: linear-gradient(90deg, rgba(164,85,63,0.14), rgba(164,85,63,0.9));
  border: 1px solid var(--rule-strong);
}
.map-caption {
  margin-top: var(--space-xs);
  font-size: 0.78rem;
  color: var(--ink-faint);
}

.callout-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}
.callout {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  background: var(--paper-raised);
  padding: var(--space-md);
}
.callout--accent {
  border-color: var(--teal);
  background: var(--teal-tint);
}
.callout-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.6rem;
  color: var(--ink);
}
.callout p {
  margin-top: 0.35rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- atlas filmstrip ---------- */

.atlas-strip {
  display: flex;
  gap: var(--space-sm);
  overflow-x: auto;
  padding-bottom: var(--space-sm);
  margin: 0 -1.25rem;
  padding-inline: 1.25rem;
  scroll-snap-type: x proximity;
}
.atlas-tile {
  flex: 0 0 auto;
  width: 220px;
  scroll-snap-align: start;
}
.atlas-tile img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--rule-strong);
  aspect-ratio: 16/9;
  object-fit: cover;
}
.atlas-tile figcaption {
  margin-top: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* ---------- doors ---------- */

.door-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.door {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  display: flex;
  flex-direction: column;
  background: var(--paper-raised);
}
.door--primary {
  background: var(--ink);
  color: var(--paper-raised);
  border-color: var(--ink);
}
.door--primary .door-label { color: var(--ochre-soft); }
.door--primary p { color: #d8d1bf; }
.door-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--teal-deep);
}
.door h3 {
  margin-top: 0.5rem;
  font-size: 1.35rem;
}
.door p { margin-top: 0.75rem; font-size: 0.95rem; }
.door-spacer { flex: 1; min-height: var(--space-md); }
.door .btn { margin-top: var(--space-md); align-self: flex-start; }
.door--primary .btn--outline { box-shadow: inset 0 0 0 1.5px var(--paper-raised); color: var(--paper-raised); }
.door--primary .btn--outline:hover { background: var(--paper-raised); color: var(--ink); }

.method-note {
  margin-top: var(--space-md);
  font-size: 0.85rem;
  color: var(--ink-faint);
  font-style: italic;
}

/* ---------- principles ---------- */

.principle-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
}
.principle {
  border-left: 3px solid var(--ochre);
  padding-left: var(--space-sm);
}
.principle-num {
  font-family: var(--font-display);
  font-weight: 800;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.principle h3 {
  margin-top: 0.35rem;
  font-size: 1rem;
}
.principle p {
  margin-top: 0.4rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
}

/* ---------- ethics + privacy ---------- */

.duo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}
.duo-card h3 {
  font-size: 1.05rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule-strong);
}
.duo-list {
  list-style: none;
  margin: var(--space-sm) 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.duo-list li {
  padding-left: 1.1rem;
  position: relative;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.duo-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.5em;
  width: 6px; height: 6px;
  background: var(--teal);
  border-radius: 999px;
}

/* ---------- episodes ---------- */

.episode-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}
.episode-card {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--paper-raised);
}
.episode-card img { width: 100%; height: auto; }
.episode-body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.episode-soon {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--teal-deep);
  background: var(--teal-tint);
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.65rem;
  margin-bottom: 0.5rem;
}
.episode-body h3 { font-size: 1.05rem; }
.episode-body p { margin-top: 0.35rem; font-size: 0.86rem; color: var(--ink-soft); }

/* ---------- footer ---------- */

.site-footer {
  padding-block: var(--space-xl);
  border-top: 1px solid var(--rule-strong);
  background: var(--paper-deep);
}
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
}
.footer-line { font-size: 0.85rem; color: var(--ink-soft); }
.footer-dot { margin: 0 0.4rem; color: var(--ink-faint); }
.footer-credits {
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--rule);
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--ink-faint);
  max-width: 80ch;
}
.footer-draft {
  margin-top: 0.6rem;
  font-size: 0.72rem;
  color: var(--ochre);
  font-weight: 600;
}

/* ---------- responsive ---------- */

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-figure { order: -1; }
  .stat-row { grid-template-columns: 1fr 1fr; }
  .process-list { grid-template-columns: 1fr 1fr; }
  .coverage-grid { grid-template-columns: 1fr; }
  .door-grid { grid-template-columns: 1fr; }
  .principle-grid { grid-template-columns: 1fr 1fr; }
  .duo-grid { grid-template-columns: 1fr; gap: var(--space-md); }
  .episode-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .wrap { padding-inline: 1rem; }
  .hero { padding-block: var(--space-lg) var(--space-xl); }
  section { padding-block: var(--space-xl); }
  .stat-row { grid-template-columns: 1fr 1fr; gap: var(--space-md); }
  .process-list { grid-template-columns: 1fr; gap: var(--space-sm); }
  .principle-grid { grid-template-columns: 1fr; }
  .brand-org { display: none; }
  .site-header .wrap { padding-block: 0.65rem; }
}
