/* ================================================
   paper.css — Styles for the paper reading page
   ================================================ */

/* Disable scroll-snap and hide home-page-only elements */
html {
  scroll-snap-type: none;
}

.nav-dots,
.progress-bar {
  display: none;
}

/* ---- PAPER HERO ---- */
.paper-hero {
  text-align: center;
  padding: 120px 24px 60px;
  max-width: 930px;
  margin: 0 auto;
}

.paper-conference {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 24px;
}

.paper-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(28px, 5vw, 48px);
  letter-spacing: 2px;
  line-height: 1.1;
  color: var(--text);
  margin-bottom: 16px;
}

.paper-subtitle {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 1px;
  color: var(--dim);
  margin-bottom: 20px;
}

.paper-author {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  color: var(--dim);
  margin-bottom: 8px;
}

.paper-affiliation {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  font-style: italic;
  color: var(--dim);
  opacity: 0.7;
}

/* ---- DOWNLOAD BUTTON ---- */
.download-bar {
  display: flex;
  justify-content: center;
  gap: 12px;
  padding: 0 24px 40px;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  transition: all 0.3s ease;
}

.download-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.download-btn svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.toggle-all-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-decoration: none;
  padding: 14px 28px;
  background: transparent;
  color: var(--text);
  border: 1px solid var(--dim);
  cursor: pointer;
  transition: all 0.3s ease;
}

.toggle-all-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* ---- TABLE OF CONTENTS ---- */
.paper-toc {
  max-width: 930px;
  margin: 0 auto 40px;
  padding: 0 24px;
}

.paper-toc h2 {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 2px;
  color: var(--text);
  margin-bottom: 16px;
}

.paper-toc ol {
  list-style: none;
  padding: 0;
  columns: 2;
  column-gap: 32px;
}

.paper-toc li {
  padding: 6px 0;
  border-bottom: 1px solid rgba(158, 154, 147, 0.15);
}

.paper-toc a {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--dim);
  text-decoration: none;
  transition: color 0.2s ease;
}

.paper-toc a:hover {
  color: var(--accent);
}

@media (max-width: 600px) {
  .paper-toc ol {
    columns: 1;
  }
}

/* ---- PAPER CONTENT ---- */
.paper-content {
  max-width: 930px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

/* ---- COLLAPSIBLE SECTIONS ---- */
.paper-section {
  border-top: 1px solid rgba(158, 154, 147, 0.2);
  margin-bottom: 0;
  scroll-margin-top: 80px;
}

.paper-section:last-child {
  border-bottom: 1px solid rgba(158, 154, 147, 0.2);
}

.paper-section summary {
  font-family: var(--font-display);
  font-size: 24px;
  letter-spacing: 2px;
  color: var(--text);
  padding: 20px 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s ease;
  user-select: none;
}

.paper-section summary::-webkit-details-marker {
  display: none;
}

.paper-section summary::after {
  content: '+';
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 300;
  color: var(--dim);
  transition: transform 0.3s ease, color 0.3s ease;
  flex-shrink: 0;
  margin-left: 16px;
}

.paper-section[open] summary::after {
  content: '-';
  color: var(--accent);
}

.paper-section summary:hover {
  color: var(--accent);
}

.paper-section .section-body {
  padding: 0 0 32px;
}

/* ---- SUBSECTIONS ---- */
.paper-section h3 {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 1px;
  color: var(--accent);
  margin: 28px 0 12px;
}

.paper-section h3:first-child {
  margin-top: 0;
}

/* ---- BODY TEXT ---- */
.paper-section p {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--dim);
  margin-bottom: 16px;
}

.paper-section ol,
.paper-section ul {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.8;
  color: var(--dim);
  margin: 0 0 16px 24px;
}

.paper-section li {
  margin-bottom: 8px;
}

/* ---- TABLES ---- */
.paper-section .table-wrap {
  margin: 24px 0;
}

.paper-section table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  color: var(--dim);
}

.paper-section table caption {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
  text-align: left;
  padding: 0 0 12px;
}

.paper-section th {
  font-weight: 500;
  color: var(--text);
  text-align: left;
  padding: 10px 12px;
  border-bottom: 2px solid rgba(158, 154, 147, 0.3);
  white-space: nowrap;
}

.paper-section td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(158, 154, 147, 0.1);
  vertical-align: top;
}

.paper-section tr:hover td {
  background: rgba(241, 198, 136, 0.03);
}

/* ---- REFERENCES ---- */
.references-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.references-list li {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--dim);
  padding: 8px 0;
  border-bottom: 1px solid rgba(158, 154, 147, 0.08);
}

.references-list .ref-num {
  color: var(--accent);
  font-weight: 400;
  margin-right: 4px;
}

/* ---- FAB TABLE OF CONTENTS ---- */
.fab-toc {
  position: fixed;
  bottom: 24px;
  left: max(24px, calc(50vw - 800px + 24px));
  z-index: 900;
}

.fab-toc-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--dim);
  background: var(--bg);
  color: var(--dim);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.fab-toc-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.fab-toc-btn svg {
  width: 20px;
  height: 20px;
}

.fab-label {
  display: none;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
}

@media (min-width: 1600px) {
  .fab-toc-btn {
    width: auto;
    border-radius: 24px;
    padding: 0 20px;
    gap: 8px;
  }

  .fab-label {
    display: inline;
  }
}

.fab-icon-close {
  display: none;
}

.fab-toc.open .fab-icon-open {
  display: none;
}

.fab-toc.open .fab-icon-close {
  display: block;
}

.fab-toc-panel {
  position: absolute;
  bottom: 60px;
  left: 0;
  width: 260px;
  max-height: 70vh;
  overflow-y: auto;
  background: var(--bg);
  border: 1px solid rgba(158, 154, 147, 0.2);
  padding: 16px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.fab-toc.open .fab-toc-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.fab-toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(158, 154, 147, 0.2);
}

.fab-toc-header span {
  font-family: var(--font-display);
  font-size: 18px;
  letter-spacing: 2px;
  color: var(--text);
}

.fab-toggle-all {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--dim);
  background: none;
  border: 1px solid rgba(158, 154, 147, 0.3);
  padding: 4px 10px;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.fab-toggle-all:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.fab-toc-links {
  display: flex;
  flex-direction: column;
}

.fab-toc-links a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--dim);
  text-decoration: none;
  padding: 5px 0;
  border-bottom: 1px solid rgba(158, 154, 147, 0.08);
  transition: color 0.15s ease;
}

.fab-toc-links a:last-child {
  border-bottom: none;
}

.fab-toc-links a:hover {
  color: var(--accent);
}

/* ---- MOBILE ---- */
@media (max-width: 600px) {
  .paper-hero {
    padding: 100px 16px 40px;
  }

  .paper-content {
    padding: 0 16px 60px;
  }

  .paper-section summary {
    font-size: 20px;
  }

  .paper-section p,
  .paper-section ol,
  .paper-section ul {
    font-size: 15px;
  }

  .download-bar {
    flex-direction: column;
    align-items: center;
  }
}
