/* Home — International product engineering art direction */

/* —— Hero: product ecosystem as visual center —— */
.hero--stage {
  --stage-shift-x: 0px;
  --stage-shift-y: 0px;
  min-height: calc(100vh - var(--header-h));
  display: flex;
  align-items: center;
  padding-block: clamp(48px, 6vh, 80px) var(--space-10);
  overflow: hidden;
  position: relative;
  isolation: isolate;
}

/* Soft technological atmosphere — not gradient blob, structured wash */
.hero--stage::before {
  content: "";
  position: absolute;
  right: -8%;
  top: 8%;
  width: min(58vw, 820px);
  height: min(70vh, 720px);
  background:
    radial-gradient(ellipse 70% 55% at 60% 40%, rgba(193, 122, 58, 0.07), transparent 70%),
    radial-gradient(ellipse 50% 40% at 30% 70%, rgba(47, 90, 140, 0.04), transparent 65%);
  pointer-events: none;
  z-index: 0;
}

.hero--stage::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--color-border) 1px, transparent 1px),
    linear-gradient(90deg, var(--color-border) 1px, transparent 1px);
  background-size: 80px 80px;
  opacity: 0.18;
  mask-image: radial-gradient(ellipse 70% 80% at 72% 50%, #000 10%, transparent 72%);
  pointer-events: none;
  z-index: 0;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.92fr) minmax(0, 1.35fr);
  gap: clamp(32px, 4vw, 56px);
  align-items: center;
  width: 100%;
  position: relative;
  z-index: 1;
}

.hero--stage .hero__content {
  max-width: none;
  position: relative;
  z-index: 3;
}

.hero--stage .hero__content .display-xl {
  max-width: 10ch;
  font-size: clamp(52px, 6.8vw, 80px);
  margin-bottom: var(--space-5);
  line-height: 1.02;
}

.hero--stage .hero__content .body-lg {
  max-width: 26em;
  margin-bottom: var(--space-6);
  font-size: clamp(17px, 1.3vw, 19px);
}

/* —— Stage canvas —— */
.hero__stage {
  position: relative;
  min-height: 560px;
  height: clamp(540px, 68vh, 680px);
  z-index: 1;
  perspective: 1400px;
}

.stage-plane {
  position: absolute;
  inset: 4% 2% 6% 0;
  border: 1px solid rgba(216, 213, 206, 0.7);
  background: rgba(250, 250, 248, 0.35);
  transform: translate3d(calc(var(--stage-shift-x) * 0.35), calc(var(--stage-shift-y) * 0.35), 0);
  transition: opacity 800ms var(--ease-out);
  opacity: 0;
  z-index: 0;
}

.hero__stage.is-assembled .stage-plane {
  opacity: 1;
}

.stage-channel {
  position: absolute;
  left: 6%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--color-border) 15%, var(--color-signal) 50%, var(--color-border) 85%, transparent);
  opacity: 0;
  transition: opacity 700ms var(--ease-out) 200ms;
  z-index: 1;
}

.hero__stage.is-assembled .stage-channel {
  opacity: 0.9;
}

.stage-panel {
  position: absolute;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.6) inset,
    0 18px 50px rgba(42, 40, 37, 0.08);
  opacity: 0;
  transform: translate3d(0, 36px, 0) scale(0.97);
  transition:
    opacity 750ms var(--ease-out),
    transform 750ms var(--ease-out),
    border-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
  will-change: transform, opacity;
  overflow: hidden;
}

.hero__stage.is-assembled .stage-panel {
  opacity: 1;
  transition:
    opacity 750ms var(--ease-out),
    transform 120ms linear,
    border-color 200ms var(--ease-out),
    box-shadow 200ms var(--ease-out);
}

.hero__stage.is-assembled .stage-panel--dash {
  transform: translate3d(calc(var(--stage-shift-x) * -0.4), calc(var(--stage-shift-y) * -0.25), 0);
  transition-delay: 60ms;
}
.hero__stage.is-assembled .stage-panel--terminal {
  transform: translate3d(calc(var(--stage-shift-x) * 0.55), calc(var(--stage-shift-y) * 0.2), 0);
  transition-delay: 180ms;
}
.hero__stage.is-assembled .stage-panel--mobile {
  transform: translate3d(calc(var(--stage-shift-x) * 0.9), calc(var(--stage-shift-y) * -0.45), 0);
  transition-delay: 280ms;
}
.hero__stage.is-assembled .stage-panel--arch {
  transform: translate3d(calc(var(--stage-shift-x) * -0.2), calc(var(--stage-shift-y) * 0.55), 0);
  transition-delay: 380ms;
}
.hero__stage.is-assembled .stage-panel--status {
  transform: translate3d(calc(var(--stage-shift-x) * 0.3), calc(var(--stage-shift-y) * 0.15), 0);
  transition-delay: 460ms;
}

