/* Architecture diagrams & animations */

:root {
  --aws: #ff9900;
  --aws-dim: rgba(255, 153, 0, 0.15);
  --azure: #0078d4;
  --azure-dim: rgba(0, 120, 212, 0.15);
  --gcp: #4285f4;
  --gcp-dim: rgba(66, 133, 244, 0.15);
  --gitops: #ef4444;
  --gitops-dim: rgba(239, 68, 68, 0.12);
  --sqor: #a78bfa;
  --sqor-dim: rgba(167, 139, 250, 0.12);
  --atm: #fb923c;
  --atm-dim: rgba(251, 146, 60, 0.14);
  --rhel: #ee0000;
  --cisco: #049fd9;
}

/* ── Scroll reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

/* ── Hero animations ── */
.hero {
  position: relative;
  overflow: visible;
}

.hero__layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.hero__visual {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.hero-orbit {
  position: relative;
  width: min(560px, 98vw);
  height: min(560px, 98vw);
  overflow: visible;
  margin-inline: auto;
}

.hero-orbit__ring {
  position: absolute;
  inset: 0;
  border: 1px dashed rgba(148, 163, 184, 0.15);
  border-radius: 50%;
  animation: spin 40s linear infinite;
}

.hero-orbit__ring--inner {
  inset: 16%;
  animation-direction: reverse;
  animation-duration: 28s;
}

.hero-orbit__core {
  position: absolute;
  inset: 28%;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.2), transparent 50%), var(--gradient);
  box-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(239, 68, 68, 0.22);
  animation: pulse-core 3s ease-in-out infinite;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  z-index: 2;
  transform: scale(1);
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s ease;
}

.hero-orbit__core:hover,
.hero-orbit__core:focus-visible,
.hero-orbit__core.is-orbit-spotlight {
  z-index: 5;
  transform: scale(1.14);
  box-shadow: 0 0 80px var(--accent-glow), 0 0 160px rgba(239, 68, 68, 0.35);
}

.hero-orbit__core:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

.hero-orbit__core::before {
  content: "";
  position: absolute;
  inset: 14%;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.hero-orbit__scale {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
}

.hero-orbit__node {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.04);
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  transform: scale(1);
  transition: transform 0.65s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.65s ease;
}

.hero-orbit__node-wrap.is-orbit-spotlight .hero-orbit__node {
  transform: scale(1.28);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.55), 0 0 0 2px var(--accent-ring);
}

.hero-orbit__core.is-orbit-spotlight {
  z-index: 7;
}

.hero-orbit__node:hover,
.hero-orbit__node:focus-visible,
.hero-orbit__node-wrap:hover .hero-orbit__node,
.hero-orbit__node-wrap:focus-within .hero-orbit__node {
  transform: scale(1.18);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.48), 0 0 0 2px rgba(249, 115, 22, 0.35);
}

.hero-orbit__core:hover,
.hero-orbit__core:focus-visible {
  transform: scale(1.1);
  z-index: 6;
}

.hero-orbit__icon {
  position: relative;
  z-index: 1;
  display: block;
  width: 52px;
  height: 52px;
  object-fit: contain;
  pointer-events: none;
}

.hero-orbit__icon--core {
  width: min(96px, 62%);
  height: min(96px, 62%);
}

.hero-orbit__node-wrap {
  position: absolute;
  z-index: 3;
  animation: orbit-float 3.5s ease-in-out infinite;
}

.hero-orbit__node-wrap.is-orbit-spotlight {
  z-index: 8;
  animation: orbit-spotlift 3s ease-in-out infinite;
}

.hero-orbit__node-wrap--aws {
  top: 1%;
  left: 50%;
  transform: translateX(-50%);
  animation-name: orbit-float-aws;
}

.hero-orbit__node-wrap--aws.is-orbit-spotlight {
  animation-name: orbit-spotlift-aws;
}

.hero-orbit__node-wrap--gitlab {
  top: 14%;
  left: 1%;
  animation-delay: 0.4s;
}

.hero-orbit__node-wrap--github {
  top: 14%;
  right: 1%;
  animation-delay: 0.8s;
}

.hero-orbit__node-wrap--azure {
  bottom: 10%;
  left: 1%;
  animation-delay: 1.2s;
}

