:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: #172033;
  --panel-2: #1e293b;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --line: rgba(148, 163, 184, 0.22);
  --line-strong: rgba(148, 163, 184, 0.4);
  --amber: #f59e0b;
  --teal: #14b8a6;
  --blue: #60a5fa;
  --purple: #a78bfa;
  --radius: 18px;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 18% 0%, rgba(20, 184, 166, 0.14), transparent 32rem),
    radial-gradient(circle at 88% 8%, rgba(245, 158, 11, 0.14), transparent 30rem),
    var(--bg);
  color: var(--text);
  font-family: "Microsoft JhengHei", "PingFang TC", "Noto Sans TC", Arial, sans-serif;
  line-height: 1.7;
}

a {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

.section-shell {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 68px;
  padding: 0 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  text-decoration: none;
}

.brand-mark {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--amber), var(--teal));
  box-shadow: 0 0 26px rgba(20, 184, 166, 0.5);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

.nav a {
  padding: 8px 10px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 160ms ease, color 160ms ease;
}

.nav a:hover,
.nav a:focus {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.language-switch {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.language-switch a {
  min-width: 36px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-align: center;
}

.language-switch a.active {
  background: rgba(245, 158, 11, 0.92);
  color: #111827;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.82fr);
  gap: 42px;
  align-items: center;
  min-height: calc(100vh - 68px);
  padding: 84px 0 74px;
}

.eyebrow,
.card-kicker {
  margin: 0;
  color: var(--amber);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 760px;
  margin-top: 16px;
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 720;
  line-height: 1.02;
}

h2 {
  font-size: clamp(32px, 4.5vw, 58px);
  font-weight: 700;
  line-height: 1.08;
}

h3 {
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 720;
  line-height: 1.16;
}

.hero-copy,
.section-heading p,
.page-hero p,
.profile-panel p,
.diagram-copy p,
.contact-cta p {
  color: var(--muted);
  font-size: 18px;
}

.hero-copy {
  max-width: 660px;
  margin: 24px 0 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-weight: 900;
  text-decoration: none;
  transition: transform 160ms ease, border-color 160ms ease, filter 160ms ease, background 160ms ease;
}

.button:hover,
.button:focus {
  transform: translateY(-2px);
}

.button.primary {
  border-color: rgba(245, 158, 11, 0.78);
  background: linear-gradient(135deg, var(--amber), #f97316);
  color: #111827;
}

.button.primary:hover,
.button.primary:focus {
  filter: brightness(1.08);
}

.button.secondary {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

.button.secondary:hover,
.button.secondary:focus {
  border-color: var(--teal);
}

.hero-email {
  margin: 18px 0 0;
  color: var(--subtle);
  font-size: 15px;
  font-weight: 800;
}

.hero-visual,
.support-visual,
.system-visual,
.diagram-image,
.library-thumbs img {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-visual {
  padding: 10px;
}

.automation-visual { padding: 0; min-height: 360px; background: radial-gradient(circle at 20% 20%, rgba(20, 184, 166, 0.18), transparent 18rem), linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.86)); }
.automation-panel { height: 100%; min-height: 360px; padding: 18px; }
.panel-topline { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12px; font-weight: 900; letter-spacing: 0.08em; text-transform: uppercase; }
.panel-topline strong { margin-left: auto; color: var(--teal); }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--teal); box-shadow: 0 0 0 0 rgba(20, 184, 166, 0.6); animation: livePulse 1.7s ease-out infinite; }
.automation-canvas { position: relative; min-height: 300px; margin-top: 12px; border: 1px solid rgba(148, 163, 184, 0.18); border-radius: 20px; background: linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px), rgba(2, 6, 23, 0.38); background-size: 28px 28px; overflow: hidden; }
.automation-lines { position: absolute; inset: 0; width: 100%; height: 100%; }
.flow-path { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 10 12; animation: dashRun 4.8s linear infinite; }
.path-a { stroke: var(--amber); }
.path-b { stroke: var(--teal); animation-delay: -1.6s; }
.path-c { stroke: var(--blue); animation-delay: -3.2s; }
.pulse { fill: #f8fafc; filter: drop-shadow(0 0 10px rgba(96, 165, 250, 0.8)); animation: nodePulse 2.4s ease-in-out infinite; }
.pulse-b { animation-delay: -0.8s; }
.pulse-c { animation-delay: -1.6s; }
.automation-node, .automation-core { position: absolute; display: grid; gap: 4px; min-width: 116px; padding: 12px; border: 1px solid rgba(148, 163, 184, 0.26); border-radius: 16px; background: rgba(15, 23, 42, 0.86); box-shadow: 0 18px 46px rgba(0, 0, 0, 0.24); }
.automation-node span { color: var(--amber); font-size: 11px; font-weight: 900; }
.automation-node strong, .automation-core strong { color: var(--text); font-size: 15px; }
.automation-node small { color: var(--subtle); font-weight: 800; }
.node-line { top: 42px; left: 34px; }
.node-router { top: 96px; left: 200px; }
.node-ai { top: 94px; right: 34px; }
.node-record { right: 60px; bottom: 42px; }
.automation-core { place-items: center; top: 194px; left: 52px; min-width: 128px; text-align: center; }
.automation-core span { width: 36px; height: 36px; border: 1px solid rgba(245, 158, 11, 0.7); border-radius: 50%; background: radial-gradient(circle, rgba(245, 158, 11, 0.72), rgba(20, 184, 166, 0.08)); animation: orbitGlow 3.2s ease-in-out infinite; }
@keyframes dashRun { to { stroke-dashoffset: -88; } }
@keyframes livePulse { 70% { box-shadow: 0 0 0 12px rgba(20, 184, 166, 0); } 100% { box-shadow: 0 0 0 0 rgba(20, 184, 166, 0); } }
@keyframes nodePulse { 0%, 100% { opacity: 0.45; transform: scale(1); } 50% { opacity: 1; transform: scale(1.35); } }
@keyframes orbitGlow { 0%, 100% { transform: scale(1); filter: brightness(1); } 50% { transform: scale(1.12); filter: brightness(1.25); } }

.hero-visual img,
.support-visual img,
.system-visual img,
.diagram-image img,
.library-thumbs img {
  width: 100%;
  transition: transform 180ms ease;
}

.support-visual:hover img,
.system-visual:hover img,
.diagram-card:hover img,
.library-thumbs img:hover {
  transform: scale(1.02);
}

.signal-strip {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 0 0 46px;
}

.signal-strip span,
.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.signal-strip span {
  min-height: 36px;
  padding: 0 14px;
}

.section {
  padding: 84px 0;
}

.section-heading {
  max-width: 860px;
  margin-bottom: 34px;
}

.section-heading h2,
.page-hero h1,
.profile-panel h2,
.diagram-copy h2,
.contact-cta h2 {
  margin-top: 12px;
}

.section-heading p {
  max-width: 760px;
  margin: 16px 0 0;
}

.section-heading.narrow {
  max-width: 740px;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.work-card,
.service-card,
.profile-panel,
.diagram-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(17, 24, 39, 0.92));
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
  transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.work-card:hover,
.service-card:hover,
.profile-panel:hover,
.diagram-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.5);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.32);
}

