/* One template of the Unisson « Gabarits » model (section.sec.gab, .container.wide, .gab-head, .gab-body,
   .gab-actions, .btn, .chip, .pro): its rules, selectors moved into the shadow tree, colours read from the --pack-*
   tokens. The section is its own 1408 px row. The uses box of its slot stays in view while the preview scrolls, as
   the model's sticky aside. The white inner ring of the buttons is --bythium-on-brand-primary, white in both themes as
   in the model. Motion only under no-preference, each transition capped at 300 ms. */
:host {
  display: block;
  min-inline-size: 0;
  scroll-margin-block-start: 90px;
  color: var(--pack-ink);
  font:
    16px / 1.6 Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  font-feature-settings: normal;
  letter-spacing: normal;
  -webkit-font-smoothing: antialiased;
}
:host([hidden]) {
  display: none;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
h2,
p {
  margin: 0;
}
:focus-visible {
  outline: 2px solid var(--pack-focus);
  outline-offset: 3px;
  border-radius: 6px;
}
.gab {
  inline-size: min(1408px, 100% - 32px);
  margin-inline: auto;
  padding-block-start: 72px;
}
.head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px 24px;
  margin-block-end: 22px;
}
[part="number"] {
  color: var(--pack-link);
  font:
    700 12px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
[part="heading"] {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-block-start: 8px;
  font:
    800 clamp(26px, 3.2vw, 36px) / 1.15 Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  letter-spacing: -0.03em;
}
/* .pro */
[part="mark"] {
  display: inline-flex;
  align-items: center;
  min-block-size: 24px;
  padding: 0 10px;
  border-radius: 99px;
  border: 1px solid var(--pack-c2);
  background: var(--pack-panel2);
  color: var(--pack-ink);
  font:
    700 12px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
  letter-spacing: 0.02em;
}
[part="lead"] {
  margin-block-start: 10px;
  max-inline-size: 66ch;
  color: var(--pack-mut);
  font-size: 16px;
}
[part="chips"] {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
[part="chip"] {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-block-size: 28px;
  padding: 0 12px;
  border-radius: 99px;
  border: 1px solid var(--pack-line2);
  background: var(--pack-panel2);
  color: var(--pack-mut);
  font:
    600 12px ui-monospace,
    "JetBrains Mono",
    Menlo,
    Consolas,
    monospace;
}
.body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 20px;
  align-items: start;
}
::slotted([slot="uses"]) {
  position: sticky;
  inset-block-start: 84px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block-start: 18px;
}
/* .btn.sm and .btn.ghost. The base sheet styles every button and anchor: undone by the model's own values. */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-block-size: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  font:
    700 14px Inter,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  color: var(--pack-btnink);
  background: linear-gradient(120deg, var(--pack-btn1), var(--pack-btn2) 60%, var(--pack-btn3));
  background-size: 160% 100%;
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--bythium-on-brand-primary) 18%, transparent) inset,
    0 10px 30px -10px var(--pack-a2),
    0 0 28px -6px var(--pack-a1);
}
.btn:hover {
  background: linear-gradient(120deg, var(--pack-btn1), var(--pack-btn2) 60%, var(--pack-btn3));
  background-size: 160% 100%;
  background-position: 100% 0;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px color-mix(in oklch, var(--bythium-on-brand-primary) 30%, transparent) inset,
    0 14px 36px -10px var(--pack-a2),
    0 0 40px -4px var(--pack-a1);
}
.btn svg {
  flex: none;
}
.ghost,
.ghost:hover {
  color: var(--pack-ink);
  background: var(--pack-panel2);
  box-shadow: 0 0 0 1px var(--pack-line2) inset;
  backdrop-filter: blur(10px);
}
[part="note"] {
  color: var(--pack-mut);
  font-size: 13.5px;
}
/* .gab .code: the panel sits 16 px under the actions; bythium-pack-code keeps 18 px above its own panel. */
[part="code"] {
  margin-block-start: -2px;
}
[part="code"][hidden] {
  display: none;
}
[part="status"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
@media (max-width: 1099px) {
  .body {
    grid-template-columns: minmax(0, 1fr);
  }
  ::slotted([slot="uses"]) {
    position: relative;
    inset-block-start: auto;
  }
}
@media (max-width: 700px) {
  :host {
    scroll-margin-block-start: 150px;
  }
  .gab {
    padding-block-start: 56px;
  }
  .btn {
    flex: 1;
  }
}
@media (prefers-reduced-motion: no-preference) {
  .btn {
    transition:
      background-position 300ms,
      transform 200ms,
      box-shadow 300ms;
  }
}
/* Forced colours: the gradients are dropped, the buttons keep a visible edge. */
@media (forced-colors: active) {
  .btn {
    border: 1px solid currentcolor;
  }
}
