/* Base styles sit in a layer so the component styles below always win over them. */
@layer global {
  :root {
    --ink: #1f1f1f;
    --ink-2: #2a2a2c;
    --graphite: #424244;
    --text: #2c2c2e;
    --muted: #68686d;
    --line: #dcdddd;
    --mist: #f3f3f2;
    --gray: #e7e8e8;
    --orange: #ff9131;
    --orange-ink: #b4520a;
    --hazard: repeating-linear-gradient(-45deg, var(--orange) 0 10px, var(--ink) 10px 20px);

    --font-head: "Montserrat Variable", system-ui, sans-serif;
    --font-body: "Open Sans Variable", system-ui, sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, monospace;

    --wrap: 76rem;
    --gutter: clamp(1rem, 4vw, 2.5rem);
    --header-h: 4rem;
  }

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

  html {
    scroll-padding-top: calc(var(--header-h) + 1.5rem);
    -webkit-text-size-adjust: 100%;
  }
  @media (max-width: 56rem) {
    html {
      scroll-padding-top: calc(var(--header-h) + 5rem);
    }
  }

  body {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    margin: 0;
    color: var(--text);
    background: #fff;
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }

  h1,
  h2,
  h3,
  h4 {
    margin: 0 0 0.6em;
    color: var(--graphite);
    font-family: var(--font-head);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -0.02em;
    text-wrap: balance;
  }

  h1 {
    font-size: clamp(2rem, 1.4rem + 2.4vw, 3.25rem);
  }
  h2 {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.1rem);
  }
  h3 {
    font-size: 1.2rem;
  }

  p {
    margin: 0 0 1em;
  }

  a {
    color: var(--orange-ink);
    text-underline-offset: 0.2em;
  }

  img {
    max-width: 100%;
    height: auto;
  }

  sub,
  sup {
    line-height: 0;
  }

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

  .wrap {
    width: min(100% - 2 * var(--gutter), var(--wrap));
    margin-inline: auto;
  }

  .mono {
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: -0.01em;
  }

  .eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1rem;
    color: var(--muted);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .eyebrow::before {
    content: "";
    width: 1.5rem;
    height: 3px;
    background: var(--orange);
  }

  .button {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.3rem;
    border: 2px solid var(--orange);
    border-radius: 3px;
    background: var(--orange);
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 700;
    text-decoration: none;
    transition:
      background 0.15s,
      color 0.15s;
  }
  .button:hover {
    background: #ffa65a;
  }
  .button.ghost {
    background: transparent;
    color: var(--orange);
  }
  .button.ghost:hover {
    background: var(--orange);
    color: var(--ink);
  }
  .button.dark {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
  }
  .button.dark:hover {
    background: var(--graphite);
  }

  /* Product photos are JPEGs on white; multiply blends that white into the tile colour. */
  .photo {
    display: grid;
    grid-template: minmax(0, 1fr) / minmax(0, 1fr);
    overflow: hidden;
    background: var(--mist);
  }
  .photo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    mix-blend-mode: multiply;
  }

  .page-head {
    padding-block: clamp(2rem, 5vw, 3.5rem) clamp(1.5rem, 3vw, 2.5rem);
    border-bottom: 1px solid var(--line);
    background:
      linear-gradient(90deg, var(--mist) 1px, transparent 1px) 0 0 / 2.5rem 100%,
      #fff;
  }
  .page-head h1 {
    margin: 0;
  }
  .page-head p {
    max-width: 44rem;
    margin: 0.8rem 0 0;
    color: var(--muted);
    font-size: 1.05rem;
  }

  .section {
    padding-block: clamp(2.5rem, 7vw, 5rem);
  }

  .prose {
    max-width: 46rem;
  }
  .prose :is(h2, h3, h4) {
    margin-top: 1.6em;
    font-size: 1.1rem;
  }
  .prose ul {
    padding-left: 1.2rem;
  }
  .prose li {
    margin-bottom: 0.35em;
  }
  .prose li::marker {
    color: var(--orange);
  }
  .prose table {
    display: block;
    max-width: 100%;
    margin-block: 1.2rem;
    overflow-x: auto;
    border-collapse: collapse;
    font-size: 0.9rem;
  }
  .prose td,
  .prose th {
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--line);
    vertical-align: top;
  }
  .prose tr:first-child td {
    background: var(--mist);
    font-weight: 600;
  }
  .prose img {
    display: block;
    margin-block: 1rem;
  }

  .visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

/*
 * Component and page styles. Each block styles only its own markup: components are roots marked
 * `data-scope`, pages are `main[data-page]`, and raw HTML from the content (`data-html`) is left alone.
 */

