:root {
  --ink: #101010;
  --graphite: #1b1c1a;
  --steel: #6f7670;
  --paper: #f4f1ec;
  --paper-strong: #fffaf3;
  --line: rgba(16, 16, 16, 0.16);
  --line-light: rgba(255, 250, 243, 0.18);
  --walnut: #8a5f3d;
  --olive: #657164;
  --shadow: 0 24px 70px rgba(16, 16, 16, 0.18);
  --header-height: 76px;
  --radius: 8px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0;
}

body.is-locked {
  overflow: hidden;
}

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

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

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

.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  z-index: 20;
  top: 0;
  left: 0;
  right: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  min-height: var(--header-height);
  padding: 0 clamp(20px, 4vw, 48px);
  color: var(--paper-strong);
  background: linear-gradient(180deg, rgba(16, 16, 16, 0.84), rgba(16, 16, 16, 0.32));
  border-bottom: 1px solid rgba(255, 250, 243, 0.12);
  transition: background 180ms ease, border-color 180ms ease;
}

.site-header.is-scrolled {
  background: rgba(16, 16, 16, 0.92);
  border-color: rgba(255, 250, 243, 0.18);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
}

.brand-mark {
  font-size: clamp(1.15rem, 2vw, 1.4rem);
  font-weight: 800;
  text-transform: uppercase;
}

.brand-text {
  color: rgba(255, 250, 243, 0.74);
  font-size: 0.92rem;
  font-weight: 600;
}

.site-nav {
  justify-self: end;
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 34px);
  font-size: 0.9rem;
  font-weight: 600;
}

.site-nav a {
  position: relative;
  padding: 12px 0;
  color: rgba(255, 250, 243, 0.78);
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 6px;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 180ms ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--paper-strong);
}

.site-nav a:hover::after,
.site-nav a:focus-visible::after {
  transform: scaleX(1);
}

.menu-toggle {
  display: none;
  justify-self: end;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--paper-strong);
  background: transparent;
  border: 1px solid rgba(255, 250, 243, 0.3);
  border-radius: 0;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 1px;
  margin: 6px auto;
  background: currentColor;
  transition: transform 180ms ease;
}

.menu-toggle.is-open span:first-child {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle.is-open span:last-child {
  transform: translateY(-3.5px) rotate(-45deg);
}

.hero {
  position: relative;
  min-height: clamp(660px, 88svh, 900px);
  display: grid;
  align-items: center;
  overflow: hidden;
  color: var(--paper-strong);
  background: var(--graphite);
}

.hero-media,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-media {
  background-image: url("assets/portfolio/hero/live-edge-table-hero.jpg");
  background-position: center right;
  background-size: cover;
  transform: scale(1.01);
}

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.88) 0%, rgba(16, 16, 16, 0.72) 28%, rgba(16, 16, 16, 0.18) 70%),
    linear-gradient(180deg, rgba(16, 16, 16, 0.12) 0%, rgba(16, 16, 16, 0.56) 100%);
}

.hero-content {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 40px));
  margin-left: clamp(20px, 7vw, 108px);
  padding-top: var(--header-height);
}

