body[data-homepage] {
  --home-dark: #21171c;
  --home-wine: #332029;
  --home-light: #faf6ef;
  --home-stone: #eee6db;
  --home-metal: #e7c994;
  --home-line: #cdbfb2;
  --home-copy: #584b48;
  --home-radius: 5px;
  --home-section-space: clamp(46px, 6.2vw, 94px);
  --home-heading-size: clamp(30px, 3.45vw, 51px);
}

body[data-homepage] main > .section {
  padding-block: var(--home-section-space);
}

body[data-homepage] main :is(.section-heading h2, .home-company h2, .custom-copy h2, .factory-layout h2) {
  max-width: 23ch;
  font-size: var(--home-heading-size);
  font-weight: 650;
  line-height: 1.19;
  letter-spacing: -.035em;
  text-wrap: balance;
}

body[data-homepage] main .section-heading {
  gap: 12px 36px;
  margin-bottom: clamp(24px, 3vw, 42px);
}

body[data-homepage] main .section-heading .text-link {
  flex-shrink: 0;
}

body[data-homepage] main .text-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  line-height: 1.35;
}

body[data-homepage] main .home-company,
body[data-homepage] main .buyer-role-section,
body[data-homepage] main .categories-section {
  background: var(--home-light);
}

body[data-homepage] main .home-company p,
body[data-homepage] main .section-heading p,
body[data-homepage] main .buyer-role-grid ul {
  color: var(--home-copy);
  line-height: 1.68;
}

body[data-homepage] .home-company-layout {
  gap: clamp(22px, 5vw, 76px);
}

body[data-homepage] .home-company-layout p:last-child { margin-bottom: 0; }

body[data-homepage] main .supplied-case-section {
  background: linear-gradient(145deg, #33242a, var(--home-dark) 78%);
  color: #fff7ed;
}

body[data-homepage] main .supplied-case-section .text-link {
  color: var(--home-metal);
  border-color: #937557;
}

body[data-homepage] main .supplied-case-section :focus-visible,
body[data-homepage] main .service-band :focus-visible,
body[data-homepage] main .custom-section :focus-visible {
  outline-color: #fff1cc;
}

body[data-homepage] .supplied-case-grid,
body[data-homepage] .category-grid {
  gap: clamp(16px, 2.2vw, 32px);
}

body[data-homepage] .supplied-case-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-homepage] .category-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

body[data-homepage] .home-card {
  --card-border: var(--home-line);
  --card-copy: var(--home-copy);
  --card-arrow: var(--wine);
  --card-highlight: #93643e;
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: var(--home-radius);
  box-shadow: none;
  transition: border-color .2s ease, background-color .2s ease;
}

body[data-homepage] .supplied-case.home-card {
  --card-border: #735a5e;
  --card-copy: #dfd0cd;
  --card-arrow: var(--home-metal);
  --card-highlight: var(--home-metal);
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-content: start;
  padding: 0;
  background: #2d2026;
}

body[data-homepage] .supplied-case.home-card:nth-child(3) {
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  grid-template-rows: 1fr 1fr;
  gap: 0;
}

body[data-homepage] .home-card :is(.supplied-case-photo, .category-image) {
  min-width: 0;
  height: auto;
  overflow: hidden;
  border-radius: 0;
  aspect-ratio: 16 / 10;
}

body[data-homepage] .supplied-case.home-card:nth-child(3) .supplied-case-photo {
  grid-row: span 2;
  width: 100%;
  height: 100%;
  min-height: 218px;
  aspect-ratio: 2 / 1;
}

body[data-homepage] .supplied-case-photo picture {
  display: block;
  height: 100%;
}

body[data-homepage] .home-card img {
  display: block;
  width: 100%;
  height: 100%;
}

body[data-homepage] .home-card :is(.supplied-case-title, .category-body) {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px 12px;
  margin: 0;
  padding: clamp(14px, 1.7vw, 25px);
}

body[data-homepage] .home-card .supplied-case-title { padding-bottom: 0; }

body[data-homepage] .home-card h3 {
  margin: 0;
  font-size: clamp(19px, 2vw, 29px);
  font-weight: 650;
  line-height: 1.23;
  letter-spacing: -.025em;
  overflow-wrap: anywhere;
}

body[data-homepage] .home-card p {
  color: var(--card-copy);
  font-size: clamp(14px, 1.23vw, 16px);
  line-height: 1.55;
}

body[data-homepage] .supplied-case.home-card p {
  margin: 0;
  padding: 8px clamp(14px, 1.7vw, 25px) clamp(16px, 1.85vw, 28px);
}

body[data-homepage] .home-card :is(.case-open, .tile-arrow) {
  display: grid;
  place-items: center;
  width: clamp(32px, 3vw, 41px);
  height: clamp(32px, 3vw, 41px);
  border: 1px solid var(--card-border);
  border-radius: 3px;
  background: transparent;
  color: var(--card-arrow);
  transition: border-color .2s ease, background-color .2s ease;
}

body[data-homepage] .home-card :is(.case-open, .tile-arrow) svg {
  width: 17px;
  height: 17px;
}