/* Layout: header, main and footer */

@scope (.site-header) to ([data-scope]) {
  :scope {
    position: sticky;
    top: 0;
    z-index: 20;
    background: var(--ink);
    border-bottom: 3px solid var(--orange);
  }
  .bar {
    display: flex;
    align-items: center;
    gap: 2rem;
    height: var(--header-h);
  }
  .desktop-nav {
    display: flex;
    align-items: center;
    flex: 1;
  }
  .desktop-nav a {
    color: #fff;
    font-family: var(--font-head);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
  }
  /* the dot separators of the original menu */
  .desktop-nav a + a::before {
    content: "";
    display: inline-block;
    width: 5px;
    height: 5px;
    margin: 0 1rem 0.18em;
    border-radius: 50%;
    background: #6c6c70;
  }
  .desktop-nav a:hover,
  .desktop-nav a[aria-current] {
    color: var(--orange);
  }
  .search {
    display: flex;
    align-items: center;
    border-bottom: 1px solid #555558;
  }
  .search input {
    width: 12rem;
    padding: 0.4rem 0;
    border: 0;
    background: none;
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
  }
  .search input::placeholder {
    color: #8b8b90;
  }
  .search input:focus {
    outline: none;
  }
  .search:focus-within {
    border-color: var(--orange);
  }
  .search button {
    padding: 0.3rem;
    border: 0;
    background: none;
    color: #fff;
    cursor: pointer;
  }

  .mobile-nav {
    display: none;
    margin-left: auto;
  }
  .mobile-nav summary {
    display: grid;
    place-items: center;
    width: 2.75rem;
    height: 2.75rem;
    color: #fff;
    cursor: pointer;
    list-style: none;
  }
  .mobile-nav summary::-webkit-details-marker {
    display: none;
  }
  .mobile-nav .shut,
  .mobile-nav[open] .open {
    display: none;
  }
  .mobile-nav[open] .shut {
    display: block;
  }
  .panel {
    position: absolute;
    inset: calc(var(--header-h) + 3px) 0 auto;
    height: calc(100dvh - var(--header-h) - 3px);
    padding: 1.25rem var(--gutter) 2rem;
    overflow-y: auto;
    background: var(--ink);
  }
  .panel input {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #444447;
    border-radius: 3px;
    background: var(--ink-2);
    color: #fff;
    font: inherit;
  }
  .panel nav {
    display: grid;
    margin-block: 1rem 2rem;
  }
  .panel nav a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid #333336;
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.25rem;
    font-weight: 600;
    text-decoration: none;
  }
  .panel nav a[aria-current] {
    color: var(--orange);
  }
  .call {
    display: inline-flex;
    gap: 0.6rem;
    align-items: center;
    color: var(--orange);
    font-family: var(--font-mono);
    font-size: 1.1rem;
    text-decoration: none;
  }

  @media (max-width: 64rem) {
    .search input {
      width: 8rem;
    }
    .desktop-nav a + a::before {
      margin-inline: 0.6rem;
    }
  }
  @media (max-width: 56rem) {
    .desktop-nav,
    .search {
      display: none;
    }
    .mobile-nav {
      display: block;
    }
  }
}

main {
  flex: 1;
  padding-bottom: clamp(3rem, 8vw, 6rem);
}
/* pages ending with the dark contact block stretch it down to the footer */
main:has(> .contact:last-child) {
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
}
main > .contact:last-child {
  flex: 1;
}

