/* Decipher Physics: one style for the whole site (October 2026).
   Warm paper, ink, a book-style serif for reading and a plain sans for labels. */

:root {
  --paper: #fbfaf7;
  --ink: #1d1d1f;
  --muted: #6b6b6b;
  --faint: #9a9a9a;
  --rule: #e6e2d9;
  --card: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Newsreader', Georgia, serif;
  font-size: 20px;
  line-height: 1.6;
}

a {
  color: inherit;
}

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

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px;
}

.wide {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.sans,
.top,
h2,
figcaption,
.button,
.small,
.fine,
footer,
.label {
  font-family: 'Inter', system-ui, sans-serif;
}

/* Header */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 26px 0;
  font-size: 15px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
  font-family: 'Newsreader', Georgia, serif;
  font-weight: 500;
  font-size: 21px;
  letter-spacing: -0.005em;
  white-space: nowrap;
}

/* Alex's own logo (public/logo-black.png): the attractor fills the middle of a square picture */
.brand img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  display: block;
}

.top nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  justify-content: flex-end;
}

.top nav a {
  text-decoration: none;
  color: var(--muted);
}

.top nav a:hover,
.top nav a[aria-current="page"] {
  color: var(--ink);
}

.top nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

/* Text */
.intro {
  padding: 44px 0 8px;
}

h1 {
  font-weight: 500;
  font-size: 46px;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 26px;
}

h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 72px 0 18px;
}

h3 {
  font-weight: 500;
  font-size: 24px;
  line-height: 1.3;
  margin: 36px 0 10px;
}

h4 {
  font-weight: 500;
  font-size: 20px;
  line-height: 1.35;
  margin: 26px 0 8px;
}

/* "Last updated", under the title of the privacy policy and the terms */
.updated {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  color: var(--muted);
}

p {
  margin: 0 0 18px;
}

ul {
  margin: 0 0 18px;
  padding-left: 22px;
}

li {
  margin-bottom: 6px;
}

.lead {
  font-size: 22px;
  line-height: 1.55;
}

.small {
  font-size: 14px;
  color: var(--muted);
}

.fine {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 14px;
}

.more {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 1px;
}

/* Buttons */
.buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 12px;
}

.button {
  display: inline-block;
  font-weight: 600;
  font-size: 16px;
  background: var(--ink);
  color: #fff;
  padding: 13px 22px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid var(--ink);
}

.button:hover {
  background: #000;
}

.button.secondary {
  background: transparent;
  color: var(--ink);
}

.button.secondary:hover {
  background: var(--card);
}

/* Clips */
figure {
  margin: 44px -64px;
}

figure video {
  width: 100%;
  display: block;
  border-radius: 10px;
  background: #000;
  aspect-ratio: 16 / 9;
}

figcaption {
  font-size: 14px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}

.sound {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.credit {
  display: block;
  font-size: 12px;
  margin-top: 4px;
  color: var(--faint);
}

.pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 44px -64px;
}

.pair figure {
  margin: 0;
}

/* Price rows (commissions) */
.prices {
  border-top: 1px solid var(--rule);
  margin-bottom: 18px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.row .what {
  font-weight: 500;
}

.row .note {
  display: block;
  font-size: 17px;
  color: var(--muted);
  font-weight: 400;
}

.row .price {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  white-space: nowrap;
}

/* Lists of things (app features, courses) */
.items {
  border-top: 1px solid var(--rule);
  margin: 0 0 22px;
}

.item {
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.item b {
  font-weight: 500;
}

.item span {
  display: block;
  font-size: 17px;
  color: var(--muted);
}

/* App screenshots */
.shots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 36px -64px 28px;
}

.shots img {
  width: 100%;
  display: block;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background: var(--card);
}

/* Lectures page */
.course {
  margin-top: 72px;
}

.lectures {
  list-style: none;
  padding: 0;
  margin: 26px 0 0;
  border-top: 1px solid var(--rule);
}

.lectures li {
  margin: 0;
  border-bottom: 1px solid var(--rule);
}

.lectures a {
  display: grid;
  grid-template-columns: 176px 1fr;
  gap: 22px;
  align-items: center;
  padding: 16px 0;
  text-decoration: none;
}

.lectures img {
  width: 176px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  display: block;
  background: #000;
}

.lectures .t {
  display: block;
  font-weight: 500;
  font-size: 20px;
  line-height: 1.35;
}

.lectures .d {
  display: block;
  font-size: 17px;
  color: var(--muted);
  margin-top: 2px;
}

.lectures a:hover .t {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Sign-off */
.sign {
  margin-top: 48px;
}

.sign .name {
  font-style: italic;
  font-size: 22px;
  line-height: 1.2;
}

/* The request form (request.html) */
.form {
  margin-top: 8px;
}

.field {
  margin: 0 0 26px;
  padding: 0;
  border: 0;
  min-width: 0;
}

.field label,
.field legend {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  padding: 0;
}

.field .optional {
  font-weight: 400;
  color: var(--muted);
}

.field .hint {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: var(--muted);
  margin: -2px 0 8px;
}

.field input[type="text"],
.field input[type="email"],
.field textarea {
  display: block;
  width: 100%;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--card);
  border: 1px solid #d6d1c4;
  border-radius: 8px;
  padding: 11px 13px;
}

.field textarea {
  min-height: 210px;
  resize: vertical;
}

.field input:focus,
.field textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: 1px;
  border-color: var(--ink);
}