.section-kicker {
  margin: 0 0 18px;
  color: var(--walnut);
  font-size: 0.78rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.hero .section-kicker {
  color: #d1aa7c;
}

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

h1 {
  max-width: 620px;
  margin-bottom: 24px;
  font-size: clamp(4rem, 11vw, 8.8rem);
  line-height: 0.9;
  font-weight: 850;
}

h2 {
  max-width: 820px;
  margin-bottom: 18px;
  font-size: clamp(2.1rem, 5vw, 4.9rem);
  line-height: 0.98;
  font-weight: 820;
}

h3 {
  margin-bottom: 12px;
  font-size: clamp(1.22rem, 2vw, 1.65rem);
  line-height: 1.12;
  font-weight: 760;
}

.hero-lead {
  max-width: 600px;
  margin-bottom: 34px;
  color: rgba(255, 250, 243, 0.86);
  font-size: clamp(1.15rem, 2.2vw, 1.62rem);
  line-height: 1.35;
}

.hero-actions,
.project-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 13px 18px;
  border: 1px solid transparent;
  border-radius: 0;
  font-weight: 760;
  line-height: 1.1;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.btn::after,
.text-link::after {
  content: "→";
  margin-left: 10px;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
}

.btn-primary {
  color: var(--paper-strong);
  background: var(--walnut);
  border-color: var(--walnut);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  background: #765031;
  border-color: #765031;
}

.btn-secondary {
  color: var(--paper-strong);
  background: rgba(255, 250, 243, 0.08);
  border-color: rgba(255, 250, 243, 0.36);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
  background: rgba(255, 250, 243, 0.16);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  max-width: 780px;
  margin: clamp(42px, 9vh, 88px) 0 0;
  padding: 0;
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.hero-metrics div {
  padding: 18px 20px 20px 0;
  border-right: 1px solid var(--line-light);
}

.hero-metrics div + div {
  padding-left: 20px;
}

.hero-metrics div:last-child {
  border-right: 0;
}

.hero-metrics dt {
  margin-bottom: 8px;
  color: #d1aa7c;
  font-size: 0.85rem;
  font-weight: 850;
}

.hero-metrics dd {
  margin: 0;
  color: rgba(255, 250, 243, 0.78);
  font-size: 0.95rem;
}

.intro-band {
  background: var(--paper-strong);
  border-bottom: 1px solid var(--line);
}

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  padding: 28px 0;
}

.intro-grid p {
  max-width: 820px;
  margin: 0;
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  line-height: 1.4;
}

.text-link {
  font-weight: 800;
  white-space: nowrap;
}

.section {
  padding: clamp(72px, 10vw, 132px) 0;
}

.section-light {
  background: var(--paper);
}

.section-dark {
  color: var(--paper-strong);
  background: var(--graphite);
}

.section-head {
  margin-bottom: clamp(34px, 6vw, 64px);
}

.section-head p:not(.section-kicker) {
  max-width: 740px;
  margin-bottom: 0;
  color: rgba(16, 16, 16, 0.68);
  font-size: clamp(1.02rem, 1.7vw, 1.24rem);
}

.section-head-invert p:not(.section-kicker) {
  color: rgba(255, 250, 243, 0.68);
}

.production-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.info-panel {
  min-height: 310px;
  padding: clamp(24px, 4vw, 38px);
  background: var(--paper-strong);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.panel-number {
  display: inline-block;
  margin-bottom: 42px;
  color: var(--olive);
  font-size: 0.9rem;
  font-weight: 850;
}

.info-panel p,
.workflow-list p,
.cooperation-list p,
.contacts-copy p {
  color: rgba(16, 16, 16, 0.68);
}

.workflow {
  display: grid;
  grid-template-columns: minmax(220px, 0.32fr) minmax(0, 1fr);
  gap: clamp(28px, 5vw, 64px);
  margin-top: clamp(46px, 7vw, 84px);
}

.workflow-head {
  position: sticky;
  top: calc(var(--header-height) + 24px);
  align-self: start;
}

.workflow-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: steps;
}

.workflow-list li {
  position: relative;
  display: grid;
  grid-template-columns: minmax(92px, 0.2fr) minmax(0, 1fr);
  gap: 22px;
  padding: 26px 0;
  border-top: 1px solid var(--line);
  counter-increment: steps;
}

.workflow-list li::before {
  content: "0" counter(steps);
  color: var(--olive);
  font-weight: 850;
}

.workflow-list span {
  font-weight: 820;
}

.workflow-list p {
  margin-bottom: 0;
}

.project-tabs {
  margin-bottom: 24px;
}

.project-tab {
  min-height: 42px;
  padding: 9px 16px;
  color: rgba(255, 250, 243, 0.72);
  background: transparent;
  border: 1px solid rgba(255, 250, 243, 0.22);
  border-radius: 0;
  cursor: pointer;
  font-weight: 720;
}

.project-tab:hover,
.project-tab:focus-visible,
.project-tab.is-active {
  color: var(--paper-strong);
  border-color: #d1aa7c;
  background: rgba(209, 170, 124, 0.12);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.project-card {
  display: grid;
  min-height: 100%;
  overflow: hidden;
  color: var(--paper-strong);
  background: #242520;
  border: 1px solid rgba(255, 250, 243, 0.16);
  border-radius: var(--radius);
  box-shadow: none;
}

.project-card.is-hidden {
  display: none;
}

.project-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #2a2a26;
}

.project-body {
  padding: 20px;
}

.project-body p {
  margin-bottom: 10px;
  color: #d1aa7c;
  font-size: 0.78rem;
  font-weight: 850;
  text-transform: uppercase;
}

.project-body h3 {
  min-height: 56px;
}

.project-body span {
  color: rgba(255, 250, 243, 0.68);
}

.cooperation-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(36px, 6vw, 84px);
  align-items: start;
}

.compact-head {
  margin-bottom: 0;
}

.cooperation-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.cooperation-list article {
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.cooperation-list p {
  margin-bottom: 0;
}

.contacts-section {
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.94), rgba(16, 16, 16, 0.86)),
    url("assets/portfolio/hero/live-edge-table-hero.jpg") center / cover;
}

.contacts-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.62fr);
  gap: clamp(34px, 7vw, 90px);
  align-items: start;
}

.contacts-copy h2 {
  max-width: 760px;
}

.contacts-copy p {
  max-width: 620px;
  color: rgba(255, 250, 243, 0.72);
  font-size: clamp(1.02rem, 1.7vw, 1.24rem);
}

