/* ================================================= VARIABLES & FONTS */
:root {
  --color-primary: #1e3d7b;
  --color-secondary: #5c4b8b;
  --color-dark: #282828;
  --color-gray: #4b4b4b;
  --color-light: #f5f7fa;
  --color-border: #e0e0e0;
  --color-accent: #ff6b6b;

  --font-serif: 'Merriweather', serif;
  --font-sans:  'Open Sans', Arial, sans-serif;

  --demo-anim-cycle: 3.6s;
}

/* ================================================= RESET / BASE */
*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--color-dark);
  background: #fff;
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: var(--font-serif);
  color: var(--color-primary);
  font-weight: 700;
  margin-top: 0;
}

h1 { font-size: 2.4rem; }
h2 { font-size: 1.8rem; margin-bottom: 1rem; }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1rem; }

a   { color: var(--color-primary); text-decoration: none; }
a:hover, a:focus { text-decoration: underline; }

ul  { list-style: none; padding: 0; margin: 0; }

.container { width: 90%; max-width: 1100px; margin: 0 auto; }

/* ================================================= HEADER */
header {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  position: sticky;
  top: 0; 
  z-index: 1000;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .8rem 0;
}

/* Hamburger menu button (mobile only) */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1001;
}

.hamburger-btn span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-gray);
  margin: 5px 0;
  transition: all 0.3s ease;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-primary);
}

.nav-list { display: flex; gap: 1.2rem; }
.nav-list a { font-weight: 600; color: var(--color-gray); }
.nav-list a:hover { color: var(--color-primary); }

/* ================================================= HERO */
.hero {
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  text-align: center;
  padding: 4rem 1rem 5rem;
}

/* To change the hero h1 color */
.hero h1 {
  color: #fff; /* Change this to any color you want */
}

.hero-domain-note {
  max-width: 560px;
  margin: 0 auto 1.1rem;
  color: rgba(255, 255, 255, 0.68);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content .subtitle {
  font-size: 1.15rem;
  max-width: 700px;
  margin: 1rem auto 0.55rem;
  opacity: 0.92;
  line-height: 1.55;
}

.hero-content .hero-support {
  font-size: 0.97rem;
  max-width: 640px;
  margin: 0 auto;
  opacity: 0.78;
  line-height: 1.65;
}

/* Hero CTA buttons */
.hero-cta-group {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1.4rem;
}

.btn-hero-primary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: var(--color-secondary);
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  border-radius: 6px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(92, 75, 139, 0.4);
  letter-spacing: 0.02em;
}

.btn-hero-primary:hover {
  transform: translateY(-2px);
  background: var(--color-primary);
  box-shadow: 0 6px 20px rgba(30, 61, 123, 0.55);
  text-decoration: none;
}

.btn-hero-secondary {
  display: inline-block;
  padding: 0.85rem 2rem;
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 1.05rem;
  border-radius: 6px;
  text-decoration: none;
  border: 2px solid rgba(255,255,255,0.5);
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-hero-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.8);
  text-decoration: none;
}

/* ================================================= LATEST PUBLICATIONS */
.latest-publications { 
  background: var(--color-light); 
  padding: 6rem 0; 
}

.pub-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  margin-top: 2rem;
}

.pub-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pub-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
}

/* Category badge pill */
.pub-category {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 0.75rem;
  width: fit-content;
}

.pub-category--briefing {
  background: rgba(30, 61, 123, 0.1);
  color: var(--color-primary);
}

.pub-category--analysis {
  background: rgba(76, 175, 80, 0.12);
  color: #2e7d32;
}

.pub-category--perspective {
  background: rgba(92, 75, 139, 0.12);
  color: var(--color-secondary);
}

.pub-meta { 
  font-size: .82rem; 
  color: var(--color-gray); 
  margin-bottom: .5rem; 
}

.pub-excerpt { 
  flex-grow: 1; 
}

.read-more { 
  margin-top: 1rem; 
  font-weight: 600; 
  color: var(--color-secondary); 
}

/* Buttons */
.btn-primary, .btn-secondary {
  display: inline-block;
  padding: .75rem 1.5rem;
  height: 52px;
  border-radius: 3px;
  font-weight: 600;
  transition: background .2s ease;
  cursor: pointer;
  border: none;
  font-size: 1rem;
  margin-top: 2rem;
}

.btn-primary {
  background: var(--color-secondary); 
  color: #fff;
  /* padding: 0.9rem 1.5rem; */
  white-space: nowrap;
}

.btn-primary:hover { 
  background: var(--color-primary); 
  text-decoration: none;
}

.btn-secondary {
  background: var(--color-primary); 
  color: #fff;
}

.btn-secondary:hover { 
  background: var(--color-secondary); 
  text-decoration: none;
}

/* ================================================= ABOUT */
.about-lab {
  padding: 6rem 0;
  background: var(--color-light);
}

.about-grid {
  display: grid;
  gap: 3rem;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  align-items: center;
}

.about-photo img { width: 100%; border-radius: 4px; }

.focus-list li {
  margin-bottom: .5rem;
  padding-left: 1.2rem;
  position: relative;
}
.focus-list li::before {
  content: "▹";
  position: absolute;
  left: 0; color: var(--color-secondary);
}

/* ================================================= NEWSLETTER */
.newsletter { 
  padding: 6rem 0; 
  background: #fff;
}

.newsletter-box { 
  text-align: center; 
  max-width: 600px; 
  margin: 0 auto;
}

.newsletter-form {
  display: flex; 
  gap: 0.25rem; 
  margin-top: 0.75rem;
  justify-content: center;
  max-width: 377px;
  margin: 1.5rem auto 0;
  align-items:end;
}

.newsletter-form input[type="email"] {
  flex: 1;
  padding: 0.9rem 1rem;
  height: 52px; 
  font-size: 1rem;
  border: 1px solid var(--color-border); 
  border-radius: 4px;
  min-width: 250px;
  background: #fff;
  transition: border-color 0.2s ease;
}

.newsletter-form input[type="email"]:focus {
  outline: none;
  border-color: var(--color-secondary);
  box-shadow: 0 0 0 2px rgba(92, 75, 139, 0.1);
}

