/* AlgoArtisans AI Office — lightweight living diorama */

.office-section {
  width: min(94%, 1200px);
  margin: 0 auto;
  padding: 5rem 0 4rem;
  display: grid;
  gap: 2.5rem;
}

@media (min-width: 1100px) {
  .office-section {
    grid-template-columns: 0.85fr 1.15fr;
    align-items: start;
    gap: 2.5rem 3rem;
  }
}

.office-copy .sectionHeader {
  max-width: 12ch;
}

.office-statement {
  margin-top: 1.5rem;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--accent-strong);
  line-height: 1.55;
}

.office-stage-wrap {
  position: relative;
}

.office-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1rem;
  margin-bottom: 0.85rem;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(148, 163, 184, 0.65);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.office-meta em {
  font-style: normal;
  color: var(--accent);
}

.office-viewport {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--navy-border);
  border-radius: var(--radius-xl);
  background: #05080f;
  aspect-ratio: 16 / 11;
  min-height: 320px;
  isolation: isolate;
}

.office-camera {
  width: 100%;
  height: 100%;
  transform-origin: 50% 45%;
  transition: transform 0.9s var(--ease);
  will-change: transform;
}

.ai-office {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  opacity: 0.28;
  filter: brightness(0.45);
  transition: opacity 0.8s ease, filter 0.8s ease;
}

.office-section.is-lit .ai-office {
  opacity: 1;
  filter: none;
}

