/* PhD defense page, phd.iliaazizi.com
   Visual language of the CAELUM project page: Libertinus, the typeface of the thesis, rules rather
   than boxes, small uppercase labels, one reading column. Everything reads from the left edge, and
   the contents bar is a dark band with the section names in small capitals.
   Colour literals appear only in the token blocks. */

@font-face { font-family: "Libertinus Serif"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/libertinus-serif-regular.woff2) format("woff2"); }
@font-face { font-family: "Libertinus Serif"; font-style: italic; font-weight: 400; font-display: swap; src: url(../fonts/libertinus-serif-italic.woff2) format("woff2"); }
@font-face { font-family: "Libertinus Serif"; font-style: normal; font-weight: 600; font-display: swap; src: url(../fonts/libertinus-serif-semibold.woff2) format("woff2"); }
@font-face { font-family: "Libertinus Serif Display"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/libertinus-serif-display.woff2) format("woff2"); }
@font-face { font-family: "Libertinus Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url(../fonts/libertinus-sans-regular.woff2) format("woff2"); }
@font-face { font-family: "Libertinus Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url(../fonts/libertinus-sans-bold.woff2) format("woff2"); }


:root {
  color-scheme: light;
  --bg: #ffffff; --bg-2: #f4f4f1; --bg-3: #ebebe6;
  --ink: #1c1c1e; --ink-2: #47474c; --ink-3: #74747a;
  --rule: #dddcd6; --rule-2: #b4b3ad; --field: #8a887f;
  --link: #1b5e8e;
  --sel: #eaf2f8; --on-solid: #ffffff;
  --bar: #1c1c1e; --bar-ink: #f4f4f1;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #141518; --bg-2: #1c1d21; --bg-3: #26282d;
    --ink: #e6e4df; --ink-2: #bdbbb5; --ink-3: #8f8d88;
    --rule: #2e3035; --rule-2: #4b4d53; --field: #6a6c73;
    --link: #83b9df;
    --sel: #1a2733; --on-solid: #111214;
    --bar: #0b0c0e; --bar-ink: #e6e4df;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #141518; --bg-2: #1c1d21; --bg-3: #26282d;
  --ink: #e6e4df; --ink-2: #bdbbb5; --ink-3: #8f8d88;
  --rule: #2e3035; --rule-2: #4b4d53; --field: #6a6c73;
  --link: #83b9df;
  --sel: #1a2733; --on-solid: #111214;
  --bar: #0b0c0e; --bar-ink: #e6e4df;
}

/* type scale: 11, 13, 15, 17 and 20.8 px; body text is 17 px, form controls and secondary text 15 px */
:root {
  --fs-xs: .6875rem; --fs-sm: .8125rem; --fs-md: .9375rem; --fs-base: 1.0625rem; --fs-lg: 1.3rem;
  --serif: "Libertinus Serif", Charter, "Iowan Old Style", Georgia, serif;
  --display: "Libertinus Serif Display", "Libertinus Serif", Georgia, serif;
  --sans: "Libertinus Sans", "Gill Sans", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 3.4rem; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 var(--fs-base)/1.6 var(--serif);
  font-variant-numeric: oldstyle-nums proportional-nums; font-kerning: normal;
  text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;
}
::selection { background: var(--sel); }
a { color: var(--link); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .16em; text-decoration-color: color-mix(in srgb, var(--link) 45%, transparent); }
a:hover { text-decoration-color: currentColor; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
p { margin: 0 0 1em; }
strong, b { font-weight: 600; }
.lnum { font-variant-numeric: lining-nums; }

.page { max-width: 46rem; margin: 0 auto; padding: 0 2rem; }
@media (max-width: 520px) { html { font-size: 92.1%; } .page { padding: 0 1.05rem; } }

/* ---------- header ---------- */
header { margin-bottom: 1.5rem; }
.kicker { margin: 2.6rem 0 0; font: 400 var(--fs-md)/1.3 var(--sans); color: var(--ink-2); }
h1 { font: 400 clamp(1.5rem, 3.6vw, 1.95rem)/1.18 var(--display); letter-spacing: -.004em; margin: .7rem 0 .9rem; text-wrap: balance; }
.kicker a { color: inherit; text-decoration-color: var(--rule-2); }
.kicker a:hover { text-decoration-color: currentColor; }
.affil { margin: 0; color: var(--ink-2); font-size: var(--fs-md); line-height: 1.5; }
@media (max-width: 520px) { .kicker { margin-top: 1.6rem; } }
@media (max-width: 599px) { h1 br { display: none; } } /* the forced break suits wide screens only; on phones the title wraps by itself */

/* ---------- key facts, booktabs style ---------- */
.facts { border-top: 1px solid var(--ink); border-bottom: 1px solid var(--rule); padding: .9rem 0 .8rem; margin: 0; }
.facts dl { display: grid; grid-template-columns: 6.2rem 1fr; gap: .3rem 1rem; margin: 0; font-size: var(--fs-md); }
.facts dt { font: 400 var(--fs-xs)/1.3 var(--sans); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); padding-top: .4rem; }
.facts dd { margin: 0; font-variant-numeric: lining-nums; }
@media (max-width: 520px) { .facts dl { grid-template-columns: 1fr; gap: 0; } .facts dd { margin-bottom: .45rem; } }

/* ---------- the bar: one dark band at the top of the window with the sections on the left and
   the room map, calendar file and light/dark switch on the right. It stays at the top while reading
   and marks the section being read with a dot. ---------- */
nav.toc { position: sticky; top: 0; z-index: 30; background: var(--bar); color: var(--bar-ink); }
.bar-in { display: flex; align-items: center; gap: 1rem; }
nav.toc ol { flex: 1 1 auto; min-width: 0; display: flex; gap: 0 1.7rem; list-style: none; margin: 0; padding: 0; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
nav.toc ol::-webkit-scrollbar { display: none; }
nav.toc ol a {
  position: relative; display: block; padding: .8rem 0 .85rem; color: color-mix(in srgb, var(--bar-ink) 68%, transparent); text-decoration: none;
  font: 400 var(--fs-base)/1.2 var(--serif); font-variant-caps: all-small-caps; letter-spacing: .06em; font-variant-numeric: lining-nums;
}
nav.toc ol a:hover, nav.toc ol a[aria-current="true"] { color: var(--bar-ink); }
nav.toc ol a[aria-current="true"]::after { content: ""; position: absolute; left: 50%; bottom: .32rem; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--bar-ink); }
nav.toc :focus-visible { outline-color: var(--bar-ink); outline-offset: -2px; }
.tools { flex: none; display: flex; align-items: center; gap: .1rem; margin-right: -.45rem; }
.tools a, .theme-btn { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 50%; background: none; color: color-mix(in srgb, var(--bar-ink) 72%, transparent); cursor: pointer; }
.tools a:hover, .theme-btn:hover { color: var(--bar-ink); background: color-mix(in srgb, var(--bar-ink) 12%, transparent); }
.tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn .i-sun { display: none; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .theme-btn .i-sun { display: block; } :root:not([data-theme="light"]) .theme-btn .i-moon { display: none; } }
:root[data-theme="dark"] .theme-btn .i-sun { display: block; }
:root[data-theme="dark"] .theme-btn .i-moon { display: none; }
@media (max-width: 760px) {
  nav.toc ol { gap: 0 1.4rem; padding-right: 1.2rem;
    -webkit-mask-image: linear-gradient(to right, black calc(100% - 1.6rem), transparent 100%);
            mask-image: linear-gradient(to right, black calc(100% - 1.6rem), transparent 100%); }
  nav.toc ol a { padding: .9rem 0 .95rem; }
  .bar-in { gap: .4rem; }
  .tools a, .theme-btn { width: 40px; height: 44px; }
}

/* ---------- sections ---------- */
section { border-top: 1px solid var(--rule); margin-top: 3rem; padding-top: 1.5rem; }
main > section:first-child { border-top: 0; margin-top: 2.4rem; padding-top: 0; }
h2 { display: flex; align-items: baseline; gap: .8rem; font: 600 var(--fs-lg)/1.25 var(--serif); margin: 0 0 .85rem; }
h3 { font: 600 var(--fs-md)/1.35 var(--serif); margin: 1.6rem 0 .45rem; }
section p, section li { hyphens: auto; -webkit-hyphens: auto; }

/* ---------- form ---------- */
form { margin: 0; } /* the fields span the column, aligned with the text above */
.field { margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; } /* name and email side by side; stacked on phones */
@media (max-width: 520px) { .pair { grid-template-columns: 1fr; } }
.field > label, .field > legend { display: block; font-size: var(--fs-md); font-weight: 600; margin: 0 0 .35rem; padding: 0; }
.req { color: var(--ink-3); font-weight: 400; font-size: var(--fs-sm); }
.hint { display: block; font: 400 var(--fs-sm)/1.4 var(--sans); color: var(--ink-3); margin-top: .1rem; }
input[type="text"], input[type="email"] {
  width: 100%; font: inherit; font-size: var(--fs-md); color: var(--ink); background: var(--bg);
  border: 1px solid var(--field); border-radius: 3px; padding: .45rem .6rem; min-height: 42px;
}
input[type="text"]:focus-visible, input[type="email"]:focus-visible { outline: 2px solid var(--link); outline-offset: 0; border-color: var(--link); }
.choices { display: flex; flex-wrap: wrap; gap: 0 1.8rem; }
.choice { display: flex; align-items: center; gap: .5rem; min-height: 44px; cursor: pointer; font-size: var(--fs-md); }
.choice input { accent-color: var(--ink); width: 1.05rem; height: 1.05rem; flex: none; margin: 0; }
label.choice.field { align-items: flex-start; min-height: 0; }
label.choice.field input { margin-top: .2rem; }
label.choice.field { font-size: var(--fs-md); }
#local-time { display: block; font-size: var(--fs-sm); color: var(--ink-2); }
#local-time[hidden] { display: none; }
.privacy { font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); border-left: 1px solid var(--rule-2); padding: .1rem 0 .1rem .9rem; margin: 1.3rem 0 1rem; }
.privacy summary { cursor: pointer; color: var(--ink); width: fit-content; }
.privacy summary:hover { color: var(--link); }
.privacy p { margin: .55rem 0 0; }
.hp { position: absolute; left: -9999px; }
#ts-slot { min-height: 65px; }
.form-error { border-left: 2px solid var(--ink); padding: .5rem .8rem; background: var(--bg-2); font-size: var(--fs-md); }
.btn {
  display: inline-flex; align-items: center; gap: .45rem; font: 400 var(--fs-md)/1.2 var(--sans);
  color: var(--on-solid); background: var(--ink); border: 1px solid var(--ink); border-radius: 3px;
  padding: .55rem 1rem; min-height: 42px; cursor: pointer; text-decoration: none;
}
.btn:hover { background: var(--ink-2); border-color: var(--ink-2); color: var(--on-solid); }
.btn.line { background: none; color: var(--ink); border-color: var(--rule-2); }
.btn.line:hover { border-color: var(--ink-3); color: var(--ink); background: none; }
.btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.btn:disabled { opacity: .6; cursor: default; }
.cta { display: flex; flex-wrap: wrap; gap: .6rem; margin: 1rem 0 0; }

/* ---------- summary ---------- */
.tldr { background: var(--bg-2); padding: .85rem 1.25rem .95rem; }
.papers-intro { margin: 0 0 .4rem; }
.tldr ol { margin: 0; padding: 0; list-style: none; counter-reset: t; }
.tldr li { counter-increment: t; position: relative; padding-left: 1.4rem; font-size: var(--fs-md); line-height: 1.5; margin: 0 0 .5rem; }
.tldr li:last-child { margin-bottom: 0; }
.tldr li::before { content: counter(t); position: absolute; left: 0; top: 0; color: var(--ink-3); font-variant-numeric: lining-nums; }

/* ---------- animations: one row that scrolls sideways, each figure snaps to the left edge and the
   next one peeks in; one video per theme, the other is never loaded ---------- */
.anim-row { position: relative; display: flex; align-items: flex-start; gap: 1.1rem; overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.anim-row::-webkit-scrollbar { display: none; }
.anim-row:focus-visible { outline-offset: 4px; }
.anim { flex: 0 0 calc((100% - 1.1rem) / 2); min-width: 0; margin: 0; scroll-snap-align: start; } /* two in view at every width; the row moves a page (two) at a time */
.anim:nth-child(even) { scroll-snap-align: none; }
.anim-row::after { content: ""; flex: 0 0 calc((100% - 1.1rem) / 2); } /* room so the last page can hold the fifth card alone */
.anim-nav { display: inline-flex; align-items: center; gap: .1rem; margin-left: auto; margin-right: -.45rem; align-self: center; }
.anim-nav button { display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; }
.anim-nav button:hover { color: var(--ink); background: var(--bg-2); }
.anim-nav button:disabled { color: var(--ink-3); opacity: .45; background: none; cursor: default; }
.anim-nav svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.anim-dots { display: inline-flex; align-items: center; gap: 0; margin: 0 .2rem; }
.anim-dots button { width: 24px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.anim-dots button::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--rule-2); transition: background .15s, transform .15s; }
.anim-dots button:hover::before { background: var(--ink-3); }
.anim-dots button[aria-current]::before { background: var(--ink); transform: scale(1.25); }
.anim-open { display: block; position: relative; width: 100%; padding: 0; background: var(--bg); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; cursor: zoom-in; transition: border-color .15s, box-shadow .15s; font: inherit; color: inherit; }
.anim-open:hover { border-color: var(--ink-3); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
.anim-open:focus-visible { outline-offset: -3px; }
.anim video, #anim-dialog video { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; }
.anim video.t-dark { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .anim video.t-dark { display: block; }
  :root:not([data-theme="light"]) .anim video.t-light { display: none; }
}
:root[data-theme="dark"] .anim video.t-dark { display: block; }
:root[data-theme="dark"] .anim video.t-light { display: none; }
.anim-open .zoom { position: absolute; right: .45rem; bottom: .45rem; display: flex; align-items: center; justify-content: center; width: 1.7rem; height: 1.7rem; border-radius: 50%; background: var(--bg-2); color: var(--ink-2); opacity: 0; transition: opacity .15s; } /* shown on hover or keyboard focus only, so it never covers the dog */
.anim-open:hover .zoom, .anim-open:focus-visible .zoom { color: var(--ink); opacity: 1; }
.anim-open .zoom svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
/* with reduced motion nothing plays by itself, so a play badge in the middle shows that the card is
   paused until the reader presses play or drags the bar below; it goes once the card plays (main.js
   sets the class paused). The circle is ::before and the triangle ::after */
@media (prefers-reduced-motion: reduce) {
  .anim.paused .anim-open::before, .anim.paused .anim-open::after { content: ""; position: absolute; left: 50%; top: 50%; pointer-events: none; }
  .anim.paused .anim-open::before { width: 2.9rem; height: 2.9rem; margin: -1.45rem 0 0 -1.45rem; border-radius: 50%; background: var(--bg-2); border: 1px solid var(--rule-2); box-shadow: 0 1px 6px color-mix(in srgb, var(--ink) 14%, transparent); }
  .anim.paused .anim-open::after { width: .95rem; height: 1.1rem; margin: -.55rem 0 0 -.38rem; background: var(--ink-2); clip-path: polygon(0 0, 100% 50%, 0 100%); }
  .anim.paused .anim-open:hover::before, .anim.paused .anim-open:focus-visible::before { border-color: var(--ink-3); }
  .anim.paused .anim-open:hover::after, .anim.paused .anim-open:focus-visible::after { background: var(--ink); }
}
.anim figcaption { margin-top: .55rem; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); }
.anim figcaption b { color: var(--ink); }
@media (max-width: 520px) {
  .anim-row { gap: .7rem; }
  .anim, .anim-row::after { flex-basis: calc((100% - .7rem) / 2); }
  .anim-prev, .anim-next { width: 36px !important; height: 44px !important; }
  .anim-dots button { width: 24px; height: 44px; }
  .anim-nav { margin-right: 0; }
}
@media (max-width: 359px) { /* five dots and the arrows still fit beside the heading on the narrowest phones */
  #animations h2 { gap: .5rem; }
  .anim-prev, .anim-next { width: 28px !important; }
  .anim-dots { margin: 0; }
}
#anim-dialog { width: min(92vw, calc(100vh - 9rem), 46rem); max-width: none; max-height: none; padding: 0; border: 1px solid var(--rule-2); border-radius: 12px; background: var(--bg); color: var(--ink); overflow: hidden; }
#anim-dialog::backdrop { background: rgba(0, 0, 0, .6); }
#anim-dialog p { margin: 0; padding: .7rem 3rem .8rem 1rem; font-size: var(--fs-sm); line-height: 1.5; color: var(--ink-2); border-top: 1px solid var(--rule); }
#anim-dialog p b { color: var(--ink); }
#anim-dialog .x { position: absolute; right: .3rem; bottom: .2rem; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; color: var(--ink-2); cursor: pointer; font: 400 1.3rem/1 var(--sans); }
#anim-dialog .x:hover { color: var(--ink); background: var(--bg-2); }

/* ---------- abstract ---------- */
.abstract p { font-size: var(--fs-md); line-height: 1.58; margin: 0; text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
@media (max-width: 520px) { .abstract p { text-align: left; } }
.lang { display: inline-flex; gap: .1rem; }
.lang button { font: 400 var(--fs-xs)/1 var(--sans); letter-spacing: .09em; color: var(--ink-3); background: none; border: 0; padding: 0 .35rem; min-height: 44px; min-width: 44px; cursor: pointer; }
.lang button[aria-pressed="true"] { color: var(--ink); text-decoration: underline; text-underline-offset: .3em; }

/* ---------- papers ---------- */
.part { margin: 0 0 1.6rem; }
.part > h3 { margin: 1.4rem 0 .5rem; font-size: var(--fs-md); }
.part:first-of-type > h3 { margin-top: 0; }
.pub { display: grid; grid-template-columns: 3rem 1fr; gap: 0 .4rem; padding: .7rem 0; border-top: 1px solid var(--rule); }
.pub:last-child { border-bottom: 1px solid var(--rule); }
.pub .ch { font: 400 var(--fs-sm)/1.6 var(--sans); color: var(--ink); font-variant-numeric: lining-nums; padding-top: .1rem; }
.pub .title { font-size: var(--fs-md); line-height: 1.45; }
.pub .meta { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; margin-top: .1rem; }
.venue { display: inline-block; font: 400 var(--fs-md)/1 var(--serif); font-variant-caps: all-small-caps; letter-spacing: .06em; font-variant-numeric: lining-nums; color: var(--bg); background: var(--ink); border-radius: 2px; padding: .2rem .45rem .26rem; margin-right: .5rem; white-space: nowrap; } /* the type of the bar, in the text colour: black on the light page, white on the dark one */
.venue .yr { font-size: .8em; letter-spacing: .04em; } /* figures at the height of the small caps, on the same baseline */
.pub .links-sm { display: flex; flex-wrap: wrap; gap: .1rem 1.1rem; margin-top: .3rem; font: 400 var(--fs-sm)/1.4 var(--sans); }
.pub .links-sm a { text-decoration: none; color: var(--link); min-height: 28px; display: inline-flex; align-items: center; gap: .35rem; }
.pub .links-sm svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.pub .links-sm svg.solid { fill: currentColor; stroke: none; }
.pub .links-sm a:hover { text-decoration: underline; }

/* ---------- footer ---------- */
footer { margin-top: 3.4rem; background: var(--bg-2); color: var(--ink-3); font: 400 var(--fs-sm)/1.5 var(--sans); }
footer .page { padding-top: 1.1rem; padding-bottom: 1.4rem; text-align: center; }
footer a { color: var(--ink-2); }


@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
@media print { .theme-btn, nav.toc, #register form, .anims { display: none; } }

/* ---------- thank-you pages ---------- */
main.thanks { margin-top: 1.6rem; }
p.back { margin-top: 2rem; }