/* Hides label from visual UI but keeps for screen readers */
.visually-hidden {
  position: absolute; 
  width: 1px; 
  height: 1px;
  margin: -1px; 
  border: 0; 
  clip-path: inset(50%); 
  overflow: hidden;
}

/* Newsletter success/error messages */
.newsletter-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 3px;
  font-size: 0.9rem;
  display: none;
}

.newsletter-message.success {
  background: #d4f4dd;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.newsletter-message.error {
  background: #ffebee;
  color: #c62828;
  border: 1px solid #ef9a9a;
}

/* ================================================= PQC TOOLS */
.tools-hero p {
  color: rgba(255,255,255,0.92);
  font-size: 1.12rem;
  max-width: 680px;
  margin: 0.75rem 0 0;
}

.tools-section {
  background: #fff;
  padding: 5rem 0;
}

.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.tool-card {
  border: 1px solid var(--color-border);
  border-radius: 8px;
  padding: 2rem;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 26, 51, 0.08);
}

.tool-card--featured {
  border-color: rgba(92, 75, 139, 0.35);
  box-shadow: 0 10px 28px rgba(92, 75, 139, 0.14);
}

.tool-kicker {
  color: var(--color-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
}

.tool-card h2 {
  font-size: 1.45rem;
}

.tool-card p {
  color: var(--color-gray);
  margin-bottom: 1.5rem;
}

/* ================================================= FOOTER */
footer {
  background: #0f1a33; color: #fff; font-size: .9rem;
}

.footer-container {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  padding: 3rem 0;
}

.footer-col h3 {
  font-family: var(--font-serif);
  margin-bottom: 1rem; color: #fff;
}
.footer-col ul li { margin-bottom: .5rem; }
.footer-col a      { color: #d1d9ff; }

.social-list { display: flex; gap: 1rem; }

.footer-bottom {
  background: #0a1227;
  text-align: center;
  padding: 1rem 0;
  border-top: 1px solid rgba(255,255,255,.1);
}

/* ================================================= RESPONSIVE */
@media (max-width: 600px) {
  .header-container { flex-direction: column; }
  .nav-list { flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: .5rem; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form input[type="email"] { width: 100%; max-width: none; }
  .btn-primary, .btn-secondary { width: 100%; }
}

/* Contact Form Styles */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 300px;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  border-radius: 4px;
  font-size: 0.9rem;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
  color: rgba(255,255,255,0.7);
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: #5c4b8b;
  background: rgba(255,255,255,0.15);
}

.btn-footer {
  background: #5c4b8b;
  color: white;
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.2s ease;
}

.btn-footer:hover {
  background: #6b5a9a;
}

.btn-footer:disabled {
  background: #666;
  cursor: not-allowed;
}

.contact-message {
  margin-top: 1rem;
  padding: 0.75rem;
  border-radius: 4px;
  font-size: 0.85rem;
  display: none;
}

.contact-message.success {
  background: rgba(76, 175, 80, 0.2);
  border: 1px solid rgba(76, 175, 80, 0.4);
  color: #a5d6a7;
}

.contact-message.error {
  background: rgba(244, 67, 54, 0.2);
  border: 1px solid rgba(244, 67, 54, 0.4);
  color: #ef9a9a;
}

/* Contact Box */
/* .contact-box {
  background: rgba(255,255,255,0.1);
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid rgba(255,255,255,0.2);
} */

/* Social Media Icons */
.social-list {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.social-list li {
  list-style: none;
}

.social-list a {
  display: block;
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.1);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.social-list a:hover {
  background: #5c4b8b;
  transform: translateY(-2px);
}

.social-list svg {
  width: 20px;
  height: 20px;
  fill: #d1d9ff;
}

.social-list a:hover svg {
  fill: white;
}

/* Responsive updates */
@media (max-width: 768px) {
  .contact-form {
    max-width: 100%;
  }
  
  .footer-container {
    grid-template-columns: 1fr;
    gap: 3rem;
  }
}
/* Lattice Animation */
#latticeCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.3;
}

.hero {
  position: relative;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
}

/* Animated text effect */
.hero h1 {
  animation: fadeInUp 1s ease-out;
}

.hero .subtitle {
  animation: fadeInUp 1s ease-out 0.3s both;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Glowing effect for the title */
.hero h1 {
  text-shadow: 0 0 20px rgba(255,255,255,0.5);
}

/* Particle Canvas Styles */
#particleCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 500px; /* Ensure enough space for animations */
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 1rem 5rem;
}

/* Combined Animation Canvas */
#latticeQuantumCanvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.4; /* Slightly higher opacity for better visibility */
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 400px; /* More space for the animation */
  background: linear-gradient(135deg, #1e3d7b 0%, #5c4b8b 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 4rem 1rem 5rem;
}

/* Add a subtle overlay gradient for better text readability */
.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: radial-gradient(ellipse at center, transparent 0%, rgba(0,0,0,0.3) 100%);
  z-index: 1;
}

/* .pqc-badge {
  display: inline-block;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.3);
  padding: 8px 20px;
  border-radius: 20px;
  margin-top: 1rem;
  font-size: 0.9rem;
  backdrop-filter: blur(10px);
} */

.pqc-badge {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.8);
  color: white;
  padding: 10px 15px;
  border-radius: 25px;
  font-size: 14px;
  font-weight: 500;
  z-index: 1000;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
  animation: fadeInUp 0.5s ease-out;
}

.pqc-badge a,
.pqc-badge a:visited,
.pqc-badge a:hover,
.pqc-badge a:focus,
.pqc-badge a:active {
  color: #fff;
  text-decoration: none;
}

.pqc-badge a {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pqc-badge a:hover,
.pqc-badge a:focus {
  opacity: 0.92;
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .pqc-badge {
    bottom: 10px;
    right: 10px;
    font-size: 12px;
    padding: 8px 12px;
  }
}

/* Privacy Banner Styles */
.privacy-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #1e3d7b;
  color: white;
  padding: 20px;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.2);
  z-index: 9999;
  display: none;
  font-family: Arial, sans-serif;
}

.privacy-banner.show {
  display: block;
}

.privacy-banner-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
}

.privacy-text {
  flex: 1;
  min-width: 300px;
}

.privacy-text h3 {
  margin: 0 0 10px 0;
  font-size: 18px;
}

