/*
 * research.css
 * Page-specific styles for research.html. Loaded after style.css.
 * Everything is prefixed .rs- so it cannot leak into other pages.
 */

/* ---- Design tokens for the engineering figures ------------------------ */
.rs-fig {
  --f-bg: #0c1a28;  --f-ink: #e8eff5;  --f-mute: #9db0c0;  --f-line: #7e93a5;
  --f-th: #ef7d57;  --f-hy: #4aa3e8;   --f-me: #e0b04a;
  --f-s1: #4a4036;  --f-s2: #2f4a5c;   --f-s3: #3a3f46;
  --rs-border: rgba(127, 147, 165, .35);
  --rs-accent: #5aa9e6;
  margin: 0 0 1.75rem;
}
[data-theme="light"] .rs-fig {
  --f-bg: #f6f9fc;  --f-ink: #0f2233;  --f-mute: #465a6d;  --f-line: #566b7e;
  --f-th: #bf4416;  --f-hy: #12669f;   --f-me: #8a5d00;
  --f-s1: #e6dccf;  --f-s2: #cfe3f0;   --f-s3: #dde2e7;
  --rs-accent: #12669f;
}

/* ---- Page navigation -------------------------------------------------- */
.rs-toc { display: flex; flex-wrap: wrap; gap: .5rem 1.1rem; margin: 1.6rem 0 0; padding: 0; list-style: none; }
.rs-toc a { font-size: .92rem; text-decoration: none; border-bottom: 1px solid currentColor; opacity: .85; }
.rs-toc a:is(:hover, :focus-visible) { opacity: 1; }

/* ---- Research areas --------------------------------------------------- */
.rs-area { scroll-margin-top: 5.25rem; }
.rs-h { margin: .25rem 0 .9rem; }
.rs-plain { max-width: 68ch; margin: 0 0 1.4rem; line-height: 1.6; opacity: .92; }
.rs-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.rs-prose p { max-width: 62ch; margin: 0 0 1em; line-height: 1.7; }
.rs-related a { font-weight: 600; }
.rs-more { max-width: 62ch; margin-top: 1.1rem; padding-top: .65rem; border-top: 1px solid var(--rs-border); }
.rs-more summary { cursor: pointer; font-weight: 600; }
.rs-more p { margin: .65rem 0 0; }
abbr[title] { text-decoration: underline dotted; text-underline-offset: 3px; cursor: help; }

/* ---- Figures ---------------------------------------------------------- */
.rs-fig__frame { overflow-x: auto; border: 1px solid var(--rs-border); border-radius: 6px; -webkit-overflow-scrolling: touch; }
.rs-fig__frame :is(img, svg) { display: block; width: 100%; min-width: 640px; height: auto; }
.rs-fig figcaption { max-width: 70ch; margin-top: .65rem; font-size: .9rem; line-height: 1.55; opacity: .88; }
.rs-fig__note { display: block; margin-top: .15rem; font-size: .82rem; opacity: .75; }
.rs-fig__ctrl { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.rs-fig__info { max-width: 70ch; min-height: 3.2em; margin: .65rem 0 0; font-size: .9rem; line-height: 1.55; }
.rs-btn { padding: .4rem .75rem; font: inherit; font-size: .86rem; color: inherit; background: transparent; border: 1px solid rgba(127, 147, 165, .55); border-radius: 4px; cursor: pointer; }
.rs-btn:hover { border-color: currentColor; }
.rs-btn[aria-pressed="true"] { background: rgba(90, 169, 230, .18); border-color: var(--rs-accent); }
.rs-fig svg [data-layer] { transition: opacity .2s; }
.rs-fig[data-focus] svg [data-layer] { opacity: .16; }
.rs-fig[data-focus] svg [data-layer].is-active { opacity: 1; }
.rs-fig svg [data-tip] { cursor: help; }

:where(.rs-btn, .rs-more summary, .rs-toc a, .rs-fig svg [tabindex]):focus-visible { outline: 3px solid var(--rs-accent); outline-offset: 2px; }

.rs-tip { position: fixed; z-index: 50; max-width: min(20rem, 86vw); padding: .55rem .75rem; font-size: .85rem; line-height: 1.45; color: #e8eff5; background: #0c1a28; border: 1px solid #5f7384; border-radius: 4px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); pointer-events: none; }
.rs-tip[hidden] { display: none; }

/* ---- Glossary and call to action ------------------------------------- */
.rs-gloss { display: grid; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); gap: 1.1rem 2rem; margin: 0; }
.rs-gloss dt { font-weight: 600; }
.rs-gloss dd { margin: .25rem 0 0; line-height: 1.55; opacity: .9; }
.rs-cta { max-width: 68ch; padding-top: 1.6rem; border-top: 1px solid var(--rs-border); }
.rs-cta p { line-height: 1.65; }

/* ---- Responsive / motion --------------------------------------------- */
@media (max-width: 900px) { .rs-cols { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .rs-fig svg [data-layer] { transition: none; } }
