/* Палитра кабинета Hermes Worker. Значения и правила — в DESIGN.md. */
:root {
  color-scheme: dark;
  --canvas: #191715;
  --panel: #211f1c;
  --surface: #292622;
  --subtle: #25221f;
  --line: #403a33;
  --ink: #f3eee7;
  --muted: #b8afa4;
  --accent: #ffa466;
  --accent-brand: #ef7326;
  --accent-foreground: #21140b;
  --accent-hover: #ff8b43;
  --accent-soft: #412c1e;
  --accent-softer: #33271f;
  --ok: #86d3a2;
  --ok-soft: #243c2d;
  --info: #90bdf9;
  --info-soft: #263747;
  --danger: #ff8f7e;
  --danger-soft: #492d28;
  --danger-foreground: #291510;
  --shadow-card: 0 8px 24px -16px rgb(0 0 0 / 0.5);
  --shadow-float: 0 24px 60px -20px rgb(0 0 0 / 0.65);
  --font: Inter, system-ui, -apple-system, sans-serif;
  --page: 72rem;
  --measure: 40rem;
  --radius-lg: 0.5rem;
  --radius-xl: 0.75rem;
  --radius-card: 20px;
  --header-pad: 1.25rem;
  --gutter: 1.25rem;
}

[data-theme="light"] {
  color-scheme: light;
  --canvas: #d9d3cb;
  --panel: #ffffff;
  --surface: #ffffff;
  --subtle: #faf9f8;
  --line: #e6e1db;
  --ink: #23201e;
  --muted: #736c65;
  --accent: #ef7326;
  --accent-foreground: #ffffff;
  --accent-hover: #e5671a;
  --accent-soft: #fdece1;
  --accent-softer: #fef6f1;
  --ok: #1ba85e;
  --ok-soft: #e5f8ef;
  --info: #2f6fd0;
  --info-soft: #eaf2fd;
  --danger: #e65b49;
  --danger-soft: #fff0ec;
  --danger-foreground: #ffffff;
  --shadow-card: 0 1px 2px rgb(35 32 30 / 0.04), 0 8px 24px -16px rgb(35 32 30 / 0.18);
  --shadow-float: 0 24px 60px -20px rgb(35 32 30 / 0.32);
}

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

html {
  letter-spacing: 0;
  scrollbar-color: var(--line) var(--canvas);
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
  letter-spacing: 0;
}

::selection {
  background: var(--accent-soft);
  color: var(--ink);
}

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

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0.75rem;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  background: var(--panel);
  color: var(--ink);
  text-decoration: none;
  border-radius: var(--radius-lg);
}

.skip:focus {
  position: fixed;
  z-index: 3;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  overflow: visible;
  clip: auto;
  box-shadow: var(--shadow-card);
}

.site-header,
main,
.site-footer {
  width: min(var(--page), calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
}

.site-header {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.75rem 1.25rem;
  padding: var(--header-pad) 0;
}

.site-header .button {
  justify-self: end;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.15rem 1.75rem;
}

.site-nav a {
  color: var(--muted);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  padding: 0.35rem 0.1rem;
  border-radius: var(--radius-lg);
}

.site-nav a:hover {
  color: var(--ink);
}

@media (max-width: 959px) {
  .site-header {
    grid-template-columns: 1fr auto;
  }

  .site-nav {
    order: 3;
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--ink);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
}

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

.brand-mark {
  position: relative;
  flex: none;
  width: 48px;
  height: 48px;
}

.brand-still,
.brand-draw {
  display: block;
  width: 48px;
  height: 48px;
}

.brand-draw {
  position: absolute;
  inset: 0;
  display: none;
  overflow: visible;
}

.brand-outline,
.brand-fill {
  clip-path: inset(0 0 100% 0);
}

@media (prefers-reduced-motion: no-preference) {
  .brand-still {
    visibility: hidden;
  }

  .brand-draw {
    display: block;
  }

  .brand-outline {
    animation:
      brand-contour 1.2s linear forwards,
      brand-contour-fade 0.3s ease 1.7s forwards;
  }

  .brand-fill {
    animation: brand-fill 0.7s cubic-bezier(0.4, 0, 0.2, 1) 1.15s forwards;
  }
}

@keyframes brand-contour {
  to { clip-path: inset(0 0 0 0); }
}

@keyframes brand-contour-fade {
  to { opacity: 0; }
}

@keyframes brand-fill {
  to { clip-path: inset(0 0 0 0); }
}

.brand-name {
  white-space: nowrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-xl);
  background: var(--accent-brand);
  color: var(--accent-foreground);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  text-decoration: none;
  transition: background-color 150ms ease-out;
}

.button:visited {
  color: var(--accent-foreground);
}

.button:hover {
  background: var(--accent-hover);
  color: var(--accent-foreground);
}

.thread-intro {
  max-width: var(--measure);
}

.hero,
.band,
.thread,
.path,
.final {
  scroll-margin-top: 1rem;
}

.hero {
  display: grid;
  gap: 2rem;
  padding: 1rem 0 3rem;
}

.hero-copy {
  max-width: 36rem;
}

.hero-copy p {
  max-width: 34rem;
}

.hero-soft {
  color: var(--muted);
}

.hero-card {
  width: min(100%, 400px);
  aspect-ratio: 4 / 5;
  margin: 0;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-float);
}

.hero-card {
  position: relative;
}

.hero-card img,
.hero-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hero-card video {
  position: absolute;
  inset: 0;
  visibility: hidden;
}

.hero-card video.is-on {
  visibility: visible;
}

@media (min-width: 960px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 400px);
    gap: clamp(2rem, 4vw, 3.5rem);
    align-items: center;
    padding: 2rem 0 4rem;
  }
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2.5rem, 7vw, 4.25rem);
  font-weight: 600;
  line-height: 1.06;
  text-wrap: balance;
}

h1 em {
  font-style: normal;
  color: var(--accent);
}

h1:focus {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

h2 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.5rem, 3vw, 1.75rem);
  font-weight: 600;
  line-height: 1.2;
}

p {
  margin: 0 0 0.55rem;
  color: var(--ink);
}

.hero .button {
  display: inline-flex;
  min-width: 12rem;
}

.hero-copy .hero-intro {
  margin: 0 0 1.5rem;
  font-size: 1.125rem;
}

.hero-copy .hero-examples {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin: 1.5rem 0 0;
  color: var(--muted);
  font-size: 0.875rem;
}

.hero-examples span {
  animation: hero-example 3s ease-in-out both;
}

.hero-examples span:nth-child(2) {
  animation-delay: 3s;
}

.hero-examples span:nth-child(3) {
  animation-delay: 6s;
}

@keyframes hero-example {
  0%, 100% { color: var(--muted); }
  35%, 65% { color: var(--accent); }
}

.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  padding: 2rem 0 2.5rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-brand {
  color: var(--ink);
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

.footer-nav a {
  color: var(--muted);
  text-decoration: none;
}

.footer-nav a:hover,
.footer-brand:hover {
  color: var(--accent);
}

.footer-copy {
  flex-basis: 100%;
  margin: 0;
}

@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;
  }
}
