/* Brand tokens as start.mjs brand printed them for the client's colours (logo green #8CD024, black
   #231F20, white), the faces pointing at next/font's Urbanist. Loaded after the kit's stylesheets. */
:root {
  --p-bg: #ffffff; --p-surface: #f3f2f2; --p-ink: #231f20; --p-muted: #6e6c6c;
  --p-accent: #8cd024; --p-accent-ink: #111111; --p-action: #231f20; --p-action-ink: #ffffff;
  --p-inv-bg: #231f20; --p-inv-surface: #302c2d; --p-inv-ink: #ffffff; --p-inv-muted: #a4a2a2;
  --p-inv-accent: #8cd024; --p-inv-accent-ink: #111111; --p-inv-action: #8cd024; --p-inv-action-ink: #111111;
  --font-display: var(--font-urbanist), system-ui, sans-serif;
  --font-text: var(--font-urbanist), system-ui, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --display-weight: 500;
  --display-tracking: -0.03em;
  --display-tracking-xl: -0.04em;
  /* Urbanist runs wider than the kit's default grotesk: a 40-character h1 keeps to two lines */
  --ly-scale: 0.88;
  /* the lit ground behind diagrams and panels, in the brand's neutral instead of the kit's sand */
  --ground-bg: #eceee8; --ground-surface: #f8f9f5; --ground-ink: #231f20; --ground-muted: #5c5f58; --ground-accent: #8cd024;
}

h1, h2, h3 { text-wrap: balance; hyphens: manual; }
p, li { text-wrap: pretty; }
.btn, .nav__link, .rows__value, .t-label { white-space: nowrap; }

.nav__logo img { height: 34px; }
.footer .nav__logo img { height: 44px; }
@media (max-width: 639px) { .nav__logo img { height: 28px; } }

/* a cut-out still stands whole on its ground instead of being cropped like a photograph */
.frame__img.is-cutout { object-fit: contain; padding: var(--s-5); }

