/* =========================================================
   СВИ — Смирнов Василий Иванович
   Base: tokens, reset, typography, navigation, footer
   ========================================================= */

:root {
  --paper: #efe8dc;
  --paper-2: #e5dac9;
  --paper-3: #d8c9b4;
  --ink: #1b1814;
  --ink-2: #3f3931;
  --muted: #6f665b;
  --rust: #a8462b;
  --rust-dark: #873521;
  --olive: #5e6248;
  --line: rgba(27, 24, 20, 0.17);
  --line-strong: rgba(27, 24, 20, 0.34);
  --line-light: rgba(239, 232, 220, 0.18);
  --line-light-strong: rgba(239, 232, 220, 0.34);

  --serif: "Constantia", "Sitka Display", "Palatino Linotype", "Book Antiqua", Georgia, serif;
  --serif-display: "Sitka Display", "Constantia", "Palatino Linotype", Georgia, serif;
  --sans: "Segoe UI", "Candara", "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", "Consolas", "Courier New", monospace;

  --pad: clamp(20px, 4.2vw, 72px);
  --max: 1680px;
  --header-h: 78px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out: cubic-bezier(0.76, 0, 0.24, 1);
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.14;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)' opacity='.55'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}

::selection {
  background: var(--rust);
  color: #fff8ee;
}

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

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

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

p,
h1,
h2,
h3,
h4,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

address {
  font-style: normal;
}

.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.display {
  font-family: var(--serif-display);
  font-weight: 400;
  line-height: 0.94;
  letter-spacing: -0.035em;
}

.eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1.5;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow--line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.eyebrow--line::before {
  content: "";
  width: 34px;
  height: 1px;
  background: currentColor;
  opacity: 0.55;
}

.section {
  padding: clamp(78px, 9.5vw, 150px) var(--pad);
}

.section--flush {
  padding-inline: 0;
}

.section-label {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

.serif {
  font-family: var(--serif);
}

.accent {
  color: var(--rust);
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--line-strong);
  transition: color 0.3s, border-color 0.3s;
}

.text-link:hover {
  color: var(--rust);
  border-color: var(--rust);
}

.arrow {
  display: inline-block;
  transition: transform 0.35s var(--ease);
}

.text-link:hover .arrow,
.btn:hover .arrow {
  transform: translate(3px, -3px);
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 15px;
  min-height: 48px;
  padding: 13px 22px;
  border: 1px solid var(--ink);
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}

.btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid {
  background: var(--ink);
  color: var(--paper);
}

.btn--solid:hover {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff9ef;
}

.btn--light {
  border-color: var(--line-light-strong);
  color: var(--paper);
}

.btn--light:hover {
  background: var(--paper);
  color: var(--ink);
  border-color: var(--paper);
}

.btn--rust {
  background: var(--rust);
  border-color: var(--rust);
  color: #fff9ef;
}

.btn--rust:hover {
  background: var(--ink);
  border-color: var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

.btn__dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------- Header ---------- */

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 120;
  color: var(--ink);
  transition: background 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}

.site-header::after {
  content: "";
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  bottom: 0;
  height: 1px;
  background: var(--line);
  opacity: 0;
  transition: opacity 0.4s;
}

