/* ---------- tokens ---------- */

:root {
  --paper: #f2f1f6;
  --ink: #1d2140;
  --muted: #5b5f7a;
  --rule: #cfcfdd;
  --focus: #d9952e;
  --hue-l: 0.66;     /* rainbow lightness + chroma, per theme */
  --hue-c: 0.17;
  --link: #2e3a87;
  --tbd-bg: #fff0c2;
  --tbd-ink: #6b4a00;

  --serif: "STIX Two Text", "STIX Two Math", Georgia, serif;
  --sans: "Schibsted Grotesk", system-ui, sans-serif;

  --measure: 34rem;
  --gutter: clamp(1rem, 5vw, 4rem);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #15172a;
    --ink: #e8e8f2;
    --muted: #a3a6c2;
    --rule: #2e3150;
    --focus: #f0b65a;
    --hue-l: 0.78;
    --hue-c: 0.15;
    --link: #aab3f5;
    --tbd-bg: #4a3a12;
    --tbd-ink: #ffe3a0;
  }
}
:root[data-theme="dark"] {
  --paper: #15172a;
  --ink: #e8e8f2;
  --muted: #a3a6c2;
  --rule: #2e3150;
  --focus: #f0b65a;
  --hue-l: 0.78;
  --hue-c: 0.15;
  --link: #aab3f5;
  --tbd-bg: #4a3a12;
  --tbd-ink: #ffe3a0;
}

/* ---------- base ---------- */

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--link); text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 2px; }

.tbd {
  background: var(--tbd-bg);
  color: var(--tbd-ink);
  padding: 0 0.25em;
  border-radius: 3px;
}

/* ---------- hero ---------- */

.hero {
  padding: 1.5rem var(--gutter) 5rem;
  max-width: 72rem;
  margin: 0 auto;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  margin-bottom: clamp(4rem, 12vw, 9rem);
}
.nav a { color: var(--muted); text-decoration: none; }
.nav a:hover { color: var(--ink); }

.masthead {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.kao {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  letter-spacing: -0.02em;
  line-height: 1;
  display: inline-block;
  transform-origin: 50% 80%;
  animation: purr 4s ease-in-out 1.8s infinite;
}
.kao sub {
  font-size: 0.72em;
  line-height: 0;
  vertical-align: baseline;
  position: relative;
  top: 0.18em;
  margin: 0 -0.03em;
}
.kao:hover { animation: wiggle 0.6s ease-in-out; }
.kao { touch-action: manipulation; user-select: none; -webkit-user-select: none; }
/* Double-tap on a phone: the cat follows the device tilt instead of purring. */
.kao.gyro, .kao.gyro:hover {
  animation: none;
  transform: rotate(var(--tilt, 0deg));
  transition: transform 80ms linear;
}
@media (prefers-reduced-motion: reduce) { .kao { animation: none; } }

.logo .ink   { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; }
.logo .glyph { font-family: var(--sans); font-weight: 700; fill: currentColor; }
.logo .omega { font-family: var(--serif); font-style: italic; fill: currentColor; }
.logo .blush { fill: #f08ca6; opacity: 0.75; }

.logo {
  flex: none;
  width: clamp(4.25rem, 8vw, 6rem);
  height: auto;
  color: var(--ink);
  transform-origin: 50% 90%;
  animation: purr 4s ease-in-out 1.8s infinite;
}
.logo:hover { animation: wiggle 0.6s ease-in-out; }

@keyframes purr {
  0%, 100% { transform: rotate(0deg); }
  50%      { transform: rotate(-4deg); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0deg); }
  25%      { transform: rotate(6deg); }
  75%      { transform: rotate(-6deg); }
}
@media (prefers-reduced-motion: reduce) {
  .logo { animation: none; }
}

.kicker {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0;
}

.title {
  font-family: var(--sans);
  font-weight: 700;
  font-size: clamp(3rem, 10vw, 8rem);
  line-height: 0.92;
  letter-spacing: -0.035em;
  margin: 0;
}
/* On wide screens the title sits on two lines: "Quantitative Type Theory" / "& Applications". */
@media (min-width: 60rem) {
  .title { font-size: clamp(2.75rem, 5.5vw, 4.5rem); }
  .title .narrow { display: none; }
}

.lede {
  font-size: clamp(1.25rem, 2.4vw, 1.625rem);
  margin: 1.5rem 0 0;
  max-width: var(--measure);
}

/* The interval [0, +∞]: the week, from 0 to +∞. */

.interval {
  margin: clamp(3.5rem, 9vw, 6rem) 0 0;
  padding: 0 2.75rem 0 1.75rem;  /* room for the 0 and +∞ labels */
}

.interval-track {
  position: relative;
  height: 2px;
  background: var(--rule);
}

.interval-fill {
  position: absolute;
  inset: -1px 0;
  /* rainbow from red (0) to violet (+∞); stops match the day dots */
  background: linear-gradient(to right in oklch,
    oklch(var(--hue-l) var(--hue-c) 25),
    oklch(var(--hue-l) var(--hue-c) 94),
    oklch(var(--hue-l) var(--hue-c) 163),
    oklch(var(--hue-l) var(--hue-c) 231),
    oklch(var(--hue-l) var(--hue-c) 300));
  transform-origin: left center;
  animation: fill 1.6s cubic-bezier(.6, 0, .2, 1) 0.2s both;
}

.endpoint {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--serif);
  font-size: 1.25rem;
  color: var(--muted);
}
.endpoint-0 { right: calc(100% + 0.75rem); }
.endpoint-1 { left: calc(100% + 0.75rem); }

