/* Allowed additions: product frame, value chips, stepper frame, threads, architecture scene.
   Tokens, borders and the net pattern come from the reference sheets. */

.landing-frame {
  scroll-margin-top: var(--header-offset);
}

body.home .site-header.is-scrolled {
  background: rgba(250, 252, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.hero .hero-visual {
  animation: fadeIn 0.45s ease forwards;
}

button.action,
button.nav-link {
  font-family: inherit;
  cursor: pointer;
}

.product-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  border-radius: var(--radius-lg);
  background: #fff;
  overflow: hidden;
  box-shadow: var(--shadow-control);
}

.product-frame::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background-image: var(--home-net-pattern);
  opacity: 0.45;
}

.product-frame-bar,
.product-frame-body {
  position: relative;
  z-index: 1;
}

.product-frame-bar {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-height: 2.25rem;
  padding: 0 var(--space-4);
  border-bottom: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
}

.product-frame-dots {
  display: inline-flex;
  gap: 0.3rem;
}

.product-frame-dots span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-nordic-sky) 45%, white);
}

.product-frame-name,
.doc-label,
.file-name {
  color: var(--text-muted);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  white-space: normal;
}

.product-frame-body {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: var(--space-2);
  padding: var(--space-3);
}

.product-frame-body > :only-child,
.step-panel,
.step-split,
.step-zoom,
.release-stage {
  grid-column: 1 / -1;
}

.frame-chat,
.frame-doc,
.frame-panel {
  min-width: 0;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  background: #fff;
  padding: var(--space-3);
}

.frame-chat,
.frame-doc,
.frame-panel,
.thread {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.frame-bubble,
.thread-item,
.open-point,
.comment,
.source-quote,
.trace-basis {
  margin: 0;
  color: var(--text-secondary);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.frame-kicker {
  display: block;
  margin-bottom: 0.15rem;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
}

.doc-row,
.file-row,
.drop-card {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
  padding-block: 0.3rem;
  border-bottom: 1px solid var(--border-subtler);
  color: var(--text-secondary);
  font-size: 0.6875rem;
}

.doc-label { flex: 1 1 auto; }

.doc-value {
  color: var(--text-primary);
  font-size: 0.6875rem;
  font-weight: 500;
  white-space: nowrap;
}

.doc-row--open,
.doc-row--focus {
  flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--color-nordic-sky) 35%, var(--border-subtler));
}

.doc-value--open {
  color: var(--color-primary-700);
  box-shadow: inset 0 -1px 0 var(--color-nordic-sky);
}

.value-chip {
  display: inline-flex;
  align-items: center;
  flex: none;
  min-height: 1.15rem;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  font-size: 0.625rem;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
}

.value-chip--source {
  color: var(--color-nordic-sky);
  background: color-mix(in srgb, var(--color-nordic-sky) 16%, white);
}

.value-chip--assumed {
  color: var(--color-spruce-green);
  background: color-mix(in srgb, var(--color-spruce-green) 14%, white);
}

.value-chip--open {
  color: var(--color-cloudberry);
  background: color-mix(in srgb, var(--color-cloudberry) 22%, white);
}

.value-chip--waiting {
  color: var(--text-muted);
  background: color-mix(in srgb, var(--text-muted) 14%, white);
}

.source-popover {
  flex: 1 0 100%;
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  background: #fff;
  box-shadow: var(--shadow-overlay);
}

.source-popover-ref {
  margin: 0 0 0.2rem;
  color: var(--color-nordic-sky);
  font-size: 0.625rem;
  font-weight: 600;
}

.source-popover q,
.source-quote {
  quotes: "\201C" "\201D";
}

.source-kicker,
.source-doc-title {
  margin: 0;
  font-size: 0.6875rem;
}

.source-kicker {
  color: var(--color-nordic-sky);
  font-weight: 600;
}

.source-doc-title {
  color: var(--text-primary);
  font-weight: 500;
}

.file-mark {
  flex: none;
  width: 0.85rem;
  height: 1rem;
  border: 1px solid color-mix(in srgb, var(--color-nordic-sky) 45%, white);
  border-radius: 2px;
  background: var(--color-primary-100);
}

.frame-label {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.625rem;
  font-weight: 600;
}

.thread {
  margin: 0;
  padding: 0;
  list-style: none;
}

.thread-item {
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  background: #fff;
}

.thread-item--resolved { color: var(--color-spruce-green); }

.line-head,
.line-row {
  display: grid;
  grid-template-columns: 6.2rem minmax(0, 1fr) auto;
  gap: var(--space-2);
  font-size: 0.6875rem;
  color: var(--text-secondary);
}

.line-head { color: var(--text-muted); font-size: 0.625rem; font-weight: 600; }