@scope (.site-footer) to ([data-scope]) {
  :scope {
    padding-top: 3.5rem;
    border-top: 3px solid var(--orange);
    background: var(--ink);
    color: #b9b9bd;
    font-size: 0.92rem;
  }
  .grid {
    display: grid;
    grid-template-columns: 1.4fr repeat(3, 1fr);
    gap: 2.5rem;
  }
  .brand p {
    max-width: 22rem;
    margin-top: 1rem;
  }
  h2 {
    margin-bottom: 1rem;
    color: #fff;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  ul {
    display: grid;
    gap: 0.45rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  a {
    color: #e3e3e6;
    text-decoration: none;
  }
  a:hover {
    color: var(--orange);
  }
  address {
    margin-bottom: 1rem;
    font-style: normal;
  }
  .legal {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-block: 1.25rem;
    border-top: 1px solid #333336;
    font-size: 0.82rem;
  }
  @media (max-width: 56rem) {
    .grid {
      grid-template-columns: 1fr 1fr;
    }
    .brand {
      grid-column: 1 / -1;
    }
  }
}

@scope ([data-layout="catalog"]) to ([data-scope], [data-html] > *) {
  :scope {
    display: grid;
    grid-template-columns: 15rem minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
    padding-top: 2rem;
  }
  .content {
    min-width: 0;
  }
  @media (max-width: 56rem) {
    :scope {
      grid-template-columns: minmax(0, 1fr);
      gap: 1.5rem;
      padding-top: 1.25rem;
    }
  }
}

/* Components */

@scope ([data-scope="logo"]) {
  :scope {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #fff;
    font-family: var(--font-head);
    font-size: 1.3rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    text-decoration: none;
    white-space: nowrap;
  }
  b {
    font-weight: 800;
  }
}

@scope ([data-scope="breadcrumbs"]) {
  :scope {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1rem;
    font-family: var(--font-mono);
    font-size: 0.8rem;
  }
  a {
    color: var(--muted);
    text-decoration: none;
  }
  a:hover {
    color: var(--orange-ink);
  }
  a + a::before {
    content: "/";
    margin-right: 0.35rem;
    color: var(--line);
  }
}

@scope ([data-scope="contact"]) to ([data-scope]) {
  :scope {
    padding-block: clamp(3rem, 8vw, 5.5rem);
    background: var(--ink);
    color: #c9c9cd;
  }
  .grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: clamp(2rem, 5vw, 4rem);
    align-items: center;
  }
  .eyebrow {
    color: #9a9a9f;
  }
  :is(h1, h2) {
    color: #fff;
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.4rem);
  }
  .lead {
    max-width: 28rem;
  }
  ul {
    display: grid;
    gap: 1rem;
    margin: 2rem 0;
    padding: 0;
    list-style: none;
  }
  li {
    display: flex;
    gap: 0.9rem;
    align-items: start;
  }
  li svg {
    flex: none;
    color: var(--orange);
  }
  li a {
    color: #fff;
    font-size: 1.1rem;
    text-decoration: none;
  }
  li a:hover {
    color: var(--orange);
  }
  .map {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border: 1px solid #3a3a3d;
    border-radius: 4px;
  }
  iframe {
    width: 100%;
    height: 100%;
    border: 0;
    filter: grayscale(1) contrast(1.05);
  }
  @media (max-width: 48rem) {
    .grid {
      grid-template-columns: 1fr;
    }
  }
}

@scope ([data-scope="katalog-tree"]) {
  :scope {
    display: grid;
    gap: 0.15rem;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
  }
  a {
    display: block;
    padding: 0.45rem 0.75rem;
    border-left: 3px solid transparent;
    color: var(--graphite);
    font-family: var(--font-head);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
  }
  .child {
    padding-left: 1.6rem;
    color: var(--muted);
    font-family: var(--font-body);
    font-weight: 400;
  }
  a:hover {
    color: var(--orange-ink);
  }
  a[aria-current] {
    border-color: var(--orange);
    background: var(--mist);
    color: var(--ink);
  }
  @media (max-width: 56rem) {
    :scope {
      position: static;
      display: flex;
      gap: 0.4rem;
      margin-inline: calc(-1 * var(--gutter));
      padding: 0 var(--gutter) 0.5rem;
      overflow-x: auto;
      scrollbar-width: none;
    }
    .group {
      display: contents;
    }
    a,
    .child {
      flex: none;
      padding: 0.45rem 0.8rem;
      border: 1px solid var(--line);
      border-radius: 999px;
      font-family: var(--font-body);
      font-size: 0.85rem;
      font-weight: 500;
      white-space: nowrap;
    }
    a[aria-current] {
      border-color: var(--ink);
      background: var(--ink);
      color: #fff;
    }
  }
}

@scope ([data-scope="navigator-step"]) to ([data-html] > *) {
  .prompt {
    margin-bottom: 1rem;
    color: var(--graphite);
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
  }
  .options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr));
    gap: 0.75rem;
  }
  .options:has(.gas) {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr));
  }
  a {
    position: relative;
    display: grid;
    gap: 0.3rem;
    align-content: start;
    padding: 1.1rem 2.75rem 1.1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    color: var(--graphite);
    text-decoration: none;
    transition:
      border-color 0.15s,
      background 0.15s;
  }
  a:hover {
    border-color: var(--orange);
    background: var(--mist);
  }
  .gas {
    min-height: 6.5rem;
  }
  .empty {
    opacity: 0.55;
  }
  .formula {
    color: var(--ink);
    font-family: var(--font-mono);
    font-size: 1.75rem;
    font-weight: 500;
    line-height: 1.1;
  }
  .name {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.3;
  }
  .gas .name {
    font-family: var(--font-body);
    font-weight: 400;
  }
  small {
    margin-top: auto;
    color: var(--muted);
    font-size: 0.75rem;
  }
  a .go {
    position: absolute;
    top: 1.1rem;
    right: 1rem;
    color: var(--orange-ink);
    transition: transform 0.15s;
  }
  a:hover .go {
    transform: translateX(3px);
  }
}

