/* PhotoAgent — OpenArt-inspired project page */

:root {
  --bg: #0d0d12;
  --bg-alt: #13131a;
  --surface: #1a1a24;
  --text: #f0f0f5;
  --text-muted: #9898a8;
  --accent: #6366f1;
  --accent-light: #818cf8;
  --gradient-start: #6366f1;
  --gradient-end: #a855f7;
  --border: rgba(255, 255, 255, 0.08);
  --radius: 12px;
  --radius-lg: 20px;
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Space Grotesk", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden; /* Prevent any horizontal overflow from sections */
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 18, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 8px 18px rgba(0, 0, 0, 0.6);
}

.logo-text {
  display: inline-block;
}

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}

.nav-links a:hover {
  color: var(--text);
}

/* Related works dropdown */
.nav-related {
  position: relative;
}

.nav-related-trigger {
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  transition: color 0.2s;
}

.nav-related-trigger:hover {
  color: var(--text);
}

.nav-related-trigger::after {
  content: "";
  margin-left: 4px;
  border: 4px solid transparent;
  border-top-color: currentColor;
  border-bottom: 0;
}

.nav-related:hover .nav-related-trigger,
.nav-related-trigger[aria-expanded="true"] {
  color: var(--text);
}

.nav-related-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 8px;
  min-width: 220px;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: opacity 0.2s, visibility 0.2s, transform 0.2s;
  z-index: 200;
}

.nav-related:hover .nav-related-dropdown,
.nav-related-dropdown[data-open] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-related-dropdown li {
  margin: 0;
}

.nav-related-dropdown a {
  display: block;
  padding: 10px 16px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: background 0.15s, color 0.15s;
}

.nav-related-dropdown a:hover {
  color: var(--text);
  background: rgba(99, 102, 241, 0.1);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
}

.btn-primary:hover {
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--accent);
  color: var(--accent-light);
}

.btn-lg {
  padding: 14px 28px;
  font-size: 1rem;
}

.btn-coming {
  cursor: default;
  pointer-events: none;
  opacity: 0.55;
}

/* Hero */
.hero {
  padding: 80px 0 100px;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: "";
  position: absolute;
  top: -50%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 100%;
  background: radial-gradient(ellipse 80% 50% at 50% 0%, rgba(99, 102, 241, 0.12), transparent 60%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  text-align: center;
}

.hero-badge {
  display: inline-block;
  padding: 6px 14px;
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  margin-bottom: 24px;
}

.hero-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 12px;
}

.hero-icon {
  width: clamp(64px, 10vw, 96px);
  height: clamp(64px, 10vw, 96px);
  border-radius: 22px;
  object-fit: cover;
  box-shadow:
    0 0 0 2px rgba(99, 102, 241, 0.25),
    0 12px 32px rgba(0, 0, 0, 0.5),
    0 0 40px rgba(99, 102, 241, 0.12);
  flex-shrink: 0;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0;
  max-width: 800px;
}

.hero-tagline {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.5vw, 2.75rem);
  font-weight: 500;
  color: #c8c8d8;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-tagline strong {
  color: var(--text);
  font-weight: 700;
}

.gradient-text {
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-authors {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 auto 8px;
  font-weight: 500;
}

.hero-authors a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid var(--text-muted);
  transition: border-color 0.2s, color 0.2s;
}

.hero-authors a:hover {
  color: var(--accent-light);
  border-bottom-color: var(--accent-light);
}

.hero-affiliations {
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 720px;
  margin: 0 auto 28px;
  line-height: 1.5;
}

.hero-subtitle {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 640px;
  margin: 0 auto 36px;
  line-height: 1.65;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
  margin-bottom: 56px;
}

.hero-visual {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow:
    0 24px 48px rgba(0, 0, 0, 0.5),
    0 0 80px rgba(99, 102, 241, 0.08);
}

.hero-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  box-shadow: inset 0 0 60px rgba(0, 0, 0, 0.25);
}

.hero-img {
  width: 100%;
  height: auto;
  display: block;
  vertical-align: middle;
}

/* Sections */
.section {
  padding: 100px 0;
}

.section-alt {
  background: var(--bg-alt);
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  text-align: center;
}

.section-lead {
  font-size: 1.1rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto 56px;
  text-align: center;
  line-height: 1.65;
}

