/* =============================================================
   Architecture page
   ============================================================= */

/* ---- Hero: text left, layered-stack visual right ---- */
.arch-hero {
  padding: 56px 0 48px;
  overflow: hidden;
}
@media (min-width: 768px) { .arch-hero { padding: 80px 0 64px; } }

.arch-hero__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
  align-items: center;
}
@media (min-width: 920px) {
  .arch-hero__grid { grid-template-columns: 1.05fr 1fr; gap: 64px; }
}

.arch-hero h1 {
  margin: 0 0 var(--space-5);
  font-size: clamp(36px, 5.4vw, 56px);
  line-height: 1.02;
  letter-spacing: -0.025em;
  color: var(--dh-navy);
  font-weight: var(--fw-medium);
}
.arch-hero__sub {
  font-size: var(--fs-18);
  color: var(--fg-2);
  max-width: 560px;
  margin: 0 0 var(--space-6);
  line-height: var(--lh-loose);
}
.arch-hero__buttons {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-7);
}
.arch-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6) var(--space-7);
}
.arch-hero__meta .item { display: grid; gap: 2px; }
.arch-hero__meta .num {
  font-size: var(--fs-24);
  font-weight: var(--fw-bold);
  color: var(--dh-navy);
  line-height: 1.1;
}
.arch-hero__meta .lbl {
  font-size: var(--fs-13, 13px);
  color: var(--fg-2);
}

/* ---- Isometric layered stack ---- */
.arch-hero__visual { display: none; }
@media (min-width: 920px) {
  .arch-hero__visual {
    display: flex;
    justify-content: center;
  }
}

.arch-stack {
  position: relative;
  width: 460px;
  height: 440px;
}

/* float wrapper: positions + bobs; inner plane holds the isometric transform */
.arch-stack__float {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  animation: archBob 7s ease-in-out infinite;
}
.arch-stack__float--dh      { top: 18px;  padding-left: 44px; z-index: 3; }
.arch-stack__float--bi      { top: 162px; padding-left: 22px; z-index: 2; animation-delay: -2.3s; }
.arch-stack__float--content { top: 306px; padding-left: 0;    z-index: 1; animation-delay: -4.6s; }

@keyframes archBob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-7px); }
}
@media (prefers-reduced-motion: reduce) {
  .arch-stack__float { animation: none; }
}

.arch-stack__plane {
  width: 268px;
  height: 160px;
  flex-shrink: 0;
  border-radius: var(--radius-md);
  transform: rotateX(57deg) rotateZ(-42deg);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Layer 1: Digital Hive */
.arch-stack__plane--dh {
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(135deg, var(--dh-navy) 0%, var(--dh-navy-700) 100%);
  border: 1px solid var(--dh-navy-500);
  box-shadow:
    0 28px 48px rgba(25, 51, 89, 0.32),
    0 0 0 1px rgba(255, 255, 255, 0.06) inset;
}
.arch-stack__search {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  width: 170px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, 0.75);
  font-size: 12px;
}
.arch-stack__brand {
  font-size: var(--fs-16);
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: 0.01em;
}
.arch-stack__brand strong {
  color: var(--dh-orange);
  font-weight: var(--fw-bold);
}

/* Layers 2 & 3: tool planes with logos */
.arch-stack__plane--tools {
  gap: 22px;
  background: var(--dh-white);
  border: 1px solid var(--border-1);
  box-shadow: 0 22px 40px rgba(25, 51, 89, 0.14);
}
.arch-stack__plane--tools img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}
.arch-stack__plane--muted {
  background: var(--dh-grey-50);
  box-shadow: 0 18px 32px rgba(25, 51, 89, 0.10);
}

/* Side labels */
.arch-stack__tag {
  position: relative;
  z-index: 2;
  margin-left: -26px;
  padding: 5px 14px;
  background: var(--dh-white);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-pill);
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--fg-2);
  white-space: nowrap;
  box-shadow: var(--shadow-1);
}
.arch-stack__tag--dh {
  background: var(--dh-orange);
  border-color: var(--dh-orange);
  color: #fff;
}

/* ---- Main section ---- */
.arch-main { padding: 56px 0 80px; }
@media (min-width: 768px) { .arch-main { padding: 64px 0 96px; } }
.arch-main .section-head { margin-bottom: var(--space-7); }

/* ---- Two-column layout ---- */
.arch-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  align-items: start;
}
@media (min-width: 860px) {
  .arch-grid { grid-template-columns: 1.75fr 1fr; gap: 56px; }
}

/* ---- Diagram card ---- */
.arch-diagram__card {
  background: var(--bg-2);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-2);
}

