@import url("./tokens.css");

.topbar {
  background: #000;
  color: #e8e8e8;
  font-size: 12px;
  letter-spacing: 0.06em;
  min-height: var(--topbar-h);
}

.topbar-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  min-height: var(--topbar-h);
}

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

.topbar a:hover { color: var(--color-primary); }

.topbar-note {
  margin-left: auto;
  color: #fff;
  font-weight: 500;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: #fff;
  border-bottom: 1px solid #000;
  transition: box-shadow var(--ease);
}

.site-header.is-solid {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px 16px;
  min-height: var(--header-h);
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  text-decoration: none;
  color: inherit;
  flex: 0 1 auto;
  min-width: 0;
}

.brand img {
  height: 44px;
  width: auto;
  max-width: min(168px, 46vw);
}

.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 0;
  margin-left: auto;
}

.nav ul {
  display: flex;
  gap: 6px 18px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.nav a[aria-current="page"] { color: var(--color-primary); }

.nav .btn {
  text-transform: none;
  letter-spacing: 0.04em;
  font-weight: 500;
}

.header-phone {
  color: inherit;
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.header-cta {
  display: none;
  flex-shrink: 0;
}

.nav-toggle {
  display: none;
  box-sizing: border-box;
  width: 44px;
  height: 44px;
  padding: 0;
  margin: 0;
  background: var(--color-paper);
  border: 1px solid #000;
  border-radius: 0;
  cursor: pointer;
  flex-shrink: 0;
  position: relative;
  z-index: 2;
  color: var(--color-ink);
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  appearance: none;
  -webkit-appearance: none;
  overflow: visible;
}

.nav-toggle span {
  display: block;
  height: 2px;
  width: 18px;
  margin: 0;
  background: currentColor;
  border-radius: 1px;
  flex-shrink: 0;
}

.legal-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-bar { display: none; }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1.18;
  margin: 0 0 12px;
}

h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 500; }
h2 { font-size: clamp(24px, 2.5vw, 32px); }
h3 { font-size: 18px; letter-spacing: -0.01em; }

.kicker {
  margin: 0 0 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 500;
  color: #000;
  display: flex;
  align-items: center;
  gap: 12px;
}

.kicker::before {
  content: "";
  width: 22px;
  height: 1px;
  background: #000;
  flex-shrink: 0;
}

.lede {
  margin: 0;
  max-width: 52ch;
  color: var(--color-steel);
}

.meta {
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-steel);
}

.text-link {
  color: var(--color-primary);
  font-weight: 600;
  text-underline-offset: 3px;
}

.section {
  padding: var(--section-y) 0;
  position: relative;
}

.section-muted {
  background:
    linear-gradient(rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.05) 1px, transparent 1px),
    var(--color-muted);
  background-size: 24px 24px, 24px 24px, auto;
}

.section-ink {
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    #000;
  background-size: 24px 24px, 24px 24px, auto;
  color: var(--color-paper);
}

.section-ink .lede,
.section-ink .kicker { color: rgba(255, 255, 255, 0.72); }

.section-ink .kicker::before { background: #fff; }

.section-ink .section-head::before,
.section-ink .section-head::after { border-color: #fff; background: #000; }
.section-ink .section-head::before { background: #fff; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
  position: relative;
  padding-left: 12px;
}

.section-head::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 1px;
  background: #000;
}

.section-head::after {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 8px;
  height: 8px;
  border: 1px solid #000;
  transform: rotate(45deg);
  background: #fff;
}

/* hero compact */
.hero {
  position: relative;
  min-height: 360px;
  display: grid;
  align-items: center;
  color: var(--color-white);
  isolation: isolate;
  overflow: hidden;
  max-width: 100%;
}

.hero-media {
  position: absolute;
  inset: 0;
  z-index: -1;
}

.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 58% 58%;
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.08) 100%);
}

.hero-deco {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.hero-slab {
  position: absolute;
  inset: 0 46% 0 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.07) 1px, transparent 1px),
    #000;
  background-size: 28px 28px, 28px 28px, auto;
}