.work-card.featured {
  grid-column: span 2;
}

.work-card a {
  display: grid;
  min-height: 310px;
  padding: 24px;
  text-decoration: none;
}

.work-card h3 {
  margin-top: auto;
}

.work-card p,
.service-card p,
.timeline-step p,
.card-meta strong,
.career-item p {
  margin: 12px 0 0;
  color: var(--muted);
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.card-meta span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
}

.card-meta strong {
  font-size: 13px;
}

.services-section {
  border-radius: 36px;
  background: rgba(17, 24, 39, 0.54);
}

.services-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.78fr);
  gap: 28px;
  align-items: center;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.service-card {
  min-height: 230px;
  padding: 22px;
}

.service-card span,
.timeline-step span,
.career-item span {
  color: var(--teal);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.service-card h3,
.timeline-step h3 {
  margin-top: 24px;
}

.timeline {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.timeline::before {
  position: absolute;
  top: 30px;
  right: 6%;
  left: 6%;
  height: 1px;
  background: linear-gradient(90deg, var(--teal), var(--amber));
  content: "";
}

.timeline-step {
  position: relative;
  min-height: 260px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(17, 24, 39, 0.72);
}

.timeline-step::before {
  display: block;
  width: 18px;
  height: 18px;
  margin-bottom: 26px;
  border: 4px solid var(--bg);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 1px rgba(245, 158, 11, 0.6);
  content: "";
}

.system-section,
.library-preview,
.contact-cta,
.profile-section {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1fr);
  gap: 36px;
  align-items: center;
}

.system-copy p,
.library-copy p {
  max-width: 620px;
  color: var(--muted);
  font-size: 18px;
}

.flow-nodes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.flow-nodes span {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-weight: 900;
}

.library-preview {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 30px;
  padding: 34px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 28rem),
    rgba(17, 24, 39, 0.68);
}