@scope ([data-scope="navigator-tiles"]) {
  :scope {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.6rem;
  }
  a {
    display: grid;
    gap: 0.35rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: #fff;
    color: var(--graphite);
    text-decoration: none;
    transition:
      border-color 0.15s,
      background 0.15s;
  }
  a svg {
    margin-bottom: 0.4rem;
    color: var(--orange-ink);
  }
  span {
    font-family: var(--font-head);
    font-weight: 700;
    line-height: 1.25;
  }
  small {
    color: var(--muted);
    font-size: 0.75rem;
  }
  a:hover {
    border-color: var(--orange);
  }
  :scope.dark a {
    border-color: #3a3a3d;
    background: var(--ink-2);
    color: #fff;
  }
  :scope.dark a svg {
    color: var(--orange);
  }
  :scope.dark small {
    color: #9a9a9f;
  }
  :scope.dark a:hover {
    border-color: var(--orange);
    background: #333336;
  }
}

@scope ([data-scope="product-card"]) {
  :scope {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--line);
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
    color: inherit;
    text-decoration: none;
    transition:
      border-color 0.15s,
      transform 0.15s;
  }
  :scope:hover {
    border-color: var(--graphite);
    transform: translateY(-2px);
  }
  .photo {
    aspect-ratio: 4 / 3;
    padding: 1.25rem;
    border-bottom: 1px solid var(--line);
  }
  .photo img {
    transition: transform 0.25s;
  }
  :scope:hover .photo img {
    transform: scale(1.04);
  }
  .body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1rem 1.1rem 1.1rem;
  }
  h3 {
    margin-bottom: 0.35rem;
    font-size: 1.05rem;
  }
  :scope:hover h3 {
    color: var(--orange-ink);
  }
  p {
    display: -webkit-box;
    margin-bottom: 0.9rem;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }
  .meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.5rem;
    margin-top: auto;
    padding-top: 0.75rem;
    border-top: 1px dashed var(--line);
    color: var(--graphite);
    font-family: var(--font-mono);
    font-size: 0.78rem;
  }
  .price {
    font-weight: 500;
  }
}

@scope ([data-scope="product-grid"]) to ([data-scope]) {
  :scope {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(15rem, 100%), 1fr));
    gap: 1rem;
  }
  @media (max-width: 30rem) {
    :scope {
      grid-template-columns: 1fr 1fr;
      gap: 0.6rem;
    }
  }
}

/* Pages */