/* Features grid */
.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.feature-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.2s, transform 0.2s;
}

.feature-card:hover {
  border-color: rgba(99, 102, 241, 0.3);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.feature-card p {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* Paradigm Shift showcase */
.paradigm-section {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 120px 0 100px;
}

.paradigm-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 40% at 20% 30%, rgba(99, 102, 241, 0.08), transparent 60%),
    radial-gradient(ellipse 50% 50% at 80% 60%, rgba(168, 85, 247, 0.07), transparent 60%);
  animation: paradigmPulse 8s ease-in-out infinite alternate;
}

@keyframes paradigmPulse {
  0%   { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1;   transform: scale(1.05); }
}

.paradigm-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 100px;
  margin: 0 auto 24px;
  text-align: center;
}

.paradigm-section .container {
  position: relative;
  text-align: center;
}

.paradigm-title {
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.2;
  margin-bottom: 20px;
}

.paradigm-lead {
  max-width: 740px;
  font-size: 1.05rem;
  margin-bottom: 48px;
}

.paradigm-showcase {
  position: relative;
  margin: 0 auto 56px;
  max-width: 960px;
}

.paradigm-img-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid rgba(99, 102, 241, 0.25);
  box-shadow:
    0 0 40px rgba(99, 102, 241, 0.1),
    0 0 80px rgba(168, 85, 247, 0.06),
    0 32px 64px rgba(0, 0, 0, 0.5);
  animation: paradigmFloat 6s ease-in-out infinite;
}

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

.paradigm-img-wrap::before {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: calc(var(--radius-lg) + 2px);
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end), transparent, var(--gradient-start));
  background-size: 300% 300%;
  animation: paradigmBorder 6s linear infinite;
  z-index: -1;
  opacity: 0.5;
}

@keyframes paradigmBorder {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.paradigm-img-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: var(--radius-lg);
  box-shadow: inset 0 0 50px rgba(0, 0, 0, 0.15);
}

.paradigm-img {
  width: 100%;
  height: auto;
  display: block;
}

.paradigm-cols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  text-align: left;
  max-width: 860px;
  margin: 0 auto;
}

.paradigm-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.paradigm-col:hover {
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.paradigm-col--pain {
  border-top: 3px solid rgba(239, 68, 68, 0.5);
}

.paradigm-col--agent {
  border-top: 3px solid rgba(99, 102, 241, 0.6);
}

.paradigm-col-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 16px;
}

.paradigm-col-title--pain {
  color: #f87171;
}

.paradigm-col-title--agent {
  color: var(--accent-light);
}

.paradigm-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.paradigm-list li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 14px;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.6;
}

.paradigm-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.paradigm-col--pain .paradigm-list li::before {
  background: rgba(239, 68, 68, 0.5);
}

.paradigm-col--agent .paradigm-list li::before {
  background: var(--accent);
}

.paradigm-list li strong {
  color: var(--text);
}

@media (max-width: 768px) {
  .paradigm-cols {
    grid-template-columns: 1fr;
  }

  .paradigm-section {
    padding: 80px 0 64px;
  }
}

/* How it works section */
.how-section {
  position: relative;
  overflow: hidden;
  background: var(--bg);
  padding: 120px 0 100px;
}

.how-bg-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 50% 50% at 25% 40%, rgba(99, 102, 241, 0.07), transparent 60%),
    radial-gradient(ellipse 45% 45% at 75% 55%, rgba(168, 85, 247, 0.06), transparent 60%);
  animation: paradigmPulse 8s ease-in-out infinite alternate;
}

.how-section .container {
  position: relative;
  text-align: center;
}

.how-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.12);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 100px;
  margin-bottom: 24px;
}

.how-title {
  margin-bottom: 16px;
}

.how-lead {
  max-width: 720px;
  margin-bottom: 60px;
}

.how-steps {
  display: flex;
  align-items: stretch;
  justify-content: center;
  gap: 0;
  margin-bottom: 36px;
}

.how-card {
  flex: 1 1 0;
  max-width: 270px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 22px 28px;
  text-align: center;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.how-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

.how-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-6px);
  box-shadow: 0 20px 50px rgba(99, 102, 241, 0.12), 0 8px 24px rgba(0, 0, 0, 0.4);
}

.how-card:hover::before {
  opacity: 1;
}