.library-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.library-thumbs img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.contact-cta {
  border: 1px solid rgba(245, 158, 11, 0.32);
  border-radius: 32px;
  padding: 38px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.14), rgba(20, 184, 166, 0.08)),
    rgba(17, 24, 39, 0.84);
}

.contact-actions {
  display: grid;
  justify-items: start;
  gap: 14px;
}

.email-link,
.text-link {
  color: var(--text);
  font-weight: 900;
  text-decoration: none;
}

.email-link:hover,
.text-link:hover {
  text-decoration: underline;
}

.site-footer {
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 30px 0 42px;
  color: var(--subtle);
  font-size: 14px;
}

.site-footer p {
  margin: 0;
}

.page-main {
  padding-top: 28px;
}

.page-hero {
  padding: 74px 0 42px;
}

.page-hero h1 {
  max-width: 940px;
}

.page-hero p {
  max-width: 820px;
}

.diagram-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.diagram-card {
  display: grid;
  grid-template-rows: auto 1fr;
  overflow: hidden;
}

.diagram-card.large {
  grid-column: span 2;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  grid-template-rows: auto;
}

.diagram-image {
  margin: 16px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(15, 23, 42, 0.54);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.22);
}

.diagram-image img {
  display: block;
  width: 100%;
  aspect-ratio: 18 / 10;
  object-fit: contain;
}

.diagram-card.large .diagram-image img {
  height: 100%;
  min-height: 360px;
}

.diagram-copy {
  padding: 24px;
}

.diagram-copy h2 {
  font-size: clamp(26px, 3vw, 42px);
}


.concept-list { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.concept-list li { display: grid; grid-template-columns: auto 1fr; gap: 10px; align-items: start; color: var(--muted); font-size: 15px; line-height: 1.65; }
.concept-list span { color: var(--teal); font-size: 12px; font-weight: 900; }
.diagram-card:target { border-color: rgba(245, 158, 11, 0.72); box-shadow: 0 24px 90px rgba(245, 158, 11, 0.12); }

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  padding: 6px 10px;
}

.profile-section {
  align-items: start;
}

.profile-card {
  position: sticky;
  top: 96px;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.9), rgba(17, 24, 39, 0.92));
}

.profile-card h2 {
  margin-top: 12px;
}

.profile-card p {
  color: var(--muted);
}

.profile-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.profile-facts span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.profile-content {
  display: grid;
  gap: 18px;
}

.profile-panel {
  padding: 24px;
}

