/* Shared visual system: warm contrast, one type family, and a clear action hierarchy. */
:root {
  --ap-paper: #f8f8f2;
  --ap-surface: #efefe8;
  --ap-card: #fbfbf6;
  --ap-ink: #292d26;
  --ap-secondary: #62675d;
  --ap-olive: #596543;
  --ap-line: #d6d1bf;
  --ap-accent: #e4f367;
  --ap-dark: #20251f;
  --ap-on-dark: #f8f8f2;
}

html, body { background: var(--ap-paper); color: var(--ap-ink); }
body, button, input, select, textarea {
  font-family: Manrope, Arial, sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
body { font-size: 16px; line-height: 1.65; }
h1, h2, h3, h4 { color: var(--ap-ink); font-family: Manrope, Arial, sans-serif; }
h1, h2 { text-wrap: balance; }
p { color: var(--ap-secondary); }
a { text-decoration-thickness: 1px; text-underline-offset: .18em; }

/* Keep the same clear order on the home page and in each catalog. */
.redesign-hero, .redesign-stand-cta,
.catalog-page .category-hero,
.catalog-page .redesign-category .redesign-category-intro {
  background-color: var(--ap-dark);
  color: var(--ap-on-dark);
}
.redesign-hero h1, .redesign-stand-cta h2,
.catalog-page .category-hero h1,
.catalog-page .redesign-category-intro h1 { color: var(--ap-on-dark); }
.redesign-kicker, .redesign-section-label,
.catalog-page .category-hero .redesign-category-intro p:first-child {
  color: var(--ap-accent);
}
.redesign-hero h1, .redesign-category-intro h1 { font-weight: 700; }
.redesign-hero h1 { line-height: 1.02; letter-spacing: -.055em; }
.redesign-lead { line-height: 1.6; }
.redesign-nav a, .redesign-phone, .site-links a, .site-phone {
  color: var(--ap-ink);
  font-weight: 600;
}

/* Lime marks the next step; olive stays available for secondary actions. */
.redesign-button, .redesign-works .redesign-button,
.redesign-category-quote, .category-action,
.catalog-page .redesign-category-quote,
.quote-section button[type="submit"], .press-quote .btn {
  background: var(--ap-accent);
  border-color: var(--ap-accent);
  color: var(--ap-ink);
}
.redesign-button:hover, .redesign-category-quote:hover,
.catalog-page .redesign-category-quote:hover,
.quote-section button[type="submit"]:hover, .press-quote .btn:hover {
  background: #d5e650;
  border-color: #d5e650;
  color: var(--ap-ink);
}
.redesign-secondary { border-color: #aeb39f; color: var(--ap-on-dark); }
.redesign-secondary:hover { background: #f8f8f21a; }

/* Product images and cards remain untouched; only their surrounding surfaces align. */
#catalog .category-card, .catalog-page .redesign-category .product,
.catalog-page .category-index .category-card {
  background: var(--ap-card);
  border-color: var(--ap-line);
  color: var(--ap-ink);
}
#catalog .category-card .product-body,
.catalog-page .redesign-category .product-body { background: var(--ap-card); }
.catalog-page .redesign-category .category-group,
.catalog-page .redesign-models-heading { color: var(--ap-ink); }
.catalog-page .redesign-category-intro h1 {
  font-family: Manrope, Arial, sans-serif;
  font-weight: 700;
  letter-spacing: -.055em;
}
.catalog-page .redesign-models-heading h2,
#catalog .catalog-intro h2,
.redesign-works h2, .reviews-heading h2,
#quote h2, #contacts h2 { letter-spacing: -.045em; }
.catalog-page .redesign-category .product-art,
.catalog-page .redesign-category .product-render { background-color: var(--ap-paper); }
.catalog-page .model-quote,
.catalog-page .model-quote:hover {
  background: var(--ap-olive);
  border-color: var(--ap-olive);
  color: var(--ap-on-dark);
}
.catalog-page .model-price strong { color: var(--ap-olive); }

/* Use accessible warm fields against the quote panel and preserve form contents. */
#quote, .catalog-page .press-quote { background: var(--ap-surface); color: var(--ap-ink); }
#quote .quote-form, .catalog-page .press-quote .quote-form { background: var(--ap-card); color: var(--ap-ink); }
#quote p, .catalog-page .press-quote > div > p { color: var(--ap-secondary); }
#quote input:not(.quote-honey), #quote select, #quote textarea,
.catalog-page .press-quote input:not(.quote-honey),
.catalog-page .press-quote select, .catalog-page .press-quote textarea {
  color: var(--ap-ink);
  background: #f8f8f2;
  border-color: #b9b5a5;
}
#quote input::placeholder, #quote textarea::placeholder,
.catalog-page .press-quote input::placeholder,
.catalog-page .press-quote textarea::placeholder { color: #76796e; }
#quote label, .catalog-page .press-quote label { color: var(--ap-ink); }
#quote button[type="submit"], .catalog-page .press-quote .btn { font-weight: 700; }

.redesign-works { background: var(--ap-surface); color: var(--ap-ink); }
.redesign-works p, .review-card p, .review-card blockquote { color: var(--ap-secondary); }
main > #reviews { background: var(--ap-paper); }
#reviews .review-card { background: var(--ap-card); border-color: var(--ap-line); color: var(--ap-ink); }
#contacts {
  background: var(--ap-dark);
  color: var(--ap-on-dark);
  padding-inline: clamp(16px, 4vw, 48px);
}
#contacts h2, #contacts .contact-card strong { color: var(--ap-on-dark); }
#contacts .section-head .small { color: var(--ap-accent); }
#contacts .contact-card {
  background: #4d583a;
  border-color: #85906b;
  color: var(--ap-on-dark);
}
#contacts .contact-card .small,
#contacts .contact-card > span:last-child { color: #e8e5d0; }
#contacts .contact-card:hover { border-color: #d6bf92; }
#contacts .channel-card {
  background: #d6bf92;
  border-color: #d6bf92;
  color: var(--ap-ink);
}
#contacts .channel-card .small,
#contacts .channel-card div > span:last-child { color: #3f482f; }

@media (max-width: 840px) {
  .catalog-page .redesign-category-quote { display: none; }
}

@media (max-width: 840px) {
  body { font-size: 16px; }
  .redesign-hero h1 { font-size: clamp(34px, 10vw, 70px); }
}

/* Mobile layout follows the reference's order and single-column reading flow. */
@media (max-width: 840px) {
  header.redesign-header { flex-wrap: nowrap; gap: 12px; }
  header.redesign-header .mobile-catalog-toggle { display: none; }
  .redesign-header .redesign-social { display: flex; margin-left: auto; }
  header.redesign-header { gap: 8px; }
  .redesign-header .logo img { width: clamp(105px, 33vw, 160px); }
  .redesign-hero { min-height: clamp(620px, 155vw, 760px); }
  .redesign-hero .redesign-lead { color: var(--ap-on-dark); }
  .redesign-hero .redesign-actions { margin-top: clamp(112px, 33vw, 170px); }
  .redesign-hero .redesign-project::after {
    background: linear-gradient(180deg, var(--ap-dark), #20251f70 65%, #20251fa0);
  }
  .redesign-work-grid { grid-template-columns: 1fr; }
  #reviews .reviews-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }
  #reviews .review-card { width: auto; min-width: 0; }
  #contacts .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

/* Match the Press Wall title block across all catalog categories. */
.catalog-page .category-hero .redesign-category-intro > p:first-child {
  font: 700 12px/1.5 Manrope, Arial, sans-serif;
  letter-spacing: .08em;
}
.catalog-page .category-hero .redesign-category-intro > h1 {
  font: 700 clamp(42px, 5.2vw, 64px)/1.05 Manrope, Arial, sans-serif;
  letter-spacing: -.045em;
}
.catalog-page .category-hero .redesign-category-intro > p:last-child {
  color: #c9cdba;
  font: 400 15px/1.55 Manrope, Arial, sans-serif;
}
@media (max-width: 700px) {
  .catalog-page .category-hero .redesign-category-intro > h1 {
    font-size: clamp(34px, 10vw, 42px);
  }
}

/* Telegram channel card sits outside the contacts section on catalog pages. */
.channel-card,
.channel-card:hover {
  background: #dfe3cf;
  border-color: #dfe3cf;
  color: var(--ap-ink);
}
.channel-card .small,
.channel-card div > span:last-child,
.channel-card .channel-arrow { color: var(--ap-olive); }

/* Telegram channel card uses the site's warm paper color. */
body .channel-card,
body .channel-card:hover,
body #contacts .channel-card {
  background: #f8f8f2;
  border-color: #d6d1bf;
  color: var(--ap-ink);
}
body .channel-card .small,
body .channel-card div > span:last-child,
body .channel-card .channel-arrow { color: var(--ap-olive); }

@media (max-width: 840px) {
  .redesign-header .redesign-social { display: none; }
  .redesign-header > .redesign-button { margin-left: auto; }
  .redesign-header .redesign-button,
  .redesign-hero .redesign-button { border-radius: 0; }
  .redesign-hero { padding-top: clamp(48px, 14vw, 64px); }
  .redesign-hero .redesign-kicker { color: var(--ap-on-dark); }
  .redesign-hero h1 { max-width: 100%; font-size: clamp(31px, 10.5vw, 52px); text-wrap: initial; }
  .redesign-hero .mobile-title-line { display: block; }
  .redesign-hero .mobile-title-period::after { content: "."; }
  .redesign-hero .redesign-actions { margin-top: 22px; }
  .redesign-hero .redesign-secondary { border: 0; background: transparent; }
  .redesign-hero .redesign-secondary::after { content: " →"; }
  .redesign-hero .redesign-project { bottom: 20px; }
}

@media (max-width: 840px) {
  .redesign-hero { min-height: clamp(600px, 153vw, 930px); }
  .redesign-hero .redesign-project {
    inset: 42% 0 20px 12%;
    -webkit-mask-image: linear-gradient(to right, transparent, #000 19%);
    mask-image: linear-gradient(to right, transparent, #000 19%);
  }
  .redesign-hero .redesign-project img { opacity: .67; object-position: center; }
  .redesign-hero .redesign-project::after {
    background: linear-gradient(180deg, var(--ap-dark), #20251f60 46%, #20251f30);
  }
  .redesign-hero .redesign-project figcaption { display: none; }
}

.contact-links { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; }
.contact-links > a { color: var(--ap-on-dark); font-weight: 600; overflow-wrap: anywhere; }
.contact-links > a:hover { text-decoration: underline; }
.contact-icons { display: flex; gap: 8px; }
.contact-icons a {
  display: grid; place-items: center; width: 44px; height: 44px;
  border: 1px solid #85906b; border-radius: 8px; color: var(--ap-on-dark);
}
.contact-icons a:hover, .contact-icons a:focus-visible {
  background: var(--ap-accent); color: var(--ap-ink);
}
.contact-icons svg { width: 21px; height: 21px; }
.contact-icons svg:not([fill]) { fill: currentColor; }
.contact-icons strong { font-size: 11px; }

#contacts .contact-icons { margin-left: auto; gap: 12px; }
@media (max-width: 640px) {
  #contacts .contact-links { flex-direction: column; align-items: flex-start; }
  #contacts .contact-icons { margin-left: 0; }
}

#contacts .contact-icons a { border: 0; border-radius: 12px; color: #fff; }
#contacts .contact-max { background: linear-gradient(135deg, #387dd4, #6244ba); }
#contacts .contact-telegram { background: #258bb6; }
#contacts .contact-icons a:hover { filter: brightness(1.12); }
.works-actions { display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 20px; }
.works-actions > a { color: var(--ap-ink); text-decoration: underline; text-underline-offset: 4px; }

@media (max-width: 840px) {
  header.redesign-header { gap: 6px; }
  .redesign-header .redesign-social { display: flex; margin-left: auto; }
  .redesign-header > .redesign-button { margin-left: 0; }
  .redesign-header .logo img { width: clamp(90px, 29vw, 145px); }
  #contacts .contact-icons { gap: 6px; }
  #contacts .contact-icons a { position: relative; width: 36px; height: 36px; border-radius: 9px; }
  #contacts .contact-icons a::after { content: ""; position: absolute; inset: -4px -3px; }
  #contacts .contact-icons svg { width: 17px; height: 17px; }
}

#contacts {
  box-shadow: 0 0 0 100vmax var(--ap-dark);
  clip-path: inset(0 -100vmax);
}

.redesign-hero .redesign-project img { filter: none; opacity: 1; }
.redesign-hero .redesign-lead { color: var(--ap-on-dark); }

.redesign-header .redesign-button,
.redesign-hero .redesign-button,
.redesign-button, .category-action, .redesign-category-quote,
.quote-section button[type="submit"], .press-quote .btn {
  border-radius: 6px;
}

/* Match the hierarchy of the homepage hero and stand callout. */
.redesign-category-intro h1,
.catalog-page .category-hero .redesign-category-intro > h1 { font-weight: 700; }
#catalog h2, #home-works h2, #reviews h2, #quote h2, #contacts h2,
.catalog-page .redesign-models-heading h2, .wood-prices h2 {
  font-weight: 500;
  letter-spacing: -.045em;
  line-height: 1.1;
}
.product-body h3, .redesign-work strong, .quote-form h3 { font-weight: 600; }
.redesign-button, .redesign-secondary, .model-quote, .quote-form button { font-weight: 700; }

@media (max-width: 840px) {
  header.redesign-header { flex-wrap: wrap; }
  header.redesign-header .redesign-phone {
    display: block;
    order: 10;
    flex: 0 0 100%;
    text-align: right;
    font-size: 14px;
    padding-block: 4px;
  }
}

#reviews .reviews-grid {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding-bottom: 12px;
}
#reviews .review-card { flex: 0 0 calc((100% - 28px) / 3); scroll-snap-align: start; }
.reviews-controls { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 12px; }
.reviews-controls button {
  width: 44px; height: 44px; border: 1px solid var(--ap-line); border-radius: 6px;
  background: var(--ap-card); color: var(--ap-ink); font-size: 20px;
}
.reviews-controls button:hover { background: var(--ap-accent); }
@media (max-width: 840px) {
  #reviews .review-card { flex-basis: 85%; }
}

@media (max-width: 840px) {
  .redesign-hero .redesign-hero-copy {
    position: static;
  }

  .redesign-hero .redesign-hero-copy > :not(.redesign-actions) {
    position: relative;
    z-index: 1;
  }

  .redesign-hero .redesign-actions {
    position: absolute;
    z-index: 2;
    inset-inline: clamp(18px, 5vw, 42px);
    bottom: 24px;
    margin-top: 0;
  }

  .redesign-hero {
    padding-bottom: 128px;
  }
}

/* Match construction and portfolio actions to the approved lime sample. */
#catalog .category-action,
.redesign-works .portfolio-open,
.catalog-page .model-quote,
.catalog-page .model-quote:hover {
  background-color: #E7F27C;
  border-color: #E7F27C;
  color: #292D26;
}

#catalog .category-action:hover,
.redesign-works .portfolio-open:hover,
.catalog-page .model-quote:hover {
  background-color: #DDEB66;
  border-color: #DDEB66;
  color: #292D26;
}

/* Compact, aligned category cards across desktop, tablet, and mobile. */
#catalog .category-card {
  display: flex;
  flex-direction: column;
}

#catalog .category-card .product-body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: stretch;
}

#catalog .category-card h3 {
  display: flex;
  align-items: flex-end;
  min-height: 1.2em;
  margin: 0;
}

#catalog .category-card .spec {
  min-height: 1.35em;
  margin: 7px 0 0;
  padding: 0;
}

#catalog .category-card .category-action {
  margin-top: 18px;
  flex: 0 0 auto;
}

@media (max-width: 620px) {
  #catalog .category-card h3 {
    min-height: 2.4em;
  }
}

@media (max-width: 350px) {
  #catalog .category-card h3 {
    min-height: 1.2em;
  }
}

#catalog .category-card .product-body { row-gap: 0; }
