@layer template-important, vendor, mui, template, cms, template-theme, overrides;
/* src/components/konektus/base.css */
@layer template {
/*
 * konektus base layer — the Bootstrap reboot rules this theme depends on.
 *
 * Smaller than dcn's equivalent (`dcn/styles/base.css`) because konektus already sets its own
 * font, colour and background on `body` below; what it never stated is the
 * box model and the document margin, both of which came from Bootstrap.
 *
 * Loaded in Bootstrap's old slot, before the theme sheet.
 */

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

/* `:has()` so the rule stays inert on the other tenants' routes — see dcn/styles/base.css. */
body {
  margin: 0;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
}

img,
svg {
  vertical-align: middle;
}

p,
ol,
ul,
dl {
  margin-top: 0;
  margin-bottom: 1rem;
}
h1,
h2,
h3,
h4,
h5,
h6 {
  margin-top: 0;
  margin-bottom: 0.5rem;
  font-weight: 500;
  line-height: 1.2;
}

label {
  display: inline-block;
}

input,
button,
select,
optgroup,
textarea {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
button {
  border-radius: 0;
}
button,
[type='button'],
[type='reset'],
[type='submit'] {
  -webkit-appearance: button;
}
}

/* src/components/konektus/konektus.css */
@layer template-theme {
/*
 * konektus styles. Ported from src/host/konektus/style/syle.css.
 */
body {
  color-scheme: dark;
  --k-bg: #070707;
  --k-bg-soft: #0f0f0f;
  --k-text: #f5f5f5;
  --k-accent: #ffffff;

  min-height: 100vh;
  background: radial-gradient(1200px 800px at 50% -200px, #1b1b1b, var(--k-bg));
  color: var(--k-text);
  /* Space Grotesk is loaded by the revision's font link (Google Fonts). */
  font-family: 'Space Grotesk', 'Segoe UI', sans-serif;
}

/*
 * Shared data-view tokens for konektus.
 *
 * The views (`components/cms/data-views/*`) are byte-for-byte the same components dcn renders — the
 * entire difference between the two tenants below is these token values. Nothing here restyles the
 * DOM or the slot mapping; it only recolours/retypes konektus's dark theme. This is the proof of
 * the standardization: a second tenant is a token sheet, not a reimplementation.
 */
body {
  --cms-view-title-color: var(--k-text);
  --cms-view-meta-color: color-mix(in srgb, var(--k-text) 65%, transparent);
  --cms-view-excerpt-color: color-mix(in srgb, var(--k-text) 78%, transparent);
  --cms-view-accent: var(--k-accent);
  --cms-view-media-radius: 12px;
}
/* CardGrid: a soft dark panel instead of dcn's #f9faf9; roomier gutter. */
.cms-view-grid {
  --cms-view-grid-gap: 28px;
  --cms-view-card-bg: var(--k-bg-soft);
  --cms-view-card-pad: 20px;
  --cms-view-title-size: 18px;
  --cms-view-title-weight: 600;
  --cms-view-title-line: 1.35;
  --cms-view-title-gap: 10px;
  --cms-view-excerpt-gap: 10px;
}
/* MediaList: konektus sidebar rhythm. */
.cms-view-list {
  --cms-view-list-row-gap: 18px;
  --cms-view-list-media: 96px;
  --cms-view-title-size: 15px;
  --cms-view-title-weight: 500;
  --cms-view-meta-gap: 4px;
}

.logo {
  width: clamp(180px, 40vw, 360px);
  max-width: 100%;
  height: auto;
  margin: 0;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.08));
  position: relative;
  z-index: 2;
}

.logo-contact {
  width: clamp(140px, 32vw, 260px);
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  filter: drop-shadow(0 0 22px rgba(255, 255, 255, 0.08));
}

.logo-rotor {
  position: relative;
  display: grid;
  place-items: center;
  width: clamp(230px, 50vw, 440px);
  height: clamp(230px, 50vw, 440px);
}

.logo-rotor .ring-layer {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: auto;
  z-index: 1;
  pointer-events: none;
}

.ring-1 {
  animation: k-spin 20s linear infinite reverse;
  opacity: 0.9;
  width: 84%;
}

.ring-2 {
  animation: k-spin 20s linear infinite reverse;
  opacity: 1;
  width: 100%;
}

@keyframes k-spin {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

.logo-wrap {
  text-align: center;
}

/*
 * ===== `dynamic_data`: the rest of the block =====
 *
 * konektus registers the shared block and writes only what is below. The grid/list tokens further
 * up already cover the two card views; this covers the section heading, the pager, the carousel,
 * the track list and the streaming dialog — every remaining piece of the block, expressed as token
 * values and a handful of button rules.
 *
 * The shared defaults assume a light page (white dialog, `rgba(0,0,0,…)` hovers), so a dark theme
 * is a good exercise of the seams: everything below is a value, never a restyle of the structure.
 */

/* Section heading. */
.cms-data-section {
  --cms-data-section-head-gap: 28px;
  --cms-data-section-title-gap: 10px;
  --cms-data-section-cta-gap: 1.25rem;
}
.cms-data-section .cms-data-section-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.2;
  color: var(--k-text);
}
.cms-data-section .cms-data-section-subtitle {
  color: color-mix(in srgb, var(--k-text) 70%, transparent);
}
.cms-data-section-cta {
  color: var(--k-accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Pager: pill numbers, inverted on the current page. */
.cms-pager {
  --cms-pager-gap: 36px;
  --cms-pager-size: 36px;
  --cms-pager-radius: 999px;
  --cms-pager-color: color-mix(in srgb, var(--k-text) 75%, transparent);
  --cms-pager-hover-bg: rgba(255, 255, 255, 0.08);
  --cms-pager-hover-color: var(--k-text);
  --cms-pager-active-bg: var(--k-accent);
  --cms-pager-active-color: var(--k-bg);
  --cms-pager-active-hover-bg: var(--k-accent);
}

/* Carousel: a wider gutter, arrows tucked inside the rail. */
.cms-view-carousel {
  --cms-view-carousel-gap: 40px;
}
.cms-view-carousel-arrows {
  --cms-view-carousel-arrow-inset: 8px;
}
.cms-view-carousel-arrows .slick-arrow {
  color: var(--k-text);
  font-size: 20px;
}

/* Track list. */
.cms-tracklist-item {
  --cms-tracklist-gap: 14px;
  --cms-tracklist-indent: 34px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  color: color-mix(in srgb, var(--k-text) 85%, transparent);
}
.cms-tracklist-play {
  color: var(--k-accent);
}
.cms-tracklist-duration {
  position: absolute;
  right: 0;
  bottom: 14px;
  font-size: 14px;
  color: color-mix(in srgb, var(--k-text) 60%, transparent);
}

/* Artist social marks — the shared inline SVGs, sized for this theme. */
.cms-view-socials {
  --cms-view-socials-size: 18px;
  --cms-view-socials-icon-gap: 1rem;
  --cms-view-socials-color: color-mix(in srgb, var(--k-text) 80%, transparent);
}

/* Streaming dialog: the dark counterpart of the shared light default. */
.cms-streaming-dialog {
  --cms-streaming-width: 420px;
  --cms-streaming-backdrop: rgba(0, 0, 0, 0.7);
}
.cms-streaming-panel {
  --cms-streaming-bg: var(--k-bg-soft);
  --cms-streaming-radius: 14px;
  --cms-streaming-border: 1px solid rgba(255, 255, 255, 0.12);
  --cms-streaming-shadow: 0 24px 60px rgba(0, 0, 0, 0.6);
  --cms-streaming-close-color: color-mix(in srgb, var(--k-text) 60%, transparent);
  color: var(--k-text);
}
.cms-streaming-trigger,
.cms-streaming-play {
  display: inline-block;
  padding: 8px 20px;
  border: 1px solid var(--k-accent);
  border-radius: 999px;
  background: transparent;
  color: var(--k-accent);
  font: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease;
}
.cms-streaming-trigger:hover,
.cms-streaming-play:hover {
  background: var(--k-accent);
  color: var(--k-bg);
}
.cms-streaming-trigger:disabled {
  opacity: 0.45;
  cursor: default;
}

/*
 * ===== Content pages: home and contact as CMS blocks =====
 *
 * konektus's two pages are content now — a section of `richtext` (the layered logo) and
 * `call_to_action` on home, the logo, the generic `form` and a "Back to Home" `call_to_action` on
 * contact — so their look moves from the hand-built classes above onto the blocks' `cms-*` tree.
 * Each page is recognised by what its section holds (`:has(.logo-rotor)`, `:has(.cms-form)`), the
 * same way the hand-built pages were recognised by their root class.
 */

/* The master has an empty header and footer: nothing to show, so no band either. */
.cms-header:not(:has(.cms-container > *)),
.cms-footer:not(:has(.cms-container > *)) {
  display: none;
}

.cms-richtext > :first-child {
  margin-top: 0;
}
.cms-richtext > :last-child {
  margin-bottom: 0;
}

/* Home: the old `.hero` — one centred column, the full height of the screen. */
.cms-section:has(.logo-rotor) {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  gap: 2rem;
}
.cms-section:has(.logo-rotor) > .cms-row,
.cms-section:has(.logo-rotor) .cms-col {
  display: flex;
  justify-content: center;
  width: auto;
  margin: 0;
  padding: 0;
}

/* The old `.btn-contact`: every call-to-action button is this pill... */
.cms-cta-actions {
  display: flex;
  justify-content: center;
  margin: 0;
}
.cms-cta-button {
  display: inline-block;
  padding: 0.9rem 2.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: transparent;
  color: var(--k-accent);
  transition: all 0.2s ease;
}
.cms-cta-button:hover,
.cms-cta-button:focus {
  background: var(--k-accent);
  color: #0a0a0a;
  box-shadow: 0 12px 30px rgba(255, 255, 255, 0.2);
}

/* Contact: the old `.page`. */
.cms-section:has(.cms-form) {
  min-height: 100vh;
  padding: 3.5rem 1rem 4rem;
}
.cms-section:has(.cms-form) > .cms-container {
  max-width: none;
  padding: 0;
}
.logo-contact-wrap {
  margin: 0;
}

/* ...except the contact page's way back, which is the old quiet `.btn-link`. */
.cms-section:has(.cms-form) .cms-cta-actions {
  max-width: 640px;
  margin: 1rem auto 0;
}
.cms-section:has(.cms-form) .cms-cta-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  color: rgba(255, 255, 255, 0.7);
}
.cms-section:has(.cms-form) .cms-cta-button:hover,
.cms-section:has(.cms-form) .cms-cta-button:focus {
  background: none;
  box-shadow: none;
  color: var(--k-accent);
}

/* The form: the old `.card-dark` and the `contact-*` vocabulary, rule for rule. */
.cms-form {
  background: rgba(12, 12, 12, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  padding: clamp(1.5rem, 4vw, 2.75rem);
  max-width: 640px;
  margin: 0 auto;
  backdrop-filter: blur(8px);
}
.cms-form > .cms-container {
  max-width: none;
  padding: 0;
}
.cms-form-head {
  margin: 0;
  text-align: center;
}
.cms-form-title {
  margin: 0 0 1rem;
  font-size: calc(1.275rem + 0.3vw);
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  color: var(--k-text);
}
.cms-form-intro {
  margin: 0 0 1.5rem;
  text-align: center;
  color: #f8f9fa;
  opacity: 0.75;
}
.cms-form-intro > p {
  margin: 0;
}
.cms-form-alert {
  display: flex;
  align-items: center;
  margin-bottom: 1rem;
  padding: 1rem;
  border: 1px solid transparent;
  border-radius: 6px;
}
.cms-form-alert[data-state='success'] {
  color: #0a3622;
  background-color: #d1e7dd;
  border-color: #a3cfbb;
}
.cms-form-alert[data-state='error'] {
  color: #58151c;
  background-color: #f8d7da;
  border-color: #f1aeb5;
}
.cms-form-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 0;
}
@media (min-width: 768px) {
  .cms-form-fields {
    grid-template-columns: 1fr 1fr;
  }
}
.cms-form-field {
  margin: 0;
  padding: 0;
  width: auto;
}
.cms-form-field[data-span='full'] {
  grid-column: 1 / -1;
}
.cms-form-label {
  display: inline-block;
  margin-bottom: 0.5rem;
  color: var(--k-text);
}
.cms-form-control {
  display: block;
  width: 100%;
  padding: 0.375rem 0.75rem;
  font: inherit;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  border-radius: 6px;
  appearance: none;
  background: #0b0b0b;
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--k-text);
}
/* Five lines, as the hand-built form's `rows="5"`. */
textarea.cms-form-control {
  height: calc(7.5em + 0.75rem + 2px);
  resize: vertical;
}
.cms-form-control:focus {
  outline: none;
  border-color: rgba(255, 255, 255, 0.6);
  box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.12);
}
.cms-form-control[aria-invalid='true'] {
  padding-right: 2.25rem;
}
.cms-form-error {
  display: block;
  width: 100%;
  margin-top: 0.25rem;
  font-size: 0.875em;
  color: #dc3545;
}
.cms-form-submit {
  display: block;
  margin: 1.5rem auto 0;
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
  text-align: center;
  cursor: pointer;
  user-select: none;
  padding: 0.85rem 2.4rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-radius: 999px;
  border: none;
  background: var(--k-accent);
  color: #0a0a0a;
}
.cms-form-submit:disabled {
  pointer-events: none;
  opacity: 0.65;
}

