/* =============================================================================
   MERICS Members Day — styles (mobile-first)
   ========================================================================== */

/* MERICS headline/UI typeface (licensed — see README). Body uses it too for now;
   Meta Serif Pro Book can be added later for brand-accurate body copy. */
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Light.woff2")   format("woff2"); font-weight: 300; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Regular.woff2") format("woff2"); font-weight: 400; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Medium.woff2")  format("woff2"); font-weight: 500; font-style: normal;  font-display: swap; }
@font-face { font-family: "Neo Sans Pro"; src: url("assets/fonts/NeoSansPro-Italic.woff2")  format("woff2"); font-weight: 400; font-style: italic;  font-display: swap; }

:root {
  /* MERICS palette (HEX from Corporate Design Manual, 2022) */
  --red:        #E8412B;  /* 01 Light Red — primary  */
  --red-deep:   #BE111F;  /* 04 Red                  */
  --raspberry:  #DD0646;  /* 07 Raspberry            */
  --orange:     #F46500;  /* 03 Orange               */
  --dark-blue:  #116179;  /* 12 Dark Blue            */
  --turquoise:  #8BCAAE;  /* 09 Turquoise            */
  --light-blue: #84C7C8;  /* 11 Light Blue           */
  --mustard:    #D9B300;  /* 13 Mustard              */
  --beige:      #F0EAE5;  /* 00 Beige                */
  --grey:       #70706F;  /* 00 Grey                 */
  --black:      #14110F;

  --ink:        #1c1a18;
  --ink-soft:   #57534e;
  --line:       #e6ded7;
  --card:       #ffffff;
  --bg:         #faf7f4;

  --radius: 16px;
  --shadow-sm: 0 1px 2px rgba(20,17,15,.06), 0 2px 8px rgba(20,17,15,.05);
  --shadow-lg: 0 8px 40px rgba(20,17,15,.18);
  --tap: 44px; /* min touch target */

  --font: "Neo Sans Pro", "Helvetica Neue", Helvetica, Arial, "Segoe UI", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  /* Neo Sans Pro ships Light/Regular/Medium only — never fake heavier/italic. */
  font-synthesis: none;
}
a { color: var(--dark-blue); }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: #fff;
  color: var(--ink);
  padding: env(safe-area-inset-top) 0 0;
  border-bottom: 1px solid var(--line);
}
.header-inner {
  max-width: 720px; margin: 0 auto;
  padding: 12px 18px;
  display: flex; align-items: center; gap: 12px;
}
.logo { display: flex; align-items: center; text-decoration: none; }
.logo img { height: 26px; width: auto; display: block; }
.header-meta { margin-left: auto; text-align: right; font-size: 11px; color: var(--grey); line-height: 1.3; }
.backbtn {
  display: grid; place-items: center; width: 40px; height: 40px; margin-left: -8px;
  border-radius: 50%; color: var(--ink); text-decoration: none; flex: none;
}
.backbtn svg { width: 24px; height: 24px; }
.backbtn:active { background: var(--beige); }

/* ---------- Landing: welcome + tiles ---------- */
.welcome {
  max-width: 720px; margin: 0 auto; padding: 30px 20px 18px;
}
.welcome .kicker {
  display: inline-block; font-size: 12px; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 12px;
}
.welcome h1 { margin: 0; font-size: 30px; line-height: 1.1; font-weight: 800; }
.welcome .lead { margin: 12px 0 0; font-size: 15px; color: var(--ink-soft); }

.tiles {
  max-width: 720px; margin: 0 auto; padding: 8px 20px 20px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 132px; padding: 16px; border-radius: var(--radius);
  text-decoration: none; color: #fff; overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease;
}
.tile:active { transform: scale(.985); }
.tile:focus-visible { outline: 3px solid var(--dark-blue); outline-offset: 3px; }
.tile-wide { grid-column: 1 / -1; }
.tile-tall { min-height: 150px; }