.stage-panel--dash {
  left: 0;
  top: 4%;
  width: 74%;
  height: 66%;
  z-index: 2;
}

.stage-panel--terminal {
  left: 8%;
  bottom: 2%;
  width: 46%;
  height: 30%;
  z-index: 4;
  background: #2a2825;
  border-color: #3a3835;
  color: #fafaf8;
}

.stage-panel--mobile {
  right: 0;
  top: 10%;
  width: 32%;
  height: 72%;
  z-index: 5;
  border-radius: 22px;
  background: #1f1e1c;
  border-color: #3a3835;
  box-shadow: 0 24px 60px rgba(42, 40, 37, 0.22);
}

.stage-panel--arch {
  right: 28%;
  bottom: 0;
  width: 34%;
  height: 24%;
  z-index: 3;
}

.stage-panel--status {
  right: 34%;
  top: 0;
  width: 24%;
  z-index: 6;
  padding: 14px 16px;
}

.stage-signal {
  position: absolute;
  z-index: 7;
  pointer-events: none;
  opacity: 0;
}

.hero__stage.is-assembled .stage-signal {
  opacity: 1;
  transition: opacity 400ms var(--ease-out) 520ms;
}

.stage-signal--h {
  height: 1px;
  background: linear-gradient(90deg, var(--color-signal), rgba(193, 122, 58, 0.2));
  transform-origin: left center;
  transform: scaleX(0);
}

.hero__stage.is-assembled .stage-signal--h {
  animation: signal-draw 800ms var(--ease-out) 580ms forwards;
}

.stage-signal__node {
  position: absolute;
  width: 7px;
  height: 7px;
  background: var(--color-signal);
  box-shadow: 0 0 0 4px rgba(193, 122, 58, 0.15);
}

.stage-signal__node--pulse {
  animation: node-pulse 2.4s var(--ease-out) 1.2s infinite;
}

@keyframes node-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(193, 122, 58, 0.12); }
  50% { box-shadow: 0 0 0 8px rgba(193, 122, 58, 0.05); }
}

/* —— Dashboard UI —— */
.ui-dash {
  height: 100%;
  display: grid;
  grid-template-columns: 88px 1fr;
  background: var(--color-surface);
}

.ui-dash__rail {
  border-right: 1px solid var(--color-border);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--color-canvas);
}

.ui-dash__brand {
  font-family: var(--font-display);
  font-size: 15px;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}

.ui-dash__dot {
  width: 100%;
  height: 7px;
  background: var(--color-border);
}

.ui-dash__dot.is-active {
  background: var(--color-signal);
  height: 32px;
}

.ui-dash__main {
  padding: 16px 18px;
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: 12px;
  min-width: 0;
}

.ui-dash__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.ui-dash__title {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 1.7vw, 1.55rem);
  margin: 0;
  letter-spacing: -0.02em;
}

