/* Cornel Nesseler — site styles
   Fonts are self-hosted (SIL Open Font License), so pages make no requests to font services. */

@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Archivo";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  src: url("fonts/archivo-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-serif-4-latin-standard-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-serif-4-latin-ext-standard-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-serif-4-latin-standard-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-display: swap;
  font-weight: 200 900;
  src: url("fonts/source-serif-4-latin-ext-standard-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --sky: #dbeaf6;          /* header and footer bands */
  --sky-deep: #c4dbee;     /* photo placeholder */
  --tint: #edf5fb;         /* highlighted boxes, sub-menu */
  --ink: #13293d;
  --muted: #475c70;
  --link: #1d5d93;
  --accent: #3f7fb5;       /* lines and markers only, never text */
  --rule: #d5e3ee;
  --paper: #ffffff;

  --sans: "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --measure: 66ch;
}

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

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.65;
  font-optical-sizing: auto;
  text-rendering: optimizeLegibility;
}

img, iframe, video { display: block; max-width: 100%; }

p, li { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--link);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: min(100% - 2rem, 68rem);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper);
  font: 600 1rem/1.2 var(--sans);
}
.skip:focus { top: 1rem; }

/* ---------- Home: header band ---------- */

.hero {
  background: var(--sky);
  color: var(--ink);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2.5rem;
  padding-block: clamp(3rem, 7vw, 5rem);
}

.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--sans);
  font-size: clamp(2.6rem, 1.4rem + 4.6vw, 4.75rem);
  font-weight: 760;
  font-stretch: 115%;
  line-height: 0.98;
  letter-spacing: -0.012em;
}

.role {
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-size: 1.125rem;
  font-weight: 520;
  line-height: 1.4;
  color: var(--muted);
}

.pitch {
  max-width: 34ch;
  margin: 0 0 1.75rem;
  font-size: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
  line-height: 1.45;
}

.contact {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 560;
  line-height: 1.4;
}
.contact a {
  color: var(--ink);
  text-decoration-color: var(--accent);
}

.portrait {
  position: relative;
  width: 13rem;
  height: 13rem;
  overflow: hidden;
  border-radius: 50%;
  background: var(--sky-deep);
}
.portrait img {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 30%;
}
.initials {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-family: var(--sans);
  font-size: 2.75rem;
  font-weight: 700;
  font-stretch: 115%;
  color: var(--muted);
}

/* ---------- Other pages: slim header band ---------- */

.band {
  background: var(--sky);
  padding-block: 1.25rem 1.1rem;
}
.sitename {
  margin: 0;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 740;
  font-stretch: 115%;
  line-height: 1.15;
}
.sitename a {
  color: var(--ink);
  text-decoration: none;
}
.sitename a:hover { text-decoration: underline; }
.siterole {
  margin: 0.2rem 0 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.4;
  color: var(--muted);
}

/* ---------- Menus ---------- */

.sitenav {
  border-bottom: 1px solid var(--rule);
  background: var(--paper);
}
.sitenav ul,
.subnav ul {
  display: flex;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--sans);
  line-height: 1.4;
}
.sitenav ul {
  gap: 0.35rem 1.75rem;
  padding-block: 0.85rem;
  font-size: 1rem;
  font-weight: 560;
}
.sitenav a,
.subnav a {
  display: inline-block;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}
.sitenav a { padding-block: 0.15rem; }
.sitenav a:hover,
.subnav a:hover { color: var(--link); border-bottom-color: currentColor; }
.sitenav a[aria-current] { border-bottom-color: var(--accent); }

.subnav {
  background: var(--tint);
  border-bottom: 1px solid var(--rule);
}
.subnav ul {
  gap: 0.25rem 1.5rem;
  padding-block: 0.6rem;
  font-size: 0.9375rem;
  font-weight: 500;
}
.subnav a[aria-current] {
  font-weight: 650;
  border-bottom-color: var(--accent);
}

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

.section { padding-top: clamp(3rem, 6vw, 4.5rem); }
.section p { max-width: var(--measure); }

.section > h2 {
  margin: 0 0 1.5rem;
  font-family: var(--sans);
  font-size: 1.75rem;
  font-weight: 680;
  font-stretch: 106%;
  line-height: 1.2;
}

h3 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 640;
  line-height: 1.35;
}