.field .choice {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Newsreader', Georgia, serif;
  font-size: 19px;
  font-weight: 400;
  margin: 6px 0;
  cursor: pointer;
}

.field .choice input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

button.button {
  font-family: 'Inter', system-ui, sans-serif;
  cursor: pointer;
}

button.button:disabled {
  opacity: 0.6;
  cursor: default;
}

/* Hidden from people: only robots fill it in */
.hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.notice {
  border: 1px solid var(--rule);
  background: var(--card);
  border-radius: 10px;
  padding: 22px 24px 6px;
  margin: 8px 0 24px;
}

.notice:focus {
  outline: none;
}

.notice.error {
  border-color: #e4b9ad;
  background: #fdf5f2;
}

.notice h3 {
  margin-top: 0;
}

[hidden] {
  display: none !important;
}

/* Footer */
footer {
  font-size: 14px;
  color: var(--muted);
  border-top: 1px solid var(--rule);
  margin-top: 96px;
  padding: 26px 0 56px;
}

footer .links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-bottom: 12px;
}

footer a {
  text-decoration: none;
}

footer a:hover {
  color: var(--ink);
}

@media (max-width: 860px) {
  figure,
  .pair,
  .shots {
    margin-left: 0;
    margin-right: 0;
  }
}

/* Phones and narrow windows: the menu goes under the name, in two neat rows of three */
@media (max-width: 860px) {
  .top {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 20px 0;
  }

  .top nav {
    display: grid;
    grid-template-columns: repeat(3, max-content);
    gap: 8px 26px;
  }
}

@media (max-width: 720px) {
  body {
    font-size: 18px;
  }

  h1 {
    font-size: 34px;
  }

  .lead {
    font-size: 19px;
  }

  .pair {
    grid-template-columns: 1fr;
  }

  .shots {
    grid-template-columns: repeat(2, 1fr);
  }

  .row {
    flex-direction: column;
    gap: 2px;
  }

  .lectures a {
    grid-template-columns: 116px 1fr;
    gap: 14px;
  }

  .lectures img {
    width: 116px;
  }

  .lectures .t {
    font-size: 17px;
  }

  .lectures .d {
    display: none;
  }
}

/* ------------------------------------------------------------------
   About me (index.html), November 2026: a photo and a short bio, then each
   piece of work as a picture with a title, link tags and two or three sentences. */

.me {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 64px;
  align-items: center;
  padding: 36px 0 12px;
}

.me h1 {
  font-size: 54px;
  margin: 0 0 8px;
}

.role {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 24px;
}

.bio {
  font-size: 21px;
  line-height: 1.55;
  margin: 0 0 26px;
  max-width: 34em;
}

.me-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 15px;
}

.me-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  text-decoration: none;
}

.me-links a:hover span {
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.me-links svg {
  width: 16px;
  height: 16px;
  flex: none;
}

.me-links .place {
  color: var(--muted);
}

.photo {
  margin: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 12px;
}

/* Work: one piece per row, the picture beside the words */
.piece {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr);
  gap: 56px;
  align-items: center;
  padding: 48px 0;
  border-top: 1px solid var(--rule);
}

.piece:last-of-type {
  border-bottom: 1px solid var(--rule);
}

.piece.flip .pic {
  order: -1;
}

.piece h3 {
  font-size: 27px;
  line-height: 1.25;
  margin: 0 0 12px;
}

.piece p {
  font-size: 19px;
  line-height: 1.6;
  margin: 0;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin: 0 0 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
}

.tags span {
  color: var(--muted);
  margin-right: 4px;
}

.tags a {
  text-decoration: none;
  border: 1px solid #d8d2c5;
  border-radius: 999px;
  padding: 2px 11px;
  white-space: nowrap;
}

.tags a:hover {
  border-color: var(--ink);
}

.pic {
  margin: 0;
}

.pic svg {
  display: block;
  width: 100%;
  max-width: 340px;
  height: auto;
  margin: 0 auto;
}