.contact-lines {
  display: grid;
  gap: 14px;
  max-width: 520px;
  margin-top: 34px;
  padding-top: 26px;
  border-top: 1px solid var(--line-light);
}

.contact-lines a,
.contact-lines span {
  color: rgba(255, 250, 243, 0.84);
  font-weight: 760;
}

.contact-form {
  display: grid;
  gap: 16px;
  padding: clamp(22px, 4vw, 34px);
  background: rgba(255, 250, 243, 0.96);
  border: 1px solid rgba(255, 250, 243, 0.28);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hidden-field {
  display: none;
}

.contact-form label {
  display: grid;
  gap: 8px;
  color: var(--ink);
  font-weight: 760;
}

.contact-form span {
  font-size: 0.9rem;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  color: var(--ink);
  background: #ffffff;
  border: 1px solid rgba(16, 16, 16, 0.22);
  border-radius: 0;
  outline: none;
}

.contact-form textarea {
  resize: vertical;
  min-height: 118px;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  border-color: var(--walnut);
  box-shadow: 0 0 0 3px rgba(138, 95, 61, 0.16);
}

.form-submit {
  width: 100%;
  margin-top: 4px;
}

.form-note {
  margin: 0;
  color: rgba(16, 16, 16, 0.58);
  font-size: 0.9rem;
}

.form-note.is-success {
  color: var(--olive);
  font-weight: 760;
}

.thanks-section {
  min-height: calc(100vh - 94px);
  display: grid;
  align-items: center;
  padding-top: calc(var(--header-height) + clamp(56px, 8vw, 96px));
  color: var(--paper-strong);
  background:
    linear-gradient(90deg, rgba(16, 16, 16, 0.92), rgba(16, 16, 16, 0.72)),
    url("assets/portfolio/hero/live-edge-table-hero.jpg") center / cover;
}

.thanks-content {
  max-width: 720px;
}

.thanks-content h1 {
  margin: 0;
  max-width: 720px;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: 0.98;
}

.thanks-content p:not(.section-kicker) {
  max-width: 560px;
  margin: 24px 0 34px;
  color: rgba(255, 250, 243, 0.78);
  font-size: clamp(1.05rem, 1.8vw, 1.28rem);
}

.site-footer {
  color: rgba(255, 250, 243, 0.72);
  background: #101010;
  border-top: 1px solid rgba(255, 250, 243, 0.12);
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 0;
}

.footer-grid p {
  margin: 0;
}

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

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    display: grid;
    gap: 0;
    padding: 10px 20px 22px;
    background: rgba(16, 16, 16, 0.96);
    border-bottom: 1px solid rgba(255, 250, 243, 0.16);
    transform: translateY(-140%);
    transition: transform 180ms ease;
  }

  .site-nav.is-open {
    transform: translateY(0);
  }

  .site-nav a {
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 250, 243, 0.12);
  }

  .hero {
    min-height: 84svh;
  }

  .hero-content {
    width: min(680px, calc(100% - 32px));
    margin-left: 20px;
  }

  .hero-metrics,
  .production-grid,
  .projects-grid,
  .cooperation-grid,
  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .workflow {
    grid-template-columns: 1fr;
  }

  .workflow-head {
    position: static;
  }

  .project-body h3 {
    min-height: 0;
  }
}

@media (max-width: 720px) {
  :root {
    --header-height: 68px;
  }

  .container {
    width: calc(100% - 28px);
    max-width: 1160px;
  }

  .hero {
    min-height: 82svh;
  }

  .hero-overlay {
    background:
      linear-gradient(90deg, rgba(16, 16, 16, 0.86), rgba(16, 16, 16, 0.54)),
      linear-gradient(180deg, rgba(16, 16, 16, 0.16), rgba(16, 16, 16, 0.7));
  }

  .hero-content {
    width: calc(100% - 28px);
    max-width: 620px;
    margin: 0 auto;
  }

  h1 {
    font-size: clamp(3.4rem, 18vw, 5.8rem);
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 360px;
  }

  .hero-metrics {
    grid-template-columns: 1fr;
    margin-top: 34px;
  }

  .hero-metrics div,
  .hero-metrics div + div {
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .hero-metrics div:last-child {
    border-bottom: 0;
  }

  .intro-grid {
    grid-template-columns: 1fr;
  }

  .text-link {
    white-space: normal;
  }

  .section {
    padding: 64px 0;
  }

  .info-panel {
    min-height: auto;
  }

  .workflow-list li {
    grid-template-columns: 56px 1fr;
    gap: 16px;
  }

  .contacts-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    display: grid;
  }
}

@media (max-width: 420px) {
  .site-header {
    padding: 0 14px;
  }

  .brand {
    gap: 8px;
  }

  .brand-mark {
    font-size: 1.05rem;
  }

  .brand-text {
    font-size: 0.84rem;
  }

  .contact-form {
    padding: 18px;
  }
}