.more {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin: 1.25rem 0 0;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

.feature {
  max-width: 52rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  border-left: 4px solid var(--accent);
  background: var(--tint);
}
.feature h3 {
  margin-bottom: 0.4rem;
  font-size: clamp(1.375rem, 1.2rem + 0.6vw, 1.625rem);
  font-weight: 660;
  line-height: 1.25;
}
.feature h3 a {
  color: var(--ink);
  text-decoration: none;
}
.feature h3 a:hover { text-decoration: underline; }
.feature p { margin: 0 0 1rem; }
.feature .more { margin: 1.25rem 0 0; }

.byline {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}
.feature .byline { margin-bottom: 1rem; }

.areas {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2.25rem 2.5rem;
}
.areas article {
  padding-top: 1rem;
  border-top: 3px solid var(--accent);
}
.areas p {
  margin: 0 0 0.75rem;
  font-size: 1.0625rem;
}
.areas a {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}

/* Publication-style lists: year in the margin, entry beside it */
.pubs {
  max-width: 54rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.pubs li {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 1rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
}
.pubs li:last-child { border-bottom: 1px solid var(--rule); }
.pubs .year {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.65;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.pubs .year.same { visibility: hidden; }
.pubs p { margin: 0; }
.pubs .entry > * + * { margin-top: 0.35rem; }
.pubs .authors { color: var(--muted); }
.pubs .me { color: var(--ink); font-weight: 620; }
.pubs .title { color: var(--ink); }
a.title { text-decoration-color: rgb(29 93 147 / 0.45); }
a.title:hover { text-decoration-color: var(--link); }
.pubs .download {
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 560;
}

.writing {
  max-width: 54rem;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}
.writing li {
  padding: 0.9rem 0;
  border-top: 1px solid var(--rule);
}
.writing li:last-child { border-bottom: 1px solid var(--rule); }
.writing .byline {
  display: block;
  margin-top: 0.2rem;
}

.apps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.75rem 2.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.apps p {
  margin: 0;
  font-size: 1.0625rem;
}
.apps .byline { margin-top: 0.35rem; }

/* ---------- Inner pages ---------- */

.page { padding-top: clamp(2.25rem, 5vw, 3.5rem); }

.page-title,
.page > h1 {
  margin: 0 0 1.25rem;
  font-family: var(--sans);
  font-size: clamp(2rem, 1.5rem + 2vw, 2.75rem);
  font-weight: 720;
  font-stretch: 108%;
  line-height: 1.1;
}

.lede {
  max-width: 60ch;
  margin: 0 0 2rem;
  font-size: 1.25rem;
  line-height: 1.55;
}

.prose { max-width: 54rem; }
.prose > * { max-width: var(--measure); }
.prose > .wide,
.prose > .pubs,
.prose > .tiles,
.prose > .embed,
.prose > figure { max-width: none; }
.prose h2 {
  margin: 2.75rem 0 0.75rem;
  font-family: var(--sans);
  font-size: 1.5rem;
  font-weight: 680;
  font-stretch: 106%;
  line-height: 1.25;
}
.prose h3 { margin-top: 2rem; }
.prose ul, .prose ol { padding-left: 1.25rem; }
.prose li + li { margin-top: 0.35rem; }
.prose hr {
  margin: 2.5rem 0;
  border: 0;
  border-top: 1px solid var(--rule);
}
.prose figure { margin: 2rem 0; }
.prose figure img { border-radius: 4px; }
.prose figcaption {
  margin-top: 0.5rem;
  font-family: var(--sans);
  font-size: 0.9375rem;
  color: var(--muted);
}

/* Picture links to other pages (research areas, esports resources) */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: 2rem 2.5rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.tiles a {
  display: block;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 640;
  line-height: 1.35;
  text-decoration: none;
}
.tiles img {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  margin-bottom: 0.75rem;
  border-radius: 4px;
  background: var(--tint);
}
.tiles a:hover span { text-decoration: underline; }
.tiles p {
  margin: 0.4rem 0 0;
  font-size: 1.0625rem;
}

/* Embedded forms, maps and games */
.embed {
  margin: 1.5rem 0 0;
}
.embed iframe {
  width: 100%;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--paper);
}

.note {
  max-width: var(--measure);
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--accent);
  background: var(--tint);
  font-size: 1.0625rem;
}

/* Legal texts read better a little smaller */
.legal { font-size: 1.0625rem; }
.legal h2 { font-size: 1.3125rem; margin-top: 2.25rem; }

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

.footer {
  margin-top: clamp(3.5rem, 7vw, 5rem);
  padding-block: 2rem 2.5rem;
  background: var(--sky);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.footer a { color: var(--ink); text-decoration-color: var(--accent); }
.footer p { margin: 0 0 0.5rem; }
.footer .more { margin: 0 0 1rem; font-weight: 560; }
.footer .stamp { color: var(--muted); }

/* ---------- Phones ---------- */

@media (max-width: 47.99rem) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    padding-block: 2rem 2.75rem;
  }
  .portrait {
    order: -1;
    width: 7.5rem;
    height: 7.5rem;
  }
  .initials { font-size: 1.75rem; }
  .sitenav ul { gap: 0.35rem 1.25rem; }
  .subnav ul { gap: 0.2rem 1.1rem; }
  .pubs li { grid-template-columns: 3.25rem minmax(0, 1fr); gap: 0.75rem; }
}

@media print {
  .sitenav, .subnav, .skip, .portrait { display: none; }
  .hero, .band, .footer { background: none; }
  .hero-grid { grid-template-columns: 1fr; padding-block: 0 1rem; }
}