.pic figcaption {
  margin-top: 10px;
  font-size: 13.5px;
}

.cell figcaption {
  text-align: center;
}

.aside {
  font-size: 17px;
  color: var(--muted);
  margin: 26px 0 0;
  max-width: 40em;
}

/* The chart: energy each model gains by going polar, one bar per model */
.ch-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 12.5px;
  color: #3c3c3f;
  margin: 0 0 12px;
}

.ch-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.ch-sw {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
}

.pbe { background: #2a78d6; }
.r2 { background: #eb6834; }

.ch-ln {
  width: 0;
  height: 12px;
  border-left: 2px solid var(--ink);
  display: inline-block;
}

.ch {
  --nw: 148px;
  --gap: 10px;
  --rm: 40px;
  position: relative;
  font-family: 'Inter', system-ui, sans-serif;
}

.ch-grid {
  position: absolute;
  top: 0;
  bottom: 22px;
  left: calc(var(--nw) + var(--gap));
  right: var(--rm);
  pointer-events: none;
}

.ch-grid i {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--x);
  border-left: 1px solid #ebe6dc;
}

.ch-grid i.dft {
  border-left: 2px solid var(--ink);
  margin-left: -1px;
  z-index: 2;
}

.ch-row,
.ch-axis {
  display: grid;
  grid-template-columns: var(--nw) minmax(0, 1fr);
  column-gap: var(--gap);
}

.ch-row {
  height: 23px;
  align-items: center;
  border-radius: 4px;
}

.ch-row:hover {
  background: #f1ede3;
}

.ch-name {
  font-size: 12.5px;
  white-space: nowrap;
  padding-left: 4px;
}

.ch-track {
  position: relative;
  height: 100%;
  margin-right: var(--rm);
}

.ch-track b {
  position: absolute;
  left: 0;
  top: 6.5px;
  height: 10px;
  width: var(--w);
  min-width: 3px;
  border-radius: 0 3px 3px 0;
}

.ch-track em {
  position: absolute;
  left: calc(var(--w) + 5px);
  top: 4px;
  line-height: 15px;
  padding: 0 3px;
  background: var(--paper);
  z-index: 3;
  font-style: normal;
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.ch-row:hover .ch-track em {
  background: #f1ede3;
}

.ch-axis {
  height: 22px;
}

.ch-axis .ch-track span {
  position: absolute;
  left: var(--x);
  top: 5px;
  transform: translateX(-50%);
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* Publications and tools */
.papers {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 760px;
}

.papers li {
  margin: 0 0 20px;
}

.papers .t {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.45;
}

.papers a.t {
  text-decoration: none;
}

.papers a.t:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

.papers .by {
  display: block;
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 3px;
}

.papers .by b {
  color: var(--ink);
  font-weight: 600;
}

.kit {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 14px 24px;
  margin: 0;
  max-width: 860px;
}

.kit dt {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  padding-top: 3px;
}

.kit dd {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.kit dd span {
  font-family: 'Inter', system-ui, sans-serif;
  font-size: 13px;
  border: 1px solid #ddd7ca;
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}

@media (max-width: 860px) {
  .me {
    grid-template-columns: minmax(0, 1fr) 220px;
    gap: 36px;
  }

  .piece,
  .piece.flip {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .piece.flip .pic {
    order: 0;
  }
}

@media (max-width: 720px) {
  .me {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-top: 16px;
  }

  .me .photo {
    order: -1;
    width: 200px;
  }

  .me h1 {
    font-size: 40px;
  }

  .bio {
    font-size: 19px;
  }

  .piece {
    padding: 36px 0;
  }

  .piece h3 {
    font-size: 23px;
  }

  .piece p {
    font-size: 18px;
  }

  .ch {
    --nw: 128px;
    --gap: 8px;
    --rm: 38px;
  }

  .ch-name {
    font-size: 11px;
    padding-left: 2px;
  }

  .ch-track em,
  .ch-axis .ch-track span {
    font-size: 11px;
  }

  .kit {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .kit dd {
    margin-bottom: 12px;
  }
}

/* About me: two small drawings side by side, and a piece whose figure takes the full width */
.duo {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: end;
}

.duo svg {
  max-width: 100%;
}

.duo figure {
  margin: 0;
}

.piece.wide {
  grid-template-columns: minmax(0, 1fr);
  gap: 30px;
}

.piece > * {
  min-width: 0;
}

.piece.wide > div {
  max-width: 640px;
}

.scroll-x svg {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

@media (max-width: 720px) {
  .duo {
    gap: 10px;
  }

  .scroll-x {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .scroll-x svg {
    width: 760px;
  }
}