.privacy-text p {
  margin: 0 0 10px 0;
  font-size: 14px;
  line-height: 1.5;
}

.privacy-text a {
  color: #8fb1ff;
  text-decoration: underline;
}

.privacy-buttons {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.privacy-btn {
  padding: 12px 24px;
  border: none;
  border-radius: 4px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.3s;
  min-width: 120px;
}

.privacy-btn-accept {
  background: #5c4b8b;
  color: white;
}

.privacy-btn-reject {
  background: #5c4b8b;
  color: white;
}

.privacy-btn-settings {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.privacy-btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

/* Cookie Settings Modal */
.cookie-settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  display: none;
  z-index: 10000;
  overflow-y: auto;
}

.cookie-settings-modal.show {
  display: flex;
  align-items: center;
  justify-content: center;
}

.cookie-settings-content {
  background: white;
  color: #333;
  padding: 30px;
  border-radius: 8px;
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  margin: 20px;
}

.cookie-settings-content h2 {
  margin: 0 0 20px 0;
  color: #1e3d7b;
}

.cookie-category {
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  padding: 15px;
  margin-bottom: 15px;
}

.cookie-category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}

.cookie-category h3 {
  margin: 0;
  font-size: 16px;
  color: #1e3d7b;
}

.cookie-toggle {
  position: relative;
  width: 50px;
  height: 26px;
}

.cookie-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: .4s;
  border-radius: 26px;
}

.cookie-toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .4s;
  border-radius: 50%;
}

.cookie-toggle input:checked + .cookie-toggle-slider {
  background-color: #5c4b8b;
}

.cookie-toggle input:checked + .cookie-toggle-slider:before {
  transform: translateX(24px);
}

.cookie-toggle input:disabled + .cookie-toggle-slider {
  opacity: 0.5;
  cursor: not-allowed;
}

.cookie-settings-footer {
  margin-top: 20px;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

@media (max-width: 768px) {
  .privacy-banner-content {
    flex-direction: column;
    text-align: center;
  }
  
  .privacy-buttons {
    width: 100%;
    justify-content: center;
  }
}

/* Cookie Settings Link in Footer */
.cookie-settings-link {
  background: none;
  color: #8fb1ff;
  border: none;
  padding: 0;
  font-size: inherit;
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  display: inline;
}

.cookie-settings-link:hover {
  color: #fff;
}

nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}
/* Language Switcher*/
.lang-switcher {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: 0;
}

.lang-btn {
  padding: 0.3rem 0.8rem;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-gray);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  border-radius: 3px;
}

.lang-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

.lang-btn:hover:not(.active) {
  background: var(--color-light);
  color: var(--color-primary);
}

/* Responsive header */
@media (max-width: 768px) {
  .header-container {
    flex-wrap: wrap;
  }
  
  nav {
    width: 100%;
    justify-content: space-between;
    margin-top: 1rem;
  }
  
  .nav-list {
    flex-wrap: wrap;
  }
}

/* ================================================= SCROLL REVEAL ANIMATIONS */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease-out, transform 0.7s ease-out;
}

.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger child elements within a revealed container */
.reveal .pub-card {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}

.reveal.revealed .pub-card {
  opacity: 1;
  transform: translateY(0);
}

.reveal.revealed .pub-card:nth-child(1) { transition-delay: 0.05s; }
.reveal.revealed .pub-card:nth-child(2) { transition-delay: 0.12s; }
.reveal.revealed .pub-card:nth-child(3) { transition-delay: 0.19s; }
.reveal.revealed .pub-card:nth-child(4) { transition-delay: 0.26s; }
.reveal.revealed .pub-card:nth-child(5) { transition-delay: 0.33s; }
.reveal.revealed .pub-card:nth-child(6) { transition-delay: 0.40s; }

/* ================================================= DEMO PAGE STYLES */
.demo-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.demo-header {
  text-align: center;
  margin-bottom: 3rem;
}

.demo-controls {
  background: #1e3d7b;
  color: white;
  padding: 2rem;
  border-radius: 10px;
  margin-bottom: 2rem;
  text-align: center;
}

.demo-button {
  background: #5c4b8b;
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  margin: 0 10px;
  transition: all 0.3s ease;
}

.demo-button:hover {
  background: #463a6f;
  transform: translateY(-2px);
}

.demo-button:disabled {
  background: #666;
  cursor: not-allowed;
  transform: none;
}

/* ================================================= ALGORITHM DETAILS STYLES */
.algorithm-details {
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  margin: 2rem 0;
}

.algorithm-tabs {
  display: flex;
  border-bottom: 2px solid #e0e0e0;
  margin-bottom: 1.5rem;
}

.tab-btn {
  background: none;
  border: none;
  padding: 12px 20px;
  cursor: pointer;
  font-size: 16px;
  color: #666;
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: #1e3d7b;
  border-bottom-color: #5c4b8b;
  font-weight: 600;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.loading-placeholder {
  background: #f8f9fa;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 2rem;
  text-align: center;
  color: #666;
  font-style: italic;
  margin: 1rem 0;
}

.algorithm-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin: 1rem 0;
  border-left: 4px solid #5c4b8b;
}

.algorithm-card h4 {
  color: #1e3d7b;
  margin: 0 0 0.5rem 0;
}

.algorithm-card p {
  color: #666;
  margin: 0 0 1rem 0;
  line-height: 1.5;
}

.algorithm-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.spec-item {
  background: white;
  padding: 8px 12px;
  border-radius: 6px;
  text-align: center;
}

.spec-label {
  font-size: 12px;
  color: #666;
  display: block;
}

.spec-value {
  font-size: 16px;
  font-weight: bold;
  color: #1e3d7b;
}

.algorithm-card ul {
  margin: 0;
  padding-left: 1.5rem;
}

.algorithm-card li {
  color: #555;
  margin: 0.25rem 0;
}

/* ================================================= BENCHMARK STYLES */
.tls-animation-section {
  margin-top: 1rem;
  background: white;
  border-radius: 5px;
  padding: 2rem;
  box-shadow: 0 0px 0px rgba(0,0,0,0.1);
}