/* Sequential glow animation across cards */
@keyframes howCardPulse {
  0%, 18%, 100% {
    border-color: var(--border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
  6%, 12% {
    border-color: rgba(99, 102, 241, 0.45);
    box-shadow: 0 0 28px rgba(99, 102, 241, 0.1), 0 8px 32px rgba(0, 0, 0, 0.25);
  }
}

.how-steps article:nth-of-type(1) { animation: howCardPulse 8s ease-in-out infinite 0s; }
.how-steps article:nth-of-type(2) { animation: howCardPulse 8s ease-in-out infinite 2s; }
.how-steps article:nth-of-type(3) { animation: howCardPulse 8s ease-in-out infinite 4s; }
.how-steps article:nth-of-type(4) { animation: howCardPulse 8s ease-in-out infinite 6s; }

.how-card:hover {
  animation: none;
}

.how-card-head {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 20px;
}

.how-card-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  color: white;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  border-radius: 10px;
  flex-shrink: 0;
}

.how-card-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border-radius: 12px;
  color: var(--accent-light);
  transition: transform 0.3s, background 0.3s;
}

.how-card:hover .how-card-icon {
  transform: scale(1.12);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
}

.how-card-icon svg {
  width: 22px;
  height: 22px;
}

.how-card-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  margin: 0 0 10px;
}

.how-card-desc {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.how-card-tag {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
}

/* Arrows between cards */
.how-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  color: var(--accent);
  opacity: 0.5;
  animation: howArrowPulse 3s ease-in-out infinite;
}

@keyframes howArrowPulse {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.75; }
}

.how-arrow svg {
  width: 22px;
  height: 22px;
}

/* Loop-back indicator */
.how-loop-back {
  max-width: 920px;
  margin: 0 auto;
  padding-top: 4px;
}

.how-loop-line {
  height: 2px;
  background: linear-gradient(90deg, transparent 5%, rgba(99, 102, 241, 0.3) 30%, rgba(168, 85, 247, 0.3) 70%, transparent 95%);
  border-radius: 1px;
  position: relative;
  overflow: hidden;
}

.how-loop-line::before {
  content: "";
  position: absolute;
  top: -3px;
  left: -12px;
  width: 12px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-light);
  box-shadow: 0 0 14px rgba(129, 140, 248, 0.6);
  animation: howFlowDot 4s ease-in-out infinite;
}

@keyframes howFlowDot {
  0%   { left: -12px; opacity: 0; }
  8%   { opacity: 1; }
  92%  { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}

.how-loop-label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding: 10px 28px;
  background: rgba(99, 102, 241, 0.06);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  color: var(--text-muted);
  font-size: 0.88rem;
  font-weight: 500;
}

.how-loop-label svg {
  width: 18px;
  height: 18px;
  color: var(--accent-light);
  flex-shrink: 0;
}

/* How section responsive */
@media (max-width: 960px) {
  .how-steps {
    flex-wrap: wrap;
    gap: 20px;
  }

  .how-card {
    flex: 1 1 calc(50% - 20px);
    max-width: none;
  }

  .how-arrow {
    display: none;
  }

  .how-section {
    padding: 80px 0 64px;
  }
}

@media (max-width: 560px) {
  .how-card {
    flex: 1 1 100%;
  }
}

/* Action Memory & History */
.how-memory {
  display: flex;
  align-items: stretch;
  gap: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-top: 64px;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.how-memory:hover {
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 40px rgba(99, 102, 241, 0.08), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.how-memory-visual {
  flex: 0 0 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 36px 24px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(168, 85, 247, 0.06));
  border-right: 1px solid var(--border);
}

.how-memory-icon-main {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border-radius: 18px;
  color: white;
  box-shadow: 0 8px 24px rgba(99, 102, 241, 0.3);
}

.how-memory-icon-main svg {
  width: 30px;
  height: 30px;
}

.how-memory-trace {
  display: flex;
  align-items: center;
  gap: 4px;
}

.how-memory-node {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}

.how-memory-node--done {
  background: var(--accent);
  opacity: 0.5;
}

.how-memory-node--skip {
  background: transparent;
  border: 2px dashed rgba(239, 68, 68, 0.5);
  width: 12px;
  height: 12px;
  position: relative;
}

.how-memory-node--skip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: -1px;
  right: -1px;
  height: 2px;
  background: rgba(239, 68, 68, 0.6);
  transform: rotate(-45deg);
}