@scope (main[data-page="home"]) to ([data-scope], [data-html] > *) {
  .hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    padding-block: clamp(3rem, 9vw, 7rem) clamp(6rem, 12vw, 9rem);
    background: var(--ink);
    color: #d6d6d9;
  }
  .hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 8px;
    background: var(--hazard);
  }
  .hero-bg {
    position: absolute;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(1) contrast(1.1);
    opacity: 0.35;
  }
  .hero-grid {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
  }
  .hero .eyebrow {
    color: #a9a9ae;
  }
  .hero h1 {
    color: #fff;
    font-size: clamp(2.3rem, 1.5rem + 3.3vw, 4.4rem);
    font-weight: 800;
    letter-spacing: -0.03em;
  }
  .lead {
    max-width: 30rem;
    font-size: 1.15rem;
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
  }
  .picker {
    padding: 1.5rem;
    border: 1px solid #3a3a3d;
    border-radius: 4px;
    background: rgb(31 31 31 / 0.88);
  }
  .picker-title {
    margin-bottom: 1rem;
    color: #fff;
    font-family: var(--font-head);
    font-weight: 700;
  }
  .gases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px dashed #3a3a3d;
  }
  .gases a {
    padding: 0.3rem 0.55rem;
    border: 1px solid #47474b;
    border-radius: 3px;
    color: #e3e3e6;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    text-decoration: none;
  }
  .gases a:hover {
    border-color: var(--orange);
    color: var(--orange);
  }

  .boards {
    display: grid;
    grid-template-columns: 1fr 1.1fr 1fr;
    align-items: start;
    gap: 1.25rem;
    margin-top: clamp(-5rem, -7vw, -3rem);
    position: relative;
  }
  .board {
    min-height: 100%;
    padding: 1.75rem;
    border: 1px solid var(--line);
    border-top: 4px solid var(--graphite);
    background: #fff;
    box-shadow: 0 18px 40px -24px rgb(0 0 0 / 0.35);
  }
  .board h2 {
    font-size: 1.3rem;
  }
  .board .year {
    margin: 0 0 0.5rem;
    color: var(--orange-ink);
    font-family: var(--font-head);
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.04em;
  }
  /* the pennant-shaped middle board of the original homepage */
  .services {
    margin-top: -1.5rem;
    padding-bottom: 4.5rem;
    border: 0;
    border-top: 4px solid var(--orange);
    background: var(--ink);
    clip-path: polygon(0 0, 100% 0, 100% calc(100% - 2.5rem), 50% 100%, 0 calc(100% - 2.5rem));
  }
  .services h2 {
    color: #fff;
  }
  .services ul {
    display: grid;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #e3e3e6;
  }
  .services li {
    display: flex;
    gap: 0.6rem;
    align-items: start;
  }
  .services li svg {
    flex: none;
    margin-top: 0.2em;
    color: var(--orange);
  }
  .award {
    display: flex;
    gap: 1rem;
    align-items: center;
    color: var(--text);
    text-decoration: none;
  }
  .award img {
    width: 6rem;
    border: 1px solid var(--line);
    transform: rotate(-3deg);
    transition: transform 0.2s;
  }
  .award:hover img {
    transform: rotate(0);
  }
  .award span {
    display: grid;
    font-weight: 600;
  }
  .award small {
    color: var(--orange-ink);
    font-weight: 400;
  }

  .section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 2rem;
  }
  .section-head h2 {
    margin: 0;
  }
  .more {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    color: var(--orange-ink);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }
  .categories {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
  }
  .category {
    color: inherit;
    text-decoration: none;
  }
  .category .photo {
    aspect-ratio: 1;
    margin-bottom: 0.9rem;
    padding: 1.5rem;
    border-radius: 4px;
    transition: background 0.2s;
  }
  .category img {
    transition: transform 0.25s;
  }
  .category:hover .photo {
    background: var(--gray);
  }
  .category:hover img {
    transform: scale(1.06);
  }
  .category h3 {
    margin-bottom: 0.15rem;
    font-size: 1.05rem;
  }
  .category:hover h3 {
    color: var(--orange-ink);
  }
  .category span {
    color: var(--muted);
    font-size: 0.8rem;
  }

  .news {
    padding-block: clamp(2.5rem, 6vw, 4rem);
    background: var(--gray);
  }
  .news-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr));
    gap: 1rem;
  }
  .news-item {
    display: grid;
    grid-template-columns: 9rem 1fr;
    gap: 1.25rem;
    align-items: center;
    padding: 1rem;
    border-radius: 4px;
    background: #fff;
    color: inherit;
    text-decoration: none;
  }
  .news-item .photo {
    aspect-ratio: 1;
    padding: 0.75rem;
    border-radius: 3px;
  }
  .news-item h3 {
    margin-bottom: 0.3rem;
  }
  .news-item p {
    color: var(--muted);
    font-size: 0.9rem;
  }
  .news-item:hover h3 {
    color: var(--orange-ink);
  }

  @media (max-width: 64rem) {
    .hero-grid {
      grid-template-columns: 1fr;
    }
    .categories {
      grid-template-columns: repeat(3, 1fr);
    }
  }
  @media (max-width: 48rem) {
    .boards {
      grid-template-columns: 1fr;
    }
    .services {
      margin-top: 0;
    }
    .categories {
      grid-template-columns: repeat(2, 1fr);
    }
    .section-head {
      flex-direction: column;
      align-items: start;
    }
  }
  @media (max-width: 30rem) {
    .news-item {
      grid-template-columns: 6rem 1fr;
      gap: 1rem;
    }
  }
}
/* Rules reaching into the texts from the content; :where keeps them as weak as the scoped rules. */
:where(main[data-page="home"]) .hero h1 em {
  font-style: normal;
  background: linear-gradient(var(--orange), var(--orange)) 0 92% / 100% 0.12em no-repeat;
}
:where(main[data-page="home"]) .board p {
  color: var(--muted);
}

@scope (main[data-page="katalog"]) to ([data-scope], [data-html] > *) {
  .list {
    display: grid;
    gap: 1rem;
  }
  .row {
    display: grid;
    grid-template-columns: 11rem 1fr;
    gap: 1.5rem;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
  }
  .row:hover {
    border-color: var(--graphite);
  }
  .photo {
    aspect-ratio: 1;
    padding: 1rem;
    border-radius: 3px;
  }
  h2 {
    margin-bottom: 0.2rem;
    font-size: 1.4rem;
  }
  h2 a {
    color: inherit;
    text-decoration: none;
  }
  .count {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .subs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
  }
  .subs a {
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--graphite);
    font-size: 0.88rem;
    text-decoration: none;
  }
  .subs a:hover {
    border-color: var(--orange);
  }
  .subs span {
    margin-left: 0.25rem;
    color: var(--muted);
    font-size: 0.75rem;
  }
  .open {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    font-weight: 600;
    text-decoration: none;
  }
  @media (max-width: 30rem) {
    .row {
      grid-template-columns: 6.5rem 1fr;
      gap: 1rem;
      align-items: start;
    }
    h2 {
      font-size: 1.15rem;
    }
  }
}

