/* ============================================================
   Data Dreams & Dilemmas — Summer School
   Hero reproduces Figma board "MacBook Pro 14" - 13" (2160 x 1350),
   followed by a scrollable content section + footer.
   ============================================================ */

/* Embedded web fonts so the type is correct on every device (phones don't
   have the designer's installed copies). local() first uses an installed
   copy when present; otherwise the bundled OTF loads. */
@font-face {
  font-family: "Dither Compose Data Dreams New UN 3";
  src: local("Dither Compose Data Dreams New UN 3"),
       url("fonts/DitherComposeDataDreamsNewUN3-Regular.otf") format("opentype");
  font-display: swap;
}
@font-face {
  font-family: "UN-11 ST";
  src: local("UN-11 ST"),
       local("UN-11 ST Regular"),
       local("UN-11"),
       url("fonts/UN_11ST_Regular.otf") format("opentype");
  font-display: swap;
}

:root {
  --bg: #b094ff;
  --white: #ffffff;
  --black: #000000;
  --ink: #1c0f3a;            /* readable dark text on the purple */
  --ghost-stroke: #58c0a3;

  --font-display: "Dither Compose Data Dreams New UN 3", "Dither Compose", "Arial Black", "Helvetica Neue", sans-serif;
  --font-body: "UN-11 ST", "UN-11", "Courier New", ui-monospace, monospace;

  --stage-w: 2160;
  --stage-h: 1350;

  /* Scroll distance (viewport heights) the title sequence occupies before the
     reading text scrolls in. Keep in sync with CROSS/FADE in script.js. */
  --title-phase: 300vh;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

.svg-defs { position: absolute; width: 0; height: 0; pointer-events: none; }

/* Language switch — fixed top-right, difference-blend so it reads on the
   purple poster and on the white footer alike. */
.lang-switch {
  position: fixed;
  top: clamp(14px, 2vw, 28px);
  right: clamp(16px, 2.4vw, 36px);
  z-index: 50;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: clamp(14px, 1.3vw, 17px);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #fff;
  mix-blend-mode: difference;
}
.lang-btn {
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: 0;
  margin: 0;
  padding: 2px;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  color: #fff;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.15s ease;
}
.lang-btn:hover { opacity: 0.85; }
.lang-btn[aria-current="true"] {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.lang-sep { opacity: 0.5; }

/* ===================== HERO + READING SCENE ===================== */
/* One tall scroll track. .frame pins (sticky) for the whole scene so the
   poster stays as a persistent backdrop; height is set by script.js. */
.scene {
  position: relative;
  width: 100%;
}

.frame {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  height: 100svh;
  min-height: 480px;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  z-index: 1;
}

/* Long reading text overlaps the sticky frame and scrolls up over it. */
.reading {
  position: relative;
  z-index: 2;
  margin-top: -100vh;               /* pull up to overlay the sticky frame */
  margin-top: -100svh;
  /* The empty title-phase area must let clicks through to the headline
     links (e.g. "Apply now") in the frame below; the text re-enables them. */
  pointer-events: none;
}
.reading > * { pointer-events: auto; }
/* Higher specificity than .content so the title-phase padding wins. */
.reading.content {
  padding: var(--title-phase, 230vh) clamp(22px, 6vw, 96px) 16vh;
  color: var(--white);
}
/* No veil — the reading text weaves over the live poster like the headline. */

/* Blended images at their own size, distributed across the full frame
   (positions/sizes set inline in vw + %). */
.images-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* Purple backdrop INSIDE this layer so the mix-blend-modes composite over
     it (as they did inside the old stage), not over transparency. */
  background: var(--bg);
}
.images-layer img {
  position: absolute;
  object-fit: cover;
  user-select: none;
  /* --p (0..1) scroll progress (set on .frame) keeps the blends in motion. */
  filter: hue-rotate(calc(var(--p, 0) * 200deg)) brightness(calc(1 + var(--p, 0) * 0.12));
}

/* The 2160x1350 design canvas (headlines, ghost letters, markers), scaled
   to fit via --scale. Transparent so the image bands show behind it. */
.stage {
  position: relative;
  z-index: 1;
  width: calc(var(--stage-w) * 1px);
  height: calc(var(--stage-h) * 1px);
  flex: none;
  background: transparent;
  transform-origin: center center;
  transform: scale(var(--scale, 0.5));
}

/* Decorative outlined "ghost" letters */
.ghost-box {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 5;            /* in front of the headlines/slides */
}
.ghost-text {
  flex: none;
  font-family: var(--font-display);
  font-size: 314px;
  line-height: 320px;
  text-align: center;
  color: transparent;
  -webkit-text-stroke: 4px var(--ghost-stroke);
  text-stroke: 4px var(--ghost-stroke);
  white-space: nowrap;
}

/* Big display headlines + the animated resolution/blur "resolve" */
.display {
  position: absolute;
  font-family: var(--font-display);
  font-size: 236px;
  line-height: 148px;
  color: var(--white);
  text-align: center;
  font-weight: 400;
  word-break: break-word;
}
/* Only the visible slide(s) run the expensive dither filter (script.js adds
   .dither); off-screen/hidden slides don't pay for it. */
.slide.dither .display { filter: url(#ditherResolve); }
.display--left  { left: 578.5px;  transform: translateX(-50%); }
.display--right { left: 1572.5px; transform: translateX(-50%); }
.display--center {
  left: 1080px;
  width: 1600px;
  transform: translateX(-50%);
}
.display--link { text-decoration: none; color: var(--white); display: block; }
.display--link:hover { color: var(--black); }

/* --- Headline slide sequence (scroll-driven, set up in script.js) --- */
.slides { position: absolute; inset: 0; }
.slide {
  position: absolute;
  inset: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
}
/* Slides past the first start hidden/below; script.js animates them in.
   Slide 0 stays put so the poster looks correct with JS disabled. */
.slide[data-slide="1"],
.slide[data-slide="2"],
.slide[data-slide="3"] { opacity: 0; }

.marker {
  position: absolute;
  font-family: var(--font-body);
  font-size: 33.17px;
  line-height: 63.17px;
  letter-spacing: 35.16px;
  text-transform: uppercase;
  color: var(--black);
  white-space: nowrap;
}

/* Bottom details — full-width flex bar fixed to the very bottom of the frame */
.meta-bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px clamp(16px, 3vw, 56px);
  padding: clamp(14px, 1.8vw, 30px) clamp(18px, 3vw, 46px);
  font-family: var(--font-body);
  font-size: clamp(13px, 1.05vw, 19px);
  line-height: 1.18;
  color: var(--white);
}
.meta-item {
  margin: 0;
  /* Resolve into the frame on load (echoes the title dither). */
  animation: typeResolve 1.1s ease both;
}
.meta-item:nth-child(1) { animation-delay: 0.10s; }
.meta-item:nth-child(2) { animation-delay: 0.20s; }
.meta-item:nth-child(3) { animation-delay: 0.30s; }
.meta-item:nth-child(4) { animation-delay: 0.40s; }
.meta-item:nth-child(5) { animation-delay: 0.50s; }
@keyframes typeResolve {
  from { opacity: 0; filter: blur(12px); }
  to   { opacity: 1; filter: blur(0); }
}
.meta-item strong { font-weight: 400; }
.meta-item a { color: inherit; text-decoration: none; }
.meta-item a:hover { text-decoration: underline; }
.meta-item--upper { text-transform: uppercase; }

/* Scroll affordance */
.scroll-hint {
  position: absolute;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: var(--white);
  text-decoration: none;
  border-radius: 50%;
  mix-blend-mode: difference;
  animation: bob 1.8s ease-in-out infinite;
}
@keyframes bob {
  0%, 100% { transform: translate(-50%, 0); }
  50%      { transform: translate(-50%, 7px); }
}

/* ========================== CONTENT ========================== */
.content {
  /* full-bleed, only edge padding — no narrow centred column */
  padding: clamp(64px, 10vw, 170px) clamp(22px, 6vw, 96px);
}

/* Big opening statement — bold display type, scrolls in like the title */
.content .lead {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(34px, 6.4vw, 116px);
  line-height: 0.98;
  color: var(--white);
  margin: 0 0 clamp(44px, 7vw, 120px);
  max-width: 22ch;
  overflow-wrap: break-word;
  hyphens: manual;
}
.content strong { font-weight: 700; color: var(--white); }

/* Intro copy flows into multiple columns on wide screens */
.prose {
  columns: clamp(18rem, 23vw, 26rem);
  column-gap: clamp(32px, 4vw, 72px);
  margin: 0 0 clamp(52px, 8vw, 120px);
}
.prose p {
  font-size: clamp(16px, 1.15vw, 20px);
  line-height: 1.1;
  margin: 0 0 1.2em;
  hyphens: auto;
  break-inside: avoid;
}
.prose p:last-child { margin-bottom: 0; }

/* Topic sections — a responsive grid of bold blocks */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: clamp(30px, 4vw, 72px) clamp(30px, 4vw, 64px);
  margin: 0 0 clamp(52px, 8vw, 110px);
}
.topic {
  padding-top: clamp(4px, 1vw, 12px);
}
.topic h3 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(26px, 3vw, 48px);
  line-height: 1.0;
  color: var(--white);
  margin: 0 0 0.55em;
  overflow-wrap: break-word;
}
.topic p {
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.1;
  margin: 0 0 1em;
}
.content ul { list-style: none; margin: 0 0 0.4em; padding: 0; }
.content li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: 0.5em;
  font-size: clamp(15px, 1.05vw, 18px);
  line-height: 1.1;
}
.content li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--white);
}