.how-memory-node--active {
  background: var(--accent-light);
  box-shadow: 0 0 10px rgba(129, 140, 248, 0.6);
  animation: memoryNodePulse 2s ease-in-out infinite;
}

@keyframes memoryNodePulse {
  0%, 100% { box-shadow: 0 0 6px rgba(129, 140, 248, 0.4); }
  50% { box-shadow: 0 0 16px rgba(129, 140, 248, 0.8); }
}

.how-memory-edge {
  width: 16px;
  height: 2px;
  background: rgba(255, 255, 255, 0.15);
  flex-shrink: 0;
}

.how-memory-body {
  flex: 1;
  padding: 36px 40px;
  min-width: 0;
}

.how-memory-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.how-memory-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0 0 24px;
  max-width: 600px;
}

.how-memory-desc strong {
  color: var(--text);
}

.how-memory-feats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.how-memory-feat {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 16px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.15);
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.how-memory-feat svg {
  width: 14px;
  height: 14px;
  color: var(--accent-light);
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .how-memory {
    flex-direction: column;
  }

  .how-memory-visual {
    flex: none;
    flex-direction: row;
    padding: 24px;
    border-right: none;
    border-bottom: 1px solid var(--border);
  }

  .how-memory-body {
    padding: 28px 24px;
  }
}

/* Scene-Aware Classification */
.how-scenes {
  margin-top: 64px;
  text-align: center;
}

.how-scenes-header {
  margin-bottom: 40px;
}

.how-scenes-badge {
  display: inline-block;
  padding: 5px 14px;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #a855f7;
  background: rgba(168, 85, 247, 0.1);
  border: 1px solid rgba(168, 85, 247, 0.2);
  border-radius: 100px;
  margin-bottom: 18px;
}

.how-scenes-title {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 16px;
  line-height: 1.3;
}

.how-scenes-desc {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.how-scenes-desc strong {
  color: var(--text);
}

.how-scenes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 32px;
}

.how-scene-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 22px 24px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.how-scene-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

.how-scene-card:hover {
  border-color: rgba(168, 85, 247, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(168, 85, 247, 0.1), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.how-scene-card:hover::before {
  opacity: 1;
}

.how-scene-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.12), rgba(99, 102, 241, 0.12));
  border-radius: 14px;
  color: #a855f7;
  transition: transform 0.3s, background 0.3s;
}

.how-scene-card:hover .how-scene-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.22), rgba(99, 102, 241, 0.22));
}

.how-scene-icon svg {
  width: 24px;
  height: 24px;
}

.how-scene-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.how-scene-desc {
  margin: 0;
  font-size: 0.86rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.how-scenes-footnote {
  text-align: center;
  font-size: 0.92rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.65;
  padding: 18px 24px;
  background: rgba(168, 85, 247, 0.05);
  border: 1px solid rgba(168, 85, 247, 0.12);
  border-radius: var(--radius);
}

.how-scenes-footnote strong {
  color: var(--text);
}

@media (max-width: 900px) {
  .how-scenes-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .how-scenes-grid {
    grid-template-columns: 1fr;
  }
}

/* Interactive: Editing process over iterations */
.iter-demo {
  margin: 0 auto 48px;
  max-width: 800px;
}

.iter-demo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
}

.iter-demo-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
  text-align: center;
}

.iter-viewer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  overflow: hidden;
}

.iter-main {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  aspect-ratio: 16/9;
  margin-bottom: 20px;
}

.iter-slides {
  position: relative;
  width: 100%;
  height: 100%;
}

.iter-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s;
}

.iter-slide.active {
  opacity: 1;
  visibility: visible;
  z-index: 1;
}

.iter-slide img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.iter-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  margin: 0;
  padding: 12px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.75));
  color: #fff;
  font-size: 0.9rem;
  font-weight: 500;
}

.iter-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
}

