/* PID2Portal landing page. Layout on top of the SURF Design System: colours, type,
   spacing and radii only through its tokens, so light and dark both work. */

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  background: var(--bg-1);
  color: var(--fg-1);
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  overflow-x: hidden;
}
main { padding-block-start: 0; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: var(--weight-xbold);
  letter-spacing: var(--tracking-tight);
  line-height: var(--lh-tight);
  color: var(--fg-1);
  text-wrap: balance;
}
h1 { font-size: clamp(40px, 5.6vw, 72px); font-weight: 900; margin: var(--space-3) 0 var(--space-5); }
h2 { font-size: var(--fs-h2); margin: 0 0 var(--space-4); }
h3 { font-size: var(--fs-h4); margin: 0 0 var(--space-3); }
h4 { font-size: var(--fs-h6); margin: var(--space-5) 0 var(--space-2); text-transform: uppercase; letter-spacing: var(--tracking-wide); color: var(--fg-accent-strong); }
p { margin: 0 0 var(--space-4); }
a { color: var(--fg-accent-strong); text-underline-offset: 3px; }
a:hover { color: var(--fg-accent); }
:focus-visible { outline: 2px solid var(--surf-orange); outline-offset: 2px; }
code { font-family: var(--font-mono); font-size: 0.9em; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 var(--space-6); }
@media (max-width: 640px) { .wrap { padding: 0 var(--space-4); } }

.skip { position: absolute; left: -9999px; top: 0; }
.skip:focus { left: var(--space-4); top: var(--space-4); z-index: 100; background: var(--bg-1); padding: var(--space-2) var(--space-3); }

.eyebrow {
  font-size: var(--fs-caption);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--fg-accent-strong);
  margin: 0 0 var(--space-3);
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg-1);
  border-bottom: 1px solid var(--border-2);
}
.topbar-inner {
  max-width: 1200px; margin: 0 auto; padding: var(--space-3) var(--space-6);
  display: flex; align-items: center; gap: var(--space-5);
}
.brand { display: flex; align-items: center; gap: var(--space-3); text-decoration: none; color: var(--fg-1); flex-shrink: 0; }
.brand:hover { color: var(--fg-1); }
.logo { height: 40px; width: auto; display: block; }
.logo-dark { display: none; height: 26px; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }
.brand-name { font-family: var(--font-display); font-weight: 900; font-size: 20px; letter-spacing: var(--tracking-tight); }

.nav { display: flex; gap: var(--space-1); margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  white-space: nowrap; text-decoration: none; color: var(--fg-2);
  font-weight: var(--weight-semibold); font-size: var(--fs-body-sm);
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-sm);
}
.nav a:hover { color: var(--fg-1); background: var(--bg-2); }
.nav a[aria-current] { color: var(--fg-accent-strong); background: var(--bg-accent-soft); }

@media (max-width: 960px) {
  .topbar-inner { flex-wrap: wrap; padding: var(--space-2) var(--space-4); gap: var(--space-2) var(--space-4); }
  .brand { margin-right: auto; }
  .nav { order: 3; width: 100%; margin: 0 calc(-1 * var(--space-3)); }
  .logo { height: 32px; }
}

/* ---------- sections ---------- */
.section { padding: var(--space-9) 0; }
.section + .section { border-top: 1px solid var(--border-2); }
.section-head { max-width: 760px; margin-bottom: var(--space-7); }
.section-head > p { color: var(--fg-2); font-size: var(--fs-body-lg); }
/* template title: thin orange bar before the title */
.section-head h2 { padding-left: var(--space-4); border-left: 5px solid var(--surf-orange); }
.section-head .eyebrow { padding-left: calc(var(--space-4) + 5px); }
.loading { padding: var(--space-9) var(--space-6); color: var(--fg-3); text-align: center; }
@media (max-width: 640px) { .section { padding: var(--space-8) 0; } }

/* buttons rendered from link lists */
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: auto; padding-top: var(--space-3); }
.actions .button { white-space: normal; text-align: left; text-decoration: none; color: var(--fg-on-accent); }
.actions .button:hover { color: var(--fg-on-accent); }
.actions .button.outline { background: transparent; color: var(--fg-1); border-color: var(--border-1); }
.actions .button.outline:hover { border-color: var(--surf-orange); color: var(--fg-1); }
.actions .arrow { font-weight: var(--weight-bold); }