@scope (main[data-page="katalog-category"]) to ([data-scope], [data-html] > *) {
  .group + .group {
    margin-top: 3rem;
  }
  h2 {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
    font-size: 1.35rem;
  }
  h2 a {
    color: inherit;
    text-decoration: none;
  }
  h2 a:hover {
    color: var(--orange-ink);
  }
  h2 span {
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 400;
  }
}

@scope (main[data-page="product"]) to ([data-scope], [data-html] > *) {
  .top {
    padding-block: 1.5rem clamp(2rem, 5vw, 3.5rem);
    border-bottom: 1px solid var(--line);
  }
  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
  }
  .main-photo {
    aspect-ratio: 1;
    padding: clamp(1.5rem, 5vw, 3.5rem);
    border-radius: 4px;
    cursor: zoom-in;
  }
  .info h1 {
    margin-bottom: 0.75rem;
    color: var(--ink);
    font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.03em;
  }
  .intro {
    color: var(--muted);
    font-size: 1.08rem;
  }
  .facts {
    display: grid;
    grid-auto-columns: 1fr;
    grid-auto-flow: column;
    margin: 1.5rem 0;
    border-block: 1px solid var(--line);
  }
  .facts div {
    padding: 0.85rem 0;
  }
  .facts div + div {
    padding-left: 1rem;
    border-left: 1px solid var(--line);
  }
  dt {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .facts dd {
    margin: 0.2rem 0 0;
    color: var(--ink);
  }
  .buy {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    align-items: center;
    margin-block: 1.5rem;
  }
  .price {
    display: grid;
    margin: 0;
    line-height: 1.2;
  }
  .price span {
    color: var(--muted);
    font-size: 0.8rem;
  }
  .price strong {
    color: var(--ink);
    font-family: var(--font-head);
    font-size: 1.6rem;
  }
  .docs {
    display: grid;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }
  .docs a {
    display: flex;
    gap: 0.9rem;
    align-items: center;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-left: 4px solid var(--orange);
    border-radius: 3px;
    color: var(--ink);
    font-weight: 600;
    text-decoration: none;
  }
  .docs a:hover {
    background: var(--mist);
  }
  .docs span {
    display: grid;
    flex: 1;
  }
  .docs small {
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 400;
  }
  .docs .dl {
    color: var(--orange-ink);
  }

  .body {
    display: grid;
    grid-template-columns: 13rem minmax(0, 1fr);
    gap: clamp(1.5rem, 5vw, 4rem);
    align-items: start;
    padding-top: clamp(2rem, 5vw, 3.5rem);
  }
  .toc {
    display: grid;
    position: sticky;
    top: calc(var(--header-h) + 1.5rem);
    border-left: 1px solid var(--line);
  }
  .toc a {
    margin-left: -1px;
    padding: 0.45rem 0 0.45rem 1rem;
    border-left: 3px solid transparent;
    color: var(--muted);
    font-size: 0.9rem;
    text-decoration: none;
  }
  .toc a:hover {
    border-color: var(--orange);
    color: var(--ink);
  }
  .sections {
    grid-column: 2;
    min-width: 0;
  }
  .sections section + section {
    margin-top: clamp(2.5rem, 6vw, 4rem);
  }
  .sections h2 {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    font-size: 1.4rem;
  }
  .sections h2::before {
    content: "";
    width: 0.6rem;
    height: 0.6rem;
    background: var(--orange);
  }

  .specs {
    margin: 0;
    border-top: 2px solid var(--ink);
  }
  .specs div {
    display: grid;
    grid-template-columns: minmax(10rem, 0.8fr) 1.5fr;
    gap: 1.5rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
  }
  .specs dt {
    color: var(--graphite);
    font-size: 0.92rem;
    font-weight: 600;
  }
  .specs dd {
    margin: 0;
    font-variant-numeric: tabular-nums;
    white-space: pre-line;
  }
  .grid-wrap {
    overflow-x: auto;
  }
  .spec-grid {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
  }
  .spec-grid :is(th, td) {
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
    white-space: pre-line;
  }
  .spec-grid thead th {
    border-bottom: 2px solid var(--ink);
    font-family: var(--font-head);
  }
  .note {
    margin-top: 1rem;
    color: var(--muted);
    font-size: 0.88rem;
  }
  .warning {
    display: flex;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border: 1px solid var(--line);
    border-top: 8px solid transparent;
    border-image: var(--hazard) 8 0 0 0 / 8px 0 0 0;
    background: #fff8f1;
  }
  .warning svg {
    flex: none;
    color: var(--orange-ink);
  }
  .figures {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
    gap: 1rem;
  }
  .figure {
    display: grid;
    place-items: center;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 4px;
    cursor: zoom-in;
  }
  .figure:hover {
    border-color: var(--graphite);
  }

  .related {
    margin-top: clamp(3rem, 8vw, 5rem);
    padding-top: 2rem;
    border-top: 1px solid var(--line);
  }
  .related-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  .related-head h2 {
    margin: 0;
    font-size: 1.35rem;
  }
  .related-head a {
    display: inline-flex;
    gap: 0.4rem;
    align-items: center;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
  }

  @media (max-width: 56rem) {
    .hero {
      grid-template-columns: 1fr;
    }
    .main-photo {
      aspect-ratio: 4 / 3;
    }
    .body {
      grid-template-columns: 1fr;
      padding-top: 0;
    }
    .toc {
      position: sticky;
      top: calc(var(--header-h) + 3px);
      z-index: 5;
      display: flex;
      gap: 0.4rem;
      margin-inline: calc(-1 * var(--gutter));
      padding: 0.75rem var(--gutter);
      overflow-x: auto;
      border: 0;
      border-bottom: 1px solid var(--line);
      background: rgb(255 255 255 / 0.96);
      scrollbar-width: none;
    }
    .toc a {
      flex: none;
      margin: 0;
      padding: 0.4rem 0.8rem;
      border: 1px solid var(--line);
      border-radius: 999px;
      font-size: 0.85rem;
      white-space: nowrap;
    }
    .sections {
      grid-column: 1;
      padding-top: 1.5rem;
    }
    .specs div {
      grid-template-columns: 1fr;
      gap: 0.2rem;
    }
    .related-head {
      flex-direction: column;
    }
  }
}
:where(main[data-page="product"]) .warning .prose p:last-child {
  margin: 0;
}