.line-row.is-hit {
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--color-nordic-sky) 16%, white);
  box-shadow: inset 2px 0 0 var(--color-nordic-sky);
  color: var(--text-primary);
  font-weight: 600;
}

.value-swap { display: inline-grid; }
.value-swap > .doc-value { grid-area: 1 / 1; }
.value-swap [data-temp-a],
.value-swap [data-rev-a] { opacity: 0; }

.content-snap-inner > .split-copy + * {
  margin-top: clamp(var(--space-8), 4.5vh, 2.75rem);
}

.package-stepper {
  display: flex;
  flex-direction: column;
  gap: clamp(var(--space-4), 2vh, var(--space-6));
}

.step-frame {
  height: 21rem;
}

.step-frame .product-frame-body {
  height: calc(21rem - 2.25rem);
  overflow: hidden;
}

.step-panel[hidden],
.split-layout[hidden] { display: none; }

.step-split,
.release-stage {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: var(--space-2);
}

.step-zoom { display: grid; }
.step-zoom > * { grid-area: 1 / 1; }
.step-zoom [data-anim="sheet"] { display: none; }

.release-docs,
.release-stage .package-card {
  position: relative;
  left: auto;
  top: auto;
  width: auto;
  max-width: none;
  grid-column: 1;
  grid-row: 1;
}

.release-stage .dms-slot {
  position: static;
  width: auto;
  margin: 0;
  grid-column: 2;
  grid-row: 1;
  align-self: center;
  padding: var(--space-3);
  border-radius: var(--radius-sm);
  border: 1px dashed color-mix(in srgb, var(--color-nordic-sky) 45%, white);
  color: var(--color-primary-700);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
}

.package-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--color-spruce-green) 35%, white);
  background: #fff;
}

.package-card strong {
  color: var(--text-primary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.package-card span {
  color: var(--text-secondary);
  font-size: 0.6875rem;
  line-height: 1.45;
}

.package-stepper.is-paused .platform-product-tab.is-active .platform-product-tab-progress::after {
  animation-play-state: paused;
}

.trace-board {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  min-width: 0;
}

.trace-docs {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  width: 100%;
}

#traceable .trace-board,
#traceable .trace-docs {
  width: 100%;
}

#traceable .trace-docs .product-frame {
  min-height: 16rem;
}

.trace-threads {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  overflow: visible;
  pointer-events: none;
}

#traceable .trace-docs .product-frame {
  z-index: 1;
}

.trace-thread {
  fill: none;
  stroke: color-mix(in srgb, var(--color-primary-500) 55%, transparent);
  stroke-width: 2px;
}

.trace-dot {
  fill: color-mix(in srgb, var(--color-primary-500) 55%, transparent);
}

.trace-board.is-done .trace-thread {
  stroke: var(--color-primary-500);
}

.trace-board.is-done .trace-dot {
  fill: var(--color-primary-500);
}

.trace-to { display: none; }
.trace-board.is-done .trace-from { display: none; }
.trace-board.is-done .trace-to { display: inline; }

.trace-pill {
  align-self: center;
  margin: 0;
  padding: var(--space-2) var(--space-3);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary-500) 12%, white);
  color: var(--color-primary-700);
  font-size: 0.8125rem;
  font-weight: 600;
  opacity: 0;
}

.trace-board.is-done .trace-pill { opacity: 1; }

.arch-pin {
  min-height: calc(100dvh - var(--header-offset));
}

.arch-scene {
  position: relative;
  width: 100%;
  height: min(22rem, 46vh);
  min-height: 14rem;
}

.arch-scene canvas,
.arch-fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.arch-fallback { display: none; }

.arch-scene.is-fallback .arch-fallback { display: block; }

.arch-step {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-2);
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.arch-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  align-self: center;
}

.arch-list li {
  padding-left: var(--space-4);
  border-left: 1px solid transparent;
}

.arch-list .foundation-pillar-title {
  text-align: left;
  color: var(--text-muted);
}

.arch-list li.is-active {
  border-left-color: var(--color-primary-500);
}

.arch-list li.is-active .foundation-pillar-title {
  color: var(--text-primary);
}

.arch-list .foundation-pillar-copy { display: none; }
.arch-list li.is-active .foundation-pillar-copy { display: block; }

[data-arch].is-static .arch-list .foundation-pillar-copy { display: block; }
[data-arch].is-static .arch-list .foundation-pillar-title { color: var(--text-primary); }

.request-dialog {
  margin: auto;
  width: min(26rem, calc(100vw - 2rem));
  padding: var(--space-6);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  border-radius: var(--radius-lg);
  background: #fff;
  color: var(--text-primary);
  box-shadow: var(--shadow-overlay);
}