/* ---------- hero ---------- */
.layout-hero { padding-top: var(--space-8); padding-bottom: var(--space-8); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: var(--space-8); align-items: center; }
.hero-text > p:not(.eyebrow) { font-size: 21px; color: var(--fg-2); max-width: 36em; }
/* two-colour title, as on the headers: the emphasised part in orange */
.hero-text h1 em { font-style: normal; color: var(--surf-orange); }
.hero-text h1 { font-size: clamp(38px, 4.3vw, 62px); text-wrap: initial; }
.hero-text .actions { padding-top: var(--space-4); }
.hero-text .actions .button { padding: var(--space-3) var(--space-5); font-size: var(--fs-body); }
.hero-visual { position: relative; padding-bottom: 18%; }
.hero-visual .frame-b { position: absolute; width: 62%; right: -4%; bottom: 0; }
.hero-visual .frame-a { width: 92%; position: relative; z-index: 1; margin-top: 6%; margin-left: 4%; }
.hero-visual .frame-b { z-index: 2; }
/* template cover: coloured rounded blocks behind the screenshots */
.hero-visual .blk { position: absolute; border-radius: var(--radius-lg); z-index: 0; }
.blk-orange { left: 0; top: 0; width: 42%; height: 40%; background: var(--surf-orange); }
.blk-yellow { right: 2%; top: -6%; width: 30%; height: 22%; background: var(--surf-yellow); }
.blk-green  { left: 10%; bottom: 2%; width: 34%; height: 22%; background: var(--surf-green-dark); }
.blk-peach  { right: -3%; bottom: 26%; width: 18%; height: 34%; background: var(--surf-orange-100); }
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; gap: var(--space-7); }
  .hero-visual .frame-b { right: 0; }
}

/* the SURF basiskader: thick rounded frame */
.frame {
  margin: 0;
  border: var(--border-thick) solid var(--fg-1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-1);
}
.frame img { display: block; width: 100%; height: auto; }

/* ---------- stats ---------- */
.layout-stats { background: var(--bg-inverse); color: var(--fg-inverse); padding: var(--space-7) 0; border-top: 0; }
.layout-stats + .section { border-top: 0; }
.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-5); }
.stat { display: flex; flex-direction: column; gap: var(--space-1); padding-left: var(--space-4); border-left: var(--border-thick) solid var(--surf-orange); }
.stat-value { font-family: var(--font-display); font-weight: 900; font-size: clamp(30px, 3.2vw, 42px); line-height: 1.1; color: var(--fg-inverse); }
.stat-label { font-size: var(--fs-body-sm); opacity: 0.85; }

/* ---------- cards ---------- */
.card-grid { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--space-5); }
.layout-cards#about .card-grid { --cols: 2; }
@media (max-width: 1040px) { .card-grid { --cols: 2 !important; } }
@media (min-width: 1041px) and (max-width: 1180px) { #stories .card-grid { --cols: 3 !important; } }
@media (max-width: 680px)  { .card-grid { --cols: 1 !important; } }

.card.deliverable {
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-1);
  box-shadow: none;
  background: var(--bg-1);
  transition: border-color .2s ease-out, transform .2s ease-out;
}
.card.deliverable:hover { border-color: var(--surf-orange); }
.card-media { margin: 0; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-2); border-bottom: 1px solid var(--border-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top left; display: block; }
.card-body { display: flex; flex-direction: column; flex: 1; padding: var(--space-5) var(--space-5) var(--space-5); }
.card-body > p { color: var(--fg-2); }
.card-body ul { padding-left: 1.2em; color: var(--fg-2); margin: 0 0 var(--space-4); }
.card-body li { margin-bottom: var(--space-2); }
.card-body li::marker { color: var(--surf-orange); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); min-height: 40px; }
.card-media-icon { display: grid; place-items: center; background: var(--bg-accent-soft); }
.card-media-icon img.pictogram-lg { width: 112px; height: 112px; object-fit: contain; }
.pictogram { width: 48px; height: 48px; object-fit: contain; }
[data-theme="dark"] .pictogram { filter: invert(1); }
.card-date { font-size: var(--fs-caption); font-weight: var(--weight-semibold); color: var(--fg-3); letter-spacing: var(--tracking-wide); text-transform: uppercase; }
#stories .card-body { padding: var(--space-4); }
#stories .card-body h3 { font-size: var(--fs-h6); }
#stories .card-body > p { font-size: var(--fs-body-sm); }
#stories .card-top { min-height: 0; margin-bottom: var(--space-3); }
.card-number { font-family: var(--font-display); font-weight: 900; font-size: 56px; line-height: 1; color: var(--surf-orange); }

