/* Full-site extension of the approved prototype. Hero and Research styles stay in prototype.css. */
#research { background: var(--color-paper); }
h1, h2, h3, .member .name, .pub .title { color: var(--text-primary); }
:is(#research, #videos, #team, #opportunities, #publications, #journey, #tools) .section-head .mono { font: 400 16px/1.5 var(--font-display); color: var(--text-secondary); }
main > section:not(#research) { padding-block: var(--space-3xl); }
section:where(:not(#research):not(#journey)) .section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-lg); margin-bottom: var(--space-xl); }
section:where(:not(#research):not(#journey)) h2, #journey h2 { font-size: clamp(36px, 4.3vw, 60px); font-weight: 500; line-height: 1.1; letter-spacing: -.035em; }
section:where(:not(#research):not(#journey)) a:focus-visible, footer a:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Scientific media: a reading column beside the original, fully functional player. */
#videos { background: var(--color-paper-2); color: var(--text-primary); }
#videos > .container { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.65fr); column-gap: var(--space-2xl); align-content: start; }
#videos .section-head { grid-column: 1; grid-row: 1; display: flex; flex-direction: column-reverse; align-items: start; gap: var(--space-lg); margin-bottom: var(--space-lg); }
#videos .section-head h2 { font-size: clamp(32px, 3vw, 44px); }
.video-wrap { grid-column: 2; grid-row: 1 / span 3; aspect-ratio: 16 / 9; align-self: start; background: #000; }
.video-wrap iframe { display: block; width: 100%; height: 100%; border: 0; }
.video-wrap:focus-within { outline: 2px solid var(--color-accent); outline-offset: 4px; }
.video-note { grid-column: 1; grid-row: 2; color: var(--text-body); font-size: 17px; line-height: 1.6; }
.video-links { grid-column: 1; grid-row: 3; display: flex; flex-direction: column; align-items: start; margin-top: var(--space-md); }
.video-link { display: inline-flex; align-items: center; min-height: 44px; padding-block: var(--space-xs); font: 400 14px/1.5 var(--font-display); color: var(--text-link); }
.video-link:hover { color: var(--text-link-hover); }

/* Useful resources, presented as open entries rather than feature cards. */
#tools { background: var(--color-paper-2); }
#tools > .container { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.65fr); gap: var(--space-2xl); }
#tools .section-head { display: block; margin: 0; }
#tools .section-head .mono { display: block; margin-top: var(--space-md); }
#tools .tool-card + .tool-card { margin-top: var(--space-2xl); }
#tools .tool-card h3 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.18; font-weight: 500; letter-spacing: -.025em; margin-bottom: var(--space-lg); }
#tools .tool-card p { font-size: 20px; line-height: 1.65; color: var(--text-body); max-width: 60ch; }
#tools .btn, #publications .btn { background: transparent; color: var(--text-link); padding: var(--space-xs) 0; justify-content: start; text-decoration: underline; }
#tools .btn:hover, #publications .btn:hover { color: var(--text-link-hover); }

/* Portraits and roles form a quiet people index, with the original images in colour. */
#team { background: var(--color-paper); }
.team-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-lg); }
.member { min-width: 0; }
.avatar { aspect-ratio: 4 / 5; overflow: hidden; margin-bottom: var(--space-lg); background: var(--color-paper-2); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.member .name { font: 500 23px/1.25 var(--font-display); letter-spacing: -.02em; }
.member .role { font-size: 16px; line-height: 1.5; margin-top: var(--space-xs); color: var(--text-secondary); }

/* Bibliography: full citations, a serif title, and a small DOI action on a ruled row. */
#publications { background: var(--color-paper-2); }
.pub { display: grid; grid-template-columns: minmax(0, 1fr) 56px; column-gap: var(--space-lg); padding-block: var(--space-lg); border-top: 1px solid var(--color-rule); scroll-margin-top: var(--space-xl); }
.pub:last-child { border-bottom: 1px solid var(--color-rule); }
.pub .venue { grid-column: 1; font: 500 14px/1.5 var(--font-display); color: var(--text-secondary); }
/* Gold identifies publication venues; dates/status remain secondary metadata. */
.pub .venue-name { color: var(--text-highlight); font-weight: 600; }
.pub .venue-separator { padding-inline: var(--space-2xs); color: var(--text-secondary); }
.pub .title { grid-column: 1; margin-block: var(--space-xs); font-size: 23px; line-height: 1.35; max-width: 75ch; }
.pub .authors { grid-column: 1; font-size: 16px; line-height: 1.6; color: var(--text-body); max-width: 110ch; }
.pub .authors strong { font-weight: 600; color: var(--text-primary); }
.pub-link { grid-column: 2; grid-row: 1 / span 3; align-self: start; justify-self: end; display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; color: var(--text-link); font: 500 14px/1.5 var(--font-display); }
.pub-link:hover { color: var(--text-link-hover); }
/* Shared size for secondary actions; primary contact and venue metadata keep their sizes. */
#research .research-toggle, .video-link, .pub-link, #tools .btn, #publications .btn { font-size: 15px; }
.pub:target { outline: 2px solid var(--color-accent); outline-offset: var(--space-xs); }

/* Open recruitment entries use the existing editorial grid, type and neutral roles. */
#opportunities { background: var(--color-paper); }
.opportunity { display: grid; grid-template-columns: minmax(0, .8fr) minmax(0, 1.65fr); gap: var(--space-2xl); padding-top: var(--space-xl); border-top: 1px solid var(--color-rule); }
.opportunity + .opportunity { margin-top: var(--space-xl); }
.opportunity-meta { font: 400 16px/1.55 var(--font-display); color: var(--text-body); }
.opportunity-kind { color: var(--text-primary); font-weight: 500; }
.opportunity-status { color: var(--text-secondary); margin-top: var(--space-xs); }
.opportunity-meta dl { margin: var(--space-lg) 0 0; }
.opportunity-meta dt { margin-top: var(--space-md); color: var(--text-secondary); }
.opportunity-meta dd { margin: var(--space-2xs) 0 0; }
.opportunity-description h3 { font-size: clamp(28px, 2.6vw, 36px); line-height: 1.18; font-weight: 500; letter-spacing: -.025em; margin-bottom: var(--space-lg); }
.opportunity-summary { font-size: 20px; line-height: 1.65; color: var(--text-body); max-width: 60ch; }
.opportunity-eligibility { margin-top: var(--space-lg); font: 400 16px/1.55 var(--font-display); color: var(--text-secondary); }
.opportunity-actions { display: flex; flex-wrap: wrap; gap: 0 24px; }
/* Share the current Journey external-action treatment, without changing its appearance. */
:is(#journey .journey-memory, #opportunities .opportunity-actions) a { display: inline-block; margin-top: 20px; padding: 0; border: 0; background: transparent; font: 400 14px/1.65 var(--font-display); color: var(--accent); text-decoration: none; text-underline-offset: auto; }
:is(#journey .journey-memory, #opportunities .opportunity-actions) a:hover { color: var(--text-link-hover); text-decoration: underline; text-underline-offset: 4px; }
#opportunities .opportunity[data-status="closed"] .opportunity-apply { display: none; }

/* Warm light framing; existing tunnel geometry and motion remain in journey.css. */
#journey { --bg: var(--color-paper); --journey-light: var(--color-accent); background: var(--color-paper); color: var(--text-primary); }
#journey .section-head { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-xl); margin-bottom: var(--space-xl); }
#journey .section-head > .mono { grid-column: 1 / -1; margin-bottom: var(--space-lg); }
#journey .journey-intro { grid-column: 2; margin-top: 0; color: var(--text-body); font-size: 20px; line-height: 1.55; align-self: end; }
#journey .journey-flow { width: calc(100vw - 56px); max-width: 1024px; margin-inline: auto; font: 400 16px/1.65 var(--font-display); color: var(--text-primary); --accent: var(--color-accent); }
/* Restore the original inherited reset and typography inside the protected component. */
:where(#journey .journey-flow) * { margin: 0; padding: 0; text-wrap: wrap; }
#journey .journey-flow h3 { font-family: var(--font-display); font-weight: 700; overflow-wrap: normal; text-wrap: wrap; }
#journey .journey-flow p { text-wrap: wrap; }
#journey .journey-flow a { text-decoration-thickness: auto; text-underline-offset: auto; }
#journey .journey-flow { caret-color: auto; }
#journey .journey-hint { font: 400 14px/1.65 var(--font-display); color: var(--text-secondary); }

/* Bronze shadow, amber filaments and a travelling gold light retain the layered depth. */
#journey .journey-flow::before { background: radial-gradient(ellipse at 53% 55%, #a77e3930, transparent 64%); }
#journey #journey-light stop:nth-child(1) { stop-color: #76603a; }
#journey #journey-light stop:nth-child(2) { stop-color: #77521e; }
#journey #journey-light stop:nth-child(3) { stop-color: #b58b39; }
#journey #journey-light stop:nth-child(4) { stop-color: #76603a; }
#journey .journey-filaments { filter: drop-shadow(0 5px 6px #6b4e252e); }
#journey .journey-stream-narrow > g { stroke: var(--color-accent); }
#journey .journey-haze { stroke: #987126; }
#journey .journey-current { stroke: var(--color-gold); stroke-width: 3; filter: drop-shadow(0 0 1px var(--color-accent)); }
#journey.journey-in-view .journey-current { animation-name: journey-gold-drift; animation-delay: -4s; }
/* Pale gold needs a stronger peak on paper; retain the original path and 18s cycle. */
@keyframes journey-gold-drift {
  0% { stroke-dashoffset: 80; opacity: 0; }
  12%, 80% { opacity: .95; }
  100% { stroke-dashoffset: -1000; opacity: 0; }
}
#journey .journey-label { color: var(--text-body); }
#journey .journey-node::before { background: #987126; border-color: var(--color-paper); box-shadow: 0 0 14px #b78b4285, 0 0 35px #8f6a2a40; }
#journey .journey-node::after { border-color: #80631c50; }
#journey summary:hover .journey-node::before,
#journey summary:focus-visible .journey-node::before,
#journey details[open] .journey-node::before { background: var(--color-gold); box-shadow: 0 0 20px #c39438b3, 0 0 48px #aa792c66; }
#journey summary:hover .journey-node::after,
#journey details[open] .journey-node::after { border-color: #80631c99; }
#journey .journey-memory { background: linear-gradient(115deg, #a77e3912, #a77e3903); border-top-color: #80631c50; border-left-color: #80631c24; }
#journey .journey-memory-meta { color: var(--text-secondary); }
#journey .journey-memory-meta time { color: var(--text-highlight); }
#journey .journey-memory a:hover { color: var(--text-link-hover); }
#journey .journey-memory p { color: var(--text-body); }
#journey .journey-close { color: var(--text-secondary); }
#journey .journey-photo { margin-top: var(--space-lg); max-width: 400px; }
#journey .journey-photo img { display: block; width: 100%; height: auto; }
#journey .journey-photo figcaption { margin-top: var(--space-sm); font: 400 14px/1.55 var(--font-display); color: var(--text-secondary); }

footer { padding-block: var(--space-2xl); background: var(--color-paper); color: var(--text-secondary); border-top: 1px solid var(--color-rule); }
footer .footer-quote { padding-bottom: var(--space-xl); margin-bottom: var(--space-xl); border-bottom: 1px solid var(--color-rule); }
.quote-cn { color: var(--color-gold); font-family: var(--font-body), 'PingFang SC', 'Microsoft YaHei', serif; font-size: clamp(17px, 1.65vw, 22px); letter-spacing: .03em; }
.quote-source { margin-top: var(--space-md); font-size: 16px; }
footer .container:not(.footer-quote) { font: 400 14px/1.7 var(--font-display); }
footer .container:not(.footer-quote) p { max-width: none; }
footer .container:not(.footer-quote) p + p { margin-top: var(--space-sm); }
footer a { color: var(--text-link); }
footer a:hover { color: var(--text-link-hover); }

@media (max-width: 960px) {
  #videos > .container { grid-template-columns: minmax(0, 1fr); }
  #videos .section-head { display: flex; flex-direction: row; align-items: baseline; justify-content: space-between; gap: var(--space-lg); }
  #videos .section-head h2 { font-size: clamp(36px, 4.3vw, 60px); }
  .video-wrap { grid-column: 1; grid-row: 2; }
  .video-note { grid-row: 3; margin-top: var(--space-lg); max-width: 75ch; }
  .video-links { grid-row: 4; flex-direction: row; gap: var(--space-lg); flex-wrap: wrap; }
  #tools > .container { grid-template-columns: minmax(0, 1fr) minmax(0, 1.65fr); gap: var(--space-xl); }
  .team-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--space-xl); }
}
@media (max-width: 600px) {
  .opportunity { grid-template-columns: minmax(0, 1fr); gap: var(--space-lg); padding-top: var(--space-lg); }
  .opportunity-summary { font-size: 18px; }
  main > section:not(#research) { padding-block: var(--space-2xl); }
  section:where(:not(#research):not(#journey)) .section-head, #videos .section-head { display: block; margin-bottom: var(--space-lg); }
  section:where(:not(#research):not(#journey)) .section-head .mono { display: block; margin-top: var(--space-md); }
    .video-note { font-size: 17px; }
  .video-links { flex-direction: column; gap: 0; }
  #tools > .container { display: block; }
  #tools .tool-card { margin-top: var(--space-xl); }
  #tools .tool-card p { font-size: 18px; }
  .team-grid { gap: var(--space-xl) var(--space-md); }
  .avatar { margin-bottom: var(--space-md); }
  .member .name { font-size: 20px; }
  .member .role { font-size: 15px; }
  .pub { column-gap: var(--space-xs); padding-block: var(--space-lg); }
  .pub .venue { align-self: center; }
  .pub .title, .pub .authors { grid-column: 1 / -1; }
  .pub .title { font-size: 21px; }
  .pub .authors { font-size: 15px; }
  .pub-link { grid-row: 1; }
  #journey .section-head { display: block; }
  #journey .section-head > .mono { display: block; }
  #journey .journey-intro { margin-top: var(--space-lg); font-size: 18px; }
  footer { padding-block: var(--space-xl); }
}
