/* ============================================================
   CoFlex-VTLA — Project Website Styles
   ============================================================ */

/* --- Theme Variables --- */
:root {
  --bg: #ffffff;
  --bg-alt: #f6f8fa;
  --bg-elevated: #eef2f6;
  --text: #0f172a;
  --text-muted: #475569;
  --text-dim: #64748b;
  --accent: #0d9488;
  --accent-hover: #0f766e;
  --accent-light: #5eead4;
  --accent-soft: rgba(13, 148, 136, 0.10);
  --border: rgba(15, 23, 42, 0.10);
  --border-strong: rgba(15, 23, 42, 0.16);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 30px rgba(15, 23, 42, 0.08);
  --radius: 10px;
  --radius-lg: 18px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --mono: "SF Mono", "Fira Code", "Consolas", monospace;
  --header-h: 64px;
  --max-w: 1100px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Reset --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s var(--ease);
}
a:hover { color: var(--accent-hover); }
img, video { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
p { text-align: justify; }

/* --- Utility --- */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.container--narrow { max-width: 820px; }
.center { text-align: center; }


/* ============================================================
   Header / Navigation
   ============================================================ */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  border-bottom: 1px solid transparent;
  transition: background 0.35s var(--ease), border-color 0.35s var(--ease),
              box-shadow 0.35s var(--ease), backdrop-filter 0.35s var(--ease);
}
.site-header.scrolled {
  background: rgba(255, 255, 255, 0.90);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.logo {
  font-weight: 800;
  font-size: 1.25rem;
  color: var(--text);
  letter-spacing: -0.02em;
}
.nav-links { display: flex; gap: 1.75rem; }
.nav-links a {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-weight: 600;
  position: relative;
  padding: 0.2rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  width: 100%; height: 2px;
  border-radius: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.25s var(--ease);
}
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { transform: scaleX(1); }

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  border-radius: 1px;
  background: var(--text);
  transition: transform 0.25s var(--ease), opacity 0.25s var(--ease);
}
.nav-toggle.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }


/* ============================================================
   Hero
   ============================================================ */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: #e2e6eb;
  padding: calc(var(--header-h) + 2rem) 1.5rem 4rem;
}
.hero-content { max-width: 800px; }
.hero-title {
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}
.hero-subtitle {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.6;
  margin-bottom: 2.5rem;
  text-align: center;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: center;
  margin-bottom: 3rem;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.3rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s var(--ease);
}
.btn--glass {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-color: rgba(255, 255, 255, 0.7);
  color: var(--text);
  box-shadow: 0 2px 12px rgba(15, 23, 42, 0.06);
}
.btn--glass:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 6px 24px rgba(15, 23, 42, 0.12);
}
.btn--primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.btn--primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(13, 148, 136, 0.35);
}

/* --- Logos (original colors) --- */
.hero-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  flex-wrap: wrap;
}
.hero-logo {
  height: 44px;
  width: auto;
}
.hero-logo--sris { height: 50px; }


/* ============================================================
   Paper Info
   ============================================================ */
.paper-info {
  padding: 4.5rem 0 3rem;
  text-align: center;
}
.paper-title {
  font-size: clamp(1.4rem, 2.8vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  max-width: 900px;
  margin: 0 auto 1.5rem;
  line-height: 1.35;
}
.paper-authors {
  font-size: 1.05rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}
.paper-affiliations {
  font-size: 0.95rem;
  color: var(--text-dim);
  text-align: center;
}
.aff-note { font-size: 0.85rem; }


/* ============================================================
   Shared Section Styles
   ============================================================ */
.section {
  padding: 5rem 0;
}
.section--alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 1.25rem;
}
.section-lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 820px;
  margin: 0 auto 2.5rem;
}
.prose p {
  font-size: 1.02rem;
  color: var(--text-muted);
}
.prose strong { color: var(--text); }


/* ============================================================
   Figures
   ============================================================ */
