:root {
  --security-green: #2de3a7;
  --security-navy: #071936;
  --security-line: #9fb3d1;
}

.hero-security {
  display: flex;
  width: fit-content;
  max-width: 100%;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 11px 14px;
  border: 1px solid #cfdbee;
  border-radius: 12px;
  background: #ffffffb8;
  box-shadow: 0 12px 35px #17356610;
  color: #29405f;
  font-size: 12px;
  font-weight: 700;
}

.hero-security b { color: #15396d; letter-spacing: .6px; }
.hero-security span { white-space: nowrap; }
.hero-security i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: #17a876;
  box-shadow: 0 0 0 5px #17a87618;
}

.security-rail {
  padding: 24px 7vw 34px;
  background: var(--security-navy);
  color: #fff;
}

.security-rail > small {
  display: block;
  margin-bottom: 18px;
  color: var(--security-green);
  font-weight: 800;
  letter-spacing: 2px;
}

.security-rail > div {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.security-rail article {
  display: flex;
  align-items: flex-start;
  gap: 13px;
  padding: 17px;
  border: 1px solid #ffffff1f;
  border-radius: 12px;
  background: linear-gradient(135deg, #ffffff0d, #ffffff05);
}

.security-rail article > b {
  color: var(--security-green);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.security-rail article span { font-weight: 700; line-height: 1.25; }
.security-rail article small { display: block; margin-top: 6px; color: #aebdd2; font-weight: 400; line-height: 1.35; }

.integrity-scan {
  position: absolute;
  z-index: 3;
  inset: 0 0 auto;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--security-green), transparent);
  box-shadow: 0 0 18px var(--security-green);
  animation: integrityScan 4s ease-in-out infinite;
  pointer-events: none;
}

.verification-chain {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 25px;
  padding-top: 13px;
  border-top: 1px solid #e6ebf2;
  color: #486079;
  font-size: 11px;
  font-weight: 700;
}

.verification-chain i { position: relative; height: 1px; flex: 1; overflow: hidden; background: #b8c7d9; }
.verification-chain i::after { content: ''; position: absolute; inset: 0; width: 45%; background: linear-gradient(90deg, transparent, #2de3a7, transparent); animation: chainSignal 5.2s linear infinite; }
.verification-chain i:nth-of-type(2)::after { animation-delay: .55s; }
.verification-chain i:nth-of-type(3)::after { animation-delay: 1.1s; }
.verification-chain span { padding: 4px 6px; border-radius: 6px; animation: stageVerify 5.2s ease-in-out infinite; }
.verification-chain span:nth-of-type(2) { animation-delay: .55s; }
.verification-chain span:nth-of-type(3) { animation-delay: 1.1s; }
.verification-chain span:nth-of-type(4) { animation-delay: 1.65s; }
.verification-chain span:last-child { color: #159863; }

.evidence ul {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  columns: auto;
  line-height: 1.45;
}

.doc .verified-stamp {
  position: relative;
  right: auto;
  bottom: auto;
  display: grid;
  grid-template-columns: 42px 1fr;
  grid-template-rows: auto auto auto;
  width: 230px;
  min-height: 94px;
  margin: 22px 0 0 auto;
  padding: 13px 15px;
  overflow: hidden;
  border: 1px solid #44d8a7;
  border-radius: 16px;
  background: linear-gradient(145deg, #071d3c, #0d3151);
  box-shadow: 0 15px 28px #061b3430, inset 0 0 0 1px #ffffff0d;
  color: #fff;
  text-align: left;
  transform: rotate(-1.5deg);
}

.doc .verified-stamp::before {
  content: '';
  position: absolute;
  width: 120px;
  height: 120px;
  right: -64px;
  top: -65px;
  border: 1px solid #44d8a744;
  border-radius: 50%;
}

.doc .verified-stamp::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 32%, #ffffff12 50%, transparent 68%);
  transform: translateX(-110%);
  animation: stampSheen 4.8s ease-in-out infinite;
  pointer-events: none;
}

.doc .verified-stamp strong {
  grid-row: 1 / 4;
  display: grid;
  width: 32px;
  height: 38px;
  place-items: center;
  align-self: center;
  border: 1px solid #67edbd;
  border-radius: 9px 9px 13px 13px;
  background: #2de3a716;
  color: #67edbd;
  font-size: 20px;
  clip-path: polygon(50% 0, 100% 18%, 92% 76%, 50% 100%, 8% 76%, 0 18%);
}

.doc .verified-stamp small {
  display: block;
  color: #9eb4ca;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 1.8px;
}

.doc .verified-stamp b {
  color: #67edbd;
  font-size: 19px;
  line-height: 1.05;
  letter-spacing: .7px;
}

.doc .verified-stamp em {
  color: #d2deea;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 9px;
  font-style: normal;
  letter-spacing: .3px;
}

.security-console {
  position: absolute;
  z-index: 4;
  right: -5%;
  bottom: 7%;
  width: min(320px, 72%);
  padding: 17px;
  border: 1px solid #8be8c855;
  border-radius: 13px;
  background: #06172ff0;
  box-shadow: 0 20px 45px #05132e40;
  color: #fff;
  text-align: left;
  backdrop-filter: blur(10px);
}

.security-console small { display: block; color: #8ea6c4; letter-spacing: 1.3px; }
.access-cycle { position: relative; height: 25px; margin: 8px 0; }
.access-cycle b { position: absolute; inset: 0; display: block; margin: 0; opacity: 0; color: var(--security-green); animation: accessState 9s ease-in-out infinite; }
.access-cycle .state-authorized { color: #ffd66b; animation-delay: 3s; }
.access-cycle .state-revoked { color: #9cb1c9; animation-delay: 6s; }
.access-cycle b i { position: static; display: inline-block; width: 8px; height: 8px; border: 0; border-radius: 50%; background: currentColor; animation: securePulse 1.8s infinite; }
.security-console span { display: block; color: #c1cde0; font-size: 13px; }
.security-console code { display: block; margin-top: 10px; padding-top: 10px; border-top: 1px solid #ffffff1a; color: #8be8c8; font-size: 11px; }

.security-principles { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 26px; }
.security-principles span { padding: 8px 11px; border: 1px solid #c7d4e5; border-radius: 99px; background: #fff; color: #234164; font-size: 13px; font-weight: 700; }

.scenario-flow {
  position: relative;
  display: flex;
  min-height: 72px;
  align-items: center;
  gap: 7px;
  margin: 2px 0 17px;
  padding: 12px;
  border-radius: 11px;
  background: #f1f5fb;
  overflow: hidden;
}

.scenario-flow::after { content: ''; position: absolute; z-index: 2; top: 50%; left: 10px; width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #2de3a7; box-shadow: 0 0 0 5px #2de3a71c; opacity: 0; transform: translateY(-50%); animation: scenarioSignal 4.8s ease-in-out infinite; }
.casegrid article:nth-child(2) .scenario-flow::after { animation-delay: .45s; }
.casegrid article:nth-child(3) .scenario-flow::after { animation-delay: .9s; }

.scenario-flow span {
  position: relative;
  z-index: 1;
  flex: 1;
  padding: 8px 6px;
  border: 1px solid #cfdbea;
  border-radius: 8px;
  background: #fff;
  color: #1d3d70;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
}

.scenario-flow i { color: #5b70f3; font-size: 17px; font-style: normal; animation: arrowFlow 1.8s ease-in-out infinite; }
.scenario-flow i:nth-of-type(2) { animation-delay: .3s; }

.authority h2 { margin: 13px 0 5px; font-size: clamp(30px, 4vw, 48px); }
.authority-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 13px; max-width: 1080px; margin: 35px auto 0; }
.authority-grid article { padding: 18px; border: 1px solid #dce5f1; border-radius: 12px; background: #fff; text-align: left; box-shadow: 0 12px 30px #1735660b; }
.authority-grid b { display: block; color: #173c71; font-size: 18px; }
.authority-grid small { display: block; margin-top: 7px; color: #697a90; line-height: 1.4; }

.ui { animation: dashboardFloat 7s ease-in-out infinite; }
.metrics span { animation: metricGlow 5s ease-in-out infinite; }
.metrics span:nth-child(2) { animation-delay: .5s; }
.metrics span:nth-child(3) { animation-delay: 1s; }
.flow div > i { position: relative; overflow: hidden; }
.flow div > i::after { content: ''; position: absolute; inset: 0; width: 35%; background: linear-gradient(90deg, transparent, #6172ff, transparent); animation: flowMove 2.2s linear infinite; }
.flow div > i:nth-of-type(2)::after { animation-delay: .35s; }
.flow div > i:nth-of-type(3)::after { animation-delay: .7s; }

@keyframes integrityScan { 0%, 12% { top: 0; opacity: 0; } 25% { opacity: 1; } 75% { opacity: 1; } 88%, 100% { top: calc(100% - 2px); opacity: 0; } }
@keyframes securePulse { 50% { box-shadow: 0 0 0 9px #2de3a71c; } }
@keyframes arrowFlow { 50% { transform: translateX(3px); color: #21aa7a; } }
@keyframes dashboardFloat { 0%, 100% { translate: 0 0; } 50% { translate: 0 -7px; } }
@keyframes metricGlow { 50% { background: #eef4ff; box-shadow: inset 0 0 0 1px #d9e3fa; } }
@keyframes flowMove { from { transform: translateX(-120%); } to { transform: translateX(400%); } }
@keyframes stampSheen { 0%, 55% { transform: translateX(-110%); } 78%, 100% { transform: translateX(110%); } }
@keyframes accessState { 0% { opacity: 0; transform: translateY(5px); } 8%, 27% { opacity: 1; transform: none; } 34%, 100% { opacity: 0; transform: translateY(-5px); } }
@keyframes chainSignal { 0% { transform: translateX(-130%); opacity: 0; } 15% { opacity: 1; } 55% { opacity: 1; } 70%, 100% { transform: translateX(340%); opacity: 0; } }
@keyframes stageVerify { 0%, 9%, 43%, 100% { background: transparent; color: #486079; box-shadow: none; } 16%, 34% { background: #e5faf2; color: #13835d; box-shadow: inset 0 0 0 1px #bdebd9; } }
@keyframes scenarioSignal { 0%, 8% { left: 10px; opacity: 0; } 16% { opacity: 1; } 82% { opacity: 1; } 94%, 100% { left: calc(100% - 18px); opacity: 0; } }

@media (max-width: 1000px) {
  .hero-security { flex-wrap: wrap; }
  .security-rail > div, .authority-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .hero-assurances { flex-direction: column; gap: 8px !important; }
  .hero-security { display: grid; width: 100%; gap: 8px; }
  .security-rail > div, .authority-grid { grid-template-columns: 1fr; }
  .security-console { right: 0; bottom: 0; width: 82%; }
  .scenario-flow { align-items: stretch; }
  .scenario-flow span { display: grid; place-items: center; font-size: 10px; }
  .verification-chain { flex-wrap: wrap; }
  .evidence ul { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  .ui, .metrics span, .integrity-scan, .access-cycle b, .access-cycle b i, .scenario-flow i, .scenario-flow::after, .verification-chain span, .verification-chain i::after, .flow div > i::after, .doc .verified-stamp::after { animation: none !important; }
  .access-cycle .state-blocked { opacity: 1; transform: none; }
}
