/* ========== InfiniteWeb Project Page Custom Styles ========== */

:root {
  --primary: #C2410C;
  --primary-dark: #9A3412;
  --primary-glow: rgba(194, 65, 12, 0.35);
  --accent: #F59E0B;
  --accent-glow: rgba(245, 158, 11, 0.3);
  --dark-bg: #111827;
  --dark-bg-light: #1F2937;
  --dark-bg-deep: #030712;
}

/* ---- Global ---- */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 60px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
}

.content-narrow {
  max-width: 960px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  margin-bottom: 1.5rem;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--primary));
  margin: 0.75rem auto 0;
  border-radius: 2px;
}

/* ---- Scroll Reveal ---- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  will-change: opacity, transform;
}

.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---- Navbar ---- */
.navbar {
  background: rgba(3, 7, 18, 0.75);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.navbar-item {
  color: rgba(233, 236, 255, 0.7);
  transition: color 0.15s ease;
}

.navbar-item:hover {
  color: #fff;
  background: transparent;
}

.navbar-link {
  color: rgba(233, 236, 255, 0.8) !important;
  font-size: 0.9rem;
}

.navbar-link:hover {
  color: #fff !important;
  background: transparent !important;
}

.navbar-link::after {
  border-color: rgba(233, 236, 255, 0.5) !important;
}

.navbar-dropdown {
  background: rgba(3, 7, 18, 0.95) !important;
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  border-radius: 8px !important;
  border-top: none !important;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

.navbar-dropdown .navbar-item {
  color: rgba(233, 236, 255, 0.7);
  font-size: 0.9rem;
}

.navbar-dropdown .navbar-item:hover {
  background: rgba(255, 255, 255, 0.06) !important;
  color: #fff;
}

.navbar-dropdown .navbar-divider {
  background-color: rgba(255, 255, 255, 0.08);
}

.nav-btn {
  background: transparent !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
  color: rgba(233, 236, 255, 0.85) !important;
  font-size: 0.8rem !important;
  font-weight: 500 !important;
  transition: all 0.2s ease;
}

.nav-btn:hover {
  border-color: var(--primary) !important;
  color: #fff !important;
  box-shadow: 0 0 10px rgba(194, 65, 12, 0.15);
}

.nav-btn.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.navbar-title {
  font-weight: 700;
  color: #fff;
  margin-left: 0.5rem;
  font-size: 1.1rem;
}

.navbar-burger span {
  background-color: #fff;
}

/* ---- Hero ---- */
.hero-dark {
  background: linear-gradient(180deg, var(--dark-bg-deep), var(--dark-bg));
  position: relative;
  overflow: hidden;
}

.hero-dark::before {
  content: "";
  position: absolute;
  inset: -40%;
  background:
    radial-gradient(closest-side at 30% 30%, rgba(194,65,12,0.55), transparent 60%),
    radial-gradient(closest-side at 70% 40%, rgba(245,158,11,0.45), transparent 60%),
    radial-gradient(closest-side at 55% 70%, rgba(194,65,12,0.35), transparent 62%);
  filter: blur(18px);
  animation: aurora 10s ease-in-out infinite alternate;
  z-index: 0;
  pointer-events: none;
}

@keyframes aurora {
  from { transform: translate3d(-2%, -1%, 0) scale(1.02); }
  to   { transform: translate3d(2%, 1%, 0) scale(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-dark::before {
    animation: none;
  }
}

.hero-dark::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(900px 520px at 50% 30%, transparent, rgba(0, 0, 0, 0.4));
  pointer-events: none;
}

.hero-dark .hero-body {
  position: relative;
  z-index: 1;
}

.hero-dark .hero-body * {
  position: relative;
  z-index: 1;
}

.hero-logo-wrap {
  margin-bottom: 1.5rem;
}

.hero-logo {
  width: 120px;
  height: 120px;
  border-radius: 20px;
  box-shadow: 0 0 40px var(--primary-glow), 0 0 80px rgba(194, 65, 12, 0.15);
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(135deg, #fff 0%, rgba(194, 65, 12, 0.9) 50%, rgba(245, 158, 11, 0.9) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.75);
  font-weight: 400;
  margin-bottom: 1.5rem;
}

.hero-authors {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.hero-authors sup {
  color: var(--primary);
}

.hero-affiliations {
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

.hero-affiliations sup {
  color: var(--primary);
}

.hero-note {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 0.25rem;
  display: inline-block;
}

.hero-buttons {
  margin-bottom: 2rem;
}

.hero-buttons .button.is-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 10px 20px rgba(194, 65, 12, 0.22);
  border-radius: 999px;
}

.hero-buttons .button.is-primary:hover {
  box-shadow: 0 14px 30px rgba(194, 65, 12, 0.35);
  transform: translateY(-2px);
}

.hero-buttons .button.is-primary.is-outlined {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(194, 65, 12, 0.4);
  box-shadow: none;
  border-radius: 999px;
}

.hero-buttons .button.is-primary.is-outlined:hover {
  background: rgba(194, 65, 12, 0.1);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 15px rgba(194, 65, 12, 0.2);
}

.hero-buttons .button.is-disabled,
.hero-buttons a[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
  pointer-events: none;
}

/* ---- Explore Websites Button (Google-style) ---- */
.explore-btn {
  background: rgba(255, 255, 255, 0.12) !important;
  border: 2px solid rgba(255, 255, 255, 0.35) !important;
  border-radius: 999px !important;
  font-weight: 600 !important;
  font-family: 'Product Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 1.05rem !important;
  letter-spacing: 0.02em;
  transition: all 0.3s ease !important;
  box-shadow: 0 4px 20px rgba(66, 133, 244, 0.15), 0 4px 20px rgba(234, 67, 53, 0.1) !important;
  backdrop-filter: blur(8px);
}

.explore-btn:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: rgba(255, 255, 255, 0.6) !important;
  box-shadow: 0 8px 30px rgba(66, 133, 244, 0.25), 0 8px 30px rgba(234, 67, 53, 0.15) !important;
  transform: translateY(-2px);
}

.explore-btn .icon {
  color: #4285f4 !important;
}

.explore-text {
  font-size: 1.05rem;
}

.g-e  { color: #4285f4; }
.g-x  { color: #ea4335; }
.g-p  { color: #fbbc05; }
.g-l  { color: #4285f4; }
.g-o  { color: #34a853; }
.g-r  { color: #ea4335; }
.g-e2 { color: #4285f4; }
.g-w  { color: #fbbc05; }
.g-e3 { color: #34a853; }
.g-b  { color: #ea4335; }
.g-s  { color: #4285f4; }
.g-i  { color: #fbbc05; }
.g-t  { color: #34a853; }
.g-e4 { color: #ea4335; }
.g-s2 { color: #4285f4; }

.hero-tagline {
  color: rgba(255, 255, 255, 0.5);
  font-size: 1rem;
  max-width: 600px;
  margin: 0 auto;
}

/* ---- Section Transitions ---- */
.section-fade-out {
  position: relative;
}

.section-fade-out::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 80px;
  pointer-events: none;
}

.section-fade-to-light::after {
  background: linear-gradient(180deg, transparent, #fff);
}

.section-fade-to-dark::after {
  background: linear-gradient(180deg, transparent, var(--dark-bg));
}

/* ---- Teaser ---- */
.teaser-image {
  max-width: 1000px;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.12);
}

.teaser-image img {
  width: 100%;
  display: block;
}

/* ---- Feature Cards ---- */
.feature-cards {
  margin-top: 2rem;
}

.feature-card {
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 18px;
  background: #FFFFFF;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
  transition: all 0.25s ease;
  height: 100%;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(600px 200px at 30% 0%, rgba(194, 65, 12, 0.06), transparent 55%),
              radial-gradient(600px 200px at 70% 10%, rgba(245, 158, 11, 0.04), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
}

.feature-card:hover {
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16), 0 6px 14px rgba(17, 24, 39, 0.08);
  border-color: rgba(194, 65, 12, 0.30);
  transform: translateY(-4px);
}

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

.feature-card .icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(194, 65, 12, 0.1), rgba(245, 158, 11, 0.08));
  border: 1px solid rgba(194, 65, 12, 0.15);
  color: var(--primary) !important;
}

.feature-card h4 {
  font-weight: 700;
  margin: 0.75rem 0 0.5rem;
  font-size: 1rem;
}

.feature-card p {
  color: #666;
  font-size: 0.9rem;
}

/* ---- Search Gallery (Dark Section) ---- */
.section-dark {
  background:
    radial-gradient(800px 400px at 50% 30%, rgba(245, 158, 11, 0.08), transparent 60%),
    linear-gradient(180deg, var(--dark-bg), #0C111B);
  padding-bottom: 4rem;
}

.section-dark .section-title::after {
  background: linear-gradient(90deg, var(--accent), var(--primary));
}

.search-container {
  max-width: 700px;
  margin: 0 auto 2.5rem;
}

.search-bar-wrap {
  justify-content: center;
}

.search-input {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  border-radius: 999px 0 0 999px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.search-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 15px rgba(194, 65, 12, 0.15);
}

.search-bar-wrap .button.is-primary {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border: none;
  font-weight: 600;
  border-radius: 0 999px 999px 0;
  box-shadow: 0 10px 20px rgba(194, 65, 12, 0.22);
}

.search-bar-wrap .icon.is-left {
  color: rgba(255, 255, 255, 0.35);
}

/* ---- Website Cards ---- */
.website-card {
  background: #FFFFFF;
  border: 1px solid rgba(17, 24, 39, 0.08);
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  cursor: pointer;
  height: 100%;
  display: flex;
  flex-direction: column;
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
  text-decoration: none;
  color: inherit;
}

.website-card:hover {
  border-color: rgba(194, 65, 12, 0.30);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16), 0 6px 14px rgba(17, 24, 39, 0.08);
  transform: translateY(-4px);
}

.website-card-thumb-wrap {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
}

.website-card-thumb {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: rgba(0, 0, 0, 0.2);
}

/* Gradient placeholder for missing thumbnails */
.website-card.is-fallback .website-card-thumb {
  display: none;
}

.website-card.is-fallback .website-card-thumb-wrap {
  background:
    radial-gradient(500px 260px at var(--px, 30%) var(--py, 30%), rgba(245, 158, 11, 0.35), transparent 60%),
    radial-gradient(520px 260px at calc(var(--px, 30%) + 40%) calc(var(--py, 30%) + 10%), rgba(194, 65, 12, 0.2), transparent 62%),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0 1px, transparent 1px 28px),
    linear-gradient(135deg, rgba(31,41,55,0.9), rgba(17,24,39,0.9));
}

.website-card.is-fallback .website-card-thumb-wrap::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, rgba(194, 65, 12, 0.08), transparent 70%);
  pointer-events: none;
}

.website-card-body {
  padding: 1rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.website-card-title {
  font-weight: 700;
  color: #111827;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}

.website-card-desc {
  color: #6B7280;
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
  flex: 1;
}

.website-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.website-card-tags .tag {
  font-size: 0.7rem;
  background: rgba(194, 65, 12, 0.12);
  color: var(--primary);
  border: none;
  border-radius: 6px;
}

.website-card-meta {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(17, 24, 39, 0.08);
}

.website-card-meta span {
  color: #9CA3AF;
  font-size: 0.75rem;
}

/* ---- Preview Modal ---- */
.modal-preview-content {
  width: 90%;
  max-width: 1100px;
  max-height: 90vh;
}

.modal-preview-box {
  padding: 1.5rem;
}

.modal-preview-iframe-wrap {
  border: 1px solid #ddd;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.modal-preview-iframe {
  width: 100%;
  height: 500px;
  border: none;
}

/* ---- Comparison Table ---- */
.comparison-table th,
.comparison-table td {
  vertical-align: middle;
  text-align: center;
}

.comparison-table th:first-child,
.comparison-table td:first-child {
  text-align: left;
}

.highlight-col {
  background: rgba(194, 65, 12, 0.06) !important;
}

/* ---- Pipeline ---- */
.pipeline-image {
  max-width: 800px;
  margin: 0 auto 3rem;
}

.pipeline-image img {
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.2s;
}

.pipeline-image img:hover {
  transform: scale(1.02);
}

.pipeline-step {
  padding: 1.5rem;
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
  height: 100%;
  position: relative;
  padding-left: 4rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pipeline-step:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16), 0 6px 14px rgba(17, 24, 39, 0.08);
}

.step-number {
  position: absolute;
  left: 1rem;
  top: 1.5rem;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.1rem;
  box-shadow: 0 4px 12px rgba(194, 65, 12, 0.2);
}

.section-light {
  background: linear-gradient(180deg, #FFFFFF, #F9FAFB);
}

#osworld.section-light {
  background: linear-gradient(180deg, #F9FAFB, #FFFFFF);
}

/* ---- Artifact Code ---- */
.artifact-code {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: 8px;
  padding: 1.25rem;
  font-size: 0.85rem;
  line-height: 1.6;
  overflow-x: auto;
}

/* ---- OSWorld Steps ---- */
.steps-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 8px 20px rgba(17, 24, 39, 0.10), 0 2px 4px rgba(17, 24, 39, 0.05);
  transition: transform 0.2s ease;
}

.step-item:hover {
  transform: translateX(4px);
}

.step-marker {
  width: 32px;
  height: 32px;
  min-width: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(194, 65, 12, 0.2);
}

.step-content {
  padding-top: 4px;
}

/* ---- Results ---- */
.results-table th,
.results-table td {
  vertical-align: middle;
  text-align: center;
}

.results-table th:first-child,
.results-table td:first-child {
  text-align: left;
}

.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #FFFFFF;
  border-radius: 18px;
  border: 1px solid rgba(17, 24, 39, 0.08);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.12), 0 2px 6px rgba(17, 24, 39, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 44px rgba(17, 24, 39, 0.16), 0 6px 14px rgba(17, 24, 39, 0.08);
}

.stat-number {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-weight: 600;
  margin-top: 0.25rem;
  margin-bottom: 0.25rem;
  font-size: 0.9rem;
}

/* ---- Getting Started ---- */
#start pre {
  background: #1a1a2e;
  color: #e0e0e0;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
}

#start code {
  color: #e0e0e0;
  background: transparent;
}

/* ---- Citation ---- */
.bibtex-code {
  background: #f5f5f5;
  border-radius: 8px;
  padding: 1rem;
  overflow-x: auto;
  font-size: 0.85rem;
  position: relative;
}

.bibtex-code code {
  color: #333;
  background: transparent;
}

/* ---- Footer ---- */
.footer {
  background: var(--dark-bg);
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 1.5rem;
}

.footer .title {
  color: #fff;
}

.footer a {
  color: var(--primary);
}

.footer-link {
  color: rgba(255, 255, 255, 0.6);
  transition: color 0.2s;
}

.footer-link:hover {
  color: var(--primary);
}

/* ---- Image Lightbox ---- */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  cursor: zoom-out;
  padding: 2rem;
}

.lightbox-overlay img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 8px;
}

/* ---- Responsive ---- */
@media screen and (max-width: 768px) {
  .hero-title {
    font-size: 2.2rem;
  }

  .hero-logo {
    width: 80px;
    height: 80px;
  }

  .hero-authors {
    font-size: 0.85rem;
  }

  .modal-preview-content {
    width: 95%;
  }

  .modal-preview-iframe {
    height: 350px;
  }

  .stat-card {
    margin-bottom: 0.5rem;
  }

  .pipeline-step {
    padding-left: 3.5rem;
  }

  .website-card-thumb,
  .website-card-thumb-wrap {
    height: 140px;
  }
}