.iter-btn {
  padding: 10px 20px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.iter-btn:hover {
  border-color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
}

.iter-dots {
  display: flex;
  gap: 10px;
}

.iter-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.iter-dot:hover {
  border-color: var(--accent-light);
}

.iter-dot.active {
  background: var(--accent);
  border-color: var(--accent);
  transform: scale(1.2);
}

.iter-autoplay {
  margin-top: 16px;
  text-align: center;
}

.iter-autoplay-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.iter-autoplay-checkbox {
  margin-right: 8px;
  accent-color: var(--accent);
}

/* Before / After slider */
.compare-demo {
  display: block;
  max-width: 800px;
  margin: 0 auto 48px auto;
  text-align: center;
}

.compare-demo-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
}

.compare-demo-desc {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0 0 20px;
  text-align: center;
}

.compare-slider-wrap {
  position: relative;
  display: block;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  aspect-ratio: 4/3;
  max-height: 520px;
  margin: 0 auto;
  cursor: ew-resize;
  text-align: left;
}

.compare-after,
.compare-before {
  position: absolute;
  inset: 0;
}

.compare-after img,
.compare-before img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.compare-before {
  clip-path: inset(0 50% 0 0);
}

.compare-slider-wrap .compare-before {
  z-index: 2;
}

.compare-slider {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: ew-resize;
  z-index: 10;
  -webkit-appearance: none;
  appearance: none;
}

.compare-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 1px;
  height: 1px;
  cursor: ew-resize;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 3px;
  margin-left: -1.5px;
  background: white;
  z-index: 8;
  pointer-events: none;
  box-shadow: 0 0 8px rgba(0, 0, 0, 0.5);
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
  border: 3px solid white;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.5), 0 0 20px rgba(99, 102, 241, 0.3);
  pointer-events: none;
}

.compare-label {
  position: absolute;
  top: 12px;
  padding: 5px 12px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  z-index: 5;
  pointer-events: none;
  transition: opacity 0.2s;
}

.compare-label-before { left: 12px; }
.compare-label-after { right: 12px; }

/* Thumbnail strip */
.compare-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.compare-thumb {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  flex-shrink: 0;
}

.compare-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.compare-thumb:hover {
  border-color: var(--accent-light);
  transform: translateY(-2px);
}

.compare-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.3), 0 4px 12px rgba(99, 102, 241, 0.2);
  transform: translateY(-2px);
}

/* Aesthetic-driven editing intro */
.aesthetic-intro {
  margin-bottom: 64px;
}

.aesthetic-intro-header {
  text-align: center;
  margin-bottom: 48px;
}

.aesthetic-intro-badge {
  display: inline-block;
  padding: 6px 16px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent-light);
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: 100px;
  margin-bottom: 20px;
}

.aesthetic-intro-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 20px;
  line-height: 1.25;
}

.aesthetic-intro-desc {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 700px;
  margin: 0 auto;
  line-height: 1.7;
}

.aesthetic-intro-desc strong {
  color: var(--text);
}

/* Operation cards grid */
.aesthetic-ops-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 40px;
}

.aesthetic-op-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  text-align: center;
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
}

.aesthetic-op-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gradient-start), var(--gradient-end));
  opacity: 0;
  transition: opacity 0.3s;
}

.aesthetic-op-card:hover {
  border-color: rgba(99, 102, 241, 0.4);
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.1), 0 4px 16px rgba(0, 0, 0, 0.3);
}

.aesthetic-op-card:hover::before {
  opacity: 1;
}

.aesthetic-op-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.15), rgba(168, 85, 247, 0.15));
  border-radius: 12px;
  color: var(--accent-light);
  transition: transform 0.3s, background 0.3s;
}

.aesthetic-op-card:hover .aesthetic-op-icon {
  transform: scale(1.1);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.25), rgba(168, 85, 247, 0.25));
}

.aesthetic-op-icon svg {
  width: 22px;
  height: 22px;
}

.aesthetic-op-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--text);
}

.aesthetic-op-desc {
  margin: 0;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.aesthetic-intro-footnote {
  text-align: center;
  font-size: 0.95rem;
  color: var(--text-muted);
  max-width: 680px;
  margin: 0 auto;
  line-height: 1.65;
  padding: 20px 24px;
  background: rgba(99, 102, 241, 0.05);
  border: 1px solid rgba(99, 102, 241, 0.12);
  border-radius: var(--radius);
}

.aesthetic-intro-footnote strong {
  color: var(--text);
}

.aesthetic-intro-footnote em {
  color: var(--accent-light);
  font-style: italic;
}

@media (max-width: 900px) {
  .aesthetic-ops-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .aesthetic-ops-grid {
    grid-template-columns: 1fr;
  }
}

/* Results */
.results-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
}