.tile-text h2 { margin: 0; font-size: 21px; font-weight: 800; line-height: 1.1; }
.tile-text p { margin: 6px 0 0; font-size: 13.5px; opacity: .92; max-width: 30ch; }
.tile-icon {
  position: absolute; top: 16px; left: 16px;
  width: 38px; height: 38px; border-radius: 11px;
  background: rgba(255,255,255,.18); display: grid; place-items: center;
}
.tile-icon svg { width: 22px; height: 22px; stroke: #fff; }
.tile-go {
  position: absolute; top: 16px; right: 18px; font-size: 22px; font-weight: 700; opacity: .9;
}

.tile-agenda { background: linear-gradient(135deg, var(--red), var(--orange)); }
.tile-menti  { background: linear-gradient(135deg, var(--dark-blue), #0d4a5c); }

/* Photo tiles use --img set inline */
.tile-photo { background-image: linear-gradient(180deg, rgba(20,17,15,.05), rgba(20,17,15,.62)), var(--img); background-size: cover; background-position: center; min-height: 150px; }

/* ---------- Content pages (about / publications) ---------- */
.page {
  max-width: 720px; margin: 0 auto; padding: 18px 20px 50px;
}
.page-hero {
  width: 100%; height: 180px; object-fit: cover; border-radius: var(--radius);
  display: block; margin-bottom: 18px;
}
.page h1 { font-size: 28px; font-weight: 800; margin: 6px 0 4px; line-height: 1.12; }
.page h2 { font-size: 18px; font-weight: 700; margin: 26px 0 6px; }
.page .page-lead { font-size: 15px; color: var(--grey); font-style: italic; margin: 0 0 18px; }
.page p { font-size: 15px; color: var(--ink); margin: 10px 0; }
.page ul { font-size: 15px; color: var(--ink); margin: 10px 0; padding-left: 20px; }
.page li { margin: 6px 0; line-height: 1.4; }
.page-links { margin-top: 26px; }
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--red); color: #fff; text-decoration: none; font-weight: 700;
  font-size: 14px; padding: 12px 18px; border-radius: 12px; min-height: var(--tap);
}

/* Publication cards */
.pub {
  display: block; text-decoration: none; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow-sm);
  transition: transform .12s ease;
}
.pub:active { transform: scale(.99); }
.pub-tag {
  display: inline-block; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #fff; background: var(--tag, var(--grey));
  border-radius: 6px; padding: 2px 9px;
}
.pub h3 { margin: 10px 0 4px; font-size: 17px; line-height: 1.25; }
.pub p { margin: 4px 0 8px; font-size: 14px; color: var(--ink-soft); }
.pub-meta { font-size: 12.5px; color: var(--grey); }

/* ---------- Hero ---------- */
.hero {
  max-width: 720px; margin: 0 auto;
  padding: 26px 18px 8px;
}
.hero .kicker {
  display: inline-block; font-size: 11px; font-weight: 700;
  letter-spacing: .18em; text-transform: uppercase;
  color: var(--red); margin-bottom: 10px;
}
.hero h1 { margin: 0; font-size: 30px; line-height: 1.08; font-weight: 800; }
.hero .lead { margin: 8px 0 0; font-size: 15px; color: var(--ink-soft); }
.hero .factline {
  margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px 16px;
  font-size: 13px; color: var(--ink-soft);
}
.hero .factline span { display: inline-flex; align-items: center; gap: 6px; }
.hero .factline svg { width: 15px; height: 15px; opacity: .7; flex: none; }

/* "Live now" banner */
.livebar {
  max-width: 720px; margin: 16px auto 0; padding: 0 18px;
}
.livebar-inner {
  display: none; align-items: center; gap: 10px;
  background: linear-gradient(90deg, var(--red), var(--orange));
  color: #fff; border-radius: 12px; padding: 10px 14px;
  font-size: 13px; box-shadow: var(--shadow-sm);
}
.livebar-inner.show { display: flex; }
.livebar .dot {
  width: 9px; height: 9px; border-radius: 50%; background: #fff; flex: none;
  box-shadow: 0 0 0 0 rgba(255,255,255,.7); animation: pulse 1.8s infinite;
}
.livebar b { font-weight: 800; }
.livebar .live-jump { margin-left: auto; color: #fff; font-weight: 700; text-decoration: underline; }
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 rgba(255,255,255,.6); }
  70%  { box-shadow: 0 0 0 8px rgba(255,255,255,0); }
  100% { box-shadow: 0 0 0 0 rgba(255,255,255,0); }
}

/* ---------- Agenda ---------- */
.agenda {
  max-width: 720px; margin: 0 auto; padding: 18px 18px 60px;
  display: flex; flex-direction: column; gap: 10px;
}
.section-label {
  font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: var(--grey); margin: 14px 2px 2px;
}

