@import url('https://fonts.googleapis.com/css2?family=Noto+Sans:wght@400;500;600;700;800&display=swap');

/* Document and typography. */
*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: 'Noto Sans', Arial, Helvetica, sans-serif;
}

button,
input,
select,
textarea { font: inherit; }

a { color: inherit; text-decoration: none; }
a:focus-visible,
button:focus-visible,
summary:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

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

h1,
h2,
h3,
h4,
h5 { color: var(--ink); font-family: Arial, Helvetica, sans-serif; font-weight: 400; }

.page-title {
  max-width: 860px;
  margin: 0 0 1.55rem;
  color: var(--ink);
  font-size: clamp(2.18rem, 3.3vw, 4.13rem);
  letter-spacing: -.045em;
  line-height: .94;
}

.page-title--inverse { color: var(--on-dark); }
.home-shell { max-width: 1600px; margin: 0 auto; overflow: clip; }

/* Shared public header. */
.home-header,
.home-footer { padding-right: clamp(1.25rem, 5vw, 5.5rem); padding-left: clamp(1.25rem, 5vw, 5.5rem); }

.home-header {
  position: sticky;
  z-index: 100;
  top: 0;
  overflow-anchor: none;
  display: flex;
  min-height: 88px;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  transition: min-height .22s ease, box-shadow .22s ease;
}
.home-header.is-scrolled {
  min-height: 50px;
  box-shadow: 0 8px 24px var(--shadow-color);
}
.home-header.is-scrolled .brand img {
  width: 24px;
  height: 24px;
}

.brand { display: inline-flex; align-items: center; gap: .65rem; font-size: .82rem; line-height: 1.03; letter-spacing: .035em; text-transform: uppercase; }
.brand img { object-fit: contain; transition: width .22s ease, height .22s ease; }
.brand strong { font-weight: 800; }
.header-controls { display: flex; align-items: center; gap: 1.2rem; }
.home-nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2.6rem); font-size: .88rem; }
.home-nav > a { border-bottom: 1px solid transparent; text-decoration: none; transition: border-color .2s ease; }
.home-nav > a:hover { border-color: currentColor; }

.mobile-nav { display: none; position: relative; font-size: .9rem; }
.mobile-nav summary { display: flex; align-items: center; gap: .45rem; cursor: pointer; list-style: none; }
.mobile-nav summary::-webkit-details-marker { display: none; }
.mobile-nav summary img { display: block; width: 1.1rem; height: 1.1rem; }
.mobile-nav div { position: absolute; z-index: 20; top: 2.2rem; right: 0; display: grid; min-width: 190px; padding: .55rem; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: var(--surface); box-shadow: 0 12px 30px var(--shadow-color); }
.mobile-nav a { padding: .75rem; }

.theme-switcher { display: flex; align-items: center; gap: .45rem; padding-left: 1.15rem; border-left: 1px solid var(--line); }
.theme-dot { display: block; flex: 0 0 1rem; width: 1rem; height: 1rem; min-height: 1rem; margin: 0; padding: 0; border: 2px solid transparent; border-radius: 50%; cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.theme-dot:hover { transform: scale(1.16); }
.theme-dot[aria-pressed='true'] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 3px var(--ink); }
.theme-dot-warm { background: #b85e3f; }
.theme-dot-coast { background: #23879a; }
.theme-dot-night { background: #27303a; }

.skip-link { position: fixed; z-index: 100; top: 1rem; left: 1rem; transform: translateY(-160%); padding: .7rem 1rem; color: var(--on-dark); background: var(--dark); font-size: .9rem; }
.skip-link:focus { transform: translateY(0); }

/* Shared footer. */
.home-footer { display: grid; grid-template-columns: 1fr auto auto; gap: 2rem; align-items: end; padding-top: 2.7rem; padding-bottom: 2.7rem; color: var(--ink); background: var(--paper); font-size: .84rem; }
.brand-footer { margin-bottom: 1rem; font-size: 1rem; text-transform: none; }
.home-footer p { margin-bottom: 0; color: var(--muted); }
.footer-links { display: flex; flex-wrap: wrap; gap: 1.2rem; }
.footer-links a { display: inline-flex; align-items: center; gap: .38rem; }
.footer-links img { width: 1.05rem; height: 1.05rem; object-fit: contain; }
.theme-night .contact-icon-vk,
.theme-night .contact-icon-telegram { filter: invert(1) brightness(1.35); }
.contact-icon-max-night { display: none; }
.theme-night .contact-icon-max-light { display: none; }
.theme-night .contact-icon-max-night { display: inline-block; }
.footer-links a:hover { text-decoration: underline; }
.footer-year { text-align: right; }

/* Shared vertical rhythm. */
.section,
.help-section,
.about-section { padding-top: clamp(1.5rem, 2.7vw, 2.65rem); padding-bottom: clamp(1.5rem, 2.7vw, 2.65rem); }
.section { padding-right: clamp(1.25rem, 5vw, 5.5rem); padding-left: clamp(1.25rem, 5vw, 5.5rem); }
.materials-page { padding: clamp(1rem, 2.7vw, 2.35rem) clamp(1.25rem, 5vw, 5.5rem) clamp(1.35rem, 2.7vw, 2.65rem); }
.tours-page-search { padding: clamp(1.2rem, 2.35vw, 2.2rem) clamp(1.25rem, 5vw, 5.5rem) clamp(1.5rem, 2.7vw, 2.65rem); }

@media (max-width: 850px) {
  .home-header { min-height: 76px; }
  .home-header.is-scrolled { min-height: 50px; }
  .home-header.is-scrolled .brand img { width: 24px; height: 24px; }
  .home-nav { display: none; }
  .mobile-nav { display: block; }
  .header-controls { gap: .9rem; }
  .theme-switcher { padding-left: 0; border-left: 0; }
}

@media (max-width: 560px) {
  .brand { font-size: .7rem; }
  .brand img { width: 42px; height: 42px; }
  .page-title { font-size: clamp(2.33rem, 11.25vw, 3.45rem); }
  .home-footer { grid-template-columns: minmax(0, 1fr) auto; align-items: start; }
  .home-footer > div:first-child { grid-column: 1 / -1; }
  .footer-year { text-align: right; white-space: nowrap; }
}