body[data-homepage] .category-tile.home-card {
  display: flex;
  flex-direction: column;
  grid-column: auto;
  align-items: stretch;
  background: #fffdfa;
}

body[data-homepage] .category-tile.home-card:nth-child(2) :is(.category-image, img) {
  background: #fff;
}

body[data-homepage] .category-tile.home-card:nth-child(2) img {
  padding: clamp(6px, 1.3vw, 18px);
}

body[data-homepage] .category-tile.home-card :is(.category-image, .category-body) {
  min-width: 0;
}

body[data-homepage] .category-tile.home-card .category-body {
  flex: 1;
  align-content: center;
}

body[data-homepage] .category-tile.home-card:hover,
body[data-homepage] .category-tile.home-card:hover img {
  transform: none;
}

body[data-homepage] .home-card:focus-visible {
  outline: 2px solid var(--card-highlight);
  outline-offset: 4px;
}

body[data-homepage] .home-card:active { border-color: var(--card-highlight); }
body[data-homepage] .home-card:active :is(.case-open, .tile-arrow) { background: #ad8d6a33; }

@media (hover: hover) and (pointer: fine) {
  body[data-homepage] .home-card:hover { border-color: var(--card-highlight); }
  body[data-homepage] .home-card:hover :is(.case-open, .tile-arrow) {
    border-color: var(--card-highlight);
    background: #ad8d6a24;
  }
}

body[data-homepage] .all-categories {
  gap: 8px;
  margin-top: clamp(20px, 2.6vw, 36px);
}

body[data-homepage] .all-categories a {
  border-color: var(--home-line);
  border-radius: var(--home-radius);
  line-height: 1.35;
}

body[data-homepage] main .service-band,
body[data-homepage] main .custom-section {
  background: var(--home-wine);
  color: #fff7ed;
}

body[data-homepage] .service-entry .entry-arrow { color: var(--home-metal); }
body[data-homepage] .service-entry + .service-entry { border-color: #987e78; }

body[data-homepage] main .gallery-section,
body[data-homepage] main .factory-section {
  background: var(--home-stone);
}

body[data-homepage] .home-structure-photo {
  border: 1px solid var(--home-line);
  border-radius: var(--home-radius);
  background: var(--home-light);
}

body[data-homepage] .custom-photo {
  border: 1px solid #876d67;
  border-radius: var(--home-radius);
}

@media (max-width: 760px) {
  body[data-homepage] main .section-heading { align-items: start; }
  body[data-homepage] .category-tile.home-card .category-body { grid-template-columns: minmax(0, 1fr); }
  body[data-homepage] .category-tile.home-card .tile-arrow { grid-area: auto; margin-top: 5px; }
}

@media (max-width: 600px) {
  body[data-homepage] .supplied-case-grid { grid-template-columns: minmax(0, 1fr); }
  body[data-homepage] .supplied-case.home-card:nth-child(3) {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto;
  }

  body[data-homepage] .supplied-case.home-card:nth-child(3) .supplied-case-photo {
    grid-row: auto;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }
}

@media (max-width: 540px) {
  body[data-homepage] main :is(.section-heading h2, .home-company h2, .custom-copy h2, .factory-layout h2) {
    text-wrap: wrap;
  }

  body[data-homepage] .category-grid { grid-template-columns: minmax(0, 1fr); }

  body[data-homepage] .category-tile.home-card {
    display: grid;
    grid-template-columns: minmax(0, 37fr) minmax(0, 63fr);
  }

  body[data-homepage] .category-tile.home-card .category-image {
    position: relative;
    height: auto;
    min-height: 116px;
    aspect-ratio: auto;
  }

  body[data-homepage] .category-tile.home-card picture {
    position: absolute;
    inset: 0;
  }

  body[data-homepage] .category-tile.home-card .category-body {
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 12px;
  }

  body[data-homepage] .category-tile.home-card .tile-arrow { grid-area: 1 / 2 / 3; margin: 0; }
}

@media (prefers-reduced-motion: no-preference) {
  [data-home-reveal].is-entering img {
    animation: home-photo-entry .52s cubic-bezier(.22, .61, .36, 1);
  }

  @keyframes home-photo-entry {
    from { transform: translateY(1.5%) scale(1.045); }
    to { transform: none; }
  }
}

@media (prefers-reduced-motion: reduce) {
  body[data-homepage] .home-card,
  body[data-homepage] .home-card :is(.case-open, .tile-arrow),
  body[data-homepage] .service-entry .entry-arrow {
    transition: none;
  }

  body[data-homepage] .service-entry:hover .entry-arrow { transform: none; }
}

body[data-homepage] .category-heading-question { white-space: nowrap; }

.home-language-suggestion {
  background: var(--home-light);
  border-bottom: 1px solid var(--home-line);
}

.home-language-suggestion a:not([hidden]) {
  display: inline-flex;
  align-items: center;
  gap: .55em;
  min-height: 44px;
  color: var(--wine);
  font-size: .875rem;
  text-decoration: underline;
  text-underline-offset: .2em;
}