/* Session card */
.item {
  position: relative; width: 100%; text-align: left;
  background: var(--card); border: 1px solid var(--line); border-left: 4px solid var(--red);
  border-radius: var(--radius); padding: 14px 14px 14px 14px;
  display: grid; grid-template-columns: 64px 1fr; gap: 12px;
  cursor: pointer; color: inherit; font: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.item:active { transform: scale(.99); }
.item:focus-visible { outline: 3px solid var(--dark-blue); outline-offset: 2px; }

.item .time { font-size: 13px; font-weight: 700; color: var(--ink); line-height: 1.3; }
.item .time .end { display: block; font-weight: 500; color: var(--ink-soft); }

.item .body { min-width: 0; }
.item h3 { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.25; }
.item .sub { margin: 3px 0 0; font-size: 13.5px; color: var(--ink-soft); }
.item .who {
  margin-top: 8px; font-size: 12.5px; color: var(--grey);
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.item .chev { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--line); }


/* Break row */
.break {
  display: flex; align-items: center; gap: 12px;
  padding: 6px 14px; color: var(--grey); font-size: 13px;
}
.break .time { font-weight: 700; min-width: 56px; }
.break .label { font-weight: 600; }
.break .rule { flex: 1; height: 1px; background: var(--line); }

/* Status states */
.item.is-current {
  border-color: var(--red); box-shadow: 0 0 0 2px var(--red), var(--shadow-sm);
}
.item.is-current::before {
  content: "LIVE NOW"; position: absolute; top: -9px; left: 14px;
  background: var(--red); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 6px;
}
.item.is-past { opacity: .55; }
.badge-next {
  position: absolute; top: -9px; left: 14px;
  background: var(--dark-blue); color: #fff; font-size: 10px; font-weight: 800;
  letter-spacing: .1em; padding: 2px 8px; border-radius: 6px;
}

/* ---------- Detail sheet (modal) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(20,17,15,.5);
  opacity: 0; pointer-events: none; transition: opacity .2s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  max-width: 720px; margin: 0 auto;
  background: var(--card); border-radius: 20px 20px 0 0;
  max-height: 92vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .26s cubic-bezier(.2,.7,.2,1);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg);
}
.sheet.open { transform: translateY(0); }
.sheet-grip { width: 38px; height: 4px; border-radius: 4px; background: var(--line); margin: 10px auto 0; }
.sheet-head { position: sticky; top: 0; background: var(--card); padding: 6px 20px 12px; }
.sheet-close {
  position: absolute; right: 12px; top: 8px;
  width: var(--tap); height: var(--tap); border: 0; background: transparent;
  font-size: 24px; color: var(--grey); cursor: pointer; border-radius: 50%;
}
.sheet-close:active { background: var(--beige); }
.sheet .s-time { font-size: 13px; font-weight: 700; color: var(--red); margin: 8px 0 4px; }
.sheet h2 { margin: 0; font-size: 22px; line-height: 1.15; padding-right: 36px; }
.sheet .s-sub { margin: 6px 0 0; font-size: 15px; color: var(--ink-soft); }
.sheet-body { padding: 4px 20px 0; }
.sheet .s-desc { font-size: 15px; color: var(--ink); margin: 16px 0; }

.sheet .s-section-title {
  font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  color: var(--grey); margin: 20px 0 10px;
}

/* Speaker block */
.speaker { display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.speaker:first-of-type { border-top: 0; }
.speaker .avatar {
  width: 56px; height: 56px; border-radius: 50%; flex: none; overflow: hidden;
  background: var(--beige); display: grid; place-items: center;
  font-weight: 800; color: var(--red); font-size: 18px;
}
.speaker .avatar img { width: 100%; height: 100%; object-fit: cover; }
.speaker .s-name { font-weight: 700; font-size: 15.5px; }
.speaker .s-role { font-size: 13px; color: var(--ink-soft); margin-top: 1px; }
.speaker .s-org { font-size: 12.5px; color: var(--grey); }
.speaker .s-bio { font-size: 13.5px; color: var(--ink); margin-top: 6px; }
.speaker .s-links { margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; }
.speaker .s-links a {
  font-size: 12.5px; text-decoration: none; color: var(--dark-blue);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}

.no-slides { font-size: 13px; color: var(--grey); font-style: italic; }

/* In-sheet slideshow */
.slideshow { margin-top: 4px; }
.ss-frame {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line);
  background: #000; border-radius: 12px; overflow: hidden; position: relative;
  cursor: pointer; aspect-ratio: 16 / 9;
}
.ss-frame img { width: 100%; height: 100%; object-fit: contain; display: block; background: #fff; }
.ss-expand {
  position: absolute; right: 10px; bottom: 10px; width: 36px; height: 36px;
  background: rgba(20,17,15,.62); border-radius: 9px; display: grid; place-items: center;
}
.ss-expand svg { width: 20px; height: 20px; stroke: #fff; }
.ss-controls { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 10px; }
.ss-nav {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; display: grid; place-items: center; cursor: pointer; color: var(--ink);
}
.ss-nav:active { background: var(--beige); }
.ss-nav svg { width: 22px; height: 22px; }
.ss-count { font-size: 14px; font-weight: 700; color: var(--ink-soft); min-width: 56px; text-align: center; }

/* Fullscreen slide viewer */
.viewer {
  position: fixed; inset: 0; z-index: 60; background: #0b0a09;
  display: none; align-items: center; justify-content: center;
}
.viewer.open { display: flex; }
.viewer #vw-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.vw-bar {
  position: absolute; top: 0; left: 0; right: 0; display: flex; align-items: center;
  justify-content: space-between; padding: 10px 12px 28px 18px;
  padding-top: calc(10px + env(safe-area-inset-top));
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(0,0,0,0));
}
.vw-count { color: #fff; font-size: 14px; font-weight: 700; }
.vw-close {
  width: 44px; height: 44px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.16); display: grid; place-items: center;
}
.vw-close svg { width: 22px; height: 22px; stroke: #fff; }
.vw-nav {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
  width: 48px; height: 48px; border: 0; border-radius: 50%; cursor: pointer;
  background: rgba(255,255,255,.16); display: grid; place-items: center;
}
.vw-nav svg { width: 26px; height: 26px; stroke: #fff; }
.vw-prev { left: 10px; }
.vw-next { right: 10px; }

/* ---------- Footer ---------- */
.site-footer {
  max-width: 720px; margin: 0 auto; padding: 24px 18px 40px;
  font-size: 12px; color: var(--grey); text-align: center;
}

@media (min-width: 560px) {
  .hero h1 { font-size: 36px; }
  .item { grid-template-columns: 76px 1fr; }
}

/* =============================================================================
   Desktop / large-screen enhancements (≥ 900px).
   Purely additive — every rule below is gated behind a min-width or hover
   media query, so the mobile-first layout above is left completely unchanged.
   ========================================================================== */
@media (min-width: 900px) {
  /* Wider, comfortable reading column. Header tracks the landing width so the
     logo lines up with the home-page content. */
  .header-inner { max-width: 960px; padding: 14px 28px; }
  .logo img { height: 30px; }

  /* Landing: roomier hero + a clean 2×2 tile grid instead of stacked bars */
  .welcome { max-width: 960px; padding: 52px 28px 22px; }
  .welcome h1 { font-size: 44px; }
  .welcome .lead { font-size: 17px; }

  .tiles { max-width: 960px; padding: 12px 28px 32px; gap: 20px; }
  .tile-wide { grid-column: auto; }          /* stop spanning → balanced 2×2 */
  .tile, .tile-tall, .tile-photo { min-height: 210px; }
  .tile-text h2 { font-size: 25px; }
  .tile-text p  { font-size: 14.5px; max-width: 34ch; }

  /* Agenda: single chronological column (correct for a timeline), just wider
     and with a larger hero so it fills the viewport instead of hugging center */
  .hero      { max-width: 880px; padding: 40px 24px 8px; }
  .hero h1   { font-size: 42px; }
  .hero .lead{ font-size: 17px; }
  .livebar   { max-width: 880px; }
  .agenda    { max-width: 880px; gap: 12px; padding: 22px 24px 72px; }

  /* Content pages keep a narrower measure for readability, but get a taller
     hero image to feel less cramped on a big screen */
  .page      { max-width: 760px; padding: 26px 24px 64px; }
  .page-hero { height: 240px; }
  .site-footer { max-width: 960px; }
}

/* Mouse / trackpad pointers get hover affordances the touch UI (:active) lacks.
   hover:hover excludes touchscreens, so phones and tablets are unaffected. */
@media (hover: hover) {
  .tile { transition: transform .14s ease, box-shadow .14s ease; }
  .tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
  .item:hover { border-color: var(--dark-blue); transform: translateY(-1px);
                box-shadow: 0 4px 18px rgba(20,17,15,.10); }
  .pub { transition: transform .14s ease, box-shadow .14s ease, border-color .14s ease; }
  .pub:hover { border-color: var(--dark-blue); transform: translateY(-1px);
               box-shadow: 0 4px 18px rgba(20,17,15,.10); }
  .backbtn:hover, .sheet-close:hover, .ss-nav:hover { background: var(--beige); }
  .btn-primary:hover { filter: brightness(.94); }
  .vw-nav:hover, .vw-close:hover { background: rgba(255,255,255,.28); }
  .live-jump:hover { opacity: .85; }
  .page p a:hover, .speaker .s-links a:hover { text-decoration: underline; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