.benchmark-section {
  margin-top: 2rem;
  background: white;
  border-radius: 10px;
  padding: 2rem;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.benchmark-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

.benchmark-controls label {
  font-weight: 600;
  color: #1e3d7b;
}

.benchmark-controls select {
  padding: 8px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.benchmark-controls input[type="number"] {
  padding: 6px 8px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

/* Animation Styles */
.benchmark-animation {
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border-radius: 12px;
  padding: 1rem;
  margin: 1rem 0;
  border: 2px solid #5c4b8b;
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-left: 0;
  max-width: 100%;
}

.benchmark-animation,
.benchmark-animation * {
  animation-play-state: paused;
}

.benchmark-animation[data-anim-state="running"],
.benchmark-animation[data-anim-state="running"] * {
  animation-play-state: running;
}

.benchmark-animation[data-anim-state="paused"] .data-packet,
.benchmark-animation[data-anim-state="complete"] .data-packet {
  opacity: 0.95;
  transform: translateX(0);
}

.benchmark-animation[data-anim-state="paused"] .cycle-progress-fill,
.benchmark-animation[data-anim-state="complete"] .cycle-progress-fill {
  transform: translateX(0);
}

.benchmark-animation::before {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  background: linear-gradient(45deg, #5c4b8b, #1e3d7b, #5c4b8b);
  border-radius: 12px;
  z-index: -1;
  animation: borderGlow 2s linear infinite;
}

@keyframes borderGlow {
  0% { filter: hue-rotate(0deg); }
  100% { filter: hue-rotate(360deg); }
}

.animation-header {
  text-align: center;
  margin-bottom: 1.25rem;
}

.animation-header h4 {
  color: #1e3d7b;
  margin: 0 0 0.5rem 0;
  font-size: 1.5rem;
}

.cycle-indicator {
  font-size: 1.1rem;
  color: #5c4b8b;
  font-weight: 600;
}

.cycle-text {
  animation: textPulse calc(var(--demo-anim-cycle) * 0.67) ease-in-out infinite;
}

.animation-controls {
  margin-top: 0.75rem;
}

.animation-toggle {
  border: 1px solid #5c4b8b;
  background: #fff;
  color: #1e3d7b;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.animation-toggle:hover {
  background: #5c4b8b;
  color: #fff;
  border-color: #5c4b8b;
}

@keyframes textPulse {
  0%, 100% { opacity: 0.8; }
  50% { opacity: 1; transform: scale(1.05); }
}

.crypto-visual {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.crypto-stage {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 0.5rem;
}

.crypto-process {
  background: white;
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
  position: relative;
  overflow: hidden;
  min-height: 250px;
  max-height: 390px;
}

.benchmark-animation .crypto-process {
  transition: opacity 0.25s ease, filter 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.benchmark-animation[data-anim-state="running"] .crypto-process {
  opacity: 0.6;
  filter: saturate(0.78);
}

.benchmark-animation[data-anim-state="running"]::before,
.benchmark-animation[data-anim-state="running"] .crypto-process,
.benchmark-animation[data-anim-state="running"] .crypto-process::before {
  animation: none !important;
}

.benchmark-animation.anim-hard-reset,
.benchmark-animation.anim-hard-reset *,
.benchmark-animation.anim-hard-reset *::before,
.benchmark-animation.anim-hard-reset *::after {
  animation: none !important;
}

.benchmark-animation[data-anim-state="running"][data-active-phase="keygen"] #keygenProcess,
.benchmark-animation[data-anim-state="running"][data-active-phase="kex"] #kexProcess,
.benchmark-animation[data-anim-state="running"][data-active-phase="sign"] #signProcess {
  opacity: 1;
  filter: saturate(1);
  border-color: #5c4b8b;
  box-shadow: 0 6px 16px rgba(92, 75, 139, 0.3);
}

/* Keep non-active phases visible but de-emphasized; timelines stay continuous to avoid freeze artifacts. */

/* Continuous cycling animation for processes */
.crypto-process {
  animation: processActivation var(--demo-anim-cycle) ease-in-out infinite;
}

.crypto-process:nth-child(1) {
  animation-delay: 0s; /* Key generation starts immediately */
}

.crypto-process:nth-child(2) {
  animation-delay: calc(var(--demo-anim-cycle) / 3);
}

.crypto-process:nth-child(3) {
  animation-delay: calc((var(--demo-anim-cycle) / 3) * 2);
}

@keyframes processActivation {
  0%, 66.67%, 100% { 
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transform: scale(1);
  }
  16.67%, 50% { 
    border-color: #5c4b8b;
    box-shadow: 0 4px 12px rgba(92, 75, 139, 0.3);
    transform: scale(1.02);
  }
}

.crypto-process::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(92, 75, 139, 0.1), transparent);
  animation: shimmerContinuous var(--demo-anim-cycle) ease-in-out infinite;
}

.crypto-process:nth-child(1)::before {
  animation-delay: 0s;
}

.crypto-process:nth-child(2)::before {
  animation-delay: calc(var(--demo-anim-cycle) / 3);
}

.crypto-process:nth-child(3)::before {
  animation-delay: calc((var(--demo-anim-cycle) / 3) * 2);
}

@keyframes shimmerContinuous {
  0%, 66.67%, 100% { left: -100%; opacity: 0; }
  16.67% { left: -100%; opacity: 1; }
  50% { left: 100%; opacity: 1; }
}

.process-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.75rem;
  text-align: center;
  font-size: 1rem;
}

/* Key Generation Animation */
.key-visual {
  display: flex;
  justify-content: space-around;
  gap: 0.5rem;
  padding: 0 1rem;
}

.key-party {
  text-align: center;
  flex: 1;
  min-width: 0; /* Allow flex items to shrink */
}

.key-party .party-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 1rem;
  font-size: 1.1rem;
}

.key-pair {
  text-align: center;
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 2rem;
  transition: all 0.3s ease;
  font-size: 0.75rem;
  min-height: 80px;
  max-height: 120px;
  min-width: 80px;
  max-width: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

/* Continuous key generation animation */
.key-pair {
  animation: keyGenerateContinuous var(--demo-anim-cycle) ease-in-out infinite;
}

.classical-key {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  border: 2px solid #424242;
  animation-delay: 0s;
}

.pqc-key {
  background: linear-gradient(135deg, #f3e5f5 0%, #e1bee7 100%);
  border: 2px solid #9c27b0;
  animation-delay: 0.5s; /* PQC key generates slightly after classical */
}

.placeholder-key {
  background: linear-gradient(135deg, #f5f5f5 0%, #e0e0e0 100%);
  border: 2px solid #bdbdbd;
  opacity: 0.6;
  animation: none; /* No animation for placeholder */
}

/* Server keys animate first, then client */
#serverClassicalKey {
  animation-delay: 0s;
}

#serverPqcKey {
  animation-delay: calc(var(--demo-anim-cycle) * 0.08);
}

#clientClassicalKey {
  animation-delay: calc(var(--demo-anim-cycle) * 0.17);
}

#clientCiphertext {
  animation-delay: calc(var(--demo-anim-cycle) * 0.25);
}

