/* ============================
   PInVerify Project Page — Style
   Theme: UniTN Red (#B0171F) + FBK Blue (#1B3A5C)
   ============================ */

:root {
  --red: #B0171F;
  --red-light: #D4363F;
  --red-bg: #FDF2F2;
  --blue: #1B3A5C;
  --blue-light: #2A5A8C;
  --blue-bg: #F0F4FA;
  --gray-50: #FAFAFA;
  --gray-100: #F5F5F5;
  --gray-200: #EEEEEE;
  --gray-300: #E0E0E0;
  --gray-600: #757575;
  --gray-800: #424242;
  --gray-900: #212121;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 56px; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: var(--gray-900);
  line-height: 1.6;
  background: var(--white);
}

/* ---- Typography ---- */
h1, h2, h3, h4 { font-weight: 700; line-height: 1.3; }
h1 { font-size: 2.8rem; }
h2 { font-size: 1.8rem; }
h3 { font-size: 1.3rem; }
p { color: var(--gray-800); }

.section-title {
  text-align: center;
  margin-bottom: 2rem;
  position: relative;
}
.section-title h2 {
  display: inline-block;
  position: relative;
}
.section-title h2::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--red), var(--blue));
  margin: 0.5rem auto 0;
  border-radius: 2px;
}

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

section {
  padding: 4rem 0;
}

section:nth-child(even) {
  background: var(--gray-50);
}

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--red-bg) 0%, var(--white) 40%, var(--blue-bg) 100%);
  padding: 5rem 0 4rem;
  text-align: center;
}

.hero-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 2rem;
  margin-bottom: 2rem;
}

.hero-logos img {
  height: 56px;
  object-fit: contain;
}