.hero-slab::after {
  content: "";
  position: absolute;
  top: 0;
  right: -56px;
  width: 56px;
  bottom: 0;
  background: linear-gradient(90deg, #000, transparent);
}

.plot-scale {
  position: absolute;
  z-index: 1;
  pointer-events: none;
  opacity: 0.4;
}

.plot-scale-y {
  left: 10px;
  top: 20px;
  bottom: 20px;
  width: 11px;
  background: repeating-linear-gradient(
    to bottom,
    #fff 0 1px,
    transparent 1px 7px,
    #fff 7px 8px,
    transparent 8px 28px
  );
}

.plot-scale-x {
  left: 24px;
  right: 48%;
  bottom: 10px;
  height: 11px;
  background: repeating-linear-gradient(
    to right,
    #fff 0 1px,
    transparent 1px 7px,
    #fff 7px 8px,
    transparent 8px 28px
  );
}

.plot-tag {
  position: absolute;
  z-index: 1;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
}

.plot-tag-a {
  left: 44px;
  bottom: 22px;
}

.plot-tag-b {
  left: 8px;
  top: 50%;
  writing-mode: vertical-rl;
  transform: translateY(-50%) rotate(180deg);
  letter-spacing: 0.32em;
  font-size: 9px;
}

.plot-cross {
  position: absolute;
  right: 22%;
  top: 36%;
  width: 64px;
  height: 64px;
  z-index: 1;
  border: 1px solid #000;
  border-radius: 50%;
}

.plot-cross::before,
.plot-cross::after {
  content: "";
  position: absolute;
  background: #000;
}

.plot-cross::before {
  left: 50%;
  top: 0;
  width: 1px;
  height: 100%;
  transform: translateX(-50%);
}

.plot-cross::after {
  top: 50%;
  left: 0;
  height: 1px;
  width: 100%;
  transform: translateY(-50%);
}

.callout {
  position: absolute;
  z-index: 1;
  width: 28px;
  height: 28px;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.08em;
  display: grid;
  place-items: center;
}

.callout::before {
  content: "";
  position: absolute;
  height: 1px;
  width: 42px;
  background: #000;
  top: 50%;
  right: calc(100% + 2px);
}

.callout-a { right: 16%; top: 20%; }
.callout-b { right: 29%; bottom: 24%; }

.mark {
  position: absolute;
  width: 76px;
  height: 76px;
  border: 1.5px solid #000;
  z-index: 1;
}

.mark-tl {
  top: 20px;
  left: 20px;
  border-color: #fff;
  border-width: 1.5px 0 0 1.5px;
}

.mark-tr {
  top: 28px;
  right: 32px;
  border-width: 1.5px 1.5px 0 0;
}

.mark-br {
  right: 32px;
  bottom: 28px;
  border-width: 0 1.5px 1.5px 0;
}

.hero-schema {
  display: none;
}

.hero-schema .draw,
.hero-pipe .draw {
  stroke-dasharray: 1600;
  stroke-dashoffset: 1600;
  animation: draw-pipe 6s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.hero-schema .delay,
.hero-pipe .delay { animation-delay: 0.7s; }

.hero-pipe {
  position: absolute;
  right: -4%;
  top: 10%;
  width: min(56vw, 620px);
  opacity: 0.42;
  mix-blend-mode: multiply;
}

.hero-pipe .joint {
  opacity: 0;
  animation: joint-in 1.2s ease 2.8s forwards;
}

.hero::after { display: none; }

.hero .container { padding-block: 36px 32px; position: relative; z-index: 1; }
.hero h1 { max-width: 16ch; }
.hero .lede { color: rgba(255, 255, 255, 0.78); margin-bottom: 18px; font-size: 17px; max-width: 42ch; }

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.hero-cta .btn { min-width: 0; white-space: normal; text-align: center; }

.hero .btn-ghost {
  color: var(--color-white);
  border-color: rgba(255, 255, 255, 0.55);
  background: transparent;
}

.hero .btn-primary {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.22), 0 12px 28px rgba(61, 170, 98, 0.28);
  animation: none;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  background: transparent;
}

/* stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: var(--color-paper);
  border: 1px solid #000;
  counter-reset: plot;
}

.stat {
  padding: 14px 16px 12px;
  border-right: 1px solid #000;
  text-align: left;
  position: relative;
}

.stat::before {
  counter-increment: plot;
  content: "0" counter(plot);
  position: absolute;
  top: 12px;
  right: 14px;
  font-size: 10px;
  letter-spacing: 0.16em;
  color: #000;
  opacity: 0.28;
}

.stat:last-child { border-right: 0; }

.stat b {
  display: block;
  font-size: 32px;
  font-weight: 500;
  color: var(--color-ink);
  letter-spacing: -0.04em;
}

.stat span { color: var(--color-steel); font-size: 13px; overflow-wrap: anywhere; }

.container:has(> .stats) {
  margin-top: 0;
}

.container:has(> .stats) + .section {
  padding-top: 28px;
}

.stat::after {
  content: "";
  display: block;
  width: 28px;
  height: 1px;
  margin-top: 10px;
  background: #000;
  transform: scaleX(0);
  transform-origin: left;
  animation: bar-in 1.2s var(--ease) forwards 0.15s;
}

/* service cards */
.svc-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.svc-card {
  background: var(--color-white);
  border: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: grid;
  grid-template-rows: auto auto;
  box-shadow: none;
  transition: background 400ms var(--ease);
}

.svc-card:hover {
  transform: none;
  box-shadow: none;
  background: var(--color-muted);
}

.svc-card figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  height: 168px;
}

