/* ════════════════════════════════════════════════════════════════════
   RocSite Discovery, /tools page styles.
   Builds on top of /static/css/site.css.
   ════════════════════════════════════════════════════════════════════ */

/* Hero */
.tools-hero {
  background:
    radial-gradient(900px 460px at 80% -10%, rgba(200,164,50,.10) 0%, transparent 60%),
    linear-gradient(180deg, var(--light-blue) 0%, var(--white) 92%);
  padding: clamp(2.5rem, 6vw, 4.5rem) 0 clamp(2rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--border-soft);
}
.tools-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.1rem);
  line-height: 1.12;
  color: var(--navy);
  max-width: 22ch;
  margin: .35rem 0 1rem;
}
.tools-hero h1 em {
  font-style: normal;
  background: linear-gradient(120deg, var(--gold) 0%, var(--gold-soft) 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.tools-hero-sub {
  font-size: clamp(1rem, 1.5vw, 1.12rem);
  color: var(--text-body);
  max-width: 64ch;
  font-weight: 500;
}

/* Section spacing */
.section-tight { padding: clamp(1.6rem, 4vw, 2.6rem) 0; }

/* Tool cards (the four switcher cards) — 4-up so all fit above the fold,
   nudged smaller so the modality grid below is visibly cut off (scroll cue). */
.tool-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .8rem;
}
@media (max-width: 1100px) { .tool-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px)  { .tool-cards { grid-template-columns: 1fr; } }

.tool-card {
  appearance: none;
  cursor: pointer;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.05rem 1.1rem;
  display: flex; flex-direction: column; gap: .4rem;
  font: inherit;
  color: var(--text-body);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease, background .18s ease;
}
.tool-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.tool-card.is-active {
  border-color: var(--navy);
  background: linear-gradient(180deg, #fcfaf2 0%, var(--white) 70%);
  border-left: 4px solid var(--gold);
  box-shadow: var(--shadow);
}
.tool-card.is-active .tool-card-cta { color: var(--gold); }
.tool-card-kicker {
  font-size: .62rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.tool-card h3 {
  font-family: var(--ff-serif);
  font-size: 1.05rem;
  color: var(--navy);
  margin: 0;
  line-height: 1.22;
}
.tool-card p {
  color: var(--text-muted);
  font-size: .8rem;
  line-height: 1.5;
  margin: 0;
  flex: 1;
}
.tool-card-cta {
  font-size: .76rem;
  font-weight: 600;
  color: var(--navy);
  margin-top: .3rem;
  align-self: flex-start;
}

/* Tool panes */
.tool-pane {
  padding: clamp(2.2rem, 5vw, 3.6rem) 0 clamp(2.5rem, 6vw, 4rem);
  border-top: 1px solid var(--border-soft);
}
.tool-pane:not(.is-active) { display: none; }
.pane-head { margin-bottom: 1.6rem; max-width: 70ch; }
.pane-head h2 {
  font-family: var(--ff-serif);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  color: var(--navy);
  margin: .25rem 0 .8rem;
}
.pane-lede {
  color: var(--text-body);
  font-size: .98rem;
  line-height: 1.7;
  max-width: 70ch;
}
.pane-fineprint {
  color: var(--text-muted);
  font-size: .78rem;
  line-height: 1.5;
  max-width: 70ch;
  margin: .5rem 0 0;
  font-style: italic;
}

/* Filter bar */
.filter-bar {
  display: flex; flex-wrap: wrap;
  gap: .5rem;
  margin: 1rem 0 1.6rem;
}
@media (max-width: 720px) {
  .filter-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: .25rem; }
}
.filter-btn {
  appearance: none;
  background: var(--white);
  border: 1px solid var(--border);
  color: var(--text-body);
  font: inherit;
  font-size: .82rem;
  font-weight: 500;
  padding: .5rem .9rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.filter-btn:hover { border-color: var(--navy); color: var(--navy); }
.filter-btn.is-active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* Modality tile grid (no per-tile demo links) */
.modality-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.6rem;
}
@media (max-width: 1080px) { .modality-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 680px)  { .modality-grid { grid-template-columns: 1fr; gap: 1.2rem; } }

.grid-loading,
.grid-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  padding: 2rem 0;
  font-size: .92rem;
}

.modality-tile {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.modality-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--gold);
}

