/* ==========================================================================
   CELLS — Workshop on Computing among Cells
   One stylesheet, no build step, no framework, no JavaScript, no external
   requests. Colours follow the original site: white ground, black text, and
   the blue and green of the CELLS mark.
   ========================================================================== */

:root {
  --ink:       #101010;
  --ink-soft:  #666666;
  --line:      #e3e3e3;
  --link:      #336394;   /* the mark's blue, muted; kept 3:1 against body text so
                             links stay identifiable without an underline */
  --green:     #3e7e0c;   /* the green of the mark; only the masthead rule uses it */
  --band:      #f5f9fd;
  --band-soft: #fafcfe;   /* next edition, a shade lighter than the banner */
  --panel:     #f8f8f8;
  --panel-line:#e6e6e6;
  --year:      #c9d2dc;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
          Arial, "Noto Sans", sans-serif;

  /* Type scale. Six steps, and nothing on the site uses a size outside them. */
  --t-sm:   .95rem;
  --t-base: 1.0625rem;
  --t-md:   1.2rem;
  --t-lg:   1.4rem;
  --t-xl:   clamp(1.45rem, 1.15rem + 1.4vw, 1.75rem);   /* speaker names */
  --t-2xl:  clamp(1.85rem, 1.35rem + 2.4vw, 2.4rem);

  /* Three weights only: light for display, regular for text, semibold for emphasis. */
  --w-display: 300;
  --w-body:    400;
  --w-bold:    600;

  --tracking-display: -.02em;   /* tightening, applied only at --t-2xl */
  --measure: 44rem;
  --page: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: #ffffff;
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-base);
  font-weight: var(--w-body);
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1, h2, h3 { font-weight: var(--w-display); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: var(--t-2xl); font-weight: var(--w-bold); letter-spacing: var(--tracking-display); }
h2 { font-size: var(--t-lg); }
h3 { font-size: var(--t-md); font-weight: var(--w-body); }
p, ul, ol { margin: 0 0 1em; }
ul, ol { padding-left: 1.2em; }
img { max-width: 100%; height: auto; }
abbr[title] { text-decoration: none; }

/* Links carry no rule until they are hovered or focused. */
a { color: var(--link); text-decoration: none; }
a:hover,
a:focus-visible { text-decoration: underline; text-underline-offset: .2em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: .5rem; top: .5rem; background: #fff; padding: .5rem .75rem;
                   border: 1px solid var(--line); z-index: 2; }

.container { width: min(100% - 2.5rem, var(--page)); margin-inline: auto; }
.measure { max-width: var(--measure); }

/* --- Header ------------------------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); padding: .9rem 0; }
.site-header__inner { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem 1.5rem; }

.brand { font-weight: var(--w-bold); color: var(--ink); text-decoration: none; }
.brand span { color: var(--ink-soft); font-weight: var(--w-body); }

.nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; margin: 0; padding: 0; }
.nav a { font-size: var(--t-sm); }

@media (min-width: 46rem) { .nav { margin-left: auto; } }

/* --- Masthead ----------------------------------------------------------- */
.masthead {
  position: relative;
  background: var(--band);
  border-bottom: 1px solid var(--line);
  padding: 2.5rem 0 2rem;
  overflow: hidden;
}