.svc-card img {
  width: 100%;
  height: 168px;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}

.svc-card figure::before,
.svc-card figure::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 1;
  pointer-events: none;
}

.svc-card figure::before {
  left: 8px;
  top: 8px;
  border-left: 1px solid #fff;
  border-top: 1px solid #fff;
}

.svc-card figure::after {
  right: 8px;
  bottom: 8px;
  display: block;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
  background: none;
  transform: none;
}

.svc-card:hover img { transform: scale(1.04); }

.svc-ico {
  position: absolute;
  left: 12px;
  bottom: 12px;
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: #000;
  color: #fff;
  display: grid;
  place-items: center;
}

.svc-ico svg { width: 18px; height: 18px; }

.svc-card div { padding: 12px 14px 14px; }
.svc-card h3 { margin-bottom: 6px; overflow-wrap: anywhere; font-weight: 500; }
.svc-card p { margin: 0; color: var(--color-steel); font-size: 14px; line-height: 1.5; }

/* ticker */
.ticker {
  overflow: hidden;
  max-width: 100%;
  border-block: 1px solid #000;
  background: #000;
  padding-block: 0;
}

.ticker-track {
  display: flex;
  gap: 0;
  width: max-content;
  animation: ticker 58s linear infinite;
}

.ticker img {
  width: 220px;
  height: 132px;
  object-fit: cover;
  border-radius: 0;
  border: 0;
  border-right: 1px solid #000;
  outline: none;
  box-shadow: none;
}

.ticker:hover .ticker-track { animation-play-state: paused; }

.word-rail {
  background: #000;
  color: #fff;
  overflow: hidden;
  max-width: 100%;
  padding: 8px 0;
  border-bottom: 0;
  position: relative;
}

.word-rail::before,
.word-rail::after {
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  width: 8px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  z-index: 1;
  pointer-events: none;
}

.word-rail::before { left: 10px; border-right: 0; }
.word-rail::after { right: 10px; border-left: 0; }

.word-rail-track {
  display: flex;
  gap: 32px;
  width: max-content;
  animation: ticker 64s linear infinite;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.word-rail b { color: #fff; font-weight: 500; white-space: nowrap; }
.word-rail span { color: rgba(255, 255, 255, 0.28); white-space: nowrap; }

/* about */
.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: stretch;
  overflow: hidden;
  padding-bottom: 0;
}

.about-frame {
  position: relative;
  height: 100%;
  min-height: 280px;
}

.about-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  border-radius: 0;
}