.figure {
  margin: 2.5rem auto;
  text-align: center;
  max-width: 820px;
}
.figure img {
  margin: 0 auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.figure figcaption {
  margin-top: 0.85rem;
  font-size: 0.9rem;
  color: var(--text-dim);
  text-align: justify;
  line-height: 1.6;
}
/* ============================================================
   Method
   ============================================================ */
.method-grid {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 2.5rem;
}
.method-block {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  transition: box-shadow 0.25s var(--ease), transform 0.25s var(--ease);
}
.method-block:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}
.method-block p {
  font-size: 0.97rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
}
.method-block p:last-child { margin-bottom: 0; }
.method-block-title {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.method-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px; height: 34px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
}
.equation {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1.25rem;
  margin: 1rem 0;
  font-size: 1.02rem;
  text-align: center;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--text);
  overflow-x: auto;
}


/* ============================================================
   Results
   ============================================================ */
.result-block { margin-top: 3.5rem; }
.result-block:first-child { margin-top: 0; }
.result-block-title {
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: 0.75rem;
}
.result-block-text {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 860px;
  margin-bottom: 1.25rem;
}

/* --- Tables --- */
.table-wrap {
  margin: 1.5rem 0;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-wrap--narrow .data-table { font-size: 0.82rem; }
.table-wrap--narrow .data-table th { font-size: 0.78rem; }
.table-wrap--narrow .data-table th.sub { font-size: 0.74rem; }
.table-wrap--narrow .data-table th,
.table-wrap--narrow .data-table td { padding: 0.45rem 0.5rem; }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  background: var(--bg);
  table-layout: fixed;
}
.data-table th,
.data-table td {
  padding: 0.35rem 0.25rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.data-table th {
  background: var(--bg-elevated);
  font-weight: 600;
  font-size: 0.68rem;
  color: var(--text);
}
.data-table th.sub {
  font-weight: 500;
  font-size: 0.64rem;
  color: var(--text-dim);
}
.data-table col.tactile { width: 4%; }
.data-table col.policy { width: 13%; }
.data-table col.avg { width: 7%; }
.data-table col.stage { width: 5.85%; }

.data-table .group-label td {
  text-align: left;
  background: var(--bg-alt);
  font-weight: 600;
  color: var(--text-dim);
  padding: 0.3rem 0.5rem;
}
.data-table tbody tr:hover { background: var(--accent-soft); }
.data-table .best {
  background: rgba(94, 234, 212, 0.22);
  font-weight: 600;
}
.data-table .row-ours {
  background: var(--accent-soft);
  font-weight: 500;
}
.data-table .row-ours td { border-bottom-color: var(--accent-light); }


/* ============================================================
   Demo Videos
   ============================================================ */
.demo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}
.demo-placeholder {
  aspect-ratio: 16 / 9;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s;
}
.demo-placeholder:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}
.demo-placeholder-inner {
  text-align: center;
  color: var(--text-dim);
}
.demo-placeholder-inner svg {
  margin: 0 auto 0.5rem;
  opacity: 0.5;
}
.demo-placeholder-inner p {
  font-weight: 600;
  font-size: 0.98rem;
  color: var(--text-muted);
  margin-bottom: 0.2rem;
  text-align: center;
}
.demo-placeholder-inner span {
  font-size: 0.83rem;
}


/* ============================================================
   Citation
   ============================================================ */
.bibtex-box {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}
.bibtex-box pre {
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  color: var(--text-muted);
  white-space: pre;
  padding-right: 140px;
}
.btn--copy {
  position: absolute;
  top: 1rem;
  right: 1rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.85rem;
}
.btn--copy.copied {
  background: var(--accent-light);
  color: var(--accent-hover);
  border-color: var(--accent-light);
}


/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background: #0f172a;
  color: rgba(255, 255, 255, 0.7);
  padding: 3rem 0;
  text-align: center;
}
.footer-logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.footer-logo {
  height: 48px;
  width: auto;
}
.footer-logo--sris { height: 56px; }
.footer-text {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
}