.profile-panel.lead {
  background:
    radial-gradient(circle at top right, rgba(20, 184, 166, 0.14), transparent 24rem),
    var(--panel);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.career-list {
  display: grid;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.career-item {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  column-gap: 28px;
  row-gap: 8px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.career-item span {
  grid-column: 1;
  grid-row: 1 / span 2;
  align-self: start;
  line-height: 1.35;
}

.career-item h3 {
  grid-column: 2;
  margin: 0;
  font-size: 22px;
}

.career-item p {
  grid-column: 2;
  max-width: 920px;
  line-height: 1.85;
}

.tag-list.expanded {
  margin-top: 18px;
}

@media (max-width: 980px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 14px 20px;
  }

  .nav {
    justify-content: flex-start;
  }

  .hero,
  .services-layout,
  .system-section,
  .library-preview,
  .contact-cta,
  .profile-section,
  .diagram-card.large {
    grid-template-columns: 1fr;
  }

  .hero {
    min-height: auto;
  }

  .work-grid,
  .diagram-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-card.featured,
  .diagram-card.large {
    grid-column: auto;
  }

  .timeline {
    grid-template-columns: 1fr;
  }

  .timeline::before {
    top: 0;
    bottom: 0;
    left: 28px;
    width: 1px;
    height: auto;
  }

  .timeline-step::before {
    position: absolute;
    top: 22px;
    left: 20px;
    margin: 0;
  }

  .timeline-step {
    padding-left: 58px;
    min-height: auto;
  }

  .profile-card {
    position: static;
  }
}

@media (max-width: 680px) {
  .section-shell {
    width: min(100% - 28px, 1180px);
  }

  .section {
    padding: 58px 0;
  }

  .hero {
    padding: 58px 0;
    gap: 28px;
  }

  h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .hero-copy,
  .section-heading p,
  .page-hero p,
  .profile-panel p,
  .diagram-copy p,
  .contact-cta p {
    font-size: 16px;
  }

  .work-grid,
  .service-grid,
  .library-thumbs,
  .diagram-gallery,
  .profile-grid,
  .flow-nodes,
  .career-item {
    grid-template-columns: 1fr;
  }

  .career-item span,
  .career-item h3,
  .career-item p {
    grid-column: 1;
  }

  .career-item span {
    grid-row: auto;
  }

  .work-card a,
  .service-card,
  .profile-panel,
  .diagram-copy {
    padding: 20px;
  }

  .contact-cta,
  .library-preview {
    padding: 24px;
  }

  .hero-actions,
  .contact-actions {
    align-items: stretch;
  }

  .button {
    width: 100%;
  }
}

/* Local review polish: horizontal fiber automation hero and aligned service visual */
.mode-flow-canvas {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  min-height: 330px;
  padding: 16px;
}

.logic-flow {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 10px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.logic-flow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 16% 50%, rgba(96, 165, 250, 0.12), transparent 12rem);
  opacity: 0.85;
  pointer-events: none;
}

.scan-flow::before {
  background: radial-gradient(circle at 84% 50%, rgba(20, 184, 166, 0.14), transparent 12rem);
}

.query-flow {
  border-color: rgba(245, 158, 11, 0.35);
}

.scan-flow {
  border-color: rgba(20, 184, 166, 0.34);
}

.mode-title {
  position: relative;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.mode-title strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.mode-icon {
  display: inline-grid;
  min-width: 34px;
  height: 26px;
  padding: 0 8px;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.38);
  font-size: 11px;
  letter-spacing: 0;
  white-space: nowrap;
}

.scan-flow .mode-icon {
  background: rgba(20, 184, 166, 0.12);
  color: var(--teal);
  border-color: rgba(20, 184, 166, 0.38);
}

.logic-steps {
  position: relative;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
  align-items: stretch;
  padding: 10px 0;
}

.logic-steps::before {
  content: "";
  position: absolute;
  left: 5%;
  right: 5%;
  top: 50%;
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(96, 165, 250, 0.22), rgba(245, 158, 11, 0.42), rgba(20, 184, 166, 0.36));
  box-shadow: inset 0 0 12px rgba(96, 165, 250, 0.15);
  transform: translateY(-50%);
}

