:root {
  --bg: #faf8f5;
  --bg-alt: #f1ede7;
  --surface: #ffffff;
  --text: #2b2f33;
  --text-muted: #5c6470;
  --accent: #1d4d6b;
  --accent-dark: #143a52;
  --border: #e2ddd5;
  --radius: 12px;
  --shadow: 0 10px 30px rgba(27, 35, 43, 0.12);
  --container: 1140px;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

h1,
h2,
h3 {
  line-height: 1.25;
  margin: 0 0 0.6em;
  font-weight: 700;
}

p {
  margin: 0 0 1em;
}

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-dark);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.container--narrow {
  max-width: 820px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--accent);
  color: #fff;
  border-radius: 6px;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

.subpage-back {
  white-space: nowrap;
  text-decoration: none;
  font-weight: 600;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(250, 248, 245, 0.96);
  border-bottom: 1px solid var(--border);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.logo {
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
}

.site-header__tagline {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
}

.site-nav {
  display: none;
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px 16px;
}

.site-nav.is-open {
  display: block;
}

.site-nav__list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-nav__list a {
  display: block;
  padding: 10px 4px;
  text-decoration: none;
  color: var(--text);
}

.site-nav__list a:hover {
  color: var(--accent);
}

/* Hero */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 480px;
  overflow: hidden;
}

.hero__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(16, 26, 34, 0.72) 0%, rgba(16, 26, 34, 0.45) 60%, rgba(16, 26, 34, 0.25) 100%);
}

.hero__content {
  position: relative;
  padding-top: 64px;
  padding-bottom: 64px;
  color: #fff;
}

.hero__title {
  max-width: 640px;
  font-size: clamp(1.65rem, 4.5vw, 2.6rem);
  letter-spacing: -0.02em;
}

.hero__subtitle {
  max-width: 560px;
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.92);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

/* Buttons */
.button {
  display: inline-block;
  padding: 12px 24px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

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

.button--primary:hover {
  background: var(--accent-dark);
  color: #fff;
}

.button--ghost {
  border-color: rgba(255, 255, 255, 0.7);
  color: #fff;
  background: transparent;
}

.button--ghost:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.button--small {
  padding: 9px 18px;
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}

.button--small:hover {
  background: var(--accent);
  color: #fff;
}

/* Sections */
.section {
  padding: 64px 0;
}

.section--alt {
  background: var(--bg-alt);
}

.section__title {
  font-size: 1.7rem;
  letter-spacing: -0.01em;
  margin-bottom: 1.2em;
}

/* Cards */
.cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

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

.card__image {
  width: 100%;
  aspect-ratio: 800 / 534;
  object-fit: cover;
}

.card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 20px;
}

.card__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.6em;
}

.card__category {
  color: var(--accent);
  font-weight: 600;
}

.card__title {
  font-size: 1.15rem;
}

.card__excerpt {
  color: var(--text-muted);
  flex: 1;
}

.card .button {
  align-self: flex-start;
  margin-top: 8px;
}

/* Accordion */
.accordion__item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.accordion__heading {
  margin: 0;
}

.accordion__button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  padding: 18px 20px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.accordion__button::after {
  content: "+";
  flex-shrink: 0;
  font-size: 1.4rem;
  font-weight: 400;
  color: var(--accent);
}

.accordion__button[aria-expanded="true"]::after {
  content: "−";
}

.accordion__button:hover {
  background: rgba(29, 77, 107, 0.05);
}

.accordion__panel {
  padding: 0 20px 20px;
  color: var(--text-muted);
}

/* Gallery */
.gallery {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.gallery__item {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.gallery__item img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery__item figcaption {
  padding: 12px 16px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

/* Contacts */
.contacts__text {
  max-width: 640px;
}

.contact-form {
  max-width: 560px;
  margin-top: 24px;
}

.contact-form__field {
  margin-bottom: 16px;
}

.contact-form label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 12px 14px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.contact-form textarea {
  resize: vertical;
}

.contact-form__error {
  color: #a33a2a;
  font-weight: 600;
}

.contact-form__note {
  margin-top: 12px;
  font-size: 0.88rem;
  color: var(--text-muted);
}

/* Footer */
.site-footer {
  padding: 32px 0;
  background: #20262c;
  color: rgba(255, 255, 255, 0.85);
}

.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.site-footer p {
  margin: 0;
}

.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-footer a {
  color: rgba(255, 255, 255, 0.85);
}

.site-footer a:hover {
  color: #fff;
}

.site-footer__made {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.6);
}

/* Modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
  background: rgba(20, 26, 32, 0.6);
}

.modal[hidden] {
  display: none;
}

.modal__dialog {
  position: relative;
  width: 100%;
  max-width: 760px;
  margin: auto 0;
  padding: 36px 28px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--text-muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.modal__close:hover {
  background: var(--bg-alt);
  color: var(--text);
}

.article h2 {
  font-size: 1.5rem;
  padding-right: 32px;
}

.article h3 {
  margin-top: 1.4em;
  font-size: 1.12rem;
}

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

body.modal-open {
  overflow: hidden;
}

/* Tablet */
@media (min-width: 640px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .modal__dialog {
    padding: 44px 40px;
  }
}

/* Desktop */
@media (min-width: 960px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    display: block;
    position: static;
    background: transparent;
    border: 0;
    padding: 0;
  }

  .site-nav__list {
    display: flex;
    gap: 24px;
  }

  .site-nav__list a {
    padding: 6px 0;
    font-size: 0.95rem;
  }

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

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

  .site-footer__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .button,
  .skip-link {
    transition: none;
  }
}