.request-dialog::backdrop {
  background: rgba(29, 29, 31, 0.28);
}

.request-dialog h2 {
  margin: 0 var(--space-8) var(--space-4) 0;
  font-size: 1.125rem;
  font-weight: 500;
}

.request-close {
  position: absolute;
  top: var(--space-3);
  right: var(--space-3);
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
}

.request-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.request-field input {
  min-height: 2.25rem;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text-primary);
  font: inherit;
  font-size: 0.9375rem;
}

.request-confirm {
  margin: var(--space-2) 0 0;
}

.request-confirm p {
  margin: 0;
}

.request-fallback {
  margin-top: var(--space-3);
}

.request-fallback a {
  color: var(--color-primary-600);
}

.logo-label {
  color: var(--text-secondary);
  font-size: 0.6875rem;
  font-weight: 600;
  text-align: center;
}

.logo-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-4);
}

.logo-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-3);
  min-height: 7.5rem;
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--border-subtle) 20%, transparent);
  border-radius: var(--radius-lg);
  background: #fff;
}

.logo-mark {
  display: block;
  height: 28px;
  width: auto;
  max-width: 100%;
  color: var(--text-muted);
}

.logo-mark--missing { width: 28px; }

.logo-cell:hover .logo-mark { color: var(--text-primary); }

.logo-name {
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25;
  text-align: center;
}

#disciplines .content-snap-inner,
#disciplines [data-discipline-tabs] {
  min-width: 0;
  max-width: 100%;
}

#disciplines .platform-product-tabs {
  flex-wrap: nowrap;
  max-width: 100%;
  gap: var(--space-4);
}

#disciplines .platform-product-tab {
  flex: 1 0 auto;
  min-width: max-content;
  white-space: nowrap;
}

#security .security-grid {
  --foundation-pillar-columns: 3;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  min-height: 0;
  margin-bottom: 0;
}

#security .foundation-pillar {
  height: auto;
  align-self: stretch;
  box-sizing: border-box;
  padding: var(--space-5);
  justify-content: flex-start;
  gap: var(--space-3);
}

#security .foundation-pillar-viz {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  min-height: 24px;
  max-height: 24px;
  justify-content: flex-start;
}

#security .foundation-pillar-icon {
  width: 24px;
  height: 24px;
}

#security .foundation-pillar-icon path,
#security .foundation-pillar-icon rect,
#security .foundation-pillar-icon circle {
  fill: none;
  stroke: var(--color-nordic-sky);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#security .foundation-pillar-title,
#security .foundation-pillar-copy {
  text-align: left;
  width: 100%;
}

#industries .industry-grid { --product-tile-columns: 4; }

#industries .product-tile {
  align-items: center;
  justify-content: flex-start;
  min-height: 0;
  padding-right: var(--space-4);
  text-align: center;
}

#industries .product-tile::before { display: none; }

#industries .industry-drawing {
  display: block;
  width: min(100%, 16rem);
  height: 140px;
  margin-inline: auto;
}

#industries .industry-drawing path {
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#industries .product-tile-name {
  width: 100%;
  text-align: center;
}

@media (max-width: 820px), (prefers-reduced-motion: reduce) {
  .trace-from { display: none; }
  .trace-to { display: inline; }
  .trace-pill { opacity: 1; }
  .trace-thread { stroke: var(--color-primary-500); }
  .trace-dot { fill: var(--color-primary-500); }
  .release-docs { display: none; }
  .arch-list .foundation-pillar-copy,
  .arch-list li.is-active .foundation-pillar-copy { display: block; }
  .arch-list .foundation-pillar-title { color: var(--text-primary); }
}

@media (max-width: 1100px) {
  #disciplines .platform-product-tabs { overflow-x: auto; }
}

@media (max-width: 820px) {
  body.home .site-header:not(.is-scrolled) {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    box-shadow: none;
  }

  #disciplines .platform-product-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
  }

  #disciplines .platform-product-tab {
    flex: 0 0 auto;
    min-width: max-content;
    white-space: nowrap;
  }

  .product-frame-body,
  .step-split,
  .release-stage,
  .trace-docs {
    grid-template-columns: 1fr;
  }

  .release-stage .dms-slot {
    grid-column: 1;
    grid-row: 2;
  }

  .logo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  #security .security-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  #industries .industry-grid { --product-tile-columns: 2; }

  .step-frame .step-split,
  .step-frame .release-stage {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  #traceable .trace-docs .product-frame { min-height: 0; }
}

@media (max-width: 640px) {
  #security .security-grid {
    --foundation-pillar-columns: 1;
    grid-template-columns: 1fr;
  }
  #industries .industry-grid { --product-tile-columns: 1; }
}