.about-frame::after,
.about-frame::before {
  display: none;
}

.plot-photo {
  position: relative;
}

.plot-photo img {
  display: block;
  border: 1px solid #000;
}

.plot-caption {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  background: #000;
  color: #fff;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 6px 10px;
  pointer-events: none;
}

.photo-schema {
  position: absolute;
  inset: 12px;
  width: calc(100% - 24px);
  height: calc(100% - 24px);
  opacity: 0.28;
  pointer-events: none;
  mix-blend-mode: multiply;
}

.plot-photo .mark {
  width: 28px;
  height: 28px;
}

.plot-photo .mark-tl {
  top: 8px;
  left: 8px;
  border-color: #fff;
}

.plot-photo .mark-tr {
  top: 8px;
  right: 8px;
  border-color: #fff;
}

.plot-photo .mark-br {
  bottom: 8px;
  right: 8px;
  border-color: #fff;
}

.about ul {
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.about li {
  display: flex;
  gap: 10px;
  margin: 8px 0;
  color: var(--color-steel);
}

.about li::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: 8px;
  border-radius: 0;
  background: #000;
  flex-shrink: 0;
}

/* process */
.steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  counter-reset: step;
  position: relative;
  border-top: 1px solid #000;
  border-left: 1px solid #000;
}

.steps::before { display: none; }

.step {
  background: var(--color-white);
  border: 0;
  border-right: 1px solid #000;
  border-bottom: 1px solid #000;
  border-radius: 0;
  padding: 18px 16px 16px;
  position: relative;
  z-index: 1;
  box-shadow: none;
}

.step::before {
  counter-increment: step;
  content: "0" counter(step);
  display: block;
  color: #000;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.2em;
  margin-bottom: 10px;
}

.step::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 16px;
  width: 7px;
  height: 7px;
  border: 1px solid #000;
  transform: rotate(45deg);
  background: #fff;
}

.step p { margin: 6px 0 0; color: var(--color-steel); font-size: 14px; }

/* gallery mosaic */
.mosaic {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 176px;
  gap: 1px;
  background: #000;
  border: 1px solid #000;
}

.mosaic a {
  position: relative;
  overflow: hidden;
  border-radius: 0;
  color: #fff;
  text-decoration: none;
  border: 0;
}

.mosaic a::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  z-index: 2;
  pointer-events: none;
}

.mosaic a:first-child { grid-column: span 2; grid-row: span 2; }

.mosaic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms ease;
}

.mosaic a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 40%, rgba(12, 16, 20, 0.72));
}

.mosaic a:hover img { transform: scale(1.03); }

.mosaic span {
  position: absolute;
  left: 12px;
  bottom: 12px;
  z-index: 1;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

/* faq */
.faq {
  display: grid;
  gap: 0;
  border: 1px solid #000;
}

.faq details {
  border: 0;
  border-bottom: 1px solid #000;
  border-radius: 0;
  background: var(--color-white);
  padding: 2px 18px 2px 28px;
  box-shadow: none;
  position: relative;
}

.faq details:last-child { border-bottom: 0; }

.faq details::before {
  content: "";
  position: absolute;
  left: 10px;
  top: 22px;
  width: 7px;
  height: 7px;
  border: 1px solid #000;
  transform: rotate(45deg);
  background: #fff;
}

.faq summary {
  cursor: pointer;
  font-weight: 500;
  min-height: 48px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  list-style: none;
  padding: 12px 0;
  min-width: 0;
}

.faq summary::after {
  content: "+";
  margin-left: auto;
  color: #000;
  font-size: 20px;
  line-height: 1;
  flex-shrink: 0;
  transition: transform 220ms ease;
}

.faq details[open] summary::after {
  content: "–";
}

.faq summary::-webkit-details-marker { display: none; }

.faq details[open] summary { color: var(--color-ink); }

.faq p {
  margin: 0 0 14px;
  color: var(--color-steel);
}

/* emergency compact */
.emergency {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.22);
  padding: 20px 22px;
}

.emergency a.btn { flex-shrink: 1; max-width: 100%; white-space: normal; text-align: center; }

