:root {
  /* Light only: the page stands on the plaster of the emblem picture (Borg 28.09) */
  color-scheme: light;
  --bg: #efede8;
  --surface: rgba(255, 255, 255, 0.78);
  --surface-strong: rgba(250, 244, 232, 0.86);
  --text: #1b2233;
  --muted: #5a5f6c;
  --line: #ddd5c6;
  --accent: #a0712f;
  --accent-dark: #7d5522;
  --logo-bg: #0a0a0d;
  --shadow: 0 18px 50px rgba(40, 30, 10, 0.10);
}


* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
}

a {
  color: inherit;
}

.page-shell {
  display: flex;
  min-height: 100svh;
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px 24px 24px;
  flex-direction: column;
}

.site-header,
.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.site-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  overflow: hidden;
  border-radius: 13px;
  background: var(--logo-bg);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.brand-mark img {
  width: 35px;
  height: 35px;
  object-fit: contain;
}

.brand-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.lang-switch {
  display: inline-flex;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.lang-switch a {
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  text-decoration: none;
}

.lang-switch a:hover,
.lang-switch a:focus-visible,
.lang-switch a[aria-current="page"] {
  background: var(--surface-strong);
  color: var(--accent-dark);
}

main {
  width: 100%;
  flex: 1;
}

.hero {
  max-width: 900px;
  padding: clamp(72px, 12vw, 138px) 0 74px;
}

.eyebrow,
.section-label {
  margin: 0 0 18px;
  color: var(--accent-dark);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 850px;
  margin-bottom: 28px;
  font-size: clamp(2.7rem, 7vw, 5.65rem);
  font-weight: 700;
  letter-spacing: -0.065em;
  line-height: 0.99;
}

.intro {
  max-width: 700px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  line-height: 1.55;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 24px;
  align-items: stretch;
  margin-bottom: 86px;
}

.copy-block,
.status-block {
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.copy-block h2 {
  max-width: 440px;
  margin-bottom: 20px;
  font-size: clamp(1.7rem, 3vw, 2.35rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
}

.copy-block p:not(.section-label) {
  max-width: 580px;
  color: var(--muted);
  font-size: 1.02rem;
}

.copy-block p:last-child {
  margin-bottom: 0;
}

.status-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: var(--surface-strong);
  box-shadow: none;
}

.status-block p:last-child {
  margin-bottom: 0;
  color: var(--text);
  font-size: 1.03rem;
}

.doors {
  margin-bottom: 86px;
}

.doors-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.doors-heading h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  letter-spacing: -0.045em;
}

.door-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.door {
  display: flex;
  min-height: 142px;
  flex-direction: column;
  justify-content: space-between;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  text-decoration: none;
  transition: border-color 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.door:hover,
.door:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow);
  transform: translateY(-3px);
}

.door-title {
  font-weight: 750;
  letter-spacing: -0.02em;
}

.door-arrow {
  align-self: flex-end;
  color: var(--accent-dark);
  font-size: 1.2rem;
}

.site-footer {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  color: var(--muted);
  font-size: 0.86rem;
}

.site-footer p {
  margin-bottom: 0;
}

.not-found {
  display: grid;
  min-height: 62vh;
  align-content: center;
  max-width: 650px;
  padding: 80px 0;
}

.not-found h1 {
  margin-bottom: 20px;
  font-size: clamp(2.7rem, 7vw, 5rem);
}

.not-found p:not(.eyebrow) {
  max-width: 500px;
  margin-bottom: 28px;
  color: var(--muted);
  font-size: 1.15rem;
}

.home-link {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  background: var(--accent);
  padding: 11px 17px;
  color: #062116;
  font-weight: 750;
  text-decoration: none;
}

.home-link:hover,
.home-link:focus-visible {
  background: var(--accent-dark);
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 18px 16px 18px;
  }

  .hero {
    padding: 70px 0 58px;
  }

  .content-grid {
    grid-template-columns: 1fr;
    margin-bottom: 64px;
  }

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

  .doors {
    margin-bottom: 64px;
  }
}