.hero-orbit__node-wrap--gcp {
  bottom: 10%;
  right: 1%;
  animation-delay: 1.6s;
}

.hero-orbit__node-wrap--iac {
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  animation-name: orbit-float-iac;
  animation-delay: 2s;
}

.hero-orbit__node-wrap--iac.is-orbit-spotlight {
  animation-name: orbit-spotlift-iac;
}

.hero-orbit__node-wrap:hover,
.hero-orbit__node-wrap:focus-within {
  z-index: 6;
}

.hero-orbit__node:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.hero-orbit__node .hero-orbit__icon {
  width: 100%;
  height: 100%;
  max-width: 48px;
  max-height: 48px;
}

.hero-orbit__node--aws {
  border-color: rgba(255, 153, 0, 0.45);
}

.hero-orbit__node--gitlab {
  border-color: rgba(252, 109, 38, 0.45);
}

.hero-orbit__node--github {
  border-color: rgba(32, 136, 255, 0.45);
}

.hero-orbit__node--azure {
  border-color: rgba(0, 120, 212, 0.45);
}

.hero-orbit__node--gcp {
  border-color: rgba(66, 133, 244, 0.45);
}

.hero-orbit__node--iac {
  border-color: rgba(123, 66, 188, 0.45);
}

.gradient-text {
  background-size: 200% auto;
  animation: shimmer 6s linear infinite;
}

.stat__value[data-count] {
  font-variant-numeric: tabular-nums;
}

/* ── Architecture section ── */
.section--arch {
  padding-top: 4rem;
}

.cloud-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}

.cloud-tab {
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.cloud-tab:hover {
  color: var(--text);
  border-color: rgba(148, 163, 184, 0.3);
}

.cloud-tab.is-active[data-cloud="aws"] {
  background: var(--aws-dim);
  border-color: rgba(255, 153, 0, 0.45);
  color: var(--aws);
}

.cloud-tab.is-active[data-cloud="azure"] {
  background: var(--azure-dim);
  border-color: rgba(0, 120, 212, 0.45);
  color: var(--azure);
}

.cloud-tab.is-active[data-cloud="gcp"] {
  background: var(--gcp-dim);
  border-color: rgba(66, 133, 244, 0.45);
  color: var(--gcp);
}

.cloud-tab.is-active[data-cloud="gitops"] {
  background: var(--gitops-dim);
  border-color: rgba(239, 68, 68, 0.4);
  color: #f87171;
}

.cloud-tab.is-active[data-cloud="sqor"] {
  background: var(--sqor-dim);
  border-color: rgba(167, 139, 250, 0.45);
  color: var(--sqor);
}

.cloud-tab.is-active[data-cloud="atm"] {
  background: var(--atm-dim);
  border-color: var(--accent-ring);
  color: var(--atm);
}

.diagram-panel {
  display: none;
  animation: fade-panel 0.45s ease;
}

.diagram-panel.is-active {
  display: block;
}

.diagram-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  overflow-x: auto;
}

.diagram-wrap svg,
.diagram-wrap .diagram-svg {
  display: block;
  width: 100%;
  min-width: 560px;
  height: auto;
  min-height: 320px;
  border: 0;
}