.ui-dash__chips {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.ui-chip {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 4px 7px;
  background: var(--color-canvas);
}

.ui-chip--live {
  color: var(--color-success);
  border-color: rgba(63, 107, 74, 0.35);
  background: rgba(63, 107, 74, 0.08);
}

.ui-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.ui-metric {
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  padding: 10px 11px;
}

.ui-metric__k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.ui-metric__v {
  font-size: clamp(1rem, 1.5vw, 1.35rem);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin: 0;
}

.ui-metric__d {
  font-size: 10px;
  color: var(--color-success);
  margin: 4px 0 0;
}

.ui-body {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 8px;
  min-height: 0;
}

.ui-chart {
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  padding: 12px 10px 10px;
  display: flex;
  align-items: flex-end;
  gap: 5px;
  min-height: 0;
  position: relative;
}

.ui-chart__label {
  position: absolute;
  top: 8px;
  left: 10px;
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.ui-chart__bar {
  flex: 1;
  background: var(--color-signal);
  opacity: 0.3;
  transform-origin: bottom;
  transform: scaleY(0);
  transition: transform 750ms var(--ease-out);
  height: 40%;
}

.hero__stage.is-assembled .ui-chart__bar {
  transform: scaleY(1);
}

.hero__stage.is-assembled .ui-chart__bar:nth-child(1) { transition-delay: 700ms; height: 34%; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(2) { transition-delay: 740ms; height: 48%; opacity: .4; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(3) { transition-delay: 780ms; height: 42%; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(4) { transition-delay: 820ms; height: 68%; opacity: .55; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(5) { transition-delay: 860ms; height: 52%; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(6) { transition-delay: 900ms; height: 84%; opacity: .7; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(7) { transition-delay: 940ms; height: 60%; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(8) { transition-delay: 980ms; height: 76%; opacity: .85; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(9) { transition-delay: 1020ms; height: 58%; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(10) { transition-delay: 1060ms; height: 94%; opacity: 1; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(11) { transition-delay: 1100ms; height: 70%; opacity: .75; }
.hero__stage.is-assembled .ui-chart__bar:nth-child(12) { transition-delay: 1140ms; height: 88%; opacity: .9; }

.ui-table {
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  padding: 8px 0;
  overflow: hidden;
  font-size: 10px;
}

.ui-table__row {
  display: grid;
  grid-template-columns: 1.2fr 0.7fr 0.6fr;
  gap: 6px;
  padding: 6px 10px;
  color: var(--color-text-muted);
}

.ui-table__row--head {
  font-family: var(--font-mono);
  font-size: 8px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2px;
}

.ui-table__row strong {
  color: var(--color-text);
  font-weight: 500;
}

.ui-table__status {
  color: var(--color-success);
}

.ui-footer-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  padding-top: 2px;
}

.ui-footer-line i {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--color-signal);
  margin-right: 6px;
  vertical-align: middle;
  font-style: normal;
}

/* Terminal */
.ui-term {
  height: 100%;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 1.55;
  color: rgba(250, 250, 248, 0.78);
}

.ui-term__head {
  display: flex;
  gap: 6px;
  margin-bottom: 12px;
}

.ui-term__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #5a5855;
}

.ui-term__line {
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
}

.hero__stage.is-assembled .ui-term__line {
  opacity: 1;
  transform: none;
  transition: opacity 400ms var(--ease-out), transform 400ms var(--ease-out);
}

.hero__stage.is-assembled .ui-term__line:nth-child(2) { transition-delay: 700ms; }
.hero__stage.is-assembled .ui-term__line:nth-child(3) { transition-delay: 820ms; }
.hero__stage.is-assembled .ui-term__line:nth-child(4) { transition-delay: 940ms; }
.hero__stage.is-assembled .ui-term__line:nth-child(5) { transition-delay: 1060ms; }
.hero__stage.is-assembled .ui-term__line:nth-child(6) { transition-delay: 1180ms; }

.ui-term__accent {
  color: #c17a3a;
}

.ui-term__ok {
  color: #7dba8a;
}

/* Phone */
.ui-phone {
  height: 100%;
  margin: 10px;
  border-radius: 14px;
  background: var(--color-surface);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.ui-phone__notch {
  width: 38%;
  height: 5px;
  margin: 10px auto 0;
  background: var(--color-border);
  border-radius: 4px;
}

.ui-phone__body {
  padding: 16px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}

.ui-phone__h {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0;
  letter-spacing: -0.02em;
}

.ui-phone__muted {
  font-size: 10px;
  color: var(--color-text-muted);
  margin: 0;
  font-family: var(--font-mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ui-phone__card {
  border: 1px solid var(--color-border);
  background: var(--color-canvas);
  padding: 9px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 8px;
  align-items: start;
}

.ui-phone__node {
  width: 7px;
  height: 7px;
  margin-top: 3px;
  background: var(--color-signal);
}

.ui-phone__card p {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.ui-phone__card span {
  display: block;
  color: var(--color-text-muted);
  font-size: 10px;
  margin-top: 3px;
}

.ui-phone__progress {
  height: 3px;
  background: var(--color-border);
  margin-top: 4px;
  overflow: hidden;
}

.ui-phone__progress > i {
  display: block;
  height: 100%;
  width: 0;
  background: var(--color-signal);
  font-style: normal;
}

.hero__stage.is-assembled .ui-phone__progress > i {
  width: 68%;
  transition: width 900ms var(--ease-out) 1100ms;
}

.ui-phone__cta {
  margin-top: auto;
  background: var(--color-text);
  color: var(--color-on-primary);
  text-align: center;
  padding: 10px;
  font-size: 12px;
  font-weight: 500;
}

/* Architecture strip */
.ui-arch {
  height: 100%;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

.ui-arch__label {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
}

.ui-arch__track {
  display: flex;
  align-items: center;
  gap: 0;
}

.ui-arch__step {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text);
  white-space: nowrap;
}

.ui-arch__line {
  flex: 1;
  height: 1px;
  background: var(--color-border);
  margin: 0 7px;
  position: relative;
  min-width: 12px;
}

.ui-arch__line::after {
  content: "";
  position: absolute;
  right: -2px;
  top: -2.5px;
  width: 5px;
  height: 5px;
  background: var(--color-signal);
  opacity: 0;
}

.hero__stage.is-assembled .ui-arch__line::after {
  opacity: 1;
  transition: opacity 300ms var(--ease-out) 1000ms;
}

.ui-meta__k {
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0 0 6px;
}

.ui-meta__v {
  font-size: 13px;
  margin: 0;
  line-height: 1.4;
}

.ui-meta__row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--color-border);
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--color-text-muted);
}

.ui-meta__row strong {
  color: var(--color-text);
  font-weight: 500;
}

@media (max-width: 1100px) {
  .ui-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .ui-metrics .ui-metric:nth-child(n + 3) {
    display: none;
  }
  .ui-body {
    grid-template-columns: 1fr;
  }
  .ui-table {
    display: none;
  }
}

@media (max-width: 1024px) {
  .hero__grid {
    grid-template-columns: 1fr;
    gap: var(--space-7);
  }

  .hero__stage {
    order: -1;
    min-height: 460px;
    height: 480px;
  }

  .hero--stage .hero__content .display-xl {
    max-width: none;
  }

  .stage-panel--mobile {
    width: 30%;
  }
}

@media (max-width: 640px) {
  .hero--stage {
    padding-block: var(--space-6) var(--space-8);
    min-height: auto;
  }

  .hero__stage {
    height: 400px;
    min-height: 400px;
  }

  .stage-panel--dash {
    width: 88%;
    height: 62%;
  }

  .stage-panel--mobile {
    width: 36%;
    height: 58%;
    top: 8%;
  }

  .stage-panel--terminal {
    width: 58%;
    height: 28%;
  }

  .stage-panel--arch,
  .stage-panel--status {
    display: none;
  }

  .hero--stage::after {
    opacity: 0.1;
  }
}

/* —— Services with depth —— */
.home-services {
  padding-block: var(--space-10);
}

.service-depth {
  margin-top: var(--space-2);
}

.service-list__row {
  align-items: start;
  padding-block: var(--space-7);
}

.service-list__body {
  display: grid;
  gap: var(--space-3);
}

.service-list__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.service-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
  padding: 4px 8px;
  background: transparent;
}

.service-list__row:hover .service-tag {
  border-color: rgba(42, 40, 37, 0.28);
  color: var(--color-text);
}

/* —— Work cases —— */
.work-stack {
  display: flex;
  flex-direction: column;
  gap: var(--space-11);
}

.work-case {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: var(--space-7) clamp(24px, 3vw, 48px);
  align-items: center;
  text-decoration: none;
  color: inherit;
}

.work-case__media {
  border: 1px solid var(--color-border);
  background: var(--color-surface);
  overflow: hidden;
  aspect-ratio: 16 / 10;
  position: relative;
  box-shadow: 0 20px 50px rgba(42, 40, 37, 0.06);
}

.work-case--featured .work-case__media {
  aspect-ratio: 16 / 9;
}

.work-case__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 500ms var(--ease-out);
}

.work-case:hover .work-case__media {
  border-color: rgba(42, 40, 37, 0.4);
}

.work-case:hover .work-case__media img {
  transform: scale(1.03);
}

.work-case__frame {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 2px;
  background: var(--color-signal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 500ms var(--ease-out);
}

.work-case:hover .work-case__frame,
.work-case.is-in .work-case__frame {
  transform: scaleX(1);
}

.work-case__body {
  min-width: 0;
}

.work-case__eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.work-case__eyebrow .mono-label {
  margin: 0;
}

.work-case__node {
  width: 6px;
  height: 6px;
  background: var(--color-signal);
  flex-shrink: 0;
}

.work-case__name {
  font-family: var(--font-display);
  font-size: clamp(2rem, 3.4vw, 2.85rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 0 var(--space-2);
}

.work-case__system {
  font-size: var(--type-body-lg);
  color: var(--color-text);
  margin: 0 0 var(--space-4);
  font-weight: 500;
}

.work-case__result {
  font-size: var(--type-body-lg);
  color: var(--color-text-muted);
  margin: 0 0 var(--space-6);
  max-width: 30em;
  line-height: 1.55;
}

.work-case__roles {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-2) var(--space-4);
  margin: 0;
  padding-top: var(--space-5);
  border-top: 1px solid var(--color-border);
}

.work-case__roles dt {
  font-family: var(--font-mono);
  font-size: var(--type-label);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 0;
  padding-top: 0.15em;
}

.work-case__roles dd {
  margin: 0;
  font-size: var(--type-body-sm);
  color: var(--color-text);
  line-height: 1.45;
}

.work-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8) var(--gutter);
}

.work-pair .work-case {
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
  align-items: stretch;
}

.work-pair .work-case__media {
  aspect-ratio: 16 / 11;
}

.work-pair .work-case__name {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
}

.work-pair .work-case__result {
  font-size: var(--type-body-md);
  margin-bottom: var(--space-4);
}

@media (max-width: 900px) {
  .work-case,
  .work-case--featured,
  .work-pair {
    grid-template-columns: 1fr;
  }
}

/* Process weight */
.home-process .section-head {
  margin-bottom: var(--space-9);
}

.home-process .process__connector {
  background: linear-gradient(90deg, var(--color-signal), var(--color-border));
}