@keyframes keyGenerateContinuous {
  0%, 66.67%, 100% {
    transform: scale(1) rotateY(0deg); 
    opacity: 0.8; 
  }
  16.67% {
    transform: scale(1.1) rotateY(180deg); 
    opacity: 1; 
  }
  33.33% {
    transform: scale(1.05) rotateY(360deg); 
    opacity: 0.9; 
  }
}

.key-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.key-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.15rem;
  font-size: 0.85rem;
}

.key-bits {
  font-size: 0.7rem;
  color: #666;
}

/* Key Exchange Animation */
.exchange-visual {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  position: relative;
  gap: 1rem;
}

.party {
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  flex: 0 0 80px;
  min-height: 300px;
  max-height: 350px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  font-size: 0.8rem;
}

.party-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.party-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

.party-keys {
  font-size: 0.7rem;
  color: #666;
}

.exchange-flow {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex: 1;
  margin: 0 0.5rem;
  position: relative;
  min-width: 0;
}

.exchange-direction {
  position: relative;
}

.flow-label {
  font-size: 0.8rem;
  color: #666;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 600;
}

.data-packet {
  padding: 0.5rem 0.75rem;
  border-radius: 15px;
  text-align: center;
  font-weight: 600;
  color: white;
  margin-bottom: 0.3rem;
  font-size: 0.85rem;
  transform: translateX(-100%);
  opacity: 0;
  transition: all 0.5s ease;
}

/* Server to Client packets */
.server-to-client {
  animation: packetFlowServerToClient var(--demo-anim-cycle) ease-in-out infinite;
}

/* Client to Server packets */
.client-to-server {
  animation: packetFlowClientToServer var(--demo-anim-cycle) ease-in-out infinite;
}

.classical-packet {
  background: linear-gradient(135deg, #424242 0%, #212121 100%);
}

.pqc-packet {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
}

/* Server packets start at 1s */
#serverClassicalPacket {
  animation-delay: calc(var(--demo-anim-cycle) * 0.28);
}

#serverPqcPacket {
  animation-delay: calc(var(--demo-anim-cycle) * 0.33);
}

/* Client packet starts at 1.5s */
#clientClassicalPacket {
  animation-delay: calc(var(--demo-anim-cycle) * 0.42);
}

#clientCiphertextPacket {
  animation-delay: calc(var(--demo-anim-cycle) * 0.47);
}

@keyframes packetFlowServerToClient {
  0%, 66.67%, 100% { 
    transform: translateX(-100%); 
    opacity: 0; 
  }
  16.67% { 
    transform: translateX(-25%); 
    opacity: 0.7; 
  }
  33.33% { 
    transform: translateX(50%); 
    opacity: 1; 
  }
  50% { 
    transform: translateX(100%); 
    opacity: 0; 
  }
}

@keyframes packetFlowClientToServer {
  0%, 66.67%, 100% { 
    transform: translateX(100%); 
    opacity: 0; 
  }
  16.67% { 
    transform: translateX(25%); 
    opacity: 0.7; 
  }
  33.33% { 
    transform: translateX(-50%); 
    opacity: 1; 
  }
  50% { 
    transform: translateX(-100%); 
    opacity: 0; 
  }
}

/* Signature Animation */
.signature-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
}

.signature-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  width: 100%;
}

.signature-party {
  text-align: center;
  padding: 0.5rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2px solid #dee2e6;
  min-width: 80px;
  font-size: 0.8rem;
}

.signature-party .party-icon {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
}

.signature-party .party-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.25rem;
  font-size: 0.8rem;
}

.signature-item {
  text-align: center;
  padding: 0.75rem;
  border-radius: 8px;
  background: linear-gradient(135deg, #fff3e0 0%, #ffe0b2 100%);
  border: 2px solid #ff9800;
  transition: all 0.3s ease;
  font-size: 0.8rem;
  flex: 1;
  max-width: 120px;
  min-width: 100px;
  min-height: 100px;
  max-height: 120px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.signature-item#serverSignature {
  animation: serverSignatureContinuous var(--demo-anim-cycle) ease-in-out infinite;
  animation-delay: calc((var(--demo-anim-cycle) / 3) * 2);
}

.signature-item#clientCertificate {
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c8 100%);
  border: 2px solid #4caf50;
  animation: clientCertificateContinuous var(--demo-anim-cycle) ease-in-out infinite;
  animation-delay: calc(var(--demo-anim-cycle) * 0.75);
}

@keyframes serverSignatureContinuous {
  0%, 66.67%, 100% { 
    transform: scale(1) rotate(0deg); 
    opacity: 0.8; 
  }
  16.67% { 
    transform: scale(1.1) rotate(2deg); 
    opacity: 1; 
  }
  33.33% { 
    transform: scale(1.05) rotate(-1deg); 
    opacity: 0.9; 
  }
  50% { 
    transform: scale(1) rotate(0deg); 
    opacity: 0.8; 
  }
}

@keyframes clientCertificateContinuous {
  0%, 66.67%, 100% { 
    transform: scale(1); 
    opacity: 0.8; 
  }
  16.67% { 
    transform: scale(0.9); 
    opacity: 0.6; 
  }
  33.33% { 
    transform: scale(1.1); 
    opacity: 1; 
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3); 
  }
  50% { 
    transform: scale(1); 
    opacity: 0.9; 
  }
}