@scope (main[data-page="navigator"]) to ([data-scope], [data-html] > *) {
  .layout {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: clamp(2rem, 5vw, 4rem);
    padding-top: 2.5rem;
  }
  .prompt {
    margin-bottom: 1rem;
    color: var(--graphite);
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
  }
  .steps {
    display: grid;
    gap: 1.5rem;
    align-content: start;
    margin: 0;
    padding: 1.75rem;
    background: var(--ink);
    color: #c9c9cd;
    list-style: none;
    border-radius: 4px;
  }
  li {
    display: flex;
    gap: 1rem;
  }
  li span {
    color: var(--orange);
  }
  h2 {
    margin-bottom: 0.3rem;
    color: #fff;
    font-size: 1.05rem;
  }
  li p {
    margin: 0;
    font-size: 0.92rem;
  }
  @media (max-width: 56rem) {
    .layout {
      grid-template-columns: 1fr;
    }
  }
}
@media (max-width: 30rem) {
  :where(main[data-page="navigator"]) .layout .tiles {
    grid-template-columns: 1fr;
  }
}

@scope (main[data-page="navigator-category"]) to ([data-scope], [data-html] > *) {
  .trail {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin: 0 0 1.25rem;
    padding: 0;
    list-style: none;
  }
  .trail a {
    display: inline-flex;
    gap: 0.5rem;
    align-items: center;
    padding: 0.35rem 0.8rem 0.35rem 0.4rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--graphite);
    font-size: 0.85rem;
    text-decoration: none;
  }
  .trail span {
    display: grid;
    place-items: center;
    width: 1.6rem;
    height: 1.6rem;
    border-radius: 50%;
    background: var(--gray);
    font-size: 0.7rem;
  }
  .trail a[aria-current] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
  }
  .trail a[aria-current] span {
    background: var(--orange);
    color: var(--ink);
  }
  .content {
    display: grid;
    gap: 3rem;
    padding-top: 2.5rem;
  }
  .found {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    color: var(--graphite);
    font-family: var(--font-head);
    font-size: 1.2rem;
    font-weight: 700;
  }
  .found svg {
    color: var(--orange-ink);
  }
  .none {
    padding: 1.5rem;
    background: var(--mist);
  }
}