.office-floor {
  position: absolute;
  left: -5%;
  right: -5%;
  bottom: 0;
  height: 42%;
  background:
    linear-gradient(180deg, transparent, rgba(7, 11, 20, 0.35)),
    repeating-linear-gradient(90deg, rgba(148, 163, 184, 0.04) 0 1px, transparent 1px 28px),
    linear-gradient(180deg, #121a2b, #0a101c);
  transform: perspective(500px) rotateX(52deg);
  transform-origin: center top;
}

.office-wall {
  position: absolute;
  inset: 0 0 38% 0;
  background:
    linear-gradient(180deg, #0b1220 0%, #101a2c 100%);
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.office-window {
  position: absolute;
  top: 8%;
  right: 7%;
  width: 22%;
  height: 28%;
  border: 1px solid rgba(56, 189, 248, 0.18);
  background:
    radial-gradient(circle at 30% 40%, rgba(56, 189, 248, 0.12), transparent 55%),
    linear-gradient(160deg, rgba(14, 165, 233, 0.08), transparent);
  box-shadow: inset 0 0 30px rgba(14, 165, 233, 0.08);
}

.office-brand {
  position: absolute;
  top: 10%;
  left: 6%;
  font-family: var(--font-serif);
  font-size: clamp(0.85rem, 1.6vw, 1.1rem);
  color: rgba(232, 238, 247, 0.45);
  letter-spacing: 0.04em;
}

/* Project board */
.project-board {
  position: absolute;
  left: 50%;
  top: 14%;
  transform: translateX(-50%) scale(0.92);
  width: min(58%, 340px);
  padding: 0.55rem 0.6rem 0.65rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 10px;
  background: rgba(7, 11, 20, 0.88);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity 0.5s ease, transform 0.5s var(--ease);
  z-index: 4;
}

.office-section[data-office-phase="1"] .project-board,
.office-section.is-active .project-board {
  opacity: 1;
  transform: translateX(-50%) scale(1);
}

.project-board__title {
  font-size: 0.55rem;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 0.45rem;
}

.project-board__cols {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.3rem;
}

.pb-col span {
  display: block;
  font-size: 0.42rem;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-bottom: 0.25rem;
  text-align: center;
}

.pb-card {
  font-size: 0.48rem;
  color: var(--muted-strong);
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  padding: 0.35rem 0.2rem;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.3s ease, color 0.3s ease, transform 0.4s var(--ease);
}

.pb-card.is-active {
  border-color: rgba(34, 211, 238, 0.55);
  color: var(--white);
  transform: translateY(-2px);
}

/* Network */
.office-net {
  position: absolute;
  inset: 18% 8% 12% 8%;
  width: auto;
  height: auto;
  z-index: 2;
  opacity: 0;
  transition: opacity 0.6s ease;
  pointer-events: none;
}

.office-section.is-networked .office-net {
  opacity: 1;
}

.net-line {
  fill: none;
  stroke: rgba(34, 211, 238, 0.28);
  stroke-width: 0.35;
  stroke-dasharray: 2 2;
}

.net-packet {
  fill: var(--accent);
  opacity: 0;
}

.packet-toast {
  position: absolute;
  top: 46%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 8;
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  color: var(--accent);
  background: rgba(7, 11, 20, 0.85);
  border: 1px solid rgba(34, 211, 238, 0.35);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
  pointer-events: none;
  white-space: nowrap;
}

.packet-toast[hidden] { display: none; }

/* Desks */
.desk {
  position: absolute;
  width: 18%;
  min-width: 86px;
  border: none;
  background: transparent;
  color: inherit;
  padding: 0;
  cursor: pointer;
  z-index: 5;
  opacity: 0.35;
  filter: grayscale(0.4);
  transition: opacity 0.45s ease, filter 0.45s ease, transform 0.4s var(--ease);
  text-align: center;
}

.desk.is-awake {
  opacity: 1;
  filter: none;
}

.ai-office.is-focusing .desk:not(.is-focused) {
  opacity: 0.22;
  filter: grayscale(0.6) brightness(0.7);
}

.desk.is-focused {
  z-index: 7;
  transform: translateY(-4px) scale(1.04);
}

.desk-light {
  position: absolute;
  top: -6px;
  left: 50%;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.35);
  transform: translateX(-50%);
  box-shadow: none;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.desk.is-awake .desk-light {
  background: var(--accent);
  box-shadow: 0 0 10px rgba(34, 211, 238, 0.55);
}

.desk.is-working .desk-light {
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.85);
}

.desk-surface {
  height: 10px;
  margin-top: 58%;
  border-radius: 3px;
  background: linear-gradient(180deg, #1a2438, #101827);
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
}

.monitor {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 78%;
  aspect-ratio: 5 / 3.4;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 4px 4px 2px 2px;
  background: #060a12;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.4);
}

.monitor::after {
  content: '';
  position: absolute;
  left: 45%;
  bottom: -7px;
  width: 10%;
  height: 7px;
  background: #1a2438;
}

.screen {
  width: 100%;
  height: 100%;
  padding: 0.3rem;
  font-size: 0.38rem;
  letter-spacing: 0.06em;
  color: rgba(148, 163, 184, 0.75);
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  opacity: 0.25;
  transition: opacity 0.4s ease;
}

.desk.is-awake .screen {
  opacity: 1;
}

.screen--atlas ul {
  list-style: none;
  display: grid;
  gap: 0.08rem;
}

.screen--atlas li.is-on {
  color: var(--accent);
}

.progress {
  margin-top: auto;
  height: 2px;
  background: rgba(148, 163, 184, 0.2);
  border-radius: 2px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  width: 35%;
  background: var(--accent);
  animation: progressPulse 3.2s ease-in-out infinite;
}

@keyframes progressPulse {
  0%, 100% { width: 28%; }
  50% { width: 72%; }
}

.screen--nova {
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  position: relative;
}

.screen--nova b { color: var(--accent); font-weight: 400; }

.arch-pulse {
  position: absolute;
  inset: 10% 20%;
  border: 1px solid transparent;
  border-image: linear-gradient(180deg, transparent, rgba(34, 211, 238, 0.5), transparent) 1;
  opacity: 0;
}

.desk.is-working .arch-pulse {
  animation: archScan 2.4s linear infinite;
  opacity: 1;
}

@keyframes archScan {
  from { transform: translateY(-40%); opacity: 0; }
  30% { opacity: 1; }
  to { transform: translateY(40%); opacity: 0; }
}

.code-lines {
  display: grid;
  gap: 0.18rem;
  padding-top: 0.15rem;
}

.code-lines span {
  display: block;
  height: 2px;
  border-radius: 2px;
  background: rgba(56, 189, 248, 0.35);
}

.code-lines span:nth-child(1) { width: 80%; }
.code-lines span:nth-child(2) { width: 62%; }
.code-lines span:nth-child(3) { width: 74%; }
.code-lines span:nth-child(4) { width: 48%; }

.desk.is-working .code-lines span {
  animation: codeFlicker 1.1s ease-in-out infinite;
}

.desk.is-working .code-lines span:nth-child(2) { animation-delay: 0.15s; }
.desk.is-working .code-lines span:nth-child(3) { animation-delay: 0.3s; }
.desk.is-working .code-lines span:nth-child(4) { animation-delay: 0.45s; }

@keyframes codeFlicker {
  0%, 100% { opacity: 0.45; }
  50% { opacity: 1; }
}

.build-badge {
  margin-top: auto;
  align-self: flex-start;
  font-size: 0.36rem;
  color: var(--navy);
  background: var(--accent);
  padding: 0.12rem 0.28rem;
  border-radius: 2px;
  opacity: 0;
}

.build-badge.is-on {
  opacity: 1;
}

.screen--vanta .chart {
  display: flex;
  align-items: flex-end;
  gap: 0.15rem;
  height: 45%;
  margin-top: auto;
}

.screen--vanta .chart i {
  flex: 1;
  background: rgba(34, 211, 238, 0.45);
  border-radius: 1px 1px 0 0;
  height: 40%;
}

.desk.is-working .screen--vanta .chart i:nth-child(1) { animation: bar 2.8s ease-in-out infinite; }
.desk.is-working .screen--vanta .chart i:nth-child(2) { animation: bar 2.8s ease-in-out 0.2s infinite; height: 55%; }
.desk.is-working .screen--vanta .chart i:nth-child(3) { animation: bar 2.8s ease-in-out 0.4s infinite; height: 70%; }
.desk.is-working .screen--vanta .chart i:nth-child(4) { animation: bar 2.8s ease-in-out 0.1s infinite; height: 48%; }
.desk.is-working .screen--vanta .chart i:nth-child(5) { animation: bar 2.8s ease-in-out 0.3s infinite; height: 62%; }

@keyframes bar {
  0%, 100% { transform: scaleY(0.7); }
  50% { transform: scaleY(1); }
}

.fin-bars {
  display: flex;
  gap: 0.2rem;
  margin-top: auto;
  height: 40%;
  align-items: flex-end;
}

.fin-bars i {
  flex: 1;
  background: rgba(56, 189, 248, 0.35);
  height: 50%;
}

.desk.is-working .fin-bars i:nth-child(2) { height: 75%; background: rgba(34, 211, 238, 0.55); }
.desk.is-working .fin-bars i:nth-child(3) { height: 40%; }

.keyboard {
  position: absolute;
  left: 50%;
  top: 58%;
  width: 55%;
  height: 5px;
  transform: translateX(-50%);
  border-radius: 2px;
  background: #1c2638;
  border: 1px solid rgba(148, 163, 184, 0.15);
}

/* Agents — digital workers */
.agent {
  position: absolute;
  left: 50%;
  bottom: 18%;
  width: 28px;
  height: 40px;
  transform: translateX(-50%);
  z-index: 3;
}

.agent-head {
  width: 14px;
  height: 14px;
  margin: 0 auto 2px;
  border-radius: 4px;
  background: linear-gradient(160deg, #dbe7f5, #8ea4bf);
  border: 1px solid rgba(255, 255, 255, 0.35);
  position: relative;
  transition: transform 0.5s var(--ease);
}

.agent-head i {
  position: absolute;
  left: 50%;
  top: 45%;
  width: 6px;
  height: 2px;
  border-radius: 1px;
  background: var(--accent);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(34, 211, 238, 0.8);
}

.agent-body {
  width: 16px;
  height: 18px;
  margin: 0 auto;
  border-radius: 3px;
  background: linear-gradient(180deg, #2a364c, #161e2d);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.agent-arm {
  position: absolute;
  top: 16px;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: #9aafc6;
  transform-origin: top center;
}

.agent-arm--l { left: 4px; }
.agent-arm--r { right: 4px; }

.agent--atlas .agent-head { background: linear-gradient(160deg, #f1f5f9, #94a3b8); }
.agent--nova .agent-head { background: linear-gradient(160deg, #c4b5fd, #6366f1); }
.agent--nova .agent-head i { background: #a5b4fc; }
.agent--forge .agent-head { background: linear-gradient(160deg, #67e8f9, #0ea5e9); }
.agent--vanta .agent-head { background: linear-gradient(160deg, #86efac, #22c55e); }
.agent--vanta .agent-head i { background: #4ade80; }
.agent--finn .agent-head { background: linear-gradient(160deg, #fcd34d, #f59e0b); }
.agent--finn .agent-head i { background: #fbbf24; }

.desk.is-working .agent-head {
  transform: rotate(-6deg);
}

.desk.is-working .agent--forge .agent-arm--r,
.agent.is-typing .agent-arm--r {
  animation: typeArm 0.35s ease-in-out infinite;
}

@keyframes typeArm {
  0%, 100% { transform: rotate(8deg); }
  50% { transform: rotate(-12deg); }
}

.desk.is-working .agent--atlas .agent-head {
  animation: lookAround 3.5s ease-in-out infinite;
}

@keyframes lookAround {
  0%, 100% { transform: rotate(-8deg); }
  50% { transform: rotate(8deg); }
}

.desk-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  color: var(--muted-strong);
}

/* Positions */
.desk--atlas { left: 8%; top: 48%; }
.desk--nova { left: 28%; top: 56%; }
.desk--forge { left: 48%; top: 58%; }
.desk--vanta { left: 66%; top: 54%; }
.desk--finn { left: 82%; top: 48%; }

.office-server {
  position: absolute;
  left: 4%;
  bottom: 12%;
  width: 28px;
  height: 42px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 4px;
  background: #0d1422;
  display: grid;
  gap: 3px;
  padding: 5px 4px;
  opacity: 0.5;
}

.office-server i {
  display: block;
  height: 3px;
  border-radius: 1px;
  background: rgba(34, 211, 238, 0.35);
}

.office-section.is-lit .office-server {
  opacity: 1;
}

.office-section.is-lit .office-server i:nth-child(2) {
  animation: serverBlink 2s ease-in-out infinite;
}

@keyframes serverBlink {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 1; }
}

/* Camera focus states via section phase */
.office-section[data-cam="atlas"] .office-camera { transform: translate3d(8%, 4%, 0) scale(1.28); }
.office-section[data-cam="nova"] .office-camera { transform: translate3d(-2%, 2%, 0) scale(1.28); }
.office-section[data-cam="forge"] .office-camera { transform: translate3d(-10%, 0%, 0) scale(1.28); }
.office-section[data-cam="vanta"] .office-camera { transform: translate3d(-18%, 2%, 0) scale(1.28); }
.office-section[data-cam="finn"] .office-camera { transform: translate3d(-24%, 4%, 0) scale(1.28); }
.office-section[data-cam="wide"] .office-camera { transform: translate3d(0, 0, 0) scale(1); }

.office-agent-panel {
  margin-top: 1rem;
}

.btn-sm {
  min-height: 40px;
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  margin-top: 0.85rem;
}

.workforce-moment {
  text-align: center;
  margin-top: 1.5rem;
  min-height: 2.4rem;
}

.workforce-moment span {
  display: none;
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.45rem);
  color: var(--accent-strong);
}

.workforce-moment span.is-on { display: block; }

.moment-tagline {
  font-style: italic;
  color: var(--muted-strong) !important;
}

/* Mobile vertical office */
.office-mobile {
  display: none;
}

@media (max-width: 899px) {
  .office-section {
    grid-template-columns: 1fr;
    padding: 3.5rem 0;
  }

  .office-viewport {
    display: none;
  }

  .office-meta {
    display: none;
  }

  .office-mobile {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 1.15rem;
  }

  .office-mobile::before {
    content: '';
    position: absolute;
    left: 5px;
    top: 1rem;
    bottom: 1rem;
    width: 1px;
    background: linear-gradient(180deg, var(--accent), rgba(148, 163, 184, 0.2));
  }

  .office-mobile__core {
    border: 1px solid rgba(34, 211, 238, 0.35);
    border-radius: var(--radius-md);
    padding: 1rem;
    text-align: center;
    font-family: var(--font-serif);
    margin-bottom: 0.85rem;
    background: var(--navy-elevated);
  }

  .office-mobile__desk {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    width: 100%;
    min-height: 64px;
    margin: 0 0 0.75rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--navy-border);
    border-radius: var(--radius-md);
    background: var(--navy-elevated);
    color: var(--white);
    text-align: left;
    opacity: 0.45;
    transform: translate3d(0, 12px, 0);
    transition: opacity 0.4s ease, transform 0.4s var(--ease), border-color 0.3s ease;
  }

  .office-mobile__desk.is-awake {
    opacity: 1;
    transform: none;
  }

  .office-mobile__desk.is-focused {
    border-color: rgba(34, 211, 238, 0.5);
  }

  .office-mobile__desk::before {
    content: '';
    position: absolute;
    left: calc(-1.15rem + 2px);
    top: 50%;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: rgba(148, 163, 184, 0.35);
    transform: translateY(-50%);
  }

  .office-mobile__desk.is-awake::before {
    background: var(--accent);
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.5);
  }

  .office-mobile__desk strong {
    letter-spacing: 0.12em;
    font-size: 0.85rem;
  }

  .office-mobile__desk span {
    color: var(--muted);
    font-size: 0.85rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ai-office,
  .desk,
  .project-board,
  .office-camera,
  .progress i,
  .code-lines span,
  .arch-pulse {
    animation: none !important;
    transition: none !important;
  }

  .ai-office {
    opacity: 1 !important;
    filter: none !important;
  }

  .desk,
  .project-board {
    opacity: 1 !important;
  }

  .office-camera {
    transform: none !important;
  }
}