.signature-arrow-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.signature-arrow {
  font-size: 2rem;
  color: #5c4b8b;
  animation: arrowPulseContinuous calc(var(--demo-anim-cycle) / 2.4) ease-in-out infinite;
  flex-shrink: 0;
}

@keyframes arrowPulseContinuous {
  0%, 100% { transform: scale(1); opacity: 0.7; }
  50% { transform: scale(1.2); opacity: 1; }
}

.signature-icon,
.certificate-icon {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.signature-label,
.certificate-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.25rem;
}

.signature-sublabel,
.certificate-sublabel {
  font-size: 0.75rem;
  color: #666;
  margin-top: 0.25rem;
}

/* Performance Meters */
.performance-meters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.meter {
  background: white;
  border-radius: 10px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  border: 1px solid #e0e0e0;
  height: 100%;
}

.meter-label {
  font-weight: 600;
  color: #1e3d7b;
  margin-bottom: 0.5rem;
  text-align: center;
  font-size: 1rem;
}

.meter-bar {
  height: 20px;
  background: #f0f0f0;
  border-radius: 10px;
  overflow: hidden;
  position: relative;
  margin-bottom: 0.5rem;
}

.meter-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.5s ease;
  position: absolute;
  top: 0;
}

.classical-fill {
  background: linear-gradient(135deg, #424242 0%, #212121 100%);
  left: 0;
  animation: meterFillContinuous var(--demo-anim-cycle) ease-in-out infinite;
}

.pqc-fill {
  background: linear-gradient(135deg, #9c27b0 0%, #7b1fa2 100%);
  right: 0;
  animation: meterFillContinuous var(--demo-anim-cycle) ease-in-out infinite;
  animation-delay: calc(var(--demo-anim-cycle) * 0.14);
}

@keyframes meterFillContinuous {
  0%, 100% { width: 20%; }
  25% { width: 60%; }
  50% { width: 85%; }
  75% { width: 40%; }
}

.security-visual {
  display: flex;
  justify-content: space-around;
  margin-bottom: 0.5rem;
}

.security-shield {
  font-size: 2rem;
  transition: all 0.3s ease;
}

/* Continuous shield activation */
.security-shield {
  animation: shieldActivateContinuous calc(var(--demo-anim-cycle) * 1.33) ease-in-out infinite;
}

.classical-shield {
  animation-delay: 0s;
}

.pqc-shield {
  animation-delay: calc(var(--demo-anim-cycle) * 0.67);
}

@keyframes shieldActivateContinuous {
  0%, 75%, 100% { 
    transform: scale(1); 
    filter: brightness(1); 
  }
  12.5% { 
    transform: scale(1.1); 
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)); 
  }
  25% { 
    transform: scale(1.2); 
    filter: brightness(1.5) drop-shadow(0 0 15px gold); 
  }
  37.5% { 
    transform: scale(1.1); 
    filter: brightness(1.3) drop-shadow(0 0 8px rgba(255, 215, 0, 0.6)); 
  }
  50% { 
    transform: scale(1); 
    filter: brightness(1); 
  }
}

.meter-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  line-height: 1.2;
}

.classical-legend {
  color: #424242;
  font-weight: 600;
}

.pqc-legend {
  color: #9c27b0;
  font-weight: 600;
}

/* Cycle Progress Indicator */
.progress-indicator {
  margin-top: 2rem;
  text-align: center;
}

.cycle-progress-bar {
  width: 100%;
  height: 8px;
  background: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.cycle-progress-fill {
  height: 100%;
  background: linear-gradient(135deg, #5c4b8b 0%, #1e3d7b 100%);
  border-radius: 4px;
  width: 100%;
  position: relative;
  animation: cycleProgress var(--demo-anim-cycle) linear infinite;
}

@keyframes cycleProgress {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(0%); }
}

.cycle-progress-fill::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 30%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShimmerCycle var(--demo-anim-cycle) linear infinite;
}

@keyframes progressShimmerCycle {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(333%); }
}

.cycle-status-text {
  font-weight: 600;
  color: #1e3d7b;
  font-size: 1rem;
  animation: statusTextCycle var(--demo-anim-cycle) ease-in-out infinite;
}

.cycle-status-text .phase-label {
  opacity: 0.55;
  transition: opacity 0.2s ease, color 0.2s ease;
}

.cycle-status-text .phase-sep {
  opacity: 0.45;
  padding: 0 0.35rem;
}

.benchmark-animation[data-active-phase="keygen"] .cycle-status-text .phase-label[data-phase="keygen"],
.benchmark-animation[data-active-phase="kex"] .cycle-status-text .phase-label[data-phase="kex"],
.benchmark-animation[data-active-phase="sign"] .cycle-status-text .phase-label[data-phase="sign"] {
  opacity: 1;
  color: #1e3d7b;
}

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

  .crypto-process {
    min-height: auto;
    max-height: none;
  }
}