@media (max-width: 430px) {
  .copy-block,
  .status-block {
    padding: 24px;
    border-radius: 20px;
  }

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

  .door {
    min-height: 110px;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
}

/* Contact: copies the address, never opens a mail program (decision of the research site) */
.door-copy { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.door-email { align-self: flex-start; color: var(--accent-dark); font-size: 0.95rem; user-select: all; }
.copy-toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 40;
  padding: 10px 14px; border: 1px solid var(--accent); border-radius: 10px;
  background: var(--surface); color: inherit; font-size: 14px;
  opacity: 0; visibility: hidden; transform: translate(-50%, 8px);
  transition: opacity 150ms ease, transform 150ms ease, visibility 150ms;
}
.copy-toast.is-visible { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .copy-toast { transition: none; } }

/* Top bar: the research site's brand block as is, menu removed (Borg 28.09).
   Always black -- the constellation logo is drawn for a dark ground. */
.topbar { background: #0a0a0d; border-bottom: 1px solid #303038; }
.topbar-inner {
  display: flex; align-items: center; gap: 18px;
  max-width: 1180px; min-height: 108px; margin: 0 auto; padding: 12px 24px;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}
.topbar .brand { display: inline-flex; align-items: center; gap: 12px; margin-right: auto; color: #ede9df; text-decoration: none; }
.topbar .brand img { width: 84px; height: 84px; object-fit: contain; mix-blend-mode: screen; }
.topbar .brand-copy { display: flex; flex-direction: column; gap: 2px; }
.topbar .brand-name { color: #ede9df; font-size: 23px; font-weight: 650; letter-spacing: .16em; line-height: 1.15; text-transform: uppercase; }
.topbar .brand-description { color: #c0b9ad; font-size: 15px; letter-spacing: .04em; line-height: 1.3; }
.topbar .lang-switch { display: flex; gap: 14px; font-size: 14px; letter-spacing: .02em; }
.topbar .lang-switch a { color: #a8a39a; text-decoration: none; }
.topbar .lang-switch a:hover, .topbar .lang-switch a:focus-visible { color: #e1b97d; }
@media (max-width: 720px) {
  .topbar-inner { padding: 10px 16px; min-height: 92px; }
  .topbar .brand img { width: 64px; height: 64px; }
  .topbar .brand-name { font-size: 19px; }
  .topbar .brand-description { font-size: 13px; }
}
.topbar .lang-switch a { background: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; }
.topbar .lang-switch a[aria-current="page"] { color: #e1b97d; }

/* Plaster background, tiled (not stretched) -- build/fon_iz_emblemy.py */
html, body { background: var(--bg) url("/assets/fon-shtukaturka.webp") repeat; background-size: 340px 340px; }
.hero {
  max-width: none; display: grid; align-items: center; gap: 40px;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
}
.hero-emblem { width: 100%; max-width: 420px; height: auto; justify-self: center; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .hero-emblem { max-width: 280px; }
}
/* Next to the emblem the headline column is narrower: the longest word must fit
   ("исследовательская" at 90px ran into the emblem -- Borg's screenshot 28.09). */
.hero h1 { font-size: clamp(2.3rem, 4.4vw, 4.2rem); hyphens: manual; overflow-wrap: break-word; }
.hero-text { min-width: 0; }

/* emblema -- ssylka na sayt issledovaniy (koren 0002) */
.hero-emblem-link { display: block; width: 100%; max-width: 420px; justify-self: center; border-radius: 50%; transition: opacity 0.2s, transform 0.2s; }
.hero-emblem-link .hero-emblem { display: block; max-width: 100%; }
.hero-emblem-link:hover, .hero-emblem-link:focus-visible { opacity: 0.92; transform: scale(1.01); }
.footer-agent { font-size: 0.9em; opacity: 0.8; }
@media (max-width: 860px) { .hero-emblem-link { max-width: 280px; } }