/* ---------- Lists of projects, articles and studies ---------- */

.projects {
  max-width: 54rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.projects > li,
.study {
  padding: 1.5rem 0;
  border-top: 1px solid var(--rule);
}
.projects > li:last-child,
.study:last-child { border-bottom: 1px solid var(--rule); }
.projects h2,
.study h2 {
  margin: 0 0 0.35rem;
  font-family: var(--sans);
  font-size: 1.25rem;
  font-weight: 660;
  line-height: 1.3;
}
.study h2 a {
  color: var(--ink);
  text-decoration-color: rgb(29 93 147 / 0.45);
}
.projects p,
.study p {
  max-width: var(--measure);
  margin: 0.5rem 0 0;
}
.projects .more,
.study .more { margin-top: 0.75rem; }
.studies { max-width: 54rem; }
.study img {
  width: min(100%, 34rem);
  margin: 1rem 0 0.25rem;
  border-radius: 4px;
}

/* App screenshots, side by side */
.shots {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  margin: 1.75rem 0;
}
.shots img {
  width: auto;
  max-width: min(100%, 22rem);
  max-height: 36rem;
  border: 1px solid var(--rule);
  border-radius: 6px;
  background: var(--tint);
}

.areas.spaced { margin-top: 2rem; }
/* On the Research areas and Apps pages these titles are h2s, styled like the h3s on the homepage */
.areas h2,
.apps h2 {
  margin: 0 0 0.5rem;
  font-family: var(--sans);
  font-size: 1.1875rem;
  font-weight: 640;
  line-height: 1.35;
}
.areas h2 a,
.areas h3 a {
  color: var(--ink);
  font-size: inherit;
  font-weight: inherit;
}

/* The interactive map brings its own styles */
.widget { margin-top: 0.5rem; }

.legal h3 {
  margin: 1.5rem 0 0.4rem;
  font-size: 1.0625rem;
}

@media (max-width: 47.99rem) {
  .shots img { max-width: calc(50% - 0.625rem); }
}

/* ---------- Home: featured study with its figure ---------- */

.latest {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.75rem;
}
@media (min-width: 64rem) {
  .latest {
    grid-template-columns: minmax(0, 46rem) minmax(13rem, 1fr);
    align-items: start;
    gap: 2.5rem;
  }
}
.latest .feature { max-width: none; }

.replies {
  max-width: 34rem;
  margin: 0;
  font-family: var(--sans);
}
.replies figcaption {
  margin-bottom: 0.9rem;
  font-size: 1rem;
  font-weight: 650;
  line-height: 1.35;
}
.reply-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.2rem 0.75rem;
  margin-bottom: 0.9rem;
}
.reply-label { font-size: 0.9375rem; line-height: 1.35; }
.reply-value {
  font-size: 1rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.reply-track {
  grid-column: 1 / -1;
  height: 0.75rem;
  border-radius: 4px;
  background: #e6ecf1;
}
.reply-fill {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: var(--accent);
}
.reply-source {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- Home: the book ---------- */

.book {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.5rem;
  max-width: 52rem;
}
.book:has(.book-cover) { grid-template-columns: 9rem minmax(0, 1fr); }
.book-cover {
  width: 9rem;
  height: auto;
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.book h3 { font-size: 1.375rem; }
.book h3 a { color: var(--ink); text-decoration-color: rgb(29 93 147 / 0.45); }
.book p { margin: 0 0 0.75rem; }
/* Phones: a smaller cover beside the title, the description below at full width */
@media (max-width: 35.99rem) {
  .book:has(.book-cover) { grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 1rem; }
  .book-cover { width: 5.5rem; grid-row: 1 / span 2; margin-bottom: 1rem; }
  .book:has(.book-cover) > div { display: contents; }
  .book:has(.book-cover) h3 { grid-column: 2; align-self: end; font-size: 1.25rem; }
  .book:has(.book-cover) .byline { grid-column: 2; align-self: start; }
  .book:has(.book-cover) > div > p:not(.byline) { grid-column: 1 / -1; }
}

/* ---------- Writing and media ---------- */

.media-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0 2.5rem;
  max-width: 64rem;
}
@media (min-width: 56rem) {
  .media-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.media-cols h3 { margin: 1.5rem 0 0; }
.media-cols .writing { margin-top: 0.6rem; }

.press {
  max-width: var(--measure);
  margin: 1.75rem 0 0;
  padding: 0.9rem 1.1rem;
  border-left: 4px solid var(--accent);
  background: var(--tint);
  font-size: 1.0625rem;
}
.prose .press-plain { margin-top: 0; }

/* Free-to-read copy next to a publication */
.free {
  margin-left: 0.35rem;
  font-family: var(--sans);
  font-size: 0.875rem;
  font-weight: 600;
  white-space: nowrap;
}

/* Screenshots that already include a phone frame */
.shots img.framed {
  border: 0;
  border-radius: 0;
  background: none;
}