@media (max-width: 768px) {
  .benchmark-animation {
    padding: 0.75rem;
  }

  .key-visual {
    flex-direction: column;
    gap: 1rem;
    padding: 0;
  }

  .exchange-visual {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .party {
    min-height: auto;
    max-height: none;
    flex: initial;
    width: 100%;
    padding: 0.75rem;
  }

  .exchange-flow {
    margin: 0;
  }

  .signature-row {
    flex-direction: column;
    gap: 0.5rem;
  }

  .signature-item {
    width: 100%;
    max-width: none;
    min-height: auto;
  }

  .performance-meters {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .benchmark-animation,
  .benchmark-animation *,
  .benchmark-animation *::before,
  .benchmark-animation *::after {
    animation: none !important;
    transition: none !important;
  }

  .benchmark-animation .data-packet {
    opacity: 1;
    transform: translateX(0);
  }

  .benchmark-animation .cycle-progress-fill {
    transform: translateX(0);
  }

  /* Keep state changes visible without motion. */
  .benchmark-animation[data-anim-state="running"] .crypto-process {
    border-color: #5c4b8b;
    box-shadow: 0 0 0 1px rgba(92, 75, 139, 0.25);
  }

  .benchmark-animation[data-anim-state="paused"] .crypto-process,
  .benchmark-animation[data-anim-state="complete"] .crypto-process {
    border-color: #e0e0e0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }
}

@keyframes statusTextCycle {
  0%, 100% { opacity: 0.7; }
  33.33% { opacity: 1; color: #424242; }
  66.67% { opacity: 1; color: #9c27b0; }
}

/* Keep animation state controls last so shorthand animation declarations above don't override them. */
.benchmark-animation[data-anim-state="paused"],
.benchmark-animation[data-anim-state="paused"] *,
.benchmark-animation[data-anim-state="paused"] *::before,
.benchmark-animation[data-anim-state="paused"] *::after,
.benchmark-animation[data-anim-state="complete"],
.benchmark-animation[data-anim-state="complete"] *,
.benchmark-animation[data-anim-state="complete"] *::before,
.benchmark-animation[data-anim-state="complete"] *::after {
  animation-play-state: paused !important;
}

.benchmark-animation[data-anim-state="running"],
.benchmark-animation[data-anim-state="running"] *,
.benchmark-animation[data-anim-state="running"] *::before,
.benchmark-animation[data-anim-state="running"] *::after {
  animation-play-state: running !important;
}

.crypto-status {
  background: #f0f0f0;
  padding: 10px;
  border-radius: 6px;
  margin: 1rem 0;
  font-size: 14px;
  color: #666;
}

.crypto-status.ready {
  background: #e8f5e8;
  color: #2e7d32;
}

.crypto-status.error {
  background: #ffebee;
  color: #c62828;
}

.benchmark-results {
  margin-top: 2rem;
}

.benchmark-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.benchmark-card {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  text-align: center;
  border: 1px solid #e0e0e0;
}

.benchmark-card h4 {
  margin: 0 0 1rem 0;
  color: #1e3d7b;
}

.benchmark-metric {
  margin: 0.5rem 0;
}

.benchmark-metric .metric-value {
  display: block;
  font-size: 1.5rem;
  font-weight: bold;
  color: #5c4b8b;
}

.benchmark-metric .metric-label {
  font-size: 12px;
  color: #666;
}

.benchmark-details {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #e0e0e0;
}

.benchmark-details small {
  color: #666;
  font-size: 11px;
}

.benchmark-breakdown {
  background: #f8f9fa;
  border-radius: 8px;
  padding: 1.5rem;
  margin-top: 1rem;
}

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

.breakdown-item {
  background: white;
  padding: 1rem;
  border-radius: 6px;
  border: 1px solid #e0e0e0;
}

.breakdown-item strong {
  color: #1e3d7b;
  display: block;
  margin-bottom: 0.5rem;
}

.breakdown-item div {
  font-size: 14px;
  margin: 0.25rem 0;
  color: #555;
}

/* ================================================= INSIGHTS STYLES */
#performance-insights {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #e0e0e0;
}

#performance-insights h4 {
  color: #1e3d7b;
  margin-bottom: 1rem;
}

.insight-item {
  display: flex;
  align-items: flex-start;
  margin: 0.75rem 0;
  padding: 0.5rem;
  background: white;
  border-radius: 6px;
  border-left: 3px solid #5c4b8b;
}

.insight-icon {
  font-size: 1.2rem;
  margin-right: 0.75rem;
  flex-shrink: 0;
}

.insight-text {
  font-size: 14px;
  color: #555;
  line-height: 1.4;
}

/* Subscribe Modal */
.subscribe-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.55);
  z-index: 11000;
  padding: 1.5rem;
}

.subscribe-modal.show {
  display: flex;
}

.subscribe-modal__dialog {
  position: relative;
  background: #fff;
  border-radius: 12px;
  max-width: 520px;
  width: 100%;
  padding: 2rem;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
}

.subscribe-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #555;
}

.subscribe-modal h2 {
  margin-top: 0;
  color: #1e3d7b;
}

.subscribe-modal p {
  margin-bottom: 1rem;
  color: #444;
}

.subscribe-modal .newsletter-form {
  display: flex;
  flex-direction: column;
  gap: 0.37rem;
  align-items: center;
}

.subscribe-modal .newsletter-form input[type="email"] {
  text-align: center;
  width: 100%;
  max-width: 520px;
}

.subscribe-modal .newsletter-form button {
  margin-top: 0.37rem;
}

.subscribe-modal .newsletter-message {
  display: none;
}

@media (max-width: 600px) {
  .subscribe-modal__dialog {
    padding: 1.5rem;
  }
}

/* ================================================= LEARN PAGE */
.learn-intro {
  max-width: 800px;
  margin: 0 auto 3rem;
  text-align: center;
}

.learn-intro p {
  font-size: 1.1rem;
  color: var(--color-gray);
  line-height: 1.8;
}

.concepts-grid {
  display: flex;
  flex-direction: column;
  gap: 2.5rem;
  max-width: 850px;
  margin: 0 auto;
}

.concept-card {
  background: #fff;
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-secondary);
  border-radius: 8px;
  padding: 2rem 2rem 1.5rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.concept-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.1);
}

.concept-header {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1rem;
}

.concept-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  font-family: var(--font-sans);
}

.concept-card h3 {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.4;
}

.concept-card p {
  line-height: 1.8;
  color: #444;
}

.concept-card ul {
  list-style: none;
  padding: 0;
  margin: 0.5rem 0 1rem;
}

.concept-card ul li {
  padding-left: 1.4rem;
  position: relative;
  margin-bottom: 0.5rem;
  line-height: 1.7;
  color: #444;
}

.concept-card ul li::before {
  content: "▹";
  position: absolute;
  left: 0;
  color: var(--color-secondary);
  font-weight: bold;
}

.concept-read-more {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
  color: var(--color-secondary);
  transition: color 0.2s ease;
}

.concept-read-more:hover {
  color: var(--color-primary);
}

.concept-analogy {
  background: #f5f7fa;
  border-radius: 6px;
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  font-size: 0.95rem;
  color: #555;
  border-left: 3px solid #64b5f6;
}

.concept-analogy strong {
  color: var(--color-primary);
}

/* Learn page glossary table */
.glossary-section {
  max-width: 850px;
  margin: 3rem auto 0;
}

.glossary-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.glossary-table thead th {
  background: var(--color-primary);
  color: #fff;
  padding: 1rem 1.25rem;
  text-align: left;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 0.95rem;
}