.hero h1 {
  font-size: 2.6rem;
  background: linear-gradient(135deg, var(--red) 0%, var(--blue) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  font-size: 1.25rem;
  color: var(--gray-600);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.hero .authors {
  font-size: 1rem;
  color: var(--gray-800);
  margin-bottom: 0.5rem;
}

.hero .authors a {
  color: var(--blue);
  text-decoration: none;
}
.hero .authors a:hover {
  text-decoration: underline;
}

.hero .affiliations {
  font-size: 0.9rem;
  color: var(--gray-600);
  margin-bottom: 0.85rem;
}

/* ---- Venue badge ---- */
.hero .venue-badge {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 100%;
  gap: 0.5rem;
  padding: 0.3rem 0.45rem 0.3rem 0.9rem;
  margin-bottom: 2rem;
  border-radius: 50px;
  background: var(--blue-bg);
  border: 1px solid rgba(27, 58, 92, 0.18);
  color: var(--blue);
  font-size: 0.88rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.hero .venue-badge:hover {
  background: var(--blue);
  color: var(--white);
  border-color: var(--blue);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.hero .venue-badge svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  flex-shrink: 0;
}
.hero .venue-badge .venue-tag {
  padding: 0.12rem 0.6rem;
  border-radius: 50px;
  background: var(--red);
  color: var(--white);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ---- Buttons ---- */
.btn-group {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  border: 2px solid transparent;
}

.btn-red {
  background: var(--red);
  color: var(--white);
}
.btn-red:hover {
  background: var(--red-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-blue {
  background: var(--blue);
  color: var(--white);
}
.btn-blue:hover {
  background: var(--blue-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.btn-outline-red {
  border-color: var(--red);
  color: var(--red);
  background: transparent;
}
.btn-outline-red:hover {
  background: var(--red);
  color: var(--white);
}

.btn-outline-blue {
  border-color: var(--blue);
  color: var(--blue);
  background: transparent;
}
.btn-outline-blue:hover {
  background: var(--blue);
  color: var(--white);
}

.btn svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ---- Stats Bar ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
  margin: 3rem 0;
}

.stat-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--red);
  transition: var(--transition);
}

.stat-card:nth-child(even) {
  border-top-color: var(--blue);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.stat-card .number {
  font-size: 2rem;
  font-weight: 800;
  color: var(--red);
}

.stat-card:nth-child(even) .number {
  color: var(--blue);
}

.stat-card .label {
  font-size: 0.85rem;
  color: var(--gray-600);
  margin-top: 0.25rem;
}

/* ---- Abstract ---- */
.abstract-box {
  background: var(--white);
  border-left: 4px solid var(--red);
  border-radius: var(--radius-sm);
  padding: 1.5rem 2rem;
  box-shadow: var(--shadow-sm);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ---- Figures ---- */
.figure-container {
  text-align: center;
  margin: 2rem 0;
}

.figure-container img {
  max-width: 100%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

.figure-container .caption {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  color: var(--gray-600);
  font-style: italic;
}

/* ---- Method ---- */
.method-highlights {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.method-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  border-bottom: 3px solid transparent;
}

.method-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.method-card:nth-child(3n+1) { border-bottom-color: var(--red); }
.method-card:nth-child(3n+2) { border-bottom-color: var(--blue); }
.method-card:nth-child(3n+3) { border-bottom-color: var(--red-light); }

.method-card h3 {
  margin-bottom: 0.5rem;
  font-size: 1.05rem;
}

.method-card p {
  font-size: 0.88rem;
  color: var(--gray-600);
}

/* ---- Results Table ---- */
.results-wrapper {
  overflow-x: auto;
  margin: 1.5rem 0;
}

.results-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.results-table thead {
  background: linear-gradient(135deg, var(--red), var(--blue));
  color: var(--white);
}

.results-table th {
  padding: 0.75rem 1rem;
  text-align: center;
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.results-table td {
  padding: 0.6rem 1rem;
  text-align: center;
  border-bottom: 1px solid var(--gray-200);
}

.results-table tbody tr:hover {
  background: var(--blue-bg);
}

.results-table .highlight {
  font-weight: 700;
  color: var(--red);
}
.results-table .gt-row {
  background: #f9f9f9;
}
.results-table .gt-row .method-name {
  font-style: italic;
}
.results-table .highlight-gt {
  font-weight: 700;
  color: #999;
}

.results-table .method-name {
  text-align: left;
  font-weight: 600;
  color: var(--gray-900);
}

.results-table .group-header td {
  background: var(--gray-100);
  font-weight: 700;
  font-size: 0.82rem;
  color: var(--gray-600);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 0.5rem 1rem;
}

/* ---- Key Findings ---- */
.findings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 2rem;
}

.finding-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  gap: 1rem;
  transition: var(--transition);
}

.finding-card:hover {
  box-shadow: var(--shadow-md);
}

.finding-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.finding-icon.red { background: var(--red-bg); }
.finding-icon.blue { background: var(--blue-bg); }

.finding-card h3 {
  font-size: 0.95rem;
  margin-bottom: 0.3rem;
}

.finding-card p {
  font-size: 0.85rem;
  color: var(--gray-600);
}

/* ---- Gallery ---- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.gallery-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  aspect-ratio: 1;
  transition: var(--transition);
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-lg);
  z-index: 2;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item .category-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: white;
  font-size: 0.7rem;
  padding: 1rem 0.5rem 0.3rem;
  text-align: center;
  font-weight: 600;
}

/* ---- Citation ---- */
.citation-box {
  background: var(--gray-900);
  color: #E0E0E0;
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: 'Fira Code', 'Consolas', monospace;
  font-size: 0.82rem;
  line-height: 1.6;
  position: relative;
  overflow-x: auto;
}

.citation-box .copy-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: var(--white);
  border-radius: 6px;
  padding: 0.3rem 0.7rem;
  font-size: 0.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.citation-box .copy-btn:hover {
  background: rgba(255,255,255,0.2);
}

/* ---- Footer ---- */
footer {
  background: var(--gray-900);
  color: var(--gray-300);
  text-align: center;
  padding: 2rem 0;
  font-size: 0.85rem;
}

footer a {
  color: var(--gray-200);
  text-decoration: none;
}
footer a:hover {
  text-decoration: underline;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .hero h1 { font-size: 1.8rem; }
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
  .method-highlights { grid-template-columns: 1fr; }
  .findings-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  h2 { font-size: 1.5rem; }
}

@media (max-width: 480px) {
  .hero h1 { font-size: 1.5rem; }
  .hero-logos img { height: 40px; }
  .stats-bar { grid-template-columns: 1fr 1fr; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
  .btn-group { flex-direction: column; align-items: center; }
}