.content .soon {
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: clamp(16px, 1.5vw, 24px);
  color: var(--white);
  margin: 0 0 1.4em;
}
.content .deadline {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(24px, 3vw, 46px);
  line-height: 1.0;
  color: var(--white);
  margin: 0 0 0.7em;
  overflow-wrap: break-word;
}

.cta-wrap { margin: 0; }
/* Outlined to sit with the rest of the white-on-purple type, not a solid box */
.cta {
  display: inline-block;
  font-family: var(--font-body);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: clamp(17px, 1.6vw, 24px);
  color: var(--white);
  background: transparent;
  border: 2px solid var(--white);
  padding: 0.6em 1.2em;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
}
.cta:hover { background: var(--white); color: var(--bg); }

/* Scroll-in reveal — echoes the title dissolve (blur + rise). Only active
   when JS is on (the .js class) so content is never hidden without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(52px);
  filter: blur(14px);
  transition: opacity 0.75s ease, transform 0.75s cubic-bezier(0.2,0.7,0.2,1), filter 0.75s ease;
  will-change: opacity, transform, filter;
}
.js .reveal.in { opacity: 1; transform: none; filter: none; }

/* =========================== FOOTER =========================== */
/* Official partner / funding footer — white with black logos, per board
   "MacBook Pro 14" - 3". */