.glossary-table tbody td {
  padding: 0.85rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
  line-height: 1.6;
  color: #444;
}

.glossary-table tbody tr:last-child td {
  border-bottom: none;
}

.glossary-table tbody tr:nth-child(even) {
  background: #f9fafb;
}

.glossary-table tbody td:first-child {
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
}

/* Learn page CTA box */
.learn-cta-box {
  max-width: 850px;
  margin: 3rem auto 0;
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-secondary) 100%);
  border-radius: 12px;
  padding: 2.5rem;
  text-align: center;
  color: #fff;
}

.learn-cta-box h2 {
  color: #fff;
  margin-bottom: 0.75rem;
}

.learn-cta-box p {
  opacity: 0.92;
  max-width: 550px;
  margin: 0 auto 1.5rem;
}

.learn-cta-box .btn-hero-primary {
  font-size: 1rem;
}

/* ================================================= HOMEPAGE CALLOUT CARD */
.pqc-callout {
  background: #fff;
  padding: 3.5rem 0;
}

.pqc-callout-inner {
  max-width: 780px;
  margin: 0 auto;
  background: linear-gradient(135deg, #f0f4ff 0%, #f3eff8 100%);
  border: 1px solid rgba(92, 75, 139, 0.15);
  border-radius: 12px;
  padding: 2.5rem 2.5rem 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.pqc-callout-icon {
  font-size: 3rem;
  flex-shrink: 0;
}

.pqc-callout-text h3 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: var(--color-primary);
}

.pqc-callout-text p {
  margin: 0 0 1rem;
  color: var(--color-gray);
  line-height: 1.7;
}

.btn-callout {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: var(--color-secondary);
  color: #fff;
  font-weight: 600;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-size: 0.95rem;
}

.btn-callout:hover {
  background: var(--color-primary);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(30, 61, 123, 0.3);
}

/* Hero tertiary button */
.btn-hero-tertiary {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
  font-size: 0.92rem;
  border-radius: 6px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.35);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(4px);
}

.btn-hero-tertiary:hover {
  background: rgba(255,255,255,0.25);
  border-color: rgba(255,255,255,0.6);
  text-decoration: none;
}

@media (max-width: 768px) {
  .pqc-callout-inner {
    flex-direction: column;
    text-align: center;
    padding: 2rem 1.5rem;
    gap: 1rem;
  }

  .concept-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .concept-card {
    padding: 1.5rem;
  }

  .glossary-table tbody td:first-child {
    white-space: normal;
  }
}

/* ================= HERO LATEST ARTICLE ALERT ================= */
.hero-highlights {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  width: min(100%, 760px);
  margin: 2.25rem auto 0;
}

.hero-latest-alert {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
}

.hero-latest-link {
  display: inline-flex;
  align-items: center;
  width: min(100%, 680px);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.32rem 0.95rem 0.32rem 0.32rem;
  border-radius: 50px;
  text-decoration: none;
  font-family: var(--font-sans);
  transition: all 0.4s ease;
  backdrop-filter: blur(6px);
  max-width: 100%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.hero-latest-link:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(100, 181, 246, 0.45);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(100, 181, 246, 0.18);
  text-decoration: none;
}

.hero-latest-badge {
  display: flex;
  align-items: center;
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  text-transform: uppercase;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 0.28rem 0.72rem;
  border-radius: 50px;
  margin-right: 0.85rem;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.24);
  white-space: nowrap;
}

.hero-latest-icon {
  display: inline-block;
  transform: scaleX(-1);
  font-size: 1.2rem;
  margin-right: 0.35rem;
  line-height: 1;
}

.hero-latest-title {
  color: rgba(255,255,255,0.9);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 430px;
  transition: color 0.3s ease;
}

.hero-latest-link:hover .hero-latest-title {
  color: #fff;
}

.hero-tool-alert {
  display: flex;
  justify-content: center;
  width: 100%;
}

.hero-tool-link {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  width: min(100%, 720px);
  padding: 0.82rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-family: var(--font-sans);
  color: #fff;
  background:
    linear-gradient(135deg, rgba(19, 44, 72, 0.78) 0%, rgba(10, 79, 96, 0.74) 52%, rgba(20, 112, 129, 0.72) 100%);
  border: 1px solid rgba(122, 220, 255, 0.24);
  box-shadow: 0 10px 24px rgba(2, 12, 27, 0.16);
  backdrop-filter: blur(10px);
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.hero-tool-link:hover {
  transform: translateY(-1px);
  border-color: rgba(162, 238, 255, 0.48);
  box-shadow: 0 14px 30px rgba(8, 74, 93, 0.24);
  text-decoration: none;
}

.hero-tool-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.38rem 0.82rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #b8f4ff;
  font-size: 0.69rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-tool-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  flex-direction: column;
  gap: 0.28rem;
}

.hero-tool-title {
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.35;
}

.hero-tool-description {
  color: rgba(235, 247, 255, 0.88);
  font-size: 0.85rem;
  line-height: 1.4;
}

.hero-tool-cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.58rem 0.92rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.info-box {
  background: #e7f3ff;
  border: 1px solid #b6d4fe;
  border-radius: 4px;
  padding: 1.5rem;
  margin: 2rem 0;
}

.citation-code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 1rem 0 0;
}

@media (max-width: 768px) {
  .hero-domain-note {
    font-size: 0.7rem;
    margin-bottom: 0.9rem;
  }

  .hero-content .subtitle {
    font-size: 1.02rem;
  }

  .hero-content .hero-support {
    font-size: 0.9rem;
  }

  .hero-highlights {
    width: 100%;
    margin-top: 1.75rem;
  }

  .hero-latest-link {
    width: 100%;
  }

  .hero-tool-link {
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    padding: 0.95rem;
    border-radius: 18px;
  }

  .hero-tool-copy {
    width: 100%;
  }

  .hero-tool-title,
  .hero-tool-description {
    text-align: left;
  }

  .hero-tool-cta {
    width: 100%;
  }

  .hero-latest-title {
    max-width: 220px;
    font-size: 0.8rem;
  }
  .hero-latest-badge {
    font-size: 0.64rem;
    padding: 0.24rem 0.56rem;
    margin-right: 0.45rem;
  }
}