.logic-steps::after {
  content: "";
  position: absolute;
  left: 5%;
  top: 50%;
  width: 82px;
  height: 3px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, #f8fafc, var(--teal), transparent);
  filter: drop-shadow(0 0 9px rgba(20, 184, 166, 0.9));
  transform: translate(-50%, -50%);
  animation: fiberRun 5.6s ease-in-out infinite;
}

.scan-flow .logic-steps::after {
  animation-delay: -2.8s;
  background: linear-gradient(90deg, transparent, #f8fafc, var(--amber), transparent);
  filter: drop-shadow(0 0 9px rgba(245, 158, 11, 0.86));
}

.flow-step {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  align-content: start;
  min-height: 96px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 13px;
  background: rgba(2, 6, 23, 0.62);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
  opacity: 0.48;
  filter: saturate(0.58) brightness(0.78);
  transform: translateY(0);
  animation: stepGlow 5.6s ease-in-out infinite;
}

.query-flow .flow-step:nth-child(1) { animation-delay: 0s; }
.query-flow .flow-step:nth-child(2) { animation-delay: 1.1s; }
.query-flow .flow-step:nth-child(3) { animation-delay: 2.2s; }
.query-flow .flow-step:nth-child(4) { animation-delay: 3.3s; }
.scan-flow .flow-step:nth-child(1) { animation-delay: -2.8s; }
.scan-flow .flow-step:nth-child(2) { animation-delay: -1.7s; }
.scan-flow .flow-step:nth-child(3) { animation-delay: -0.6s; }
.scan-flow .flow-step:nth-child(4) { animation-delay: 0.5s; }

.flow-step b {
  display: inline-grid;
  width: 30px;
  height: 24px;
  place-items: center;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.13);
  color: var(--amber);
  border: 1px solid rgba(245, 158, 11, 0.28);
  font-size: 10px;
  line-height: 1;
}

.scan-flow .flow-step b {
  background: rgba(20, 184, 166, 0.14);
  color: var(--teal);
  border-color: rgba(20, 184, 166, 0.3);
}

.flow-step span {
  min-width: 0;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.flow-step small {
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.28;
  overflow-wrap: anywhere;
}

.flow-loop {
  position: relative;
  z-index: 4;
  display: flex;
  justify-content: flex-end;
  color: var(--teal);
  font-size: 10px;
  font-weight: 900;
}

.flow-loop span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 100%;
  padding: 6px 9px;
  border: 1px solid rgba(20, 184, 166, 0.3);
  border-radius: 999px;
  background: rgba(20, 184, 166, 0.07);
  overflow-wrap: anywhere;
}

.flow-loop span::before {
  content: "↺";
  color: var(--amber);
  font-size: 12px;
}

.services-layout {
  align-items: stretch;
}

.support-visual {
  align-self: stretch;
  display: flex;
  min-height: 100%;
  padding: clamp(10px, 1.3vw, 18px);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(30, 41, 59, 0.68));
}

.support-visual img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  object-position: center;
}

@keyframes fiberRun {
  0% { left: 5%; opacity: 0; }
  9% { opacity: 1; }
  88% { opacity: 1; }
  100% { left: 95%; opacity: 0; }
}

@keyframes stepGlow {
  0%, 17%, 100% {
    opacity: 0.48;
    filter: saturate(0.58) brightness(0.78);
    border-color: rgba(148, 163, 184, 0.16);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    transform: translateY(0);
  }
  24%, 39% {
    opacity: 1;
    filter: saturate(1.18) brightness(1.18);
    border-color: rgba(248, 250, 252, 0.44);
    box-shadow: 0 0 0 1px rgba(248, 250, 252, 0.05), 0 0 24px rgba(20, 184, 166, 0.28);
    transform: translateY(-2px);
  }
}

@media (max-width: 1120px) {
  .mode-flow-canvas {
    min-height: auto;
  }
}

@media (max-width: 980px) {
  .logic-steps {
    grid-template-columns: 1fr;
  }

  .logic-steps::before,
  .logic-steps::after {
    display: none;
  }

  .flow-step {
    min-height: auto;
  }

  .support-visual img {
    height: auto;
    object-fit: contain;
  }
}