.ink-schema {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  width: min(46%, 340px);
  height: auto;
  opacity: 0.22;
  pointer-events: none;
  z-index: 0;
}

.emergency > div,
.emergency > a { position: relative; z-index: 1; }

/* inner */
.page-band {
  height: clamp(88px, 12vw, 128px);
  overflow: hidden;
  position: relative;
  background: #000;
}

.page-band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.page-band::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 0, 0, 0.55), transparent 58%);
  background-size: 28px 28px, 28px 28px, auto;
  pointer-events: none;
}

.plot-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}

.page-band .mark {
  border-color: #fff;
  width: 42px;
  height: 42px;
}

.page-band .mark-tl { top: 14px; left: 14px; }
.page-band .mark-tr { top: 14px; right: 14px; }
.page-band .mark-br { bottom: 14px; right: 14px; }

.page-band .plot-tag {
  color: rgba(255, 255, 255, 0.7);
}

.page-band .plot-tag-a {
  left: 18px;
  bottom: 14px;
  writing-mode: horizontal-tb;
  transform: none;
}

.band-schema {
  position: absolute;
  right: 4%;
  top: 18%;
  height: 64%;
  width: auto;
  max-width: 48%;
  opacity: 0.45;
}

.page-intro { padding-block: 24px 8px; }
.page-intro h1 { max-width: 18ch; }

.jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 10px 0 4px;
  min-width: 0;
  width: max-content;
  max-width: 100%;
  border: 1px solid #000;
  border-right: 0;
}

.jump a {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid #000;
  border-radius: 0;
  text-decoration: none;
  color: inherit;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  white-space: nowrap;
  background: var(--color-white);
  transition: color var(--ease), background var(--ease);
}

.jump a:hover {
  color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
}

.chapter {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  align-items: start;
  padding-block: 20px;
  border-top: 1px solid #000;
  position: relative;
  scroll-margin-top: calc(var(--header-h) + 28px);
  overflow: hidden;
}

.chapter::before {
  content: attr(data-n);
  position: absolute;
  left: 0;
  top: 28px;
  width: 280px;
  text-align: center;
  font-size: 68px;
  font-weight: 700;
  letter-spacing: -0.06em;
  color: rgba(0, 0, 0, 0.08);
  line-height: 1;
  pointer-events: none;
  z-index: 0;
}

.chapter > div { position: relative; z-index: 1; }

.chapter .plot-photo::before,
.chapter .plot-photo::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  z-index: 2;
  pointer-events: none;
}

.chapter .plot-photo::before {
  left: 8px;
  top: 8px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
}

.chapter .plot-photo::after {
  right: 8px;
  bottom: 8px;
  border-right: 1px solid #fff;
  border-bottom: 1px solid #fff;
}

.chapter img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: 0;
}

.chapter ul {
  margin: 10px 0 16px;
  padding-left: 1.1em;
  color: var(--color-steel);
  columns: 2;
}

.chapter li { margin: 4px 0; }

.prose {
  max-width: var(--measure);
  padding-block: 24px 40px;
}

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  margin: 16px 0 24px;
}