.tile-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(600px 240px at 50% 120%, rgba(200,164,50,.18) 0%, transparent 60%),
    var(--navy-deep);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: pointer;
}
.tile-play {
  position: absolute;
  top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(27, 58, 92, .82);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  opacity: .92;
  transition: opacity .15s ease, transform .15s ease, background .15s ease;
  box-shadow: 0 4px 18px rgba(0,0,0,.35), 0 0 0 3px rgba(255,255,255,.18);
}
.tile-play svg { margin-left: 3px; } /* optical-center the triangle inside the disc */
.modality-tile:hover .tile-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.08);
  background: rgba(200, 164, 50, .92); /* gold on hover so it reads as the active CTA */
}
.modality-tile:not([data-video]) .tile-thumb { cursor: default; }
.modality-tile:not([data-video]) .tile-play { display: none; }

@media (prefers-reduced-motion: reduce) {
  .tile-play { transition: none; }
  .modality-tile:hover .tile-play { transform: translate(-50%, -50%); }
}
.tile-thumb img {
  display: block;
  width: 100%; height: 100%;
  object-fit: cover;
}
.tile-thumb-pending {
  text-align: center;
  padding: 1rem 1.2rem;
  color: rgba(255,255,255,.92);
  display: flex; flex-direction: column; align-items: center; gap: .4rem;
}
.tile-thumb-pending .pending-num {
  font-family: var(--ff-serif);
  font-size: 1.6rem;
  color: rgba(255,255,255,.95);
  line-height: 1;
}
.tile-thumb-pending .pending-label {
  font-size: .68rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 700;
}

.tile-content {
  padding: 1rem 1.1rem 1.15rem;
  display: flex; flex-direction: column; gap: .55rem;
  flex: 1;
}
.tile-content h3 {
  font-family: var(--ff-serif);
  font-size: 1.08rem;
  color: var(--navy);
  margin: 0;
  line-height: 1.3;
}
.tile-scoring {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0;
  font-style: italic;
}

/* One-line evidence/methodology claim under the scoring tool. Visible without
   a click — this is what a clinician scanning the grid sees first. */
.tile-claim {
  font-size: .82rem;
  color: var(--text-body);
  line-height: 1.45;
  margin: .35rem 0 0;
  padding: .55rem .7rem;
  border-left: 3px solid var(--gold);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
}

/* "Methodology →" pill. Quiet, navy on white with a gold-on-hover. */
.tile-method-pill {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--navy);
  font: inherit;
  font-size: .76rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .35rem .7rem;
  border-radius: 999px;
  cursor: pointer;
  margin-top: .5rem;
  align-self: flex-start;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
.tile-method-pill:hover,
.tile-method-pill:focus-visible {
  border-color: var(--gold);
  color: var(--gold);
  background: #fcfaf2;
  outline: none;
}