.site-header.is-scrolled {
  background: rgba(239, 232, 220, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header.is-scrolled::after {
  opacity: 1;
}

.site-header--solid {
  background: rgba(239, 232, 220, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.site-header--solid::after {
  opacity: 1;
}

.header__inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  max-width: 1800px;
  min-height: var(--header-h);
  margin-inline: auto;
  padding: 12px var(--pad);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 13px;
  justify-self: start;
  color: inherit;
}

.brand__mark {
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid currentColor;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 0.08em;
  line-height: 1;
  padding-top: 2px;
  transition: background 0.3s, color 0.3s;
}

.brand__mark::after {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--rust);
}

.brand:hover .brand__mark {
  background: var(--ink);
  color: var(--paper);
}

.brand__name {
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.55;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.brand__name span {
  display: block;
  color: var(--muted);
}

.header__nav {
  display: flex;
  align-items: center;
  gap: clamp(20px, 2.4vw, 38px);
  justify-self: center;
}

.header__nav a {
  position: relative;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 8px 0;
}

.header__nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 2px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.4s var(--ease);
}

.header__nav a:hover::after {
  transform: scaleX(1);
  transform-origin: left;
}

.header__cta {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0 10px 16px;
  border-left: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.header__cta:hover {
  color: var(--rust);
}

.header__cta .arrow {
  font-size: 13px;
}

.burger {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  position: relative;
  z-index: 130;
  color: inherit;
}

.burger span {
  position: absolute;
  left: 8px;
  right: 8px;
  height: 1px;
  background: currentColor;
  transition: transform 0.4s var(--ease), top 0.4s var(--ease), opacity 0.3s;
}

.burger span:nth-child(1) {
  top: 17px;
}

.burger span:nth-child(2) {
  top: 26px;
}

.burger[aria-expanded="true"] span:nth-child(1) {
  top: 21px;
  transform: rotate(45deg);
}

.burger[aria-expanded="true"] span:nth-child(2) {
  top: 21px;
  transform: rotate(-45deg);
}

body.menu-open {
  overflow: hidden;
}

body.menu-open .site-header {
  color: var(--paper);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.menu-open .site-header::after {
  opacity: 0;
}

body.menu-open .brand__mark {
  border-color: var(--line-light-strong);
}

body.menu-open .header__cta {
  color: var(--paper);
  border-color: var(--line-light);
}

/* ---------- Mobile menu ---------- */

.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  padding: calc(var(--header-h) + 34px) var(--pad) 34px;
  background: var(--ink);
  color: var(--paper);
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.7s var(--ease-in-out), visibility 0.7s;
}

.mobile-menu.is-open {
  clip-path: inset(0);
  visibility: visible;
}

.mobile-menu__links {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-menu__links a {
  display: flex;
  align-items: baseline;
  gap: 18px;
  padding: 7px 0;
  font-family: var(--serif-display);
  font-size: clamp(38px, 9vw, 72px);
  line-height: 1;
  letter-spacing: -0.03em;
  border-bottom: 1px solid var(--line-light);
  transition: color 0.3s, padding-left 0.4s var(--ease);
}

.mobile-menu__links a:hover {
  color: #d9bda1;
  padding-left: 8px;
}

.mobile-menu__links span {
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  color: #9f9487;
}

.mobile-menu__foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 24px;
  padding-top: 26px;
  border-top: 1px solid var(--line-light);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #b7ab9c;
}

.mobile-menu__foot a:hover {
  color: var(--paper);
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  padding: 74px var(--pad) 0;
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
}

.footer__top {
  display: grid;
  grid-template-columns: 1.25fr 0.55fr 0.55fr;
  gap: 40px;
  padding-top: 34px;
  border-top: 1px solid var(--line-light);
}

.footer__brand {
  font-family: var(--serif);
  font-size: clamp(22px, 2.2vw, 32px);
  line-height: 1.2;
}

.footer__brand span {
  display: block;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9f9487;
  margin-top: 10px;
}

.footer__col h3 {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #9f9487;
  margin-bottom: 16px;
}

.footer__col a {
  display: block;
  font-size: 13px;
  line-height: 2;
  color: #d6cbbc;
  transition: color 0.25s;
}

.footer__col a:hover {
  color: var(--paper);
}

.footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 0 20px;
  margin-top: 48px;
  border-top: 1px solid var(--line-light);
  font-family: var(--mono);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8e8376;
}

.footer__word {
  margin: 20px -0.04em -0.16em;
  font-family: var(--serif-display);
  font-size: clamp(76px, 18.4vw, 310px);
  line-height: 0.72;
  letter-spacing: -0.055em;
  white-space: nowrap;
  color: var(--paper);
  opacity: 0.94;
  user-select: none;
}

/* ---------- Toast ---------- */

.toast-stack {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 400;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100vw - 44px));
}

.toast {
  padding: 14px 17px;
  background: var(--ink);
  color: var(--paper);
  border-left: 3px solid var(--rust);
  font-size: 12.5px;
  line-height: 1.5;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
  animation: toast-in 0.4s var(--ease);
}

.toast--ok {
  border-left-color: var(--olive);
}

.toast--error {
  border-left-color: #b43b2c;
}

.toast.is-leaving {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.3s, transform 0.3s;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Helpers ---------- */

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 140;
  width: 0;
  height: 2px;
  background: var(--rust);
  transition: width 0.1s linear;
}

/* ---------- Reveal ---------- */

[data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

[data-reveal-delay="1"] {
  transition-delay: 0.08s;
}

[data-reveal-delay="2"] {
  transition-delay: 0.16s;
}

[data-reveal-delay="3"] {
  transition-delay: 0.24s;
}

/* ---------- Responsive ---------- */

@media (max-width: 1080px) {
  .header__inner {
    grid-template-columns: 1fr auto;
  }

  .header__nav,
  .header__cta {
    display: none;
  }

  .burger {
    display: block;
  }
}

@media (max-width: 760px) {
  :root {
    --header-h: 68px;
  }

  .brand__name {
    font-size: 8px;
  }

  .brand__mark {
    width: 33px;
    height: 33px;
  }

  .footer__top {
    grid-template-columns: 1fr 1fr;
    gap: 30px;
  }

  .footer__brand {
    grid-column: 1 / -1;
  }

  .footer__word {
    font-size: clamp(66px, 21vw, 160px);
  }

  .toast-stack {
    right: 14px;
    bottom: 84px;
    left: 14px;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