.prose th,
.prose td {
  border: 1px solid #000;
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.prose th { background: var(--color-muted); font-weight: 500; }

.prose-wide { max-width: 86ch; }
.prose table { display: block; overflow-x: auto; }
.prose table { display: block; overflow-x: auto; }

.prose h2 { margin-top: 28px; font-size: 20px; }

.contact-grid {
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 24px;
  padding-bottom: 28px;
}

.facts p { margin: 0 0 12px; }
.facts a { color: inherit; }

.contact-visual {
  position: relative;
  margin-bottom: 18px;
  overflow: hidden;
  padding-bottom: 0;
  border: 1px solid #000;
}

.contact-visual img {
  width: 100%;
  height: 160px;
  object-fit: cover;
  border-radius: 0;
  border: 0;
}

.contact-visual::after { display: none; }

.hours-card {
  margin: 0;
  position: relative;
  background: var(--color-white);
  border: 0;
  border-top: 1px solid #000;
  border-radius: 0;
  padding: 14px 16px;
  box-shadow: none;
}

.hours-card strong {
  display: block;
  color: #000;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 4px;
}

.hours-card p { margin: 0; font-size: 14px; }

.lead-form { display: grid; gap: 12px; }
.lead-form label { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }

.lead-form input,
.lead-form select,
.lead-form textarea {
  font: inherit;
  font-size: 16px;
  font-weight: 400;
  padding: 12px 14px;
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  background: var(--color-white);
  transition: border-color var(--ease), box-shadow var(--ease);
}

.lead-form input:focus,
.lead-form select:focus,
.lead-form textarea:focus {
  outline: none;
  border-color: #000;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.12);
}

.form-purpose { font-size: 14px; color: var(--color-steel); margin: 0; }
.form-consent {
  display: flex !important;
  gap: 10px;
  align-items: flex-start;
  font-weight: 400 !important;
}

.form-consent input {
  width: 18px;
  height: 18px;
  margin-top: 3px;
  flex-shrink: 0;
}

#poptavka { scroll-margin-top: calc(var(--header-h) + 28px); }

.map-lazy {
  margin: 0 0 32px;
  padding: 0;
  background: var(--color-muted);
  border: 1px solid #000;
  border-radius: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 12px 0 16px;
  min-width: 0;
  border: 1px solid #000;
  border-right: 0;
  width: max-content;
  max-width: 100%;
}

.filters button {
  min-height: 40px;
  padding: 0 16px;
  border: 0;
  border-right: 1px solid #000;
  background: var(--color-white);
  border-radius: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  cursor: pointer;
}

.filters button.is-on {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.gallery {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #000;
  border: 1px solid #000;
  padding-bottom: 0;
  margin-bottom: 32px;
}

.gallery a {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 0;
  position: relative;
  border: 0;
}

.gallery a::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 7px;
  width: 11px;
  height: 11px;
  border-top: 1px solid #fff;
  border-left: 1px solid #fff;
  z-index: 1;
  pointer-events: none;
}

.gallery a.is-wide { grid-column: span 2; aspect-ratio: 16 / 9; }

.gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 900ms var(--ease);
}

.gallery a:hover img { transform: scale(1.03); }

.lightbox {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  z-index: 100;
  background: rgba(22, 28, 34, 0.94);
  display: grid;
  place-items: center;
  padding: 64px 56px 72px;
}

.lightbox[hidden] { display: none; }

body.lightbox-open {
  overflow: hidden;
}
body.lightbox-open .mobile-bar { display: none !important; }
body.lightbox-open .site-header,
body.lightbox-open .topbar { visibility: hidden; }

.lightbox img {
  max-width: min(1100px, 100%);
  max-height: 72svh;
  object-fit: contain;
}

.lightbox-close,
.lightbox-prev,
.lightbox-next {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  border: 0;
  background: var(--color-paper);
  color: var(--color-ink);
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  z-index: 1;
}

.lightbox-close { top: 16px; right: 16px; }
.lightbox-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox-next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox p {
  position: absolute;
  bottom: 16px;
  left: 16px;
  right: 16px;
  text-align: center;
  color: var(--color-paper);
  margin: 0;
  font-size: 14px;
  pointer-events: none;
}

.site-footer {
  padding: 36px 0 20px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    #000;
  background-size: 24px 24px, 24px 24px, auto;
  color: #c8c8c8;
  border-top: 0;
  position: relative;
}

.site-footer::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  top: 18px;
  height: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  border-left: 1px solid rgba(255, 255, 255, 0.2);
  border-right: 1px solid rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.site-footer a { color: inherit; }

.footer-brand {
  font-size: 22px;
  font-weight: 500;
  letter-spacing: 0.12em;
  margin: 0 0 10px;
  color: #fff;
}

.site-footer h2 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin: 6px 0; overflow-wrap: anywhere; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--color-line-on-ink);
  font-size: 13px;
}

.footer-mescon img { height: 18px; width: auto; opacity: 0.85; }