/* Cascade the layers top-to-bottom once the card scrolls in — the reveal
   walks the eye down the request flow (People → … → existing systems).
   The card frame slides in via .arch-diagram.reveal; its rows fill after.
   The global prefers-reduced-motion block snaps these visible instantly. */
.arch-diagram__card > * {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.arch-diagram.is-visible .arch-diagram__card > * { opacity: 1; transform: none; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(1) { transition-delay: 40ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(2) { transition-delay: 85ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(3) { transition-delay: 130ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(4) { transition-delay: 175ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(5) { transition-delay: 220ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(6) { transition-delay: 265ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(7) { transition-delay: 310ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(8) { transition-delay: 355ms; }
.arch-diagram.is-visible .arch-diagram__card > *:nth-child(9) { transition-delay: 400ms; }

/* ---- Generic layer ---- */
.arch-layer {
  text-align: center;
}
.arch-layer__label {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-3);
  margin: 0 0 var(--space-3);
}
.arch-layer__note {
  font-size: var(--fs-13, 13px);
  color: var(--fg-2);
  margin: var(--space-3) 0 0;
  font-style: italic;
  text-align: center;
}

/* ---- Existing-systems layer ---- */
.arch-layer--existing {
  border-top: 1px solid var(--border-2);
  padding-top: var(--space-4);
  margin-top: 0;
}

/* ---- People pills ---- */
.arch-people {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-2);
}
.arch-pill {
  padding: 6px 18px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-pill);
  font-size: var(--fs-13, 13px);
  font-weight: var(--fw-medium);
  color: var(--fg-1);
  background: var(--bg-1);
}
.arch-pill--active {
  background: var(--dh-navy);
  color: #fff;
  border-color: var(--dh-navy);
}

/* ---- Connector (arrow between layers) ---- */
.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-2) 0;
}
.arch-connector__line {
  width: 1px;
  height: 20px;
  background: var(--border-1);
}
.arch-connector__label {
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--fg-3);
  line-height: 1;
  margin: 1px 0;
}
.arch-connector__arrow {
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--dh-grey-300);
}

/* ---- Two-column box grid ---- */
.arch-boxes { display: grid; gap: var(--space-3); }
.arch-boxes--2 { grid-template-columns: 1fr 1fr; }

.arch-box {
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  background: var(--bg-1);
  text-align: center;
}
/* Connector boxes carry a group label + chips — those read better left-aligned */
.arch-box:has(.arch-box__group) { text-align: left; }
.arch-box strong {
  display: block;
  font-size: var(--fs-14);
  font-weight: var(--fw-semibold);
  color: var(--dh-navy);
  margin-bottom: 4px;
}
.arch-box > span {
  font-size: var(--fs-13, 13px);
  color: var(--fg-2);
  line-height: 1.4;
}
.arch-box__group {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-3);
  margin: 0 0 var(--space-2);
}
.arch-box--muted {
  background: var(--bg-3);
  border-style: dashed;
}
.arch-box--muted strong {
  font-weight: var(--fw-medium);
  color: var(--fg-2);
  margin: 0;
}

/* ---- Tool chips inside connector boxes ---- */
.arch-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.arch-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px 4px 6px;
  border: 1px solid var(--border-1);
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: var(--fw-medium);
  color: var(--fg-1);
  background: var(--bg-2);
  white-space: nowrap;
}
.arch-chip img {
  width: 14px;
  height: 14px;
  object-fit: contain;
  flex-shrink: 0;
  display: block;
}
.arch-chip--text {
  padding-left: 8px;
  color: var(--fg-2);
}
.arch-chip--text svg {
  flex-shrink: 0;
  color: var(--fg-3);
}

/* ---- Digital Hive Server tier ---- */
.arch-server {
  background: var(--dh-navy);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  text-align: left;
}
.arch-server__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.arch-server__name {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: #fff;
}
.arch-server__sub {
  font-size: var(--fs-12);
  color: rgba(255,255,255,0.48);
  letter-spacing: 0.04em;
}
.arch-server__modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.arch-server__modules span {
  padding: 7px 14px;
  background: rgba(255,255,255,0.09);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius-md);
  font-size: var(--fs-13, 13px);
  font-weight: var(--fw-medium);
  color: rgba(255,255,255,0.9);
}

/* ---- Three-column captions ---- */
.arch-captions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
  padding: var(--space-3) 0;
}
.arch-caption {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}
.arch-caption p {
  font-size: 10px;
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--fg-3);
  margin: 0 0 4px;
  line-height: 1.45;
}
.arch-caption--accent p {
  color: var(--dh-orange);
}
.arch-caption__arrow {
  width: 1px;
  height: 20px;
  background: var(--border-1);
  position: relative;
  flex-shrink: 0;
}
.arch-caption__arrow::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: -4px;
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--dh-grey-300);
}