.diagram-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.diagram-meta__item {
  padding: 1rem 1.15rem;
  background: rgba(17, 24, 39, 0.6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
}

.diagram-meta__item strong {
  display: block;
  font-size: 0.72rem;
  font-family: var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.35rem;
  color: var(--text-muted);
}

.diagram-meta__item span {
  color: var(--text);
  line-height: 1.45;
}

/* SVG diagram styles */
.dg-box {
  fill: #1a2332;
  stroke: rgba(148, 163, 184, 0.25);
  stroke-width: 1.5;
}

.dg-box--aws { stroke: rgba(255, 153, 0, 0.5); }
.dg-box--azure { stroke: rgba(0, 120, 212, 0.5); }
.dg-box--gcp { stroke: rgba(66, 133, 244, 0.5); }
.dg-box--accent { stroke: rgba(249, 115, 22, 0.45); }
.dg-box--green { stroke: rgba(52, 211, 153, 0.45); }

.dg-label {
  fill: #e2e8f0;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 11px;
  font-weight: 500;
}

.dg-sublabel {
  fill: #94a3b8;
  font-family: var(--font);
  font-size: 9px;
}

.dg-title {
  fill: #94a3b8;
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dg-line {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

.dg-line--flow {
  stroke-dasharray: 8 6;
  animation: flow-dash 1.2s linear infinite;
}

.dg-line--aws { stroke: rgba(255, 153, 0, 0.6); }
.dg-line--azure { stroke: rgba(0, 120, 212, 0.6); }
.dg-line--gcp { stroke: rgba(66, 133, 244, 0.6); }
.dg-line--accent { stroke: rgba(249, 115, 22, 0.55); }
.dg-line--green { stroke: rgba(52, 211, 153, 0.55); }

.dg-pulse {
  animation: dg-pulse 2s ease-in-out infinite;
}

/* Feature pills row */
.cloud-features {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
}

.cloud-feature {
  font-size: 0.72rem;
  font-family: var(--mono);
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.cloud-feature--aws { border-color: rgba(255, 153, 0, 0.3); color: #fbbf24; }
.cloud-feature--azure { border-color: rgba(0, 120, 212, 0.3); color: #60a5fa; }
.cloud-feature--gcp { border-color: rgba(66, 133, 244, 0.3); color: #93c5fd; }
.cloud-feature--sqor { border-color: rgba(167, 139, 250, 0.35); color: #c4b5fd; }
.cloud-feature--atm { border-color: rgba(251, 146, 60, 0.35); color: #fdba74; }

/* Card stagger animation on hover area */
.card,
.portfolio__item {
  transition: background 0.25s, border-color 0.25s, transform 0.25s, box-shadow 0.25s;
}

.card:hover,
.portfolio__item:hover {
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bg-glow--1 {
  animation: drift-glow 12s ease-in-out infinite alternate;
}

.bg-glow--2 {
  animation: drift-glow 15s ease-in-out infinite alternate-reverse;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes orbit-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes orbit-float-aws {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-8px); }
}

@keyframes orbit-float-iac {
  0%, 100% { transform: translateY(calc(-50% + 0px)); }
  50% { transform: translateY(calc(-50% + -8px)); }
}

@keyframes orbit-spotlift {
  0%, 100% { transform: translateY(-10px); }
  50% { transform: translateY(-16px); }
}

@keyframes orbit-spotlift-aws {
  0%, 100% { transform: translateX(-50%) translateY(-10px); }
  50% { transform: translateX(-50%) translateY(-16px); }
}

@keyframes orbit-spotlift-iac {
  0%, 100% { transform: translateY(calc(-50% + -10px)); }
  50% { transform: translateY(calc(-50% + -16px)); }
}

@keyframes pulse-core {
  0%, 100% { box-shadow: 0 0 60px var(--accent-glow), 0 0 120px rgba(239, 68, 68, 0.22); }
  50% { box-shadow: 0 0 72px var(--accent-glow), 0 0 140px rgba(239, 68, 68, 0.3); }
}

@keyframes float-node {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes float-node-aws-wrap {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-10px); }
}

@keyframes float-node-iac-wrap {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(calc(-50% - 10px)); }
}

@keyframes shimmer {
  0% { background-position: 0% center; }
  100% { background-position: 200% center; }
}

@keyframes flow-dash {
  to { stroke-dashoffset: -28; }
}

@keyframes fade-panel {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes dg-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

@keyframes drift-glow {
  from { transform: translate(0, 0); }
  to { transform: translate(30px, 20px); }
}

@media (max-width: 900px) {
  .hero__layout {
    grid-template-columns: 1fr;
  }

  .hero__visual {
    min-height: 320px;
    order: -1;
  }

  .hero__inner {
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .hero-orbit__ring,
  .hero-orbit__core,
  .hero-orbit__node-wrap,
  .gradient-text,
  .dg-line--flow,
  .dg-pulse,
  .bg-glow--1,
  .bg-glow--2,
  .diagram-panel {
    animation: none !important;
  }

  .hero-orbit__core:hover,
  .hero-orbit__core:focus-visible,
  .hero-orbit__node:hover,
  .hero-orbit__node:focus-visible {
    animation: none;
  }
}