.err { padding-block: 64px 80px; max-width: 28rem; }
.err .btn-ghost { border-color: #000; }

.cookie-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 85;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--color-paper);
  border: 1px solid var(--color-line);
  border-radius: var(--radius);
  box-shadow: 0 12px 28px rgba(32, 40, 48, 0.12);
}

.cookie-bar p { margin: 0; max-width: 52ch; }

.cookie-bar-actions { display: flex; flex-wrap: wrap; gap: 8px; }

body.has-mobile-bar .cookie-bar { bottom: 88px; }

/* motion helpers — content stays painted; enter motion is in motion.css */
[data-reveal].is-in {
  animation: rise 0.7s var(--ease) both;
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

@keyframes draw-pipe {
  to { stroke-dashoffset: 0; }
}

@keyframes ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

@keyframes joint-in {
  to { opacity: 1; }
}

@keyframes bar-in {
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-schema .draw,
  .hero-pipe .draw,
  .hero-pipe .joint,
  .stat::after,
  [data-reveal] {
    animation: none !important;
    opacity: 1;
    transform: none;
    stroke-dashoffset: 0;
  }
  .ticker-track,
  .word-rail-track { animation: none; }
}

@media (max-width: 1100px) {
  .svc-cards { grid-template-columns: repeat(3, 1fr); }
  .header-phone { display: none; }
}

@media (max-width: 1100px) and (min-width: 900px) {
  .svc-card:nth-child(5) {
    grid-column: span 2;
    grid-template-columns: 220px 1fr;
    grid-template-rows: auto;
  }
  .svc-card:nth-child(5) figure,
  .svc-card:nth-child(5) img { height: 148px; }
}

@media (max-width: 1023px) {
  .topbar-note { display: none; }
  .hero { min-height: 0; }
  .hero .container { padding-block: 28px 28px; }
  .hero h1 { max-width: 18ch; }
  .hero-media img { object-position: 50% 48%; }
  .hero-slab {
    inset: 0;
    background:
      linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      rgba(0, 0, 0, 0.72);
    background-size: 28px 28px, 28px 28px, auto;
  }
  .hero-slab::after { display: none; }
  .mark { border-color: #fff; width: 48px; height: 48px; }
  .hero-pipe,
  .hero-schema,
  .plot-scale,
  .plot-cross,
  .callout,
  .plot-tag { display: none; }
  .header-cta {
    display: inline-flex;
    margin-left: auto;
  }
  .nav-toggle {
    display: flex !important;
    margin-left: 0;
  }
  .nav {
    display: none;
    position: fixed;
    z-index: 45;
    left: 0;
    right: 0;
    top: calc(var(--topbar-h) + var(--header-h));
    bottom: 0;
    margin-left: 0;
    background: var(--color-paper);
    color: var(--color-ink);
    padding: 16px 20px 96px;
    flex-direction: column;
    align-items: stretch;
    border-bottom: 1px solid var(--color-line);
    overflow: auto;
  }
  .nav.is-open { display: flex; }
  .nav ul { flex-direction: column; }
  .nav a { white-space: normal; min-height: 44px; display: inline-flex; align-items: center; }
  .nav-cta { justify-content: center; margin-top: 8px; }
  body.nav-open { overflow: hidden; }
  .header-phone { display: inline-flex; min-height: 44px; align-items: center; }
  .stats { grid-template-columns: 1fr 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .stat { border-bottom: 1px solid #000; }
  .stat:nth-child(2n) { border-right: 0; }
  .stat:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 899px) {
  .svc-cards,
  .stats,
  .steps,
  .contact-grid,
  .footer-grid,
  .mosaic {
    grid-template-columns: 1fr 1fr;
  }
  .steps::before { display: none; }
  .mosaic { grid-auto-rows: 148px; }
  .mosaic a:first-child { grid-column: span 2; }
  .svc-card:last-child {
    grid-column: span 2;
    grid-template-columns: 200px 1fr;
    grid-template-rows: auto;
  }
  .svc-card:last-child figure,
  .svc-card:last-child img { height: 148px; }
  .chapter { grid-template-columns: 1fr; }
  .chapter::before { display: none; }
  .chapter ul { columns: 1; }
  .chapter img { height: 220px; }
  .about { grid-template-columns: 1fr; }
  .about-frame { height: 240px; min-height: 240px; }
  .about-frame img { height: 100%; }
  .about-frame::before,
  .about-frame::after { display: none; }
  .stat:nth-child(2n) { border-right: 0; }
  .gallery { grid-template-columns: 1fr 1fr; }
  .ink-schema,
  .band-schema,
  .photo-schema,
  .plot-caption { display: none; }
  .contact-visual::after { display: none; }
  .section-head { padding-left: 12px; }
}

@media (max-width: 767px) {
  .topbar-inner {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .topbar a {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .topbar a[href^="mailto"] { display: none; }
  .header-cta { display: none; }
  .nav-toggle { margin-left: auto; }
  .brand img { height: 36px; max-width: min(148px, 58vw); }
  .mobile-bar {
    display: flex;
    gap: 8px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--color-paper) 92%, transparent);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--color-line);
  }
  .mobile-bar .btn {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  body.has-mobile-bar { padding-bottom: calc(120px + env(safe-area-inset-bottom, 0px)); }
  body.lightbox-open .mobile-bar { display: none; }
  body.lightbox-open .site-header,
  body.lightbox-open .topbar { visibility: hidden; }
  .mosaic,
  .gallery { grid-template-columns: 1fr; }
  .mosaic a:first-child,
  .gallery a.is-wide { grid-column: auto; grid-row: auto; }
  .svc-cards, .steps, .footer-grid, .contact-grid {
    grid-template-columns: 1fr;
  }
  .hero .container { padding-block: 24px; }
  .hero-cta { flex-direction: column; align-items: stretch; }
  .hero-cta .btn { width: 100%; }
  .hero-slab {
    background:
      linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      linear-gradient(90deg, rgba(255, 255, 255, 0.06) 1px, transparent 1px),
      rgba(0, 0, 0, 0.78);
    background-size: 24px 24px, 24px 24px, auto;
  }
  .chip { padding: 0 10px; letter-spacing: 0.12em; }
  .section { padding: 32px 0; }
  .section-head { align-items: flex-start; gap: 8px; }
  h1 { font-size: 28px; }
  .lightbox { padding: 56px 12px 168px; }
  .lightbox-prev,
  .lightbox-next { top: auto; bottom: 88px; transform: none; }
  .lightbox p { bottom: 140px; }
  .map-lazy { margin-bottom: 24px; }
  .word-rail { padding: 8px 0; }
  .emergency { padding: 16px; }
  .emergency a.btn { width: 100%; }
  .svc-card:last-child,
  .svc-card:nth-child(5) {
    grid-column: auto;
    grid-template-columns: none;
    grid-template-rows: auto auto;
  }
  .svc-card:last-child figure,
  .svc-card:last-child img,
  .svc-card figure,
  .svc-card img { height: 148px; }
  .jump {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    border-right: 1px solid #000;
  }
  .jump a {
    border-right: 0;
    border-bottom: 1px solid #000;
    white-space: normal;
    justify-content: center;
    text-align: center;
    font-size: 12px;
    padding: 8px 8px;
    min-height: 44px;
  }
  .jump a:last-child {
    grid-column: span 2;
    border-bottom: 0;
  }
  .filters { width: 100%; }
}

@media (max-width: 389px) {
  .gallery, .mosaic { grid-template-columns: 1fr; }
  .gallery a.is-wide, .mosaic a:first-child { grid-column: auto; grid-row: auto; }
  .container { padding-inline: 14px; }
  .hero-cta .btn { width: 100%; }
  .jump a { white-space: normal; }
  .hero h1 { font-size: 26px; }
  .stat { padding: 16px 14px 14px; }
  .jump { width: 100%; }
  .jump a { white-space: normal; }
}

@media (max-height: 740px) and (min-width: 1024px) {
  .hero { min-height: 0; }
  .hero .container { padding-block: 32px 36px; }
}
