:root {
  --paper: #f7f3ed;
  --paper-deep: #eee6db;
  --white: #fffdf9;
  --ink: #202a31;
  --ink-soft: #52606a;
  --line: #d8cfc3;
  --carmine: #9e2630;
  --teal: #196a68;
  --navy: #123e5c;
  --ochre: #c69043;
  --shadow: 0 24px 70px rgb(53 38 29 / 14%);
  --content: 92rem;
  /* The master mark has a larger transparent lower margin than upper margin. */
  --brand-mark-optical-offset: 13.25%;
  --serif: Georgia, 'Times New Roman', serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background-color: var(--paper); background-image: url('dbm-fibre-pattern.svg'); background-position: center; background-size: 28rem 21rem; font-family: var(--sans); line-height: 1.55; }
img, video { max-width: 100%; }
a { color: inherit; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--ochre); outline-offset: 4px; }
.skip-link { position: fixed; z-index: 100; top: .5rem; left: .5rem; padding: .7rem 1rem; background: var(--ink); color: white; transform: translateY(-150%); }
.skip-link:focus { transform: none; }

.site-header { position: relative; z-index: 20; border-top: 4px solid var(--carmine); border-bottom: 1px solid var(--line); background: rgb(247 243 237 / 94%); backdrop-filter: blur(12px); }
.header-inner { width: min(calc(100% - 2rem), var(--content)); min-height: 9.425rem; margin: auto; display: flex; align-items: center; gap: clamp(.9rem, 1.5vw, 1.6rem); }
.brand { display: flex; flex: 0 1 40.3rem; min-width: 0; align-items: center; gap: 1.3rem; text-decoration: none; }
.brand img { display: block; width: 8.22rem; height: auto; aspect-ratio: 1; object-fit: contain; transform: translateY(var(--brand-mark-optical-offset)); }
.brand-name { display: grid; max-width: 27.3rem; padding-left: 1.3rem; border-left: 3px solid var(--carmine); color: #000; font-size: clamp(1.222rem, 1.495vw, 1.404rem); font-weight: 800; line-height: 1.18; text-align: left; }
.brand-name > span { display: block; white-space: nowrap; }
.site-nav { margin-left: auto; }
.site-nav ul { display: flex; align-items: center; gap: clamp(.8rem, 1.3vw, 1.35rem); margin: 0; padding: 0; list-style: none; font-size: .88rem; font-weight: 720; }
.site-nav a { text-decoration: none; }
.site-nav a:hover { color: var(--carmine); }
.header-video { flex: 0 0 auto; padding: .68rem .95rem; border: 1px solid var(--carmine); border-radius: 999px; color: var(--carmine); font-size: .8rem; font-weight: 800; text-decoration: none; }
.header-video:hover { color: white; background: var(--carmine); }
.language { display: inline-grid; width: 2.4rem; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 50%; text-decoration: none; font-size: .8rem; font-weight: 800; }

.hero { position: relative; z-index: 1; min-height: calc(100svh - 7.5rem); overflow: hidden; display: grid; align-items: center; isolation: isolate; background: #eadfd4; }
.hero-media { position: absolute; z-index: -2; inset: 0; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 55% center; filter: saturate(.86) contrast(.94); }
.hero::before { position: absolute; z-index: -1; inset: 0; content: ''; background-image: url('dbm-fibre-pattern.svg'), linear-gradient(90deg, rgb(24 30 35 / 83%) 0 37%, rgb(24 30 35 / 47%) 55%, rgb(24 30 35 / 8%) 82%), linear-gradient(0deg, rgb(24 30 35 / 56%), transparent 55%); background-position: center; background-size: 28rem 21rem, auto, auto; }
.hero-copy { width: min(calc(100% - 2rem), var(--content)); margin: auto; padding: clamp(4.5rem, 9vh, 8rem) 0; color: white; }
.hero-copy > * { max-width: 48rem; }
.eyebrow { margin: 0 0 1.1rem; color: #f0c7a0; font-size: .76rem; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 500; letter-spacing: -.035em; line-height: .98; }
h1 { max-width: 13ch; font-size: clamp(3.1rem, 7.4vw, 7.4rem); }
.hero-lede { max-width: 45rem; margin: 1.8rem 0 0; color: #f5eee8; font-size: clamp(1rem, 1.7vw, 1.35rem); }
.hero-guardrail { max-width: 42rem; margin: 1rem 0 0; padding-left: 1rem; border-left: 2px solid var(--ochre); color: #ddd5ce; font-size: .92rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .8rem 1.5rem; margin-top: 2rem; }
.scroll-cue { display: inline-flex; align-items: center; gap: .75rem; color: white; font-size: .8rem; font-weight: 750; letter-spacing: .11em; text-decoration: none; text-transform: uppercase; }
.scroll-cue::before { width: 2.8rem; height: 1px; content: ''; background: var(--ochre); }
.video-cue { padding: .8rem 1.05rem; border: 1px solid rgb(255 255 255 / 62%); border-radius: 999px; color: white; font-size: .8rem; font-weight: 780; text-decoration: none; }
.video-cue:hover { border-color: var(--ochre); color: #f4c987; }

.journey { padding: clamp(4rem, 9vw, 9rem) 0; background-color: var(--white); background-image: url('dbm-fibre-pattern.svg'); background-position: center; background-size: 28rem 21rem; }
.journey-intro { width: min(calc(100% - 2rem), 68rem); margin: 0 auto clamp(4rem, 9vw, 8rem); text-align: center; }
.journey-intro h2 { font-size: clamp(2.6rem, 5vw, 5.8rem); }
.journey-intro p:last-child { max-width: 49rem; margin: 1.5rem auto 0; color: var(--ink-soft); font-size: 1.15rem; }
.journey-layout { width: min(calc(100% - 2rem), var(--content)); margin: auto; display: grid; grid-template-columns: minmax(19rem, .62fr) minmax(0, 1.38fr); gap: clamp(2rem, 5vw, 6rem); align-items: start; }
.journey-stage-wrap { position: sticky; top: 50svh; translate: 0 -50%; display: grid; grid-template-columns: .3rem minmax(0, 1fr); column-gap: 1rem; align-items: stretch; min-width: 0; }
.journey-stage-wrap { grid-column: 2; grid-row: 1; }
.journey-stage { position: relative; grid-column: 2; margin: 0; overflow: hidden; aspect-ratio: 16 / 9; min-height: 0; border-radius: 2rem 2rem 6rem 2rem; background: #eadfd3; box-shadow: var(--shadow); transition: background .5s ease; }
.journey-stage::after { position: absolute; inset: 0; content: ''; pointer-events: none; box-shadow: inset 0 0 0 1px rgb(255 255 255 / 45%); border-radius: inherit; }
.journey-stage video, .journey-stage .stage-poster, .journey-stage .stage-transition { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .35s ease, transform .75s cubic-bezier(.2,.75,.2,1), filter .35s ease; }
.journey-stage .stage-poster { display: none; }
.journey-stage .stage-transition { display: none; opacity: 0; }
.journey-stage.has-image-transition .stage-transition { display: block; }
.journey-stage.has-image-transition.is-transitioning .stage-transition { animation: tissue-remodelling 3.2s cubic-bezier(.45, 0, .2, 1) .55s forwards; }
@keyframes tissue-remodelling {
  from { opacity: 0; transform: scale(1); }
  to { opacity: 1; transform: scale(1.008); }
}
.stage-institution-lockup { position: absolute; z-index: 3; top: 0; left: 0; display: none; width: clamp(15.75rem, 27vw, 21rem); max-width: calc(100% - 1.3rem); align-items: center; gap: .825rem; padding: .675rem .9rem; border-radius: 0 0 .375rem 0; background: #fff; box-shadow: 0 1.5px 12px rgb(17 29 36 / 18%); }
.stage-institution-lockup img { display: block; height: auto; }
.stage-institution-lockup .institution-iibm { width: 36%; }
.stage-institution-lockup .institution-csic { width: 58%; }
.journey-stage[data-state='09'] .stage-institution-lockup { display: flex; }
.journey-stage[data-state='09'] #state-number { display: none; }
.journey-stage.is-changing video, .journey-stage.is-changing .stage-poster, .journey-stage.is-changing .stage-transition { opacity: .2; transform: scale(1.035); filter: blur(5px); }
.stage-shade { position: absolute; inset: 0; background: linear-gradient(0deg, rgb(17 29 36 / 74%), transparent 47%); pointer-events: none; }
.stage-meta { position: absolute; z-index: 2; right: 2rem; bottom: 1.8rem; left: 2rem; display: flex; align-items: end; justify-content: space-between; color: white; }
.stage-meta strong { display: block; font-family: var(--serif); font-size: clamp(2rem, 4vw, 4.3rem); font-weight: 500; line-height: 1; }
.stage-meta span:last-child { max-width: 16rem; font-size: .8rem; font-weight: 750; letter-spacing: .1em; text-align: right; text-transform: uppercase; }
.state-progress { --progress: 12.5%; position: relative; z-index: 3; grid-column: 1; width: .3rem; overflow: hidden; align-self: stretch; border-radius: 1rem; background: rgb(198 144 67 / 18%); }
.state-progress::before { position: absolute; top: 0; right: 0; left: 0; height: var(--progress); content: ''; border-radius: inherit; background: var(--ochre); transition: height .5s ease; }
.journey-stage[data-state='07'] { background: #9e2630; }
.journey-stage[data-state='08'] { background: #123e5c; }

.journey-steps { grid-column: 1; grid-row: 1; min-width: 0; }
.journey-step { min-height: 78vh; display: grid; align-content: center; padding: 3rem 0; opacity: .4; transform: translateY(1.5rem); transition: opacity .45s ease, transform .55s ease; }
.journey-step.is-active { opacity: 1; transform: none; }
.step-number { margin: 0 0 1rem; color: var(--carmine); font-size: .78rem; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.journey-step h3 { max-width: 12ch; margin: 0; font-family: var(--serif); font-size: clamp(2.4rem, 4.6vw, 5rem); font-weight: 500; letter-spacing: -.035em; line-height: 1; }
.journey-step--unlabelled h3 { max-width: 13.5ch; }
.journey-step > p:last-of-type { margin: 1.3rem 0 0; color: var(--ink-soft); font-size: clamp(1rem, 1.4vw, 1.18rem); }
.step-static { display: none; width: 100%; margin: 1.5rem 0 0; border-radius: 1rem; }
.state-tag { display: inline-flex; align-items: center; gap: .6rem; width: max-content; margin-top: 1.5rem; color: var(--teal); font-size: .76rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }
.state-tag::before { width: 1.8rem; height: 1px; content: ''; background: currentColor; }

.lab-bridge { padding: clamp(5rem, 10vw, 10rem) 1rem; color: white; background: var(--ink); text-align: center; }
.lab-bridge > * { max-width: 69rem; margin-right: auto; margin-left: auto; }
.lab-bridge h2 { font-size: clamp(3rem, 6vw, 6.5rem); }
.lab-bridge p:not(.eyebrow) { max-width: 47rem; margin-top: 1.5rem; color: #ccd2d5; font-size: 1.12rem; }
.cta-row { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-top: 2rem; }
.cta-row a { padding: .85rem 1.1rem; border: 1px solid #6d7479; border-radius: 999px; text-decoration: none; font-weight: 750; }
.cta-row a:hover { border-color: var(--ochre); color: #f4c987; }
.disclosure { padding: 3rem 1rem; border-top: 1px solid #3d484f; color: #c5cdd2; background: var(--ink); text-align: center; font-size: .625rem; line-height: 1.45; }
.disclosure p { max-width: 55rem; margin: auto; }

.site-footer { padding: 2.2rem 1rem; background: #121a20; color: white; }
.footer-inner { width: min(100%, var(--content)); margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 1.15rem; text-decoration: none; }
.footer-brand img { width: 5.175rem; filter: brightness(0) invert(1); }
.footer-brand span { max-width: 20.7rem; padding-left: 1.15rem; border-left: 1px solid #58636a; font-size: .943rem; font-weight: 760; line-height: 1.2; }
.footer-institution { display: flex; align-items: center; gap: 1.035rem; color: #cbd2d6; }
.footer-institution img { width: clamp(5.52rem, 8.05vw, 7.475rem); max-height: 4.37rem; filter: brightness(0) invert(1); }
.footer-inner p { margin: 0; color: #aeb8be; font-size: .943rem; }

/* Existing formal-page classes remain supported. */
.template-formal main { width: min(calc(100% - 2rem), 76rem); margin: auto; padding: 5rem 0; }
.page-intro h1 { max-width: 14ch; color: var(--ink); font-size: clamp(3.2rem, 6vw, 6rem); }
.page-intro .lede { max-width: 50rem; color: var(--ink-soft); font-size: 1.15rem; }
.formal-hero-placeholder { min-height: 24rem; margin-top: 3rem; border-radius: 2rem; background: linear-gradient(135deg, var(--navy), var(--teal)); }
.directory-section { padding: 4rem 0; border-top: 1px solid var(--line); }
.directory-section h2 { font-size: clamp(2.5rem, 4vw, 4rem); }
.directory-grid, .card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1rem; margin-top: 2rem; }
.directory-card, .record-card { padding: 1.4rem; border: 1px solid var(--line); border-radius: 1rem; background: white; }

@media (min-width: 68.001rem) {
  .journey-steps { padding-bottom: 15vh; }
}

/* The hero artwork is 16:9. Keep that as the wide-screen minimum, but do not
   force a definite 16:9 height: at compact desktop heights the editorial copy
   is taller and must be able to reserve its full reading space. The positive
   stacking order also keeps the transformed sticky journey card behind this
   section until the hero has fully passed. */
@media (min-width: 46.001rem) {
  .hero { min-height: max(56.25vw, calc(100svh - 7.5rem)); }
  /* Reframe the source plate: keep the whole person-and-organs composition
     while moving the primary tumour past the left-hand editorial panel. */
  .hero-media img { transform: scale(1.06) translateX(9%); }
}

@media (max-width: 68rem) {
  .header-inner { min-height: 8.125rem; }
  .brand { flex-basis: 31.2rem; gap: 1.04rem; }
  .brand img { width: 7.18rem; height: auto; }
  .brand-name { max-width: 20.8rem; padding-left: 1.04rem; font-size: 1.144rem; }
  .site-nav ul { gap: .8rem; font-size: .78rem; }
  .header-video { padding: .58rem .75rem; font-size: .74rem; }
  .hero { min-height: calc(100svh - 6.5rem); }
  .journey-layout { grid-template-columns: 1fr; }
  .journey-stage-wrap { z-index: 5; grid-column: 1; grid-row: 1; top: 1rem; translate: none; }
  .journey-steps { grid-column: 1; grid-row: 2; }
  .journey-stage { min-height: 0; border-radius: 1.2rem 1.2rem 4rem 1.2rem; }
  .journey-step { min-height: 68svh; width: min(100%, 42rem); margin: auto; }
}

@media (max-width: 62rem) {
  .header-inner { min-height: 7.54rem; gap: .75rem; }
  .brand { flex-basis: 25.35rem; gap: .845rem; }
  .brand img { width: 6.5rem; height: auto; }
  .brand-name { max-width: 16.25rem; padding-left: .845rem; font-size: .988rem; }
  .site-nav ul { gap: .65rem; font-size: .73rem; }
  .site-nav li:nth-child(n+4) { display: none; }
  .header-video { padding: .52rem .68rem; font-size: .7rem; }
  .hero { min-height: calc(100svh - 6rem); }
}

@media (max-width: 46rem) {
  .header-inner { min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .6rem .85rem; padding: .7rem 0 .8rem; }
  .brand { grid-column: 1; grid-row: 1; gap: .7rem; }
  .brand img { width: 4.255rem; height: auto; }
  .brand-name { max-width: 15.25rem; padding-left: .7rem; font-size: .8rem; line-height: 1.22; }
  .site-nav { display: none; }
  .header-video { grid-column: 1 / -1; grid-row: 2; justify-self: start; margin-left: 0; padding: .55rem .8rem; font-size: .72rem; }
  .language { grid-column: 2; grid-row: 1; width: 2.25rem; font-size: .74rem; }
  .hero { min-height: calc(100svh - 6.65rem); align-items: end; }
  .hero-copy { padding: clamp(3.5rem, 8vh, 4.75rem) 0; }
  .hero::before { background-image: url('dbm-fibre-pattern.svg'), linear-gradient(0deg, rgb(24 30 35 / 84%) 0 48%, rgb(24 30 35 / 18%) 80%); background-position: center; background-size: 28rem 21rem, auto; }
  .hero-media img { object-position: 60% center; transform: scale(1.035) translateX(3%); }
  h1 { max-width: 14ch; font-size: clamp(2.55rem, 10.8vw, 3.55rem); line-height: 1; }
  .hero-lede { margin-top: 1.35rem; font-size: 1rem; }
  .hero-guardrail { font-size: .84rem; }
  .journey { padding-top: 4rem; }
  .journey-layout { width: 100%; }
  .journey-stage-wrap { height: auto; margin-bottom: calc(-75vw + .975rem); padding: 0; }
  .journey-stage { min-height: 0; aspect-ratio: 4 / 3; border-radius: 0 0 3.25rem 0; }
  .journey-stage video, .journey-stage .stage-poster, .journey-stage .stage-transition { object-fit: cover; }
  .journey-stage[data-state='01'] video, .journey-stage[data-state='01'] .stage-poster { object-position: 52% center; }
  .journey-stage[data-state='02'] video, .journey-stage[data-state='02'] .stage-poster, .journey-stage[data-state='02'] .stage-transition { object-position: 48% center; }
  .journey-stage[data-state='03'] video, .journey-stage[data-state='03'] .stage-poster { object-position: 51% center; }
  .journey-stage[data-state='04'] video, .journey-stage[data-state='04'] .stage-poster { object-position: 54% center; }
  .journey-stage[data-state='05'] video, .journey-stage[data-state='05'] .stage-poster { object-position: 50% center; }
  .journey-stage[data-state='06'] video, .journey-stage[data-state='06'] .stage-poster { object-position: 46% center; }
  .journey-stage[data-state='07'] video, .journey-stage[data-state='07'] .stage-poster { object-position: 50% center; }
  .journey-stage[data-state='08'] video, .journey-stage[data-state='08'] .stage-poster { object-position: 52% center; }
  .journey-stage[data-state='09'] video, .journey-stage[data-state='09'] .stage-poster { object-position: 48% center; }
  .stage-meta { right: 1.2rem; bottom: 1.1rem; left: 1.2rem; }
  .stage-meta span:last-child { max-width: 10rem; font-size: .65rem; }
  .journey-steps { padding: 0 1.15rem; }
  .journey-step { min-height: 108svh; align-content: start; padding-top: calc(75vw + 4.75rem); }
  .journey-step h3 { font-size: clamp(2.3rem, 10.5vw, 3.4rem); }
  .journey-step > p:last-of-type { font-size: 1rem; line-height: 1.58; }
  .lab-bridge { padding: 4.5rem 1.15rem; }
  .lab-bridge h2 { font-size: clamp(2.65rem, 11vw, 3.5rem); }
  .footer-inner { align-items: flex-start; flex-direction: column; gap: 1.25rem; }
  .footer-institution { align-items: center; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .journey-stage video { display: none; }
  .journey-stage .stage-poster { display: block; }
  .journey-stage .stage-transition { display: none; }
  .journey-stage.has-image-transition .stage-poster { display: none; }
  .journey-stage.has-image-transition .stage-transition { display: block; opacity: 1; transform: none; filter: none; }
}

@media print {
  .site-header { position: static; }
  .journey-layout { display: block; }
  .journey-stage-wrap { display: none; }
  .journey-step { min-height: 0; opacity: 1; transform: none; break-inside: avoid; }
  .step-static { display: block; }
}

.no-js .journey-stage-wrap { display: none; }
.no-js .journey-layout { display: block; max-width: 55rem; }
.no-js .journey-step { min-height: 0; opacity: 1; transform: none; }
.no-js .step-static { display: block; }

/* Keep the landing header structurally and visually identical to formal pages. */
.site-header { z-index: 50; background: rgb(255 253 249 / 96%); backdrop-filter: none; }
.header-inner { min-height: 0; padding: .75rem 0; }
.identity { display: grid; grid-template-columns: auto minmax(0, 23.4rem); gap: 1.105rem; align-items: center; color: var(--ink); text-decoration: none; }
.identity-logo { width: clamp(6.73rem, 10.47vw, 9.34rem); height: clamp(6.73rem, 10.47vw, 9.34rem); object-fit: contain; transform: translateY(var(--brand-mark-optical-offset)); }
.identity-name { display: grid; max-width: 23.4rem; padding-left: 1.105rem; border-left: 3px solid var(--carmine); color: #000; font-size: clamp(.936rem, 1.43vw, 1.17rem); font-weight: 800; line-height: 1.2; text-align: left; }
.identity-name > span { display: block; white-space: nowrap; }
.site-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .15rem .5rem; margin: .6rem 0 0 auto; padding: .55rem 0 .1rem; border-top: 1px solid var(--line); }
.site-nav a { min-width: 0; padding: .45rem .1rem; font-size: .76rem; font-weight: 750; line-height: 1.15; text-align: center; text-decoration: none; }
.site-nav a[aria-current='page'] { color: var(--carmine); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .5rem; }
.language-link { display: inline-grid; flex: 0 0 auto; width: 2.4rem; aspect-ratio: 1; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: var(--ink); font-size: .8rem; font-weight: 800; line-height: 1; text-decoration: none; }

@media (min-width: 48rem) {
  .site-header { position: sticky; top: 0; }
  .site-nav { display: flex; justify-content: flex-end; flex-wrap: wrap; overflow: visible; margin: 0 0 0 auto; padding: 0; border: 0; }
  .site-nav a { flex: 0 0 auto; text-align: start; }
}

@media (min-width: 85.375rem) {
  .site-nav { gap: .35rem 1rem; }
  .site-nav a { font-size: .82rem; }
}

@media (min-width: 90rem) {
  .header-inner { padding-block: 1rem; }
}

@media (max-width: 46rem) {
  .header-inner { min-height: 0; }
  .identity { grid-column: 1; grid-row: 1; grid-template-columns: auto minmax(0, 15.25rem); gap: .7rem; }
  .identity-logo { width: 4.255rem; height: 4.255rem; }
  .identity-name { max-width: 15.25rem; padding-left: .7rem; font-size: .8rem; line-height: 1.22; }
  .site-nav { display: none; }
  .language-link { grid-column: 2; grid-row: 1; width: 2.25rem; font-size: .74rem; }
}