/* ---- Why it works sidebar ---- */
.arch-why {
  position: sticky;
  top: 88px;
}
.arch-why__eyebrow {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  color: var(--fg-3);
  margin: 0 0 var(--space-5);
  display: block;
}
.arch-why__list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.arch-why__list li {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border-2);
}
.arch-why__list li:first-child { border-top: 1px solid var(--border-2); }
.arch-why__num {
  font-size: var(--fs-12);
  font-weight: var(--fw-bold);
  color: var(--dh-orange);
  letter-spacing: 0.04em;
  padding-top: 2px;
}
.arch-why__title {
  font-size: var(--fs-15, 15px);
  font-weight: var(--fw-bold);
  color: var(--dh-navy);
  margin: 0 0 4px;
}
.arch-why__desc {
  font-size: var(--fs-14);
  color: var(--fg-2);
  margin: 0;
  line-height: 1.5;
}

/* Stagger the numbered principles in top-down — reinforces the 01→05 order.
   The aside carries .reveal; items pick up individually once it's visible.
   The global prefers-reduced-motion block neutralises this automatically. */
.arch-why__list li {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out);
}
.arch-why.is-visible .arch-why__list li { opacity: 1; transform: none; }
.arch-why.is-visible .arch-why__list li:nth-child(1) { transition-delay: 60ms; }
.arch-why.is-visible .arch-why__list li:nth-child(2) { transition-delay: 120ms; }
.arch-why.is-visible .arch-why__list li:nth-child(3) { transition-delay: 180ms; }
.arch-why.is-visible .arch-why__list li:nth-child(4) { transition-delay: 240ms; }
.arch-why.is-visible .arch-why__list li:nth-child(5) { transition-delay: 300ms; }

/* -----------------------------------------------------------
   Bottom CTA — navy panel (matches Home / Product / About)
   ----------------------------------------------------------- */
.pr-cta {
  position: relative;
  overflow: hidden;
  padding: 40px 0;
  background: var(--dh-navy);
  color: #fff;
}
@media (min-width: 768px) { .pr-cta { padding: 56px 0; } }
.pr-cta__motif {
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 52'><polygon points='30,1 59,17 59,35 30,51 1,35 1,17' fill='none' stroke='%23ffffff' stroke-width='0.4' stroke-opacity='0.06'/></svg>");
  background-size: 60px 52px;
  pointer-events: none;
}
.pr-cta .container { position: relative; z-index: 1; }
.pr-cta__grid {
  display: grid;
  gap: var(--space-6);
  align-items: center;
  grid-template-columns: 1fr;
}
@media (min-width: 720px) { .pr-cta__grid { grid-template-columns: 1fr auto; gap: 48px; } }
.pr-cta__copy { max-width: 620px; }
.pr-cta h3 {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 500;
  color: #fff;
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  line-height: 1.12;
}
.pr-cta p {
  font-size: var(--fs-18);
  color: rgba(255,255,255,0.78);
  margin: 0 0 var(--space-5);
  line-height: 1.55;
  max-width: 56ch;
}
.pr-cta__buttons { display: flex; flex-wrap: wrap; gap: var(--space-3); }
.pr-cta .btn--accent {
  background: var(--dh-orange);
  color: #fff;
  border: 1px solid var(--dh-orange);
}
@media (hover: hover) {
  .pr-cta .btn--accent:hover { background: var(--link-hover); border-color: var(--link-hover); }
  .pr-cta .btn--accent:hover .arrow { transform: translateX(3px); }
}
.pr-cta .btn--accent .arrow { transition: transform var(--dur-base) var(--ease-out); }
.btn--ghost-light {
  padding: 12px 22px;
  font-weight: var(--fw-bold);
  font-size: var(--fs-16);
}
.pr-cta__art { display: none; }
@media (min-width: 720px) {
  .pr-cta__art { display: flex; align-items: center; justify-content: center; }
}
.pr-cta__stack { width: 220px; height: 220px; flex-shrink: 0; }
@keyframes archFlow { to { stroke-dashoffset: -20; } }
.arch-flow {
  stroke-dasharray: 4 6;
  animation: archFlow 2.2s linear infinite;
}
@media (prefers-reduced-motion: reduce) { .arch-flow { animation: none; } }

/* ---- Mobile overrides ---- */
@media (max-width: 600px) {
  .arch-boxes--2    { grid-template-columns: 1fr; }
  .arch-captions    { grid-template-columns: 1fr; }
  .arch-diagram__card { padding: var(--space-4); }
  .arch-why         { position: static; }
}