.days {
  list-style: none;
  margin: 0;
  padding: 0;
}

.days li {
  position: absolute;
  left: calc(var(--t) * 100%);
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: appear 0.4s ease-out both;
  animation-delay: calc(0.2s + var(--t) * 1.4s);
}

.dot {
  width: 0.875rem;
  height: 0.875rem;
  margin-top: -0.4375rem;
  border-radius: 50%;
  background: oklch(var(--hue-l) var(--hue-c) calc(25 + var(--t) * 275));
  box-shadow: 0 0 0 4px var(--paper);
}

.day {
  margin-top: 0.875rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

.date {
  font-family: var(--sans);
  font-weight: 500;
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.1;
}

@keyframes fill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- sections ---------- */

main {
  max-width: 72rem;
  margin: 0 auto;
  padding: 3rem var(--gutter) 0;
}

.section {
  display: grid;
  grid-template-columns: minmax(9rem, 1fr) minmax(0, 3fr);
  gap: 1rem 3rem;
  padding: 2.5rem 0 3rem;
  border-top: 1px solid var(--rule);
  scroll-margin-top: 1rem;
}

.section h2 {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1.25rem;
  line-height: 1.6;
  margin: 0;
}

.body { max-width: var(--measure); }
.body > :first-child { margin-top: 0; }
.body > :last-child { margin-bottom: 0; }
.body p { margin: 0 0 1em; }

.topics {
  margin: 0;
  padding-left: 1.25em;
}
.topics li::marker { color: var(--muted); }
.topics li + li { margin-top: 0.5em; }

.schedule {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
}
.schedule li {
  display: grid;
  grid-template-columns: 8.5rem 1fr;
  gap: 1rem;
  align-items: baseline;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--rule);
}
.schedule .when {
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}
.schedule .what { justify-self: start; }

.talks-heading {
  font-family: var(--sans);
  font-weight: 500;
  font-size: 1rem;
  color: var(--muted);
  margin: 2.5rem 0 0.5rem;
}

.talks {
  list-style: none;
  margin: 0;
  padding: 0;
}
.talks li { border-bottom: 1px solid var(--rule); }
.talks summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.125rem 1rem;
  align-items: baseline;
  padding: 0.85rem 0;
  cursor: pointer;
  list-style: none;
}
.talks summary::-webkit-details-marker { display: none; }
.talks summary::after {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  content: "+";
  font-family: var(--sans);
  font-size: 1.25rem;
  color: var(--muted);
  transition: transform 0.2s;
}
.talks details[open] summary::after { transform: rotate(45deg); }
.talks summary:hover .talk-title { text-decoration: underline; text-underline-offset: 0.18em; }
.talks .talk-plain {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.125rem;
  padding: 0.85rem 0;
}
.talk-title { font-weight: 600; grid-column: 1; }
.talk-speaker {
  grid-column: 1;
  font-family: var(--sans);
  font-size: 0.9375rem;
}
.talk-speaker .affil { color: var(--muted); }
.abstract { padding: 0 0 1.25rem; color: var(--ink); }
.abstract p { margin: 0 0 0.75em; }
.abstract p:last-child { margin-bottom: 0; }
.talk-link { font-family: var(--sans); font-size: 0.9375rem; color: var(--muted); }
.abstract .refs { list-style: none; margin: 0; padding: 0; }
.talks .refs li { border-bottom: none; overflow-wrap: anywhere; }

.people {
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}
.people li { margin-bottom: 0.75rem; }
.people .name { display: block; font-weight: 600; }
.people .affil { color: var(--muted); }
.people .affil.tbd { color: var(--tbd-ink); }

.photo {
  margin: 0 0 2rem;
  max-width: none;
}
.photo img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 3px;
}
.photo figcaption {
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}

.roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 0 2rem;
  max-width: none;
}

/* ---------- footer ---------- */

.footer {
  max-width: 72rem;
  margin: 0 auto;
  padding: 2rem var(--gutter) 3rem;
  border-top: 1px solid var(--rule);
  font-family: var(--sans);
  font-size: 0.875rem;
  color: var(--muted);
}
.footer p { margin: 0; }

/* ---------- small screens ---------- */

@media (max-width: 40rem) {
  body { font-size: 1.0625rem; }
  .section { grid-template-columns: 1fr; gap: 0.75rem; padding: 2rem 0 2.5rem; }
  .schedule li { grid-template-columns: 1fr; gap: 0.125rem; }
  .interval { padding: 0 2.5rem 0 1.25rem; }
  .day { font-size: 0.8125rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .interval-fill, .days li { animation: none; }
}
