/* ============================================================
   PixelSmile Paper — styles.css
   Palette: Dark Indigo (#1A1040) × Coral Accent (#E85D34)
   ============================================================ */

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: #0F0A28;
  background: #F7F3EE;
  line-height: 1.7;
}

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

a { color: inherit; text-decoration: none; }

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1 !important; transform: none !important; }
}

/* ---------- Typography ---------- */
h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.2;
  font-weight: 700;
  color: #FFFFFF;
}

h2.section-heading {
  font-family: 'Inter', sans-serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 700;
  color: #1A1040;
  padding-bottom: 10px;
  border-bottom: 3px solid #E85D34;
  margin-bottom: 36px;
  display: flex;
  align-items: center;
  gap: 12px;
}

h2.section-heading.on-dark { color: #F0EBF8; border-bottom-color: rgba(232,93,52,0.6); }
h2.section-heading.centered { text-align: center; justify-content: center; }

h3.subsection-heading {
  font-size: 1.3rem;
  font-weight: 600;
  color: #1A1040;
  margin: 48px 0 20px;
}

h3.subsection-heading.on-dark { color: #F0EBF8; }

/* ---------- Layout Utilities ---------- */
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: start;
}

@media (max-width: 768px) {
  .two-col { grid-template-columns: 1fr; gap: 32px; }
}

/* ---------- Navigation ---------- */
#site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(26, 16, 64, 0.95);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(232, 93, 52, 0.3);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  font-weight: 700;
  font-size: 1.05rem;
  color: #F0EBF8;
  letter-spacing: 0.01em;
  transition: color 0.2s;
}
.nav-logo:hover { color: #E85D34; }

.nav-links {
  list-style: none;
  display: flex;
  gap: 28px;
}

.nav-links a {
  color: #D4CEEC;
  font-size: 0.9rem;
  font-weight: 500;
  position: relative;
  padding-bottom: 2px;
  transition: color 0.2s;
}
.nav-links a::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: #E85D34;
  transition: width 0.25s ease;
}
.nav-links a:hover { color: #FFFFFF; }
.nav-links a:hover::after { width: 100%; }

@media (max-width: 640px) {
  .nav-links { gap: 16px; }
  .nav-links a { font-size: 0.8rem; }
}

/* ---------- Hero Section ---------- */
.section-hero {
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: rgba(26, 16, 64, 0.7);
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 80px 32px;
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 60px;
}

.hero-text { text-align: center; max-width: 880px; }

.authors {
  color: #D4CEEC;
  font-size: 0.95rem;
  margin-top: 20px;
  line-height: 1.9;
}
.authors sup { font-size: 0.7em; }

.affil-note {
  color: #9B94C0;
  font-size: 0.82rem;
  margin-top: 4px;
}

.affil-badges {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.badge {
  background: rgba(255, 255, 255, 0.13);
  color: #F0EBF8;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid rgba(255,255,255,0.18);
}


.arxiv-tag {
  color: #9B94C0;
  font-size: 0.8rem;
  margin-top: 16px;
  font-family: 'JetBrains Mono', monospace;
}

.hero-figure {
  width: 100%;
  max-width: 920px;
}

.hero-figure img {
  width: 100%;
  border-radius: 14px;
  box-shadow: 0 8px 60px rgba(0,0,0,0.6);
}

.hero-figure figcaption {
  color: #D4CEEC;
  font-size: 0.85rem;
  text-align: center;
  margin-top: 14px;
  line-height: 1.6;
}

/* ---------- Section Backgrounds ---------- */
.section-light  { background: #F7F3EE; padding: 80px 0; }
.section-white  { background: #FFFFFF; padding: 80px 0; }
.section-conclusion { background: linear-gradient(135deg, rgba(232,93,52,0.06) 0%, rgba(26,16,64,0.04) 100%); padding: 80px 0; }
.section-footer { background: #1A1040; padding: 60px 0; }

.section-dark {
  position: relative;
  overflow: hidden;
  padding: 80px 0;
  background: #1C1C2E;
}

.method-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.method-overlay {
  position: absolute;
  inset: 0;
  background: rgba(28, 28, 46, 0.86);
  z-index: 1;
}

/* ---------- Abstract ---------- */
.abstract-text {
  border-left: 4px solid #E85D34;
  padding: 16px 24px;
  font-style: italic;
  color: #2D1B6B;
  background: rgba(232,93,52,0.04);
  border-radius: 0 8px 8px 0;
  line-height: 1.9;
  font-size: 0.97rem;
}

/* ---------- Contribution Cards ---------- */
.contribution-cards { list-style: none; display: flex; flex-direction: column; gap: 20px; }

.contrib-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  border-left: 4px solid #E85D34;
  box-shadow: 0 4px 24px rgba(26,16,64,0.08);
}

.contrib-icon { font-size: 1.8rem; display: block; margin-bottom: 10px; }
.contrib-card h3 { font-size: 1rem; font-weight: 700; color: #1A1040; margin-bottom: 8px; }
.contrib-card p { font-size: 0.9rem; color: #4A3F6B; line-height: 1.6; }

/* ---------- Dataset Detail List ---------- */
.detail-list { margin-top: 16px; }
.detail-list dt {
  font-weight: 600;
  color: #1A1040;
  margin-top: 16px;
  font-size: 0.95rem;
}
.detail-list dd {
  color: #4A3F6B;
  font-size: 0.9rem;
  margin-top: 4px;
  padding-left: 16px;
  border-left: 2px solid #E8D5CD;
}

/* ---------- Metric Cards ---------- */
.metric-cards { list-style: none; display: flex; flex-direction: column; gap: 14px; }

.metric-card {
  background: #F7F3EE;
  border-radius: 8px;
  padding: 16px 20px;
  border-top: 3px solid #E85D34;
}
.metric-icon { font-size: 1.4rem; }
.metric-card h4 {
  font-size: 1.15rem;
  font-weight: 700;
  color: #1A1040;
  display: inline;
  margin-left: 8px;
}
.metric-name { font-size: 0.8rem; color: #6B6585; margin: 4px 0; }
.metric-card p { font-size: 0.88rem; color: #4A3F6B; }

/* ---------- Section Decoration ---------- */
.section-deco {
  width: 48px;
  height: 48px;
  object-fit: contain;
  opacity: 0.8;
  flex-shrink: 0;
  animation: spin-slow 12s linear infinite;
}

@keyframes spin-slow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ---------- Figures & Tables ---------- */
.full-figure {
  margin: 0 0 48px;
}
.full-figure img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(26,16,64,0.10);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.full-figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 40px rgba(26,16,64,0.18);
}

.center-figure {
  margin: 0 auto 48px;
}
.center-figure img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 4px 24px rgba(26,16,64,0.10);
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.center-figure img:hover {
  transform: scale(1.01);
  box-shadow: 0 8px 40px rgba(26,16,64,0.18);
}

figcaption {
  font-size: 0.85rem;
  color: #6B6585;
  text-align: center;
  margin-top: 12px;
  line-height: 1.6;
}

.caption-dark { color: #B0A8D0; }

/* ---------- Method Cards ---------- */
.method-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 40px;
}

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

.method-card {
  background: rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 28px;
  border: 1px solid rgba(232,93,52,0.3);
  color: #F0EBF8;
}

.method-card h3 {
  font-size: 1rem;
  font-weight: 700;
  color: #E85D34;
  margin-bottom: 12px;
}

.method-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: #D4CEEC;
  margin-bottom: 10px;
}

code.formula {
  display: block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.35);
  padding: 8px 14px;
  border-radius: 6px;
  color: #F5A623;
  margin: 12px 0;
  white-space: pre-wrap;
  word-break: break-all;
}

/* ---------- Table Cards ---------- */
.table-row { margin-bottom: 48px; }

.table-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 4px 24px rgba(26,16,64,0.08);
}
.table-card img {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.table-card img:hover { transform: scale(1.01); }
.table-caption {
  font-size: 0.82rem;
  color: #6B6585;
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* ---------- Ablation Grid ---------- */
.ablation-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-top: 24px;
}

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

.ablation-card {
  background: #FFFFFF;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 4px 24px rgba(26,16,64,0.08);
}
.ablation-card img {
  width: 100%;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.25s ease;
}
.ablation-card img:hover { transform: scale(1.01); }
.ablation-card figcaption {
  font-size: 0.8rem;
  margin-top: 10px;
}

/* ---------- Highlight Box ---------- */
.highlight-box {
  background: rgba(232,93,52,0.10);
  border-left: 4px solid #E85D34;
  padding: 14px 20px;
  border-radius: 0 8px 8px 0;
  font-size: 0.92rem;
  color: #2D1B6B;
  margin: 16px auto 48px;
  max-width: 560px;
}

/* ---------- Conclusion ---------- */
.conclusion-text {
  max-width: 780px;
  margin: 0 auto 36px;
  text-align: center;
  color: #2D1B6B;
  font-size: 0.97rem;
  line-height: 1.9;
}

.keyword-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.tag {
  background: rgba(232,93,52,0.10);
  color: #E85D34;
  border-radius: 20px;
  padding: 5px 16px;
  font-size: 0.82rem;
  font-weight: 500;
  border: 1px solid rgba(232,93,52,0.25);
}

/* ---------- Appendix ---------- */
.appendix-details {
  border: 1px solid rgba(26,16,64,0.12);
  border-radius: 12px;
  overflow: hidden;
}

.appendix-details > summary {
  cursor: pointer;
  padding: 16px 24px;
  background: rgba(232,93,52,0.07);
  font-weight: 600;
  font-size: 1.05rem;
  color: #E85D34;
  border-radius: 12px;
  list-style: none;
  transition: background 0.2s;
}
.appendix-details > summary:hover { background: rgba(232,93,52,0.12); }
.appendix-details[open] > summary { border-radius: 12px 12px 0 0; }

.appendix-content { padding: 32px 24px; }

.appendix-figure img {
  width: 100%;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.25s;
}
.appendix-figure img:hover { transform: scale(1.01); }
.appendix-figure figcaption { font-size: 0.82rem; margin-top: 10px; }

/* ---------- Footer ---------- */
.citation-heading {
  color: #E85D34;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.bibtex {
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  padding: 20px 24px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.85rem;
  color: #F0EBF8;
  line-height: 1.8;
  border: 1px solid rgba(255,255,255,0.08);
}

.footer-credit {
  font-size: 0.8rem;
  color: #6B6585;
  text-align: center;
  margin-top: 32px;
}

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lightbox[hidden] { display: none; }

.lightbox-close {
  position: absolute;
  top: 20px; right: 24px;
  background: none;
  border: none;
  color: #FFFFFF;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}
.lightbox-close:hover { color: #E85D34; }

.lightbox-figure {
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.lightbox-figure img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
}
.lightbox-figure figcaption {
  color: #D4CEEC;
  font-size: 0.88rem;
  text-align: center;
  max-width: 700px;
}

/* ---------- Scroll Reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease, transform 0.6s ease;
  transition-delay: var(--delay, 0s);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* AI explanation labels */
.flecto-note::before,
.flecto-callout::before,
.flecto-card::before,
.flecto-panel::before {
  content: "🤖 AI explanation";
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #60a5fa;
  margin-bottom: 0.5em;
  opacity: 0.9;
}