.site-footer {
  background: #fff;
  color: #000;
  padding: clamp(44px, 6vw, 80px) clamp(22px, 6vw, 80px);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: flex-start;
  justify-content: space-between;
}
.footer-meta {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.5;
  color: #000;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
}
.footer-meta p { margin: 0; }
.footer-meta a { color: #000; text-decoration: none; }
.footer-meta a:hover { text-decoration: underline; }
.footer-meta strong { font-weight: 700; }

.footer-logos {
  display: flex;
  flex-wrap: wrap;              /* wrap rather than overflow when tight */
  align-items: center;
  justify-content: space-between;
  gap: clamp(18px, 2.4vw, 40px);
  flex: 1 1 auto;
}
/* All logos the same height in a single row (widths follow each aspect ratio). */
.footer-logos img {
  display: block;
  height: 42px;
  width: auto;
  flex: 0 0 auto;
}

/* Program note */
/* Program note + Goethe-Uni / C3S logos */
.footer-program {
  max-width: 1200px;
  margin: clamp(30px, 4.5vw, 56px) auto 0;
}
.footer-note {
  margin: 0;
  max-width: 860px;
  font-family: var(--font-body);
  font-size: clamp(13px, 1vw, 16px);
  line-height: 1.5;
  color: #000;
}
.program-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: clamp(26px, 4vw, 56px);
  margin-top: clamp(22px, 3vw, 36px);
}
.program-logos img { display: block; width: auto; }
.program-logos .logo-dkuw { height: clamp(38px, 4.4vw, 54px); }
.program-logos .logo-gu  { height: clamp(46px, 5vw, 62px); }
.program-logos .logo-c3s { height: clamp(48px, 5.2vw, 66px); }

/* Funding notice (BMFTR) */
.footer-funding {
  max-width: 1200px;
  margin: clamp(36px, 5vw, 64px) auto 0;
  padding-top: clamp(24px, 3vw, 36px);
  border-top: 1px solid rgba(0,0,0,0.18);
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 48px);
}
.footer-funding .funding-logo {
  display: block;
  height: clamp(72px, 8vw, 96px);
  width: auto;
  flex: none;
}
.footer-funding .funding-text {
  margin: 0;
  font-family: var(--font-body);
  font-size: 12px;
  line-height: 1.55;
  color: #000;
  max-width: 760px;
}

/* ===================== Responsive / motion ===================== */
@media (max-width: 640px) {
  .footer-inner { flex-direction: column; gap: 32px; }
  .footer-funding { flex-direction: column; align-items: flex-start; gap: 20px; }
}

/* ----------- Mobile: stacked layout, no pinned title sequence ----------- */
@media (max-width: 700px) {
  /* Hero is a normal section (relative, not sticky); reading stacks below it
     on plain purple instead of overlaying the poster. */
  .frame {
    position: relative;
    top: auto;
    height: 100svh;          /* fixed so the (1350px) stage box doesn't stretch it */
  }
  .reading { margin-top: 0; pointer-events: auto; }
  .reading.content { padding: clamp(44px, 13vw, 96px) clamp(18px, 6vw, 26px) 16vh; }

  .prose { columns: 1; }
  .sections-grid { grid-template-columns: 1fr; }

  /* Only the main headline; the cross-fade sequence is desktop-only. */
  .slide:not([data-slide="0"]) { display: none; }
  .scroll-hint { display: none; }

  /* Drop the heavy animated dither on small screens — keep the headline crisp
     and the page light (the typeface is already dithered). */
  .display { filter: none; }

  /* Footer logos wrap rather than squeeze into one row. */
  .footer-logos { flex-wrap: wrap; justify-content: flex-start; gap: 22px 34px; flex-basis: 100%; }
  .footer-logos img { height: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .display { filter: none; }
  .scroll-hint { animation: none; }
  .meta-item { animation: none; }
  .js .reveal { opacity: 1; transform: none; filter: none; transition: none; }
}
