/* =============================================================================
   CEDIS Lab — css/layout.css
   -----------------------------------------------------------------------------
   Page structure: section themes, the content wrapper, the navigation bar,
   the page header used on inner pages, the grid of each page, and the footer.
   Phone and tablet adjustments live in responsive.css.
   ============================================================================= */
/* Section themes (as on KERNEL): .dark (black), .light (paper grey) or
   .white. Each sets local colours that components read. */
.dark { background: var(--black); color: var(--white); --fg: var(--white); --fg-2: var(--gray); --line: var(--hair); --surface: var(--tile); --link: var(--sig); }
.light { background: var(--paper); color: var(--ink); --fg: var(--ink); --fg-2: var(--ink-2); --line: var(--hair-l); --surface: var(--card); --link: var(--sig-deep); }
.white { background: #FFFFFF; color: var(--ink); --fg: var(--ink); --fg-2: var(--ink-2); --line: var(--hair-l); --surface: var(--paper); --link: var(--sig-deep); }
section { padding-block: clamp(84px, 12vw, 150px); scroll-margin-top: 52px; }
.wrap { max-width: 1120px; margin-inline: auto; padding-left: max(clamp(16px, 4vw, 40px), env(safe-area-inset-left, 0px)); padding-right: max(clamp(16px, 4vw, 40px), env(safe-area-inset-right, 0px)); }
.head { display: grid; gap: 18px; margin-bottom: clamp(40px, 6vw, 72px); }
.light .panel, .white .panel { border-color: transparent; }
.light .pill-btn, .white .pill-btn { background: var(--ink); color: #FFFFFF; }
.light .pill-btn:hover, .white .pill-btn:hover { box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .45); }

/* Navigation: sticky translucent black bar with blur (as on KERNEL). The lab
   mark and name on the left; page links, then "Join the lab", on the right. */
.nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 30; background: rgba(0, 0, 0, .72); -webkit-backdrop-filter: saturate(1.8) blur(20px); backdrop-filter: saturate(1.8) blur(20px); border-bottom: 1px solid rgba(255, 255, 255, .08); }
.nav .wrap { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 52px; }
.nav .lab .mark { width: 30px; height: 30px; }
.nav-r { display: flex; align-items: center; gap: 22px; }
.nav-links { display: flex; align-items: center; gap: 22px; }
.nav-menu { display: none; place-items: center; width: 40px; height: 40px; margin: 0 -10px; border: 0; border-radius: 50%; background: transparent; color: var(--white); cursor: pointer; }
.nav-menu svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; }
.nav-menu path { transform-origin: 12px 12px; transition: transform .25s ease; }
.nav-menu[aria-expanded="true"] .a { transform: translateY(3.5px) rotate(45deg); }
.nav-menu[aria-expanded="true"] .b { transform: translateY(-3.5px) rotate(-45deg); }
.nav-r a.nl { color: rgba(245, 245, 247, .82); text-decoration: none; font-size: .8125rem; white-space: nowrap; }
.nav-r a.nl:hover, .nav-r a.nl[aria-current="page"] { color: var(--white); }
.nav-r a.nl[aria-current="page"] { box-shadow: inset 0 -1px 0 var(--sig); padding-bottom: 2px; }
.nav .pill-btn { padding: 7px 14px; font-size: .8125rem; }

/* Inner-page header: eyebrow, oversized title and lead on black. */
.page-head { padding-block: clamp(64px, 10vw, 128px) clamp(56px, 8vw, 104px); position: relative; overflow: hidden; }
.page-head + .dark { padding-top: 0; }
.page-head .wrap { position: relative; display: grid; gap: 20px; }
.page-head h1 { font-size: clamp(2.8rem, 7.4vw, 5.6rem); line-height: 1.02; letter-spacing: -0.045em; max-width: 13em; }
.page-head .lead { max-width: 34em; }
.page-head::after { content: ""; position: absolute; right: -12%; top: -40%; width: min(720px, 90vw); aspect-ratio: 1; background: radial-gradient(circle, rgba(var(--sig-rgb), .14), transparent 62%); pointer-events: none; }
.page-head .ghost-mark { position: absolute; right: max(-60px, -6vw); top: 50%; width: clamp(240px, 34vw, 440px); height: auto; transform: translateY(-50%); color: rgba(245, 245, 247, .07); fill: var(--black); pointer-events: none; }

/* Home 1. Hero: the lab's full name, the web drawing under a spotlight
   (::before) with a gold glow (::after), then the headline and buttons.
   The hero always fills one screen below the menu bar: the drawing takes
   whatever height is left, so the headline and buttons are never cut off. */
.hero { display: flex; flex-direction: column; text-align: center; overflow: hidden;
  min-height: calc(100vh - 52px); min-height: calc(100svh - 52px - env(safe-area-inset-top, 0px));
  padding-block: clamp(14px, 3vh, 40px) clamp(18px, 4vh, 52px); }
