/* ============================================================
   Visual Components — macOS Tahoe style with rounded elements
   ============================================================ */

.vis {
  width: 100%;
  height: 100%;
  min-height: 240px;
  position: relative;
  display: grid;
  place-items: center;
  padding: var(--sp-6);
  overflow: hidden;
}

.vis--dark { color: #E5E5E7; }

/* Floating frame — macOS window chrome, very rounded */
.vis__frame {
  width: 100%;
  max-width: 420px;
  background: var(--bg-primary);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
  overflow: hidden;
  position: relative;
}

.vis__frame-head {
  display: grid;
  grid-template-columns: 60px 1fr 60px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--separator);
  background: var(--bg-secondary);
}
.vis__traffic { display: flex; gap: 6px; }
.vis__traffic span { width: 10px; height: 10px; border-radius: 50%; }
.vis__traffic span:nth-child(1) { background: #FF5F57; }
.vis__traffic span:nth-child(2) { background: #FEBC2E; }
.vis__traffic span:nth-child(3) { background: #28C840; }
.vis__tabtitle {
  font-size: 10px;
  color: var(--label-tertiary);
  text-align: center;
  letter-spacing: 0.02em;
}
.vis__chart-area {
  padding: 16px;
  color: var(--label-primary);
  height: 140px;
}
.vis__stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--separator);
}
.vis__stat-item {
  padding: 12px;
  text-align: center;
  border-right: 1px solid var(--separator);
}
.vis__stat-item:last-child { border-right: none; }
.vis__stat-val { font-size: 15px; font-weight: 600; }
.vis__stat-key {
  font-size: 10px;
  color: var(--label-tertiary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

/* Ambient glow — subtle, behind elements */
.vis__glow {
  position: absolute;
  width: 70%;
  height: 50%;
  border-radius: 50%;
  filter: blur(60px);
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

/* SRE dial */
.vis__dial {
  position: relative;
  width: 180px; height: 180px;
  color: var(--label-primary);
  display: grid;
  place-items: center;
}
.vis__dial-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.vis__dial-num {
  font-family: "SF Pro Display", "SF Pro Icons", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 36px;
  font-weight: 600;
  letter-spacing: -0.02em;
}
.vis__dial-lab { font-size: 11px; color: var(--label-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.vis__slo-list {
  margin-left: 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.vis__slo {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--label-secondary);
  background: var(--bg-primary);
  border: 1px solid var(--separator);
  padding: 8px 14px;
  border-radius: var(--r-md);
}
.vis__slo em { margin-left: auto; font-style: normal; color: var(--label-tertiary); font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; }
.vis__slo .dot { width: 8px; height: 8px; border-radius: 50%; }
.vis__slo .dot.green { background: var(--sys-green); box-shadow: 0 0 0 3px rgba(52,199,89,0.2); }
.vis__slo .dot.amber { background: var(--sys-yellow); box-shadow: 0 0 0 3px rgba(255,204,0,0.2); }

@media (max-width: 734px) {
  .vis__dial { width: 140px; height: 140px; }
  .vis__slo-list { display: none; }
}

/* Pipeline */
.vis__pipeline {
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 440px;
  margin-bottom: 18px;
}
.vis__node {
  display: flex; flex-direction: column;
  align-items: center; gap: 6px;
  flex-shrink: 0;
  animation: nodeIn 0.6s cubic-bezier(0.4, 0, 0.2, 1) both;
}
@keyframes nodeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.vis__node-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--fill-primary);
  box-shadow: 0 0 0 3px var(--bg-primary);
  transition: box-shadow 0.3s;
}
.vis__node-lab { font-size: 10px; color: var(--label-tertiary); text-transform: uppercase; letter-spacing: 0.05em; }
.vis__pipe {
  flex: 1;
  height: 2px;
  background: var(--fill-primary);
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
}
.vis__pipe-fill {
  position: absolute; inset: 0;
  transform-origin: left;
  animation: pipeFill 2.5s ease-out infinite;
}
@keyframes pipeFill {
  0% { transform: scaleX(0); opacity: 0; }
  40% { transform: scaleX(1); opacity: 1; }
  100% { transform: scaleX(1); opacity: 0; }
}
.vis__terminal {
  background: var(--bg-primary);
  border: 1px solid var(--separator);
  border-radius: var(--r-lg);
  padding: 14px 18px;
  font-size: 11px;
  width: 100%;
  max-width: 440px;
  line-height: 1.7;
}

/* Java code — rounded window */
.vis__code {
  width: 100%;
  max-width: 440px;
  background: var(--bg-primary);
  border: 1px solid var(--separator);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.vis__code-head {
  padding: 12px 16px;
  font-size: 11px;
  color: var(--label-tertiary);
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--separator);
}
.vis__code-body {
  padding: 16px 18px;
  margin: 0;
  font-size: 11px;
  line-height: 1.55;
  color: var(--label-primary);
  overflow-x: auto;
}

/* Terminal window — dark rounded */
.vis__term-window {
  width: 100%;
  max-width: 440px;
  background: #0F0F12;
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--r-xl);
  overflow: hidden;
}
.vis--dark .vis__frame-head { background: #151519; border-color: rgba(255,255,255,0.06); }

/* Network graph glow */
.vis__network-glow {
  position: absolute;
  width: 60%;
  height: 60%;
  border-radius: 50%;
  filter: blur(50px);
  opacity: 0.1;
  pointer-events: none;
}

/* Small screen layouts */
.project-card--third .vis { padding: var(--sp-4); }
.project-card--third .vis__frame,
.project-card--third .vis__code,
.project-card--third .vis__term-window { max-width: 100%; }
.project-card--third .vis__pipeline { max-width: 100%; }
