:root {
  color-scheme: light;
  --ink: #17211f;
  --muted: #5c6865;
  --paper: #fbfaf7;
  --surface: #eef5f2;
  --line: #d6dfdc;
  --teal: #0d695f;
  --teal-dark: #074a43;
  --red: #b53a2f;
  --gold: #c28b2c;
  --white: #ffffff;
  --shadow: 0 18px 60px rgba(23, 33, 31, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
}

a { color: inherit; }
button, input, select, textarea { font: inherit; }
input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.82rem 0.9rem;
  background: var(--white);
  color: var(--ink);
}
textarea { resize: vertical; }
label { display: grid; gap: 0.42rem; font-weight: 700; }

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 20;
  background: var(--ink);
  color: var(--white);
  padding: 0.6rem 0.8rem;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem clamp(1rem, 4vw, 3rem);
  background: rgba(251, 250, 247, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  font-weight: 900;
  min-width: max-content;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 2.2rem;
  height: 2.2rem;
  background: var(--teal);
  color: var(--white);
  border-radius: 8px;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  font-size: 0.95rem;
}
.site-nav a, .text-button {
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  cursor: pointer;
  padding: 0.3rem;
}
.site-nav a:hover, .site-nav a:focus, .text-button:hover { color: var(--teal-dark); }
.nav-toggle { display: none; }

.hero {
  position: relative;
  min-height: min(760px, calc(100vh - 70px));
  display: grid;
  align-items: center;
  overflow: hidden;
  background: #d9ece8;
}
.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(251,250,247,0.96) 0%, rgba(251,250,247,0.78) 38%, rgba(251,250,247,0.06) 72%);
}
.hero-overlay {
  position: relative;
  z-index: 1;
  width: min(660px, calc(100% - 2rem));
  margin-left: clamp(1rem, 6vw, 5rem);
  padding: 5rem 0;
}
.hero h1 {
  margin: 0.8rem 0 1rem;
  font-size: clamp(2.4rem, 6vw, 5.6rem);
  line-height: 0.98;
  max-width: 9ch;
}
.hero p { font-size: clamp(1.05rem, 2vw, 1.28rem); max-width: 36rem; color: #34413e; }
.demo-pill, .eyebrow {
  margin: 0;
  color: var(--red);
  text-transform: uppercase;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0;
}
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.4rem; }
.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 2.9rem;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.75rem 1rem;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}
.button.primary { background: var(--teal); color: var(--white); }
.button.primary:hover { background: var(--teal-dark); }
.button.secondary { background: var(--white); color: var(--teal-dark); border-color: var(--line); }

.notice {
  display: flex;
  gap: 0.5rem;
  padding: 1rem clamp(1rem, 4vw, 3rem);
  background: #fff3df;
  border-block: 1px solid #eed3a3;
}
.section {
  padding: clamp(3rem, 7vw, 6rem) clamp(1rem, 4vw, 3rem);
  width: min(1180px, 100%);
  margin: 0 auto;
}
.surface {
  width: 100%;
  max-width: none;
  background: var(--surface);
}
.surface > * { max-width: 1180px; margin-inline: auto; }
.section-head { max-width: 760px; margin-bottom: 1.5rem; }
.section h2, .section h1 {
  margin: 0.25rem 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 3.2rem);
  line-height: 1.08;
}
.grid-3, .card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}
.grid-3 article, .card, .grant-box, .login-panel, .tab-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1.2rem;
  box-shadow: 0 8px 28px rgba(23, 33, 31, 0.06);
}
.card h3, .grid-3 h3, .grid-3 h2 { margin-top: 0; }
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0.8rem 0;
}
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 1.8rem;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  background: #e7f3ef;
  color: var(--teal-dark);
  font-size: 0.84rem;
  font-weight: 800;
}
.example { color: var(--red); font-weight: 800; }
.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.82fr);
  gap: clamp(1rem, 4vw, 3rem);
  align-items: start;
}
.timeline {
  display: grid;
  gap: 0.8rem;
  padding-left: 1.35rem;
}
.timeline li {
  padding: 1rem;
  background: var(--white);
  border-left: 4px solid var(--gold);
  border-radius: 8px;
}
.stats {
  display: grid;
  gap: 0.8rem;
}
.stats div {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 1rem;
  background: var(--surface);
  border-radius: 8px;
}
.stats strong { font-size: 2rem; color: var(--teal); }

.application form, #login-form {
  display: grid;
  gap: 1rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1rem, 3vw, 1.5rem);
  box-shadow: var(--shadow);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
.checkbox {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-weight: 600;
}
.checkbox input { width: auto; margin-top: 0.3rem; }
.form-errors { color: #8b1d14; font-weight: 800; }
.form-status { color: var(--teal-dark); font-weight: 800; margin: 0; }
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.faq {
  display: grid;
  gap: 0.8rem;
}
details {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 1rem;
}
summary { cursor: pointer; font-weight: 900; }
.contacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
address {
  display: grid;
  gap: 0.6rem;
  font-style: normal;
  font-weight: 800;
}
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem clamp(1rem, 4vw, 3rem);
  background: var(--ink);
  color: var(--white);
}

.admin-shell { padding: clamp(1rem, 4vw, 3rem); }
.login-panel { max-width: 440px; margin: 3rem auto; }
.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1rem;
}
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.9rem;
  background: var(--white);
  cursor: pointer;
  font-weight: 900;
}
.tab.active { background: var(--teal); color: var(--white); }
.admin-list { display: grid; gap: 0.9rem; }
.admin-item {
  display: grid;
  gap: 0.7rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}
.admin-grid label.full { grid-column: 1 / -1; }
.status-row {
  display: flex;
  align-items: end;
  gap: 0.8rem;
  flex-wrap: wrap;
}
.small { color: var(--muted); font-size: 0.9rem; }
.admin-notice {
  margin: 0 0 1rem;
  border-radius: 8px;
}

@media (max-width: 860px) {
  .nav-toggle {
    display: inline-flex;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--white);
    padding: 0.55rem 0.7rem;
  }
  .site-nav {
    position: absolute;
    inset: calc(100% - 1px) 0 auto 0;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
  }
  .site-nav.open { display: flex; }
  .hero {
    min-height: 720px;
    align-items: end;
  }
  .hero::after { background: linear-gradient(180deg, rgba(251,250,247,0.08), rgba(251,250,247,0.96) 58%); }
  .hero-image { object-position: 58% center; }
  .hero-overlay { margin: 0 auto; padding: 18rem 0 2.5rem; }
  .hero h1 { max-width: 11ch; }
  .grid-3, .card-grid, .split, .contacts, .form-grid, .admin-grid { grid-template-columns: 1fr; }
  .site-footer { flex-direction: column; }
}

@media (max-width: 520px) {
  .site-header { align-items: center; }
  .brand { min-width: 0; }
  .brand span:last-child { overflow-wrap: anywhere; }
  .section { padding-inline: 1rem; }
  .notice { flex-direction: column; }
  .hero-actions .button { width: 100%; }
  .stats div { grid-template-columns: 1fr; }
}