/* Category badges */
.category-badge {
  align-self: flex-start;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: .3rem .55rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.category-badge.imaging     { color: #1e4f87; background: #e3edf7; border-color: #c9dcec; }
.category-badge.clinical    { color: #1f6b41; background: #e3f3ea; border-color: #c6e0d0; }
.category-badge.operational { color: #95571a; background: #fbe9d0; border-color: #ecd0a8; }
.category-badge.pharmacy    { color: #5a3a8a; background: #ebe4f5; border-color: #d2c4e6; }
.category-badge.lab         { color: #1c6d6d; background: #d8efef; border-color: #bbdcdc; }
.category-badge.population  { color: #393d8a; background: #e1e3f3; border-color: #c4c8e2; }
.category-badge.specialized { color: #993060; background: #f4dbe6; border-color: #e6c1d2; }

/* Discovery pane */
.discovery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 1.6rem;
}
@media (max-width: 920px) { .discovery-grid { grid-template-columns: 1fr; } }
.discovery-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem 1.5rem 1.55rem;
  display: flex; flex-direction: column; gap: .5rem;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.discovery-card:hover { border-color: var(--gold); transform: translateY(-2px); box-shadow: var(--shadow); }
.discovery-card h3 {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  color: var(--navy);
  margin: 0;
}
.discovery-card p {
  font-size: .92rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0;
}
.overview-kicker {
  font-size: .68rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.pane-quicklinks {
  display: flex; flex-wrap: wrap; gap: 1.4rem;
  margin: 1.4rem 0 0;
  font-size: .92rem;
}
.quicklink {
  font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.quicklink:hover { color: var(--gold); }

/* Pre-print pane */
.preprint-list {
  display: flex; flex-direction: column;
  gap: 1.2rem;
  margin-bottom: 1.4rem;
}
.preprint {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem clamp(1.3rem, 2.5vw, 2rem);
  transition: border-color .2s, box-shadow .2s;
}
.preprint:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.preprint-meta {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: .55rem;
  margin-bottom: .8rem;
  font-size: .8rem;
  color: var(--text-muted);
}
.preprint-meta .dot { color: var(--text-faint); }
.preprint-status {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .25rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase;
}
.preprint-status.status-preprint { background: var(--sky); color: var(--navy); }

.preprint h3 {
  font-family: var(--ff-serif);
  font-size: clamp(1.15rem, 2vw, 1.45rem);
  color: var(--navy);
  margin: 0 0 .7rem;
  line-height: 1.3;
}
.preprint-key {
  font-size: .96rem;
  color: var(--text-body);
  line-height: 1.6;
  margin: 0 0 .9rem;
  padding: .8rem 1rem;
  border-left: 3px solid var(--gold);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
}
.preprint-key strong { color: var(--navy); }
.preprint-link {
  font-size: .85rem; font-weight: 600;
  color: var(--navy);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.preprint-link:hover { color: var(--gold); }

.preprint-note {
  font-size: .9rem;
  color: var(--text-muted);
  margin-bottom: 0;
}
.preprint-note a { font-weight: 600; color: var(--navy); text-decoration: underline; text-underline-offset: 2px; }
.preprint-note a:hover { color: var(--gold); }

/* Pane CTA, repeated at bottom of every pane */
.pane-cta {
  margin-top: clamp(2rem, 4vw, 3rem);
  padding: clamp(1.6rem, 3vw, 2.2rem);
  background: linear-gradient(180deg, #fcfaf2 0%, var(--white) 60%);
  border: 1px solid var(--border);
  border-left: 4px solid var(--gold);
  border-radius: var(--radius);
}
.pane-cta h3 {
  font-family: var(--ff-serif);
  font-size: clamp(1.2rem, 2vw, 1.55rem);
  color: var(--navy);
  margin: 0 0 .5rem;
  max-width: 36ch;
}
.pane-cta p {
  color: var(--text-body);
  margin: 0 0 1.2rem;
  max-width: 64ch;
  line-height: 1.6;
}

/* Contact modal */
.contact-modal {
  position: fixed; inset: 0;
  background: rgba(12,27,46,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 2rem);
  z-index: 100;
}
.contact-modal[hidden] { display: none; }
.contact-modal-card {
  position: relative;
  width: 100%; max-width: 540px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.6rem, 4vw, 2.4rem);
}
.contact-modal-card h2 {
  font-family: var(--ff-serif);
  font-size: 1.55rem;
  color: var(--navy);
  margin: .25rem 0 .5rem;
}
.contact-modal-lede {
  font-size: .92rem;
  color: var(--text-body);
  margin-bottom: 1.2rem;
}
.contact-modal-close {
  position: absolute; top: .8rem; right: .8rem;
  background: none; border: 0;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.contact-modal-close:hover { color: var(--navy); background: var(--gray-soft); }

.contact-form { display: flex; flex-direction: column; gap: .9rem; }
.contact-field { display: flex; flex-direction: column; gap: .3rem; }
.contact-field > span {
  font-size: .72rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
}
.contact-field input,
.contact-field select,
.contact-field textarea {
  font: inherit;
  font-size: .95rem;
  padding: .6rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text);
  min-height: 42px;
}
.contact-field textarea { min-height: 110px; resize: vertical; }
.contact-field input:focus,
.contact-field select:focus,
.contact-field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(27,58,92,.12);
}
.contact-row {
  display: flex; gap: .6rem; justify-content: flex-end;
  margin-top: .3rem;
}
.contact-note {
  min-height: 1.2rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.contact-note.is-error   { color: var(--red); }
.contact-note.is-success { color: var(--green); font-weight: 600; }

/* Methodology modal (text-first detail, opened by the "Methodology →" pill) */
.method-modal {
  position: fixed; inset: 0;
  background: rgba(12,27,46,.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.method-modal[hidden] { display: none; }
.method-modal-card {
  position: relative;
  width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 3.5vw, 1.9rem);
}
.method-modal-close {
  position: absolute; top: .6rem; right: .6rem;
  background: none; border: 0; cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
}
.method-modal-close:hover { color: var(--navy); background: var(--gray-soft); }

.method-modal-eyebrow {
  font-size: .68rem;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  margin-bottom: .4rem;
}
.method-modal-card h3 {
  font-family: var(--ff-serif);
  font-size: 1.4rem;
  color: var(--navy);
  margin: 0 0 .35rem;
  line-height: 1.25;
}
.method-modal-tool {
  font-size: .85rem;
  color: var(--text-muted);
  font-style: italic;
  margin: 0 0 1rem;
}
.method-modal-claim {
  font-size: .92rem;
  color: var(--text);
  line-height: 1.55;
  margin: 0 0 .9rem;
  padding: .7rem .9rem;
  border-left: 3px solid var(--gold);
  background: var(--bg-panel);
  border-radius: var(--radius-sm);
  font-weight: 500;
}
.method-modal-blurb {
  font-size: .92rem;
  color: var(--text-body);
  line-height: 1.65;
  margin: 0 0 1rem;
}
.method-modal-cite {
  font-size: .82rem;
  color: var(--text-muted);
  margin: 0 0 1.2rem;
  border-top: 1px solid var(--border-soft);
  padding-top: .8rem;
}
.method-modal-cite a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}
.method-modal-cite a:hover { color: var(--gold); }
.method-modal-actions {
  display: flex; flex-wrap: wrap;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: .4rem;
}

/* Video modal (lightbox) */
.video-modal {
  position: fixed; inset: 0;
  background: rgba(12,27,46,.78);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 200;
  display: flex; align-items: center; justify-content: center;
  padding: clamp(1rem, 4vw, 2.5rem);
}
.video-modal[hidden] { display: none; }
.video-modal-card {
  position: relative;
  width: 100%;
  max-width: 920px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.video-modal-close {
  position: absolute; top: .6rem; right: .6rem;
  z-index: 2;
  background: rgba(255,255,255,.92);
  border: 0; border-radius: 50%;
  width: 36px; height: 36px;
  cursor: pointer;
  color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.video-modal-close:hover { background: var(--white); color: var(--navy); }
.video-modal-frame {
  background: var(--navy-deep);
  aspect-ratio: 16 / 9;
}
.video-modal-frame video {
  display: block;
  width: 100%; height: 100%;
}
.video-modal-meta {
  padding: 1rem 1.4rem 1.2rem;
}
.video-modal-meta h3 {
  font-family: var(--ff-serif);
  font-size: 1.2rem;
  color: var(--navy);
  margin: 0 0 .35rem;
}

@media (prefers-reduced-motion: reduce) {
  .modality-tile, .filter-btn, .tool-card, .discovery-card { transition: none; }
  .modality-tile:hover, .tool-card:hover, .discovery-card:hover { transform: none; }
}