.metric-value {
  display: block;
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--accent-light);
  margin-bottom: 6px;
}

.metric-label {
  font-size: 0.9rem;
  color: var(--text-muted);
}

.results-iter {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.results-img-sm {
  width: 100%;
  height: auto;
  display: block;
}

/* Results: Input / Output gallery */
.results-io-gallery {
  margin-top: 56px;
}

.results-io-gallery--hero {
  margin-top: 0;
  margin-bottom: 48px;
}

.results-io-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 8px;
  text-align: center;
}

.results-io-desc {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: var(--text-muted);
  text-align: center;
}

/* Results IO grid — 3 columns on desktop */
.results-io-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 100%;
}

.results-io-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 14px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  transition: border-color 0.25s, transform 0.25s, box-shadow 0.25s;
  margin: 0;
}

.results-io-card:hover {
  border-color: rgba(99, 102, 241, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(99, 102, 241, 0.12), 0 6px 20px rgba(0, 0, 0, 0.5);
}

.results-io-half {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.results-io-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.results-io-label--out {
  color: var(--accent-light);
}

.results-io-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  margin: 0 8px;
  font-size: 0.95rem;
  color: var(--accent);
  background: rgba(99, 102, 241, 0.1);
  border-radius: 50%;
  flex-shrink: 0;
}

.results-io-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: #000;
  object-fit: contain;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.results-io-img:hover {
  border-color: rgba(99, 102, 241, 0.7);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.6);
}

@media (max-width: 900px) {
  .results-io-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .results-io-grid {
    grid-template-columns: 1fr;
  }
}

/* Lightbox for IO images */
.io-lightbox-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.io-lightbox {
  width: min(1000px, 90vw);
  max-width: 100%;
  max-height: 90vh;
  padding: 20px;
  background: rgba(15, 15, 23, 0.95);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.8);
}

.io-lightbox-main {
  display: flex;
  align-items: center;
  justify-content: center;
}

.io-lightbox-main img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 10px;
  background: #000;
}

.io-lightbox-label {
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.io-lightbox-footer {
  margin-top: 12px;
  font-size: 0.9rem;
  color: var(--text-muted);
  text-align: right;
}

.io-lightbox-footer span {
  opacity: 0.8;
}


@media (max-width: 768px) {
  .io-lightbox {
    padding: 14px;
  }

  .io-lightbox-main {
    grid-template-columns: 1fr;
  }
}

/* Dataset */
.dataset-fig {
  margin-bottom: 32px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
}

.dataset-fig img {
  width: 100%;
  height: auto;
  display: block;
}

.dataset-fig-caption {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  padding: 14px 24px 16px;
  line-height: 1.55;
  margin: 0;
  border-top: 1px solid var(--border);
}

.dataset-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 8px;
}

.dataset-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  transition: border-color 0.25s, transform 0.25s;
}

.dataset-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

.dataset-card-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--text);
}

.dataset-card-text {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}

@media (max-width: 768px) {
  .dataset-cards {
    grid-template-columns: 1fr;
  }
}

/* Paper & CTA */
.section-cta {
  padding-bottom: 120px;
}

.paper-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  max-width: 680px;
  margin: 0 auto 24px;
}

.paper-card h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 600;
  margin: 0 0 12px;
  line-height: 1.4;
}

.paper-authors {
  color: var(--text-muted);
  font-size: 1rem;
  margin: 0 0 6px;
}

.paper-authors a {
  color: var(--accent-light);
  text-decoration: none;
}

.paper-authors a:hover {
  text-decoration: underline;
}

.paper-affiliations {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0 0 24px;
}

.paper-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cta-text {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cta-text a {
  color: var(--accent-light);
  text-decoration: none;
}

.cta-text a:hover {
  text-decoration: underline;
}

/* Footer */
.footer {
  padding: 40px 0;
  border-top: 1px solid var(--border);
  text-align: center;
}

.footer p {
  margin: 0 0 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-muted {
  opacity: 0.7;
}

/* Screen-reader only: hidden visually, accessible to crawlers & assistive tech */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Responsive */
@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .hero {
    padding: 56px 0 64px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .section {
    padding: 64px 0;
  }

  .how-arrow {
    display: none;
  }

}