@scope (main[data-page="all-products"]) to ([data-scope], [data-html] > *) {
  .filters {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    position: sticky;
    top: calc(var(--header-h) + 3px);
    z-index: 5;
    padding-block: 1.25rem;
    background: rgb(255 255 255 / 0.97);
  }
  .search {
    display: flex;
    flex: 1 1 18rem;
    gap: 0.6rem;
    align-items: center;
    padding: 0 1rem;
    border: 1px solid var(--line);
    border-radius: 3px;
    color: var(--muted);
  }
  .search:focus-within {
    border-color: var(--ink);
  }
  .search input {
    flex: 1;
    min-width: 0;
    padding: 0.8rem 0;
    border: 0;
    font: inherit;
  }
  .search input:focus {
    outline: none;
  }
  .chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
  }
  .chips button {
    padding: 0.45rem 0.85rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    color: var(--graphite);
    font: inherit;
    font-size: 0.85rem;
    cursor: pointer;
  }
  .chips button:hover {
    border-color: var(--graphite);
  }
  .chips [aria-pressed="true"] {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff;
  }
  .count {
    margin: 0 0 0 auto;
    color: var(--muted);
    font-size: 0.85rem;
  }

  .products {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
  }
  th {
    padding: 0.75rem 0.9rem;
    border-bottom: 2px solid var(--ink);
    color: var(--graphite);
    font-family: var(--font-head);
    font-size: 0.8rem;
    text-align: left;
  }
  td {
    padding: 0.8rem 0.9rem;
    border-bottom: 1px solid var(--line);
    vertical-align: top;
  }
  td.mono {
    font-size: 0.82rem;
    white-space: nowrap;
  }
  tbody tr:hover {
    background: var(--mist);
  }
  .name a {
    color: var(--ink);
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
  }
  .name a:hover {
    color: var(--orange-ink);
  }
  .empty {
    padding: 2rem 0;
    color: var(--muted);
  }

  @media (max-width: 48rem) {
    .filters {
      gap: 0.75rem;
    }
    .chips {
      flex-wrap: nowrap;
      margin-inline: calc(-1 * var(--gutter));
      padding-inline: var(--gutter);
      overflow-x: auto;
      scrollbar-width: none;
    }
    .chips button {
      flex: none;
    }
    .count {
      display: none;
    }
    thead {
      display: none;
    }
    .products,
    tbody,
    tr,
    td {
      display: block;
    }
    tr {
      padding: 1rem 0;
      border-bottom: 1px solid var(--line);
    }
    tr[hidden] {
      display: none;
    }
    td {
      padding: 0.15rem 0;
      border: 0;
    }
    td[data-label] {
      display: flex;
      gap: 0.5rem;
      color: var(--graphite);
      white-space: normal;
    }
    td[data-label]::before {
      content: attr(data-label) ":";
      color: var(--muted);
      font-family: var(--font-body);
    }
    .name a {
      font-size: 1.05rem;
    }
  }
}

@scope (main[data-page="cenik"]) to ([data-scope], [data-html] > *) {
  .download {
    margin-top: 1.5rem;
  }
  .download small {
    font-weight: 400;
    opacity: 0.75;
  }
  section {
    margin-top: clamp(2rem, 5vw, 3rem);
  }
  h2 {
    font-size: 1.4rem;
  }
  ul {
    margin: 0;
    padding: 0;
    border-top: 2px solid var(--ink);
    list-style: none;
  }
  li {
    display: grid;
    grid-template-columns: 12rem 1fr auto;
    gap: 1.5rem;
    align-items: baseline;
    padding: 0.9rem 0;
    border-bottom: 1px solid var(--line);
  }
  li a {
    color: var(--ink);
    text-decoration: none;
  }
  li a:hover {
    color: var(--orange-ink);
  }
  .summary {
    color: var(--muted);
    font-size: 0.92rem;
  }
  .price {
    color: var(--ink);
    font-size: 1.05rem;
    white-space: nowrap;
  }
  @media (max-width: 48rem) {
    li {
      grid-template-columns: 1fr auto;
      gap: 0.25rem 1rem;
    }
    .summary {
      grid-column: 1 / -1;
      grid-row: 2;
    }
  }
}

@scope (main[data-page="not-found"]) to ([data-scope], [data-html] > *) {
  section {
    padding-block: clamp(4rem, 12vw, 8rem);
  }
  .code {
    margin: 0;
    color: var(--orange-ink);
    font-size: 4rem;
    line-height: 1;
  }
  .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
  }
  .button.ghost {
    color: var(--orange-ink);
  }
}

/* Draft preview, admins only */
.preview-bar {
  padding: 0.5rem var(--gutter);
  background: var(--orange);
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
}
.preview-bar a {
  color: inherit;
}