/*
 * ===== Home: the diorama =====
 *
 * What the home page needs around the `script_module` block running `js/diorama.js` (built from
 * template-scripts/konektus/diorama.js in kosterme-public-client). These rules exist only here.
 *
 * Three states, all keyed off the page (`body:has()`), not the block's place in it:
 *
 *   loading  from the first paint: the block's element, rendered by the server, already names the
 *            script. The spinning logo stays where it always is and is the loader; the button
 *            waits (its space kept, so nothing moves), and appears anyway after 15 s in case the
 *            script never runs.
 *   ready    the script has drawn its first frame (`.k-diorama.ready`): the map fades in and the
 *            logo and the button arrive in their places over it.
 *   off      WebGL is missing or the script failed (`.k-diorama-off`): the plain home page.
 */
body:has(.cms-script[data-script='js/diorama.js']) {
  overflow: hidden;
}
body:has(.cms-script[data-script='js/diorama.js']):not(:has(.k-diorama.ready, .k-diorama-off)) .cms-cta {
  visibility: hidden;
  animation: k-diorama-give-up 0s 15s forwards;
}
@keyframes k-diorama-give-up {
  to {
    visibility: visible;
  }
}

.k-diorama {
  position: fixed;
  inset: 0;
  z-index: 0;
}
.k-diorama canvas {
  display: block;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.8s ease;
}
.k-diorama.ready canvas {
  opacity: 1;
}