.hero > .wrap { flex: none; width: 100%; }
.hero > .hero-stage { flex: 1 1 0; min-height: clamp(96px, 18vh, 150px); margin-top: clamp(8px, 2vh, 24px); container-type: size; display: grid; place-items: center; }
.hero-text { display: grid; gap: clamp(14px, 2.4vh, 22px); justify-items: center; }
.hero-after { margin-top: clamp(10px, 2.6vh, 34px); }
.hero h1 { font-size: max(2.4rem, min(clamp(3rem, 8.4vw, 6.6rem), 10.5vh)); font-size: max(2.4rem, min(clamp(3rem, 8.4vw, 6.6rem), 10.5svh)); line-height: 1; letter-spacing: -0.045em; max-width: 11em; }
.hero .lead { margin-inline: auto; }
.hero-cta { display: flex; gap: 28px; align-items: center; justify-content: center; flex-wrap: wrap; }
/* the drawing keeps its 1000 x 690 proportions inside the space left */
.web-stage { position: relative; width: min(860px, 100%); width: min(860px, 100cqw, 100cqh * 1.4493); }
@media (max-height: 560px) { .hero .lockup { display: none; } }
/* Phones: the headline keeps two rows ("Many resources," / "one intelligent
   web."). Its size follows the width left inside the page gutters, so the
   longer row (about 8.9 times the font size wide) always fits. */
@media (max-width: 600px) { .hero h1 { font-size: min(3rem, calc((100vw - 2 * max(16px, 4vw)) / 8.9), 10.5svh); } }
.web-stage::before { content: ""; position: absolute; left: 50%; top: -8%; width: 130%; height: 108%; transform: translateX(-50%); pointer-events: none;
  background: conic-gradient(from 148deg at 50% 0%, transparent 0deg, rgba(255, 255, 255, .045) 18deg, rgba(255, 255, 255, .06) 32deg, rgba(255, 255, 255, .045) 46deg, transparent 64deg);
  -webkit-mask-image: linear-gradient(#000 40%, transparent 96%); mask-image: linear-gradient(#000 40%, transparent 96%); }
.web-stage::after { content: ""; position: absolute; inset: 14% 14% 6%; pointer-events: none; background: radial-gradient(ellipse 46% 50% at 50% 50%, rgba(var(--sig-rgb), .17), rgba(255, 255, 255, .025) 48%, transparent 70%); }

/* Home 2. Research areas: four cards as a quadrant around a ring
   (components.css). */
.area-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Home 3. KERNEL: text beside a facts list. */
.feature { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: center; }
.feature-text { display: grid; gap: 22px; justify-items: start; }

/* Home 4. Name and mark: the large mark beside the two explanations. */
.origin { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(32px, 7vw, 96px); align-items: center; }
.origin-copy { display: grid; gap: 28px; }

/* Home 5 and other pages: closing call to action with a gold glow behind it. */
.cta { text-align: center; position: relative; overflow: hidden; }
.cta::before { content: ""; position: absolute; left: 50%; top: 0; width: min(900px, 140%); aspect-ratio: 1; transform: translate(-50%, -42%); background: radial-gradient(circle, rgba(var(--sig-rgb), .2), transparent 62%); pointer-events: none; }
.cta .wrap { position: relative; display: grid; gap: 22px; justify-items: center; }
.cta h2 { font-size: clamp(2.6rem, 7vw, 5.2rem); letter-spacing: -0.045em; line-height: 1.02; max-width: 12em; }
.cta .sub { color: var(--gray); font-size: clamp(1.1rem, 2vw, 1.35rem); font-weight: 600; max-width: 30em; }

/* Research: each area is a section; the area title and its plain-language
   summary on the left, what the lab works on and related work on the right. */
.area { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 6vw, 88px); align-items: start; }
.area-intro { display: grid; gap: 20px; position: sticky; top: 96px; }
.area-body { display: grid; gap: 28px; }
.area-jump { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }

/* Projects: one large project card; future projects below. */
.proj { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 64px); align-items: start; }
.proj-main { display: grid; gap: 22px; justify-items: start; }

/* People: portrait beside the profile. */
.director { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }
.director-body { display: grid; gap: 24px; }

/* People and Projects: two blocks side by side. */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }

/* Publications: one list, newest first. */
.pubs { display: grid; gap: 16px; max-width: 900px; }

/* Join: six openings, three per row; how we work; how to get in touch. */
.opp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(20px, 3vw, 40px); }
.apply { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: clamp(28px, 6vw, 80px); align-items: start; }

/* Contact: ways to reach the lab beside the message helper. */
.contact { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 16px; align-items: start; }
.channels { display: grid; gap: 16px; }

/* Footer: the lab lockup and a line about it, link columns, the bottom bar. */
.foot { padding-block: 56px 40px; font-size: .8125rem; line-height: 1.55; color: var(--ink-2); }
.foot .wrap { display: grid; gap: 32px; }
.foot-top { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 28px; padding-bottom: 32px; border-bottom: 1px solid var(--hair-l); }
/* top row: the CEDIS Lab mark on the left; a university or partner mark
   can sit opposite it on the right (a.mcgill, image in assets/brand/) */
.foot-brand { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: -8px; }
.foot-brand .lab { color: var(--ink); }
.foot-brand .lab .mark { width: 34px; height: 34px; fill: #FFFFFF; }
.foot-brand .lab-n b { color: var(--ink-2); }
.foot-brand .mcgill { display: block; flex: none; line-height: 0; }
.foot-brand .mcgill img { display: block; width: auto; height: 48px; }
.foot-id { display: grid; gap: 12px; align-content: start; max-width: 34ch; }
.foot-col { display: grid; gap: 8px; align-content: start; }
.foot-col h2 { font-size: .8125rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.foot-col ul { list-style: none; padding: 0; display: grid; gap: 6px; }
.foot a { color: var(--ink); text-decoration: none; }
.foot a:hover { text-decoration: underline; }
.foot .bot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px 24px; }