.tags { display: flex; flex-wrap: wrap; gap: var(--space-1); justify-content: flex-end; }
.tag { font-size: 12px; font-weight: var(--weight-semibold); padding: 2px 10px; border-radius: var(--radius-pill); white-space: nowrap; }
.tone-orange { background: var(--tone-orange-bg); color: var(--tone-orange-fg); }
.tone-blue   { background: var(--tone-blue-bg);   color: var(--tone-blue-fg); }
.tone-green  { background: var(--tone-green-bg);  color: var(--tone-green-fg); }
.tone-purple { background: var(--tone-purple-bg); color: var(--tone-purple-fg); }

/* the two objective cards in "About" */
#about .section-head { max-width: 820px; }
#about .card-body { padding: var(--space-6); }
#about .card-body h3 { font-size: var(--fs-h3); }

/* ---------- features (key results) ---------- */
.layout-features { background: var(--tone-orange-bg); }
#next { background: var(--tone-yellow-bg); }
#next .card.deliverable { border-color: transparent; }
#poster { background: var(--bg-1); }
#poster .feature-media img { max-height: 620px; object-fit: cover; object-position: top; }
.layout-features + .section, #next + .section, .layout-statement + .section { border-top: 0; }

/* ---------- statement (template: purple ambition slide) ---------- */
.layout-statement { background: var(--surf-purple); color: #fff; padding: var(--space-8) 0; border-top: 0 !important; }
.statement { max-width: 900px; margin: 0 auto; text-align: center; }
.statement-label { display: flex; align-items: center; justify-content: center; gap: var(--space-5); font-size: var(--fs-caption); font-weight: var(--weight-bold); letter-spacing: .1em; text-transform: uppercase; margin: 0 0 var(--space-5); }
.statement-label::before, .statement-label::after { content: ""; width: min(160px, 18vw); height: 1px; background: currentColor; opacity: .8; }
.statement-text { font-family: var(--font-display); font-weight: 800; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; color: #fff; margin: 0; text-wrap: balance; }

/* ---------- timeline (template: line with coloured year pills) ---------- */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(var(--n, 8), minmax(0, 1fr)); position: relative; }
.timeline::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--border-1); }
.tl-item { position: relative; text-align: center; padding: 0 var(--space-2); }
.tl-pill { display: inline-block; position: relative; font-family: var(--font-display); font-weight: 800; font-size: 15px; line-height: 1; padding: 12px 12px; border-radius: var(--radius-sm); color: #fff; white-space: nowrap; }
.tl-item:nth-child(5n+1) .tl-pill { background: var(--surf-orange); color: #000; }
.tl-item:nth-child(5n+2) .tl-pill { background: var(--surf-yellow); color: #000; }
.tl-item:nth-child(5n+3) .tl-pill { background: var(--surf-blue); }
.tl-item:nth-child(5n+4) .tl-pill { background: var(--surf-green-dark); }
.tl-item:nth-child(5n+5) .tl-pill { background: var(--surf-purple); }
.tl-text { display: block; margin-top: var(--space-3); font-size: var(--fs-body-sm); color: var(--fg-2); line-height: 1.4; }
@media (max-width: 900px) {
  .timeline { grid-template-columns: 1fr; gap: var(--space-4); padding-left: var(--space-2); }
  .timeline::before { left: 50px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; }
  .tl-item { display: grid; grid-template-columns: 96px 1fr; align-items: center; text-align: left; gap: var(--space-4); padding: 0; }
  .tl-pill { justify-self: center; }
  .tl-text { margin: 0; }
}
.feature { display: grid; grid-template-columns: 1.25fr 1fr; gap: var(--space-8); align-items: center; }
.feature + .feature { margin-top: var(--space-9); }
.feature.flip .feature-media { order: 2; }
.feature-text h3 { font-size: var(--fs-h2); margin: var(--space-3) 0 var(--space-4); }
.feature-text p { color: var(--fg-2); font-size: var(--fs-body-lg); }
.feature-text p strong { color: var(--fg-1); }
.feature-text .tags { justify-content: flex-start; }
.feature-media { box-shadow: var(--shadow-md); }
@media (max-width: 900px) {
  .feature { grid-template-columns: 1fr; gap: var(--space-5); }
  .feature.flip .feature-media { order: 0; }
  .feature + .feature { margin-top: var(--space-8); }
}

/* ---------- media (video) ---------- */
.media-grid { display: grid; grid-template-columns: 1fr 1.35fr; gap: var(--space-8); align-items: center; }
.media-grid .section-head { margin-bottom: 0; }
.video-frame { box-shadow: var(--shadow-md); }
.video { position: relative; aspect-ratio: 16 / 9; background: #000; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
@media (max-width: 900px) { .media-grid { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ---------- band (call to action) ---------- */
.layout-band { border-top: 0 !important; }
.band-box {
  background: var(--surf-orange);
  color: #000;
  border-radius: var(--radius-xl);
  padding: var(--space-8);
  position: relative; overflow: hidden;
}
.band-box .section-head { max-width: 820px; margin: 0; }
.band-box .eyebrow, .band-box h2, .band-box .section-head > p { color: #000; }
.band-box .actions .button { background: #000; color: #fff; border-color: #000; }
.band-box .actions .button:hover { background: #262626; }
.band-box .actions .button.outline { background: transparent; color: #000; border: 2px solid #000; }
.band-box .actions .button.outline:hover { background: rgba(0, 0, 0, 0.08); }
@media (max-width: 640px) { .band-box { padding: var(--space-6) var(--space-5); border-radius: var(--radius-lg); } }

/* ---------- prose ---------- */
.prose { max-width: 760px; }
/* acknowledgements: people with ORCID icon and institution (ROR) */
.layout-prose .section-head { max-width: 860px; margin-bottom: 0; }
.layout-prose h3 { margin-top: var(--space-6); }
.layout-prose ul { padding-left: 1.2em; margin: 0; }
.layout-prose li { margin-bottom: var(--space-3); color: var(--fg-2); }
.layout-prose li::marker { color: var(--surf-orange); }
.layout-prose li strong { color: var(--fg-1); }
/* commons: highlighted quote */
.layout-prose blockquote { margin: var(--space-5) 0; padding: var(--space-4) var(--space-5); border-left: 5px solid var(--surf-orange); background: var(--bg-accent-soft); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.layout-prose blockquote p { margin: 0; font-style: normal; font-family: var(--font-display); font-weight: 700; font-size: clamp(18px, 1.8vw, 22px); line-height: 1.35; color: var(--fg-1); }
#commons { background: var(--bg-2); }
/* collapsible "read more" block: Oat styles <details> as an accordion; only tune colour and spacing */
details.more { margin-top: var(--space-4); background: var(--bg-1); }
details.more > summary { font-weight: var(--weight-bold); color: var(--fg-accent-strong); text-align: left; justify-content: space-between; }
a.orcid { display: inline-block; vertical-align: -2px; margin: 0 2px 0 4px; line-height: 0; }
a.orcid img { width: 16px; height: 16px; display: block; }

/* ---------- footer ---------- */
.site-footer { background: #000; color: #d4d4d4; padding: var(--space-8) 0; margin-top: var(--space-8); }
.footer-inner { display: grid; grid-template-columns: auto 1fr; gap: var(--space-7); align-items: start; }
.footer-logo { height: 34px; width: auto; }
.footer-text { font-size: var(--fs-body-sm); max-width: 760px; }
.footer-text strong { color: #fff; }
.footer-text a { color: var(--surf-orange-300); }
.footer-text a:hover { color: #fff; }
@media (max-width: 640px) { .footer-inner { grid-template-columns: 1fr; gap: var(--space-5); } }