.banner-motif, .banner-motif img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .3; pointer-events: none;
  /* The shapes live in the right-hand part of the viewBox, and this fade keeps
     them clear of the logo and headings whatever the banner's width. */
  -webkit-mask-image: linear-gradient(to right, transparent 0 56%, #000 80%);
          mask-image: linear-gradient(to right, transparent 0 56%, #000 80%);
}

@media (prefers-reduced-motion: reduce) {
  .m, }

.masthead .container { position: relative; }
.masthead__logo { width: min(100%, 38rem); display: block; margin-bottom: 1.25rem; }
.masthead h1 { margin-bottom: .15em; }
.masthead__tagline { color: var(--ink-soft); font-size: var(--t-md); margin-bottom: 0; }
.masthead__tagline::after {
  content: ""; display: block; width: 2.25rem; height: 2px;
  background: var(--green); margin-top: .9rem;
}
.masthead__when { color: var(--ink-soft); margin: 1rem 0 0; }

@media (max-width: 60rem) {
  .banner-motif, .footer-motif { display: none; }   /* no room beside the logo */
}

/* --- Sections: heading in the left column, as on the original site ------ */

.section { position: relative; padding: 2.25rem 0; border-top: 1px solid var(--line); }
.section::before {
  content: "";
  position: absolute; top: -5px; left: 50%; margin-left: -4.5px;
  width: 9px; height: 9px;
  border: 1px solid var(--line); border-radius: 50%; background: #fff;
}
.section:first-of-type { border-top: 0; }
.section:first-of-type::before { display: none; }

/* Tinted the full width of the window. The cell glyph straddles the rule, so it
   is filled half in one ground and half in the other. */
.section--next { background: var(--band-soft); }
.section--next::before {
  background: linear-gradient(to bottom, #fff 50%, var(--band-soft) 50%);
}
.section--next + .section::before {
  background: linear-gradient(to bottom, var(--band-soft) 50%, #fff 50%);
}

.section__grid { display: grid; gap: .75rem; grid-template-columns: 1fr; }
.section__label { margin: 0 0 .75rem; }
.section__label--strong { font-weight: var(--w-bold); }
.section__body > :last-child { margin-bottom: 0; }

@media (min-width: 56rem) {
  .section__grid { grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; }
  .section__label { margin-bottom: 0; }
}

/* --- Editions ----------------------------------------------------------- */

.editions { list-style: none; padding: 0; margin: 0; }
.editions > li { margin: 0 0 2rem; }
.editions > li:last-child { margin-bottom: 0; }

.edition { display: grid; grid-template-columns: 1fr; gap: .35rem; }
.edition__year {
  font-size: var(--t-2xl); font-weight: var(--w-display); line-height: 1.05;
  letter-spacing: var(--tracking-display); color: var(--year); margin: 0;
}
.edition__body > :last-child { margin-bottom: 0; }
.edition--next .edition__name { font-weight: var(--w-bold); }
.edition--next .edition__year { font-weight: var(--w-body); color: var(--ink-soft); }

.edition__name {
  margin: 0 0 .4rem; font-size: var(--t-2xl); font-weight: var(--w-body); line-height: 1.05;
  letter-spacing: var(--tracking-display);
}
.edition__when { margin: 0 0 .45rem; color: var(--ink-soft); font-size: var(--t-sm); }
/* The DISC links take this line's colour; only the hover underline marks them. */
.edition__when a { color: inherit; }
.edition__people { margin: 0 0 .3rem; }
.edition__people:last-child { margin-bottom: 0; }

@media (min-width: 46rem) {
  .edition { grid-template-columns: 6rem minmax(0, 1fr); gap: 0 1.5rem; }
  .edition__body { border-left: 1px solid var(--line); padding-left: 1.4rem; }
}

/* --- Programme ---------------------------------------------------------- */

.programme { list-style: none; padding: 0; margin: 0; --time-col: 4.5rem; }
.programme > li { display: grid; grid-template-columns: 1fr; gap: .2rem; margin: 0 0 1.5rem; }
.programme > li:last-child { margin-bottom: 0; }

.programme .time {
  margin: 0; font-size: var(--t-lg); font-weight: var(--w-bold); line-height: 1.15;
  font-variant-numeric: tabular-nums;
}
.programme__body > :last-child { margin-bottom: 0; }
.programme__name { margin: 0 0 .15rem; font-size: var(--t-lg); font-weight: var(--w-bold); line-height: 1.15; }
.programme .talk { margin: 0; color: var(--ink-soft); font-size: var(--t-base); }

@media (min-width: 46rem) {
  .programme > li { grid-template-columns: var(--time-col) minmax(0, 1fr); gap: 0 1.5rem; }
  .programme__body { border-left: 1px solid var(--line); padding-left: 1.4rem; }
}

/* --- Speakers ----------------------------------------------------------- */

.speaker {
  background: var(--panel);
  border: 1px solid var(--panel-line);
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}
.speaker:last-child { margin-bottom: 0; }
.speaker::after { content: ""; display: block; clear: both; }

.speaker__photo,
.speaker__placeholder { float: right; width: 190px; margin: .25rem 0 1.25rem 1.75rem; }

/* Shown until a real photograph is dropped in. */
.speaker__placeholder {
  height: 190px;
  border: 1px solid var(--panel-line); background: #fff;
  color: var(--ink-soft); font-size: var(--t-base);
  display: flex; align-items: center; justify-content: center;
}

.speaker__name { margin: 0 0 .25rem; font-size: var(--t-xl); font-weight: var(--w-bold); }
.speaker__affiliation { color: var(--ink-soft); font-size: var(--t-sm); margin: 0 0 .7rem; }
.speaker__title { color: var(--ink); margin: 0 0 1rem; font-size: var(--t-lg); font-weight: var(--w-bold); }
.label { font-weight: var(--w-bold); }

@media (max-width: 40rem) {
  .speaker { padding: 1.25rem; }
  .speaker__photo, .speaker__placeholder { float: none; margin: 0 0 1rem; }
}

/* --- Simple lists ------------------------------------------------------- */

.plain { list-style: none; padding: 0; margin: 0; }
.plain > li { margin: 0 0 .8rem; }
.plain .where { color: var(--ink-soft); font-size: var(--t-sm); }

/* --- Footer ------------------------------------------------------------- */

.site-footer { position: relative; overflow: hidden; background: var(--band);
               border-top: 1px solid var(--line); margin-top: 2.5rem; padding: 2rem 0 3.25rem;
               color: var(--ink-soft); font-size: var(--t-sm); }

/* The same field as the banner, standing still. */
.footer-motif {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: .26; pointer-events: none;
  -webkit-mask-image: linear-gradient(to right, transparent 0 42%, #000 70%);
          mask-image: linear-gradient(to right, transparent 0 42%, #000 70%);
}
.site-footer .container { position: relative; }
.site-footer p { margin: 0 0 .25rem; }

/* --- Print -------------------------------------------------------------- */

@media print {
  .site-header, .skip-link { display: none; }
  body { font-size: 11pt; }
  .masthead, .site-footer { background: none; padding: 0 0 1rem; }
  .banner-motif, .footer-motif { display: none; }
  .section { break-inside: avoid; }
  .section::before { display: none; }
  .section__grid { grid-template-columns: 1fr; gap: .5rem; }
  .speaker { break-inside: avoid; background: none; border: 0; padding: 0 0 1rem; }
  .speaker__photo, .speaker__placeholder { display: none; }
  a { color: #000; }
  a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; color: #555;
                           word-break: break-all; }
}