/* the 3D viewer: the still shows until the model has loaded, then the live canvas takes its place */
.frame > .viewer.viewer { position: absolute; inset: 0; max-width: none; }
.viewer__still { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.viewer model-viewer { position: absolute; inset: 0; width: 100%; height: 100%; background: none; opacity: 0; transition: opacity 400ms var(--ease); --poster-color: transparent; }
.viewer[data-live] model-viewer { opacity: 1; }
.viewer__controls { position: absolute; right: 0; bottom: var(--s-3); z-index: 2; display: flex; gap: var(--s-2); }
.viewer__controls button {
  display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink);
}
.viewer__controls button:hover { border-color: var(--ink); }
.viewer__controls svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.viewer__spot {
  display: inline-flex; align-items: center; gap: var(--s-2); height: 32px; padding: 0 var(--s-3) 0 var(--s-1); border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); font: 500 var(--t-small)/1 var(--font-text); white-space: nowrap;
  transform: translate(-50%, -50%); transition: opacity 200ms var(--ease);
}
.viewer__spot > span { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--p-accent); color: var(--p-accent-ink); }
.viewer__spot[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.viewer__step { position: absolute; left: 0; bottom: var(--s-4); z-index: 2; background: var(--bg); }
@media (max-width: 639px) {
  .viewer__spot { justify-content: center; width: 44px; height: 44px; padding: 0; font-size: 0; gap: 0; }
  .viewer__spot > span { font-size: var(--t-small); }
}

/* the hero's viewer stays inside the stage, so the fold never cuts its controls */
.hero--product .hero__stage > [data-product] { inset: 0; }

/* the two flow diagrams fill their frame */
.flow { padding: var(--s-5); min-height: 320px; }
.flow > .dg { width: 100%; }
.areas .rows__name > a { display: inline-flex; align-items: center; gap: var(--s-2); font: inherit; }
@media (max-width: 639px) { .areas .rows__name > a { min-height: 44px; } }
.rows > li > .rows__name { font: 500 var(--t-card)/1.3 var(--font-text); }
.rows > li > .link { grid-column: 1; justify-self: start; min-height: 44px; }

/* technologies: the six rows, then the machine across the wrap as the way into its page */
.tech .rows > li { scroll-margin-top: calc(var(--nav) + var(--s-5)); }
.tech .rows__value { align-self: start; color: var(--muted); }
.tech .rows__name > a { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; }
.tech .rows__name > a:hover { text-decoration-color: currentColor; }
.tech .rows > li > p { grid-column: 1 / -1; max-width: none; }
main > section > .wrap > .fill.tech__band { min-height: 140px; }
.tech:has(#polybet:target) [data-area="plasty"],
.tech:has(#multiferm:target) [data-area="bioodpady"],
.tech:has(#susarna-kalu:target) [data-area="kaly"],
.tech:has(#packwall:target) [data-area="cirkularni"] { border-bottom-color: var(--p-accent); box-shadow: 0 2px 0 var(--p-accent); }
.tech__band { --ratio: 0px; margin-top: var(--s-6); min-height: 200px; background: var(--surface); }
.tech__band > .frame__img { object-fit: cover; object-position: 50% 60%; }
@media (max-width: 639px) {
  .tech .rows > li { grid-template-columns: minmax(0, 1fr); }
  .tech .rows__value { grid-column: 1; grid-row: auto; text-align: left; }
}

/* the phases and the process: the stills are cut-outs, shown whole on the frame's ground */
[data-moment="pinned-chapters"] .mo-pc__visual > img { object-fit: contain; }
[data-moment="pinned-chapters"] .mo-pc__text > .section-head { margin-bottom: 0; }
[data-moment="pinned-chapters"] .mo-pc__text > .section-head > .link { justify-self: start; }
/* live, the frame is square and the stage centred, so the space above and below it matches the other sections */
main [data-moment="pinned-chapters"][data-moment].is-live > .mo-pc__grid { align-content: center; }
[data-moment="pinned-chapters"].is-live .mo-pc__visuals { aspect-ratio: 1 / 1; }
/* at rest the steps stand as rows: one screen on a tablet, two on a phone, so the next section starts on a screen line */
@media (min-width: 640px) and (max-width: 1023px) { [data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual > img { max-height: 21svh; } }
/* a phone, upright or on its side: the phases are a row of cards to swipe, the next one peeking in */
@media (max-width: 639px), (max-height: 560px) {
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__steps {
    display: flex; gap: var(--s-4); margin-inline: calc(var(--gut) * -1); padding: 0 var(--gut) var(--s-2);
    overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: var(--gut); overscroll-behavior-x: contain; scrollbar-width: none;
  }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__steps::-webkit-scrollbar { display: none; }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step {
    flex: 0 0 84%; display: flex; flex-direction: column; scroll-snap-align: start; margin: 0; padding: var(--s-4);
    border: 1px solid var(--line); border-radius: var(--r-card, 12px); opacity: 1;
  }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step > figure { order: -1; margin: 0 0 var(--s-4); }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step > * { align-self: stretch; }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual > img { aspect-ratio: 4 / 3; width: 100%; max-height: none; }
}

/* the client's name from line to line, at every width */
.closing__cta.close--word { container-type: inline-size; }
.closing__cta .close__word { font-size: 12.5cqw; line-height: 1; white-space: nowrap; }

.specs__label { margin-bottom: var(--s-4); color: var(--muted); }
.specs__band { --ratio: 0px; margin-top: var(--s-6); min-height: 180px; background: none; }
.specs__band > .frame__img.is-cutout { padding: 0; }
.rows--spec > li { grid-template-columns: auto minmax(0, 1fr); }
.rows--spec .rows__value { white-space: normal; }
@media (max-width: 1023px) {
  .rows--spec > li { grid-template-columns: minmax(0, 1fr); }
  .rows--spec .rows__value { grid-column: 1; grid-row: auto; text-align: left; }
  /* stacked, a frame takes what its screens leave: the machine fills it instead of standing small in a tall box */
  .benefits .frame__img.is-cutout, .specs__band > .frame__img.is-cutout { object-fit: cover; padding: 0; }
}
.footer__col address { font-style: normal; }

.viewer[data-key-focus] model-viewer { outline: 2px solid var(--action); outline-offset: -2px; }
.viewer model-viewer::part(default-progress-bar) { display: none; }

/* a phone, upright or on its side: sections take the height of what they hold, and the frames that fill a desktop screen get a fixed shape */
@media (max-width: 639px), (max-height: 560px) {
  main > :is(section, .section):not(.hero), footer.closing { min-height: 0; }
  main > :is(section, .section) > .wrap > .fill { flex: none; }
  main > :is(section, .section) .grid.fill > .frame--fill { flex: none; height: auto; min-height: 0; }
  main > :is(section, .section) .grid.fill > .flow { aspect-ratio: 4 / 5; }
  main > :is(section, .section) .grid.fill > .frame--photo, main > section > .wrap > .tech__band { aspect-ratio: 4 / 3; min-height: 0; margin-top: var(--s-5); }
  .dg[data-tier] .dg-cap { white-space: nowrap; max-width: none; }
  .viewer__step { bottom: calc(var(--s-3) + 44px + var(--s-3)); left: var(--s-3); padding: var(--s-2) var(--s-3); border: 1px solid var(--line-strong); border-radius: 999px; min-height: 0; }
}

/* a phone on its side: two cards in view, and the hero's machine gets a stage of its own under the words */
@media (min-width: 640px) and (max-height: 560px) {
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__step { flex-basis: 44%; }
  section[data-moment="pinned-chapters"]:not(.is-live) .mo-pc__visual > img { aspect-ratio: 16 / 9; }
  main > :is(section, .section).hero { height: auto; min-height: 0; }
  main > :is(section, .section) .grid.fill > .flow { aspect-ratio: auto; height: 340px; }
  main > :is(section, .section) .grid.fill > .frame--photo, main > section > .wrap > .tech__band { aspect-ratio: 21 / 9; }
}