/* Ready: the logo and the button float over the map, top and bottom centre... */
body:has(.k-diorama.ready) .logo-rotor {
  position: fixed;
  top: clamp(10px, 2.4vh, 30px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  width: clamp(120px, 22vh, 220px);
  height: clamp(120px, 22vh, 220px);
  pointer-events: none;
}
body:has(.k-diorama.ready) .logo-rotor .logo {
  width: 80%;
}
body:has(.k-diorama.ready) .cms-cta {
  position: fixed;
  bottom: clamp(18px, 5vh, 52px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
}
body:has(.k-diorama.ready) .cms-cta-button {
  white-space: nowrap;
  background: rgba(7, 7, 7, 0.55);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
body:has(.k-diorama.ready) .cms-cta-button:hover,
body:has(.k-diorama.ready) .cms-cta-button:focus {
  background: var(--k-accent);
}

/* ...or, on a landscape screen where the map runs corner to corner, the two free corners. */
body:has(.k-diorama.ready.wide) .logo-rotor {
  top: clamp(14px, 3.4vh, 40px);
  left: auto;
  right: clamp(18px, 3.2vw, 56px);
  transform: none;
  width: clamp(130px, 25vh, 250px);
  height: clamp(130px, 25vh, 250px);
}
body:has(.k-diorama.ready.wide) .cms-cta {
  left: clamp(22px, 6vw, 110px);
  bottom: clamp(24px, 9vh, 96px);
  transform: none;
}

/* Their arrival, while the map fades in under them. `scale`, not `transform`, which places them. */
body:has(.k-diorama.ready) .logo-rotor,
body:has(.k-diorama.ready) .cms-cta {
  animation: k-diorama-arrive 1.2s ease both;
}
@keyframes k-diorama-arrive {
  from {
    opacity: 0;
    scale: 0.9;
  }
}

@media (prefers-reduced-motion: reduce) {
  body:has(.k-diorama) .ring-layer {
    animation: none;
  }
  body:has(.k-diorama.ready) .logo-rotor,
  body:has(.k-diorama.ready) .cms-cta {
    animation: none;
  }
}
}