/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 768px) {
  .section { padding: 3.5rem 0; }
  .paper-info { padding: 3rem 0 2rem; }
  .container { padding: 0 1rem; }
  .header-inner { padding: 0 1rem; }

  /* Mobile nav */
  .nav-toggle { display: flex; }
  .nav-links {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    transform: translateY(-130%);
    transition: transform 0.3s var(--ease);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-links a {
    color: var(--text) !important;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border);
  }

  /* Hero */
  .hero { min-height: 80vh; }
  .hero-logo { height: 32px; }
  .hero-logo--sris { height: 36px; }
  .hero-logos { gap: 1.5rem; }

  /* Content */
  .figure figcaption { font-size: 0.83rem; }

  /* Tables */
  .data-table { font-size: 0.76rem; }
  .data-table th,
  .data-table td { padding: 0.4rem 0.45rem; }

  /* Bibtex */
  .bibtex-box pre { padding-right: 0; padding-bottom: 3.5rem; }
  .btn--copy { top: auto; bottom: 1rem; right: 1rem; }
}

/* Anonymous review presentation and current four-task evaluation. */
html { scroll-padding-top: calc(var(--header-h) + 1rem); }
.skip-link { position: fixed; left: 1rem; top: -5rem; z-index: 1100; padding: .7rem 1rem; background: #fff; border: 2px solid var(--accent); border-radius: 8px; }
.skip-link:focus { top: .5rem; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.hero { min-height: 66vh; padding-bottom: 3.5rem; background: linear-gradient(135deg, #e8edf1, #e7eeed); }
.hero-content { max-width: 960px; width: 100%; }
.hero-subtitle { max-width: 750px; margin: 0 auto 2.5rem; }
.review-badge { display: inline-block; color: #475569; font-size: .78rem; font-weight: 600; letter-spacing: .025em; border: 1px solid #cbd5df; padding: .4rem .8rem; border-radius: 999px; margin-bottom: 1.3rem; text-align: center; background: #ffffff66; }
.hero-actions { align-items: flex-start; gap: 1rem; margin-bottom: 0; }
.resource-item { display: flex; flex-direction: column; align-items: center; gap: .65rem; }
.btn { font-family: inherit; line-height: 1.4; }
.btn--unavailable, .btn--unavailable:hover { color: #6b7280; background: #dce0e4; border-color: #cbd1d8; box-shadow: none; transform: none; cursor: default; }
.btn--pending, .btn--pending:hover { color: #475569; background: #ffffff80; border-color: #ffffff; box-shadow: none; transform: none; cursor: default; }
.resource-note { font-size: .71rem; line-height: 1.55; color: #64748b; text-align: center; max-width: 190px; }
.paper-info { padding: 3rem 0 0; }
.paper-anonymous { color: var(--text-dim); text-align: center; font-size: .92rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1rem; margin-top: 2rem; }
.metric { padding: 1.3rem .8rem; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); text-align: center; }
.metric > strong { display: block; font-size: 2rem; color: var(--accent-hover); letter-spacing: -.04em; }
.metric > strong span { font-size: 1.1rem; }
.metric > span { display: block; font-size: .79rem; color: var(--text-muted); }
.method-flow { border: 1px solid var(--border); background: var(--bg); border-radius: var(--radius-lg); padding: 1.6rem; }
.flow-inputs { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; padding-bottom: 1.2rem; }
.flow-inputs span { padding: .3rem .7rem; font-size: .79rem; background: var(--bg-elevated); border-radius: 6px; color: var(--text-muted); }
.flow-stages { display: grid; grid-template-columns: 1fr; gap: 1rem; }
.flow-stage { border-left: 3px solid var(--accent); padding: .8rem 1rem; background: var(--accent-soft); border-radius: 0 10px 10px 0; }
.flow-index { display: block; color: var(--accent-hover); font-size: .69rem; font-weight: 700; letter-spacing: .07em; margin-bottom: .2rem; }
.flow-stage strong { font-size: 1rem; }
.flow-stage p { font-size: .83rem; color: var(--text-muted); margin-top: .35rem; text-align: left; }
.method-flow figcaption { font-size: .78rem; color: var(--text-dim); margin-top: 1rem; }
.task-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.2rem; }
.task-card { padding: 1.6rem; border: 1px solid var(--border); border-radius: var(--radius-lg); }
.task-number { display: inline-block; font-size: .77rem; color: var(--accent); font-weight: 700; margin-bottom: .5rem; }
.task-card h3 { font-size: 1.14rem; }
.task-card p { font-size: .92rem; color: var(--text-muted); text-align: left; margin-top: .75rem; }
.task-card .task-demand { font-size: .78rem; font-weight: 600; color: var(--accent-hover); margin-top: .35rem; }
.task-card .task-randomization { font-size: .82rem; color: var(--text-dim); }
.task-video-status { display: inline-block; font-size: .73rem; color: var(--text-dim); border-top: 1px solid var(--border); margin-top: 1rem; padding-top: .6rem; }
.protocol-note { font-size: .84rem; color: var(--text-dim); margin: 1.2rem 0; text-align: left; }
.container--results { max-width: 1100px; }
.research-questions { list-style: none; padding: 1.2rem 1.4rem; margin: 1.8rem auto 2rem; max-width: 930px; background: white; border: 1px solid var(--border); border-radius: var(--radius); }
.research-questions li { font-size: .92rem; color: var(--text-muted); padding: .3rem 0; }
.research-questions strong { color: var(--accent-hover); margin-right: .3rem; }
.result-block-text { max-width: none; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { table-layout: auto; font-size: .8rem; }
.data-table caption { caption-side: top; text-align: left; font-size: .88rem; font-weight: 600; color: var(--text); background: #fff; padding: .8rem 1rem; }
.data-table th, .data-table td { padding: .6rem .5rem; overflow: visible; text-overflow: clip; }
.data-table thead th { font-size: .76rem; }
.data-table tbody th { text-align: left; font-size: .8rem; background: inherit; font-weight: 500; }
.data-table tbody .row-ours th { font-weight: 700; }
.data-table--main { min-width: 960px; }
.data-table--compact { min-width: 520px; }
.data-table .group-label td { font-size: .73rem; }
.table-wrap--narrow { max-width: 760px; }
.citation-pending { color: var(--text-dim); font-size: .95rem; text-align: center; margin-top: .7rem; }
.site-footer { padding: 2rem 0; }
@media (max-width: 768px) {
  .hero { min-height: 0; padding-top: calc(var(--header-h) + 2.5rem); padding-bottom: 3rem; }
  .hero-actions { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1.25rem .6rem; }
  .resource-item .btn { font-size: .76rem; padding: .65rem .6rem; width: 100%; justify-content: center; min-height: 44px; gap: .35rem; }
  .hero-actions .resource-item .btn { min-height: 58px; }
  .resource-item .btn svg { width: 15px; height: 15px; flex-shrink: 0; }
  .resource-note { font-size: .66rem; }
  .review-badge { font-size: .66rem; padding: .35rem .6rem; }
  .paper-info { padding-top: 2.5rem; }
  .paper-anonymous { font-size: .79rem; }
  .metric-grid { gap: .5rem; }
  .metric { padding: 1rem .25rem; }
  .metric > strong { font-size: 1.55rem; }
  .metric > strong span { font-size: .75rem; }
  .metric > span { font-size: .65rem; line-height: 1.5; }
  .task-grid { grid-template-columns: 1fr; }
  .method-flow { padding: 1rem; }
  .method-block { padding: 1.25rem; }
  .method-block-title { align-items: flex-start; font-size: 1rem; }
  .research-questions { padding: 1rem; }
  .research-questions li { font-size: .85rem; }
  .data-table th, .data-table td { padding: .55rem .5rem; }
  .figure { margin: 1.75rem auto; }
  .nav-links:not(.open) { visibility: hidden; pointer-events: none; }
  .nav-links.open { visibility: visible; pointer-events: auto; }
  p { text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
