
/* EB Garamond, served from the site itself (SIL Open Font License) */
@font-face { font-family: 'EB Garamond'; font-style: normal; font-weight: 400 800; font-display: swap; src: url(../fonts/ebgaramond.woff) format('woff'); }
@font-face { font-family: 'EB Garamond'; font-style: italic; font-weight: 400 800; font-display: swap; src: url(../fonts/ebgaramond-italic.woff) format('woff'); }
/* AMMOC — An International Math Circle
   Site styles. Each page's layout is carried inline from the approved design;
   this file holds the base, the responsive rules, the motion and the quotation of the day. */

:root {
  --ink: #0B2545;
  --ivory: #FAF7F0;
  --stone: #F3EEE3;
  --gold: #A8843C;
  --bronze: #7A5C1F;
  --rule: #D8D0BE;
  /* a pixel of the 1440 px design; above 1440 px it grows with the window, to 1.25 px from 1800 px */
  --u: 1px;
  --gx96: max(calc(96 * var(--u)), calc((100vw - 1440 * var(--u)) / 2 + 96 * var(--u)));
  --gx72: max(calc(72 * var(--u)), calc((100vw - 1440 * var(--u)) / 2 + 72 * var(--u)));
  --gx20: max(20px, calc((100vw - 640px) / 2));
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 16px; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: #FAF7F0;
  color: #0B2545;
  font-family: 'EB Garamond', Garamond, Georgia, serif;
  font-variant-numeric: oldstyle-nums;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; display: flex; flex-direction: column; }
.pg, .pm { display: flex; flex-direction: column; flex: 1 0 auto; }
a { color: #0B2545; }
a:hover { color: #7A5C1F; }
img { max-width: 100%; }
svg { max-width: 100%; }
:focus-visible { outline: 2px solid #A8843C; outline-offset: 3px; }

.skip { position: absolute; left: -9999px; top: 12px; z-index: 20; padding: 10px 14px; background: #FAF7F0; border: 1px solid #0B2545; color: #0B2545; font-size: 17px; }
.skip:focus { left: 16px; }

/* Gutters: the design's 96 px and 72 px margins. Above 1440 px the whole design grows with the window, by --u, so that
   the margins keep their proportion and the lines their length; from 1800 px it is held at 1.25 and centred. */
@media screen and (min-width: 1441px) {
  :root { --u: min(1.25px, calc(100vw / 1440)); }
  svg[style*="--w:"] { width: calc(var(--w) * var(--u)); height: calc(var(--h) * var(--u)); }
}
.gx96 { padding-left: var(--gx96); padding-right: var(--gx96); }
.gx72 { padding-left: var(--gx72); padding-right: var(--gx72); }
.gx20 { padding-left: var(--gx20); padding-right: var(--gx20); }

/* Desktop and phone chrome */
@media (min-width: 901px) { .m-only { display: none !important; } }
@media (max-width: 900px) { .d-only { display: none !important; } }

/* Narrow desktops and tablets in landscape */
@media (max-width: 1100px) {
  :root { --gx96: 48px; --gx72: 36px; }
  .hdr-tag { display: none !important; }
  .hdr-nav { gap: 12px !important; font-size: 18px !important; }
}

/* Tablets and phones: one reading column, aligned with the phone header */
@media (max-width: 900px) {
  :root { --gx96: var(--gx20); --gx72: var(--gx20); }
  .g12 { grid-template-columns: minmax(0, 1fr) !important; row-gap: 22px; }
  .g12 > * { grid-column: 1 / -1 !important; }
  .g12 > [style*="padding-right: calc(24*var(--u))"] { padding-right: 0 !important; }
  .g12 > [style*="padding-left: calc(24*var(--u))"] { padding-left: 0 !important; }
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .plate-fig svg, .wide-svg { width: 100%; height: auto; }
  table { font-size: 16px !important; }
  .pg nav[style*="display: flex"], .pg div[style*="display: flex"][style*="justify-content: space-between"] { flex-wrap: wrap; }
  .pg nav[style*="display: flex"] { row-gap: 4px; }
}
@media (max-width: 760px) {
  .gl { grid-template-columns: minmax(0, 1fr) !important; row-gap: 6px !important; }
  .g3 { grid-template-columns: minmax(0, 1fr) !important; }
  .gsplit { grid-template-columns: minmax(0, 1fr) !important; row-gap: 20px; }
  .gsplit > [style*="width: 1px"], .gsplit > [aria-hidden="true"] { display: none !important; }
  .pg section, .pg article { scroll-margin-top: 12px; }
}
@media (max-width: 560px) {
  .g2 { grid-template-columns: minmax(0, 1fr) !important; row-gap: 18px; }
}

/* The menu page on wide screens */
.menu-page { width: 100%; max-width: 560px; margin: 0 auto; --gx20: 20px; }

/* Typography common to all pages */
h1, h2, h3 { text-wrap: balance; }
.pg div[style*="font-variant-caps: all-small-caps"], .pm div[style*="font-variant-caps: all-small-caps"] { text-wrap: balance; }
/* Large initials beside names keep their size when the name wraps */
.pg div[style*="display: flex"][style*="align-items: center"] > svg:first-child,
.pm div[style*="display: flex"][style*="align-items: center"] > svg:first-child { flex-shrink: 0; }

/* Narrow screens: collapsed lists, year index, grids and portraits */
@media (max-width: 900px) {
  .facts-after > :first-child { order: 2; }
}
@media (min-width: 561px) and (max-width: 900px) {
  .pg .portrait { max-width: 420px; }
  .pm figure img[style*="object-fit: cover"] { height: auto !important; aspect-ratio: 4 / 5; }
}
@media (max-width: 760px) {
  .gl > dt { border-bottom: 0 !important; padding-bottom: 0 !important; }
  .gl > dd { padding-top: 4px !important; }
  .pg nav[style*="display: flex"] { column-gap: 22px !important; row-gap: 0 !important; }
  .pg nav[style*="display: flex"] > span:first-child:not([aria-hidden]) { flex-basis: 100%; margin: 0 !important; }
  .pg nav[style*="display: flex"] > span[aria-hidden="true"][style*="width: 1px"] { display: none; }
}
@media (max-width: 560px) {
  .g4 { grid-template-columns: minmax(0, 1fr) !important; }
  ol.g2 > li:not(:last-child), ul.g2 > li:not(:last-child) { border-bottom: 0 !important; }
  .pg table { font-size: 15.5px !important; }
  .pg table th { letter-spacing: 0.04em !important; }
}

/* ---------- Motion ---------- */
@keyframes dc-draw { to { stroke-dashoffset: 0; } }
@keyframes dc-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes dc-develop {
  from { opacity: 0; filter: saturate(.2) brightness(1.08); transform: scale(1.035); }
  to { opacity: 1; filter: none; transform: scale(1); }
}
@keyframes dc-drift { from { transform: scale(1); } to { transform: scale(1.045); } }
@keyframes dc-spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: no-preference) {
  /* Plate I: Euclid I.1 constructed on arrival, once per visit */
  html:not(.plate-seen) .plate .p-pt1 { animation: dc-in .5s ease-out .15s both; }
  html:not(.plate-seen) .plate .p-ab { stroke-dasharray: 70; stroke-dashoffset: 70; animation: dc-draw .7s ease-out .35s both; }
  html:not(.plate-seen) .plate .p-ca { stroke-dasharray: 440; stroke-dashoffset: 440; animation: dc-draw 1.5s ease-in-out 1.1s both; }
  html:not(.plate-seen) .plate .p-cb { stroke-dasharray: 440; stroke-dashoffset: 440; animation: dc-draw 1.5s ease-in-out 1.7s both; }
  html:not(.plate-seen) .plate .p-pt2 { animation: dc-in .6s ease-out 3.1s both; }
  html:not(.plate-seen) .plate .p-pt3, html:not(.plate-seen) .plate .p-de { animation: dc-in .6s ease-out 3.3s both; }
  html:not(.plate-seen) .plate .p-a { stroke-dasharray: 280; stroke-dashoffset: 280; animation: dc-draw 1.2s ease-in-out 3.6s both; }
  html:not(.plate-seen) .plate .p-m { stroke-dasharray: 140; stroke-dashoffset: 140; animation: dc-draw .9s ease-in-out 4.8s both; }

  /* The director's portrait develops, then drifts very slowly towards the face */
  .founder-view img { transform-origin: 53% 34%; animation: dc-develop 2.6s cubic-bezier(.2,.6,.2,1) .2s both, dc-drift 38s ease-in-out 2.8s infinite alternate; }

  /* Portraits of those who inspire us warm under the pointer */
  .portrait { transition: border-color .7s ease, outline-color .7s ease, outline-offset .7s ease; }
  .portrait img { transition: transform 1.2s cubic-bezier(.2,.6,.2,1), filter 1.2s ease; }
  a:hover .portrait img, a:focus-visible .portrait img, .portrait:hover img { transform: scale(1.045); }

  /* The seal's lettered ring turns slowly under the pointer */
  .seal .seal-ring { transform-box: view-box; transform-origin: 220px 220px; }
  .seal:hover .seal-ring { animation: dc-spin 60s linear infinite; }

  /* Sections rise into view as the page is read */
  .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.6,.2,1); }
  .reveal.in { opacity: 1; transform: none; }

  @view-transition { navigation: auto; }
}
.portrait:hover, a:hover .portrait, a:focus-visible .portrait { border-color: #A8843C !important; outline-color: #A8843C !important; }
.portrait:hover[style*="outline"], a:hover .portrait[style*="outline"] { outline-offset: -8px !important; }
.portrait:hover img, a:hover .portrait img, a:focus-visible .portrait img { filter: grayscale(1) sepia(.32) contrast(1.05) !important; }
.hero-link { display: block; color: inherit; text-decoration: none; }
.hero-link:hover { color: inherit; }


/* ---------- Quotation of the day ---------- */
[data-q-source] cite { font-style: normal; }

/* ---------- Links ---------- */
/* Text links rest on a fine gold rule; under the pointer an ink line is drawn over it, left to right */
a.tl {
  text-decoration: none;
  background-image: linear-gradient(#0B2545, #0B2545), linear-gradient(rgba(168, 132, 60, .7), rgba(168, 132, 60, .7));
  background-repeat: no-repeat;
  background-size: 0 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
}
a.tl[style*="inline-flex"] { background-position: 0 calc(50% + .78em), 0 calc(50% + .78em); }
a.tl:hover, a.tl:focus-visible { color: #0B2545; background-size: 100% 1px, 100% 1px; }
/* In the menus the line appears only under the pointer; the page being read keeps its own */
a.nl {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 calc(50% + .72em);
}
a.nl:hover, a.nl:focus-visible { background-size: 100% 1px; }
@media (prefers-reduced-motion: no-preference) {
  a.tl, a.nl { transition: background-size .45s cubic-bezier(.2, .6, .2, 1), color .2s ease; }
}

/* ---------- The circle in figures (home page) ---------- */
/* On the ink band the text link rests on gold and is drawn over in paper; each square lightens under the pointer */
.figs a.tl { background-image: linear-gradient(#F4EFE4, #F4EFE4), linear-gradient(rgba(210, 176, 106, .8), rgba(210, 176, 106, .8)); }
.figs a.tl:hover, .figs a.tl:focus-visible { color: #F4EFE4; }
.figs a.fig:hover, .figs a.fig:focus-visible { background-color: #1A3F70 !important; }
.figs a.fig:focus-visible { outline-offset: -5px; }
/* The words under each figure are the link's text: they rest on a fine gold rule, as text links do, and under the pointer
   a line in paper is drawn across them, left to right. The figures themselves are not underlined. */
.figs .fig-u {
  padding-bottom: 2px;
  background-image: linear-gradient(#F4EFE4, #F4EFE4), linear-gradient(rgba(210, 176, 106, .7), rgba(210, 176, 106, .7));
  background-repeat: no-repeat;
  background-size: 0 1px, 100% 1px;
  background-position: 0 100%, 0 100%;
}
.figs a.fig:hover .fig-u, .figs a.fig:focus-visible .fig-u { color: #F4EFE4; background-size: 100% 1px, 100% 1px; }
@media (prefers-reduced-motion: no-preference) {
  .figs a.fig { transition: background-color .3s ease; }
  .figs .fig-u { transition: background-size .45s cubic-bezier(.2, .6, .2, 1), color .2s ease; }
}
@media (min-width: 901px) and (max-width: 1180px) {
  .figs .figs-grid { grid-column: 7 / span 6 !important; }
  .figs .fig-n { font-size: 58px !important; }
  .figs .fig-l { font-size: 15px !important; }
}

/* Selection in pale gold; words divide at line ends on small screens */
::selection { background: #EADFC4; color: #0B2545; }
@media (max-width: 560px) {
  .pg p, .pm p, .pg li, .pm li, .pg dd, .pm dd, .pg td, figcaption { -webkit-hyphens: auto; hyphens: auto; }
}

/* ---------- Links to sections ---------- */
.para {
  margin-left: .32em; font-size: .62em; font-weight: 400; font-style: normal; letter-spacing: 0;
  font-variant-caps: normal; color: #A8843C; text-decoration: none; vertical-align: .12em; opacity: 0;
}
h2:hover > .para, h3:hover > .para, .para:focus-visible { opacity: 1; }
.para:hover { color: #7A5C1F; }
@media (hover: none) { .para { display: none; } }
@media (prefers-reduced-motion: no-preference) { .para { transition: opacity .2s ease; } }
:target { scroll-margin-top: 64px; }

/* ---------- Plates and figures ---------- */
@media (prefers-reduced-motion: no-preference) {
  html:not(.plate-seen) .fig-load .draw, html:not(.plate-seen) .fig-view.play .draw {
    stroke-dasharray: 1; stroke-dashoffset: 1;
    animation: dc-draw var(--t, 1s) ease-in-out calc(var(--d, 0s) + .35s) both;
  }
  html:not(.plate-seen) .fig-load .fade, html:not(.plate-seen) .fig-view.play .fade {
    animation: dc-in var(--t, .6s) ease-out calc(var(--d, 0s) + .35s) both;
  }
}
.front-plate { justify-self: stretch; }
@media (max-width: 900px) {
  .front-plate { justify-self: start; width: 100%; max-width: 440px; }
  .hero-art > * { grid-row: auto !important; }
  .hero-fig { max-width: 420px; margin-top: 8px !important; }
}

/* ---------- The course at a glance ---------- */
.cmap { display: grid; grid-template-columns: calc(150 * var(--u)) repeat(4, minmax(0, 1fr)); column-gap: calc(36 * var(--u)); row-gap: calc(18 * var(--u)); align-items: stretch; }
.cm-h { padding-bottom: calc(8 * var(--u)); border-bottom: 1px solid #0B2545; font-size: calc(17.5 * var(--u)); font-weight: 500; letter-spacing: .09em; font-variant-caps: all-small-caps; color: #7A5C1F; }
.cm-t { align-self: center; font-size: calc(17.5 * var(--u)); line-height: 1.3; font-style: italic; color: #55606E; }
.cm-b { position: relative; display: flex; flex-direction: column; justify-content: center; gap: calc(4 * var(--u)); padding: calc(13 * var(--u)) calc(15 * var(--u)) calc(14 * var(--u)); border: 1px solid #0B2545; background: #FCFAF5; color: #0B2545; text-decoration: none; }
a.cm-b:hover { background: #F3EEE3; color: #0B2545; }
.cm-n { font-size: calc(18 * var(--u)); line-height: 1.3; }
.cm-s { font-size: calc(15 * var(--u)); line-height: 1.35; font-style: italic; color: #55606E; }
.cm-y { display: none; font-style: normal; font-size: calc(15 * var(--u)); font-weight: 500; letter-spacing: .09em; font-variant-caps: all-small-caps; color: #7A5C1F; }
.cm-opt { border-style: dashed; background: transparent; }
.cm-stack { display: flex; flex-direction: column; gap: calc(22 * var(--u)); }
.cm-stack > .cm-b { flex: 1 1 auto; }
.cm-b.to::after { content: ""; position: absolute; left: 100%; top: 50%; width: calc(36 * var(--u)); border-top: 1px solid #A8843C; }
.cm-b.to::before { content: ""; position: absolute; left: calc(100% + calc(29 * var(--u))); top: calc(50% - calc(4 * var(--u))); border-style: solid; border-width: calc(4 * var(--u)) 0 calc(4 * var(--u)) calc(7 * var(--u)); border-color: transparent transparent transparent #A8843C; }
.cm-b.to-top::after { top: 25%; }
.cm-b.to-top::before { top: calc(25% - calc(4 * var(--u))); }
.cm-b.down::after { content: ""; position: absolute; top: 100%; left: 50%; height: calc(22 * var(--u)); border-left: 1px solid #A8843C; }
.cm-b.down::before { content: ""; position: absolute; top: calc(100% + calc(15 * var(--u))); left: calc(50% - calc(4 * var(--u))); border-style: solid; border-width: calc(7 * var(--u)) calc(4 * var(--u)) 0 calc(4 * var(--u)); border-color: #A8843C transparent transparent transparent; }
@media (max-width: 1100px) { .cmap { grid-template-columns: 112px repeat(4, minmax(0, 1fr)); column-gap: 30px; } .cm-b.to::after { width: 30px; } .cm-b.to::before { left: calc(100% + 23px); } }
@media (max-width: 900px) {
  .cmap { grid-template-columns: minmax(0, 1fr); row-gap: 0; max-width: 560px; }
  .cmap > * { grid-row: auto !important; grid-column: auto !important; }
  .cm-h { display: none; }
  .cm-t { margin: 26px 0 12px; font-size: 20px; }
  .cm-t:first-of-type { margin-top: 0; }
  .cm-y { display: block; }
  .cm-stack { gap: 0; }
  .cmap > .cm-b, .cm-stack > .cm-b { margin-bottom: 26px; }
  .cm-b.to::after, .cm-b.to-top::after, .cm-b.down::after { top: 100%; left: 50%; width: 0; height: 26px; border-top: 0; border-left: 1px solid #A8843C; }
  .cm-b.to::before, .cm-b.to-top::before, .cm-b.down::before { top: calc(100% + 19px); left: calc(50% - 4px); border-width: 7px 4px 0 4px; border-color: #A8843C transparent transparent transparent; }
  .cm-opt { margin-bottom: 0 !important; }
}

/* ---------- Teachers and pupils ---------- */
.lineage { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: calc(20 * var(--u)); row-gap: calc(40 * var(--u)); align-items: end; }
.ln-col { display: flex; flex-direction: column; }
.ln-p { margin-bottom: calc(18 * var(--u)); padding-bottom: calc(8 * var(--u)); border-bottom: 1px solid #0B2545; font-size: calc(17.5 * var(--u)); font-weight: 500; letter-spacing: .09em; font-variant-caps: all-small-caps; color: #7A5C1F; text-align: center; }
.lineage ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
.lineage li { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; }
.lineage li + li { margin-top: calc(34 * var(--u)); }
.lineage li + li::before { content: ""; position: absolute; top: calc(-28 * var(--u)); left: 50%; height: calc(22 * var(--u)); border-left: 1px solid #A8843C; }
.lineage li + li::after { content: ""; position: absolute; top: calc(-10 * var(--u)); left: calc(50% - calc(3.5 * var(--u))); border-style: solid; border-width: calc(6 * var(--u)) calc(3.5 * var(--u)) 0 calc(3.5 * var(--u)); border-color: #A8843C transparent transparent transparent; }
.lineage li > span, .ln-hero { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ln-n { font-size: calc(17.5 * var(--u)); line-height: 1.25; color: #243247; text-wrap: balance; }
.ln-d { font-size: calc(14.5 * var(--u)); font-style: italic; color: #6A7280; font-variant-numeric: lining-nums; }
.ln-hero { min-height: calc(84 * var(--u)); justify-content: center; padding: calc(9 * var(--u)) calc(10 * var(--u)) calc(8 * var(--u)); border: 1px solid #0B2545; outline: 1px solid #0B2545; outline-offset: calc(-4 * var(--u)); background: #FCFAF5; color: #0B2545; text-decoration: none; width: 100%; }
.ln-hero .ln-n { color: #0B2545; font-weight: 500; }
a.ln-hero:hover { background: #F3EEE3; color: #0B2545; }
.lineage li:not(.ln-last) { display: flex; flex-direction: column; align-items: center; gap: 2px; }
@media (max-width: 760px) { .lineage { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- The index of a long page, and the reading line ---------- */
.readline { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; background: #A8843C; transform: scaleX(0); transform-origin: 0 50%; pointer-events: none; }
.pidx { display: none; }
.pidx ol { margin: 0; padding: 0; list-style: none; }
.pidx a { color: #55606E; text-decoration: none; }
.pidx a:hover { color: #0B2545; }
.pidx a[aria-current] { color: #0B2545; }
.pidx-t { font-size: 15.5px; font-weight: 500; letter-spacing: .09em; font-variant-caps: all-small-caps; color: #7A5C1F; }
@media (min-width: 2040px) {
  .pidx { display: flex; flex-direction: column; gap: 10px; position: fixed; z-index: 20; top: 50%; transform: translateY(-50%);
    left: calc((100vw - 1440 * var(--u)) / 2 + 96 * var(--u) - 214px); width: 176px; max-height: 76vh; overflow-y: auto; padding: 2px 0; }
  .pidx ol { display: flex; flex-direction: column; gap: 6px; border-left: 1px solid #D8D0BE; }
  .pidx li { margin-left: -1px; }
  .pidx a { display: block; padding: 2px 0 2px 13px; border-left: 1px solid transparent; font-size: 16px; line-height: 1.3; }
  .pidx a[aria-current] { border-left-color: #A8843C; }
  .pidx .pidx-g > a { font-variant-caps: all-small-caps; letter-spacing: .06em; font-size: 16.5px; color: #7A5C1F; }
  .pidx .pidx-g ol { border-left: 0; gap: 2px; margin: 2px 0 8px; }
  .pidx .pidx-g ol a { font-size: 15px; }
  .pidx { opacity: 0; }
  .pidx-on .pidx { opacity: 1; }
}
@media (min-width: 901px) and (max-width: 2039px) {
  .pidx { display: flex; align-items: center; gap: 22px; position: fixed; z-index: 50; top: 0; left: 0; right: 0; height: 48px;
    padding: 0 var(--gx96); background: rgba(250, 247, 240, .97); border-bottom: 1px solid #D8D0BE; transform: translateY(-101%);
    visibility: hidden; }
  .pidx-on .pidx { transform: none; visibility: visible; }
  .pidx-t { white-space: nowrap; }
  .pidx > ol { display: flex; align-items: center; gap: 20px; overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
  .pidx > ol::-webkit-scrollbar { display: none; }
  .pidx-g > ol { display: inline-flex; gap: 16px; margin-left: 16px; }
  .pidx-g > a { color: #7A5C1F; font-variant-caps: all-small-caps; letter-spacing: .06em; }
  .pidx a { display: inline-flex; align-items: center; min-height: 44px; font-size: 17px; }
  .pidx a[aria-current] { box-shadow: inset 0 -1px 0 #A8843C; }
  .has-index :target { scroll-margin-top: 64px; }
}
@media (prefers-reduced-motion: no-preference) {
  .pidx { transition: transform .3s ease, opacity .4s ease, visibility .3s; }
}
.pcontents { padding-top: 4px; padding-bottom: 36px; }
.pcontents-t { margin-bottom: 8px; font-size: 15.5px; font-weight: 500; letter-spacing: .09em; font-variant-caps: all-small-caps; color: #7A5C1F; }
.pcontents ol { margin: 0; padding: 0; list-style: none; border-top: 1px solid #D8D0BE; }
.pcontents li { border-bottom: 1px solid #D8D0BE; }
.pcontents a { display: flex; align-items: center; min-height: 44px; font-size: 18px; color: #0B2545; text-decoration: none; }

/* ---------- The phone's header returns when the reader scrolls back up ---------- */
@media (max-width: 900px) {
  .phdr { position: sticky; top: 0; z-index: 40; background: #FAF7F0; }
  .hdr-away .phdr { transform: translateY(-100%); }
}
@media (max-width: 900px) and (prefers-reduced-motion: no-preference) { .phdr { transition: transform .28s ease; } }

/* ---------- Small things ---------- */
.vh { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.print-head { display: none; }

/* ---------- Print: A4, the text alone ---------- */
@page { size: A4; margin: 16mm 15mm 18mm; }
@page { @bottom-right { content: counter(page) " / " counter(pages); font-family: 'EB Garamond', Georgia, serif; font-size: 9pt; color: #55606E; } }
@media print {
  :root { --gx96: 0px; --gx72: 0px; --gx20: 0px; }
  html, body { background: #fff !important; }
  body { zoom: .8; display: block; }
  body > .d-only, body > .m-only, .skip, .pidx, .readline, .para, .pcontents, .hero-link:after { display: none !important; }
  .print-head { display: flex !important; justify-content: space-between; gap: 20px; margin: 0 0 22px; padding-bottom: 8px; border-bottom: 1px solid #0B2545; font-size: 15px; letter-spacing: .06em; font-variant-caps: all-small-caps; color: #0B2545; }
  .reveal { opacity: 1 !important; transform: none !important; }
  .draw, .fade { animation: none !important; stroke-dashoffset: 0 !important; opacity: 1 !important; }
  a { color: inherit !important; background: none !important; }
  main a.tl { text-decoration: underline; text-decoration-color: #A8843C; text-decoration-thickness: 1px; }
  main a[href^="http"]::after { content: " (" attr(href) ")"; font-size: .82em; color: #55606E; word-break: break-all; }
  main a[href^="mailto:"]::after { content: ""; }
  h1, h2, h3, .cm-h { break-after: avoid; page-break-after: avoid; }
  figure, table, tr, li, dl > div, blockquote, .cm-b, .ln-col, article > div:first-child { break-inside: avoid; page-break-inside: avoid; }
  section { padding-top: 28px !important; padding-bottom: 28px !important; }
  .pg [style*="background: #F3EEE3"], .pm [style*="background: #F3EEE3"] { background: #fff !important; }
  .founder-view img { animation: none !important; }
  .figs, .figs a.fig { background: #fff !important; }
  .figs, .figs * { color: #0B2545 !important; }
  .figs a.fig { border: 1px solid #D8D0BE; }
  .figs .fig-u { background: none !important; }
}

/* ---------- POETIC and MOTIF ---------- */
@media (max-width: 900px) { .motif-line { padding-top: 0 !important; } }
@media (max-width: 760px) { .gl-dl > div { grid-template-columns: minmax(0, 1fr) !important; gap: 2px !important; } }

/* Type scale for smaller screens (generated) */
@media (max-width: 1100px) {
  .pg [style*="font-size: calc(34*var(--u))"] { font-size: 30.5px !important; }
  .pg [style*="font-size: calc(36*var(--u))"] { font-size: 32px !important; }
  .pg [style*="font-size: calc(38*var(--u))"] { font-size: 33.6px !important; }
  .pg [style*="font-size: calc(40*var(--u))"] { font-size: 35.2px !important; }
  .pg [style*="font-size: calc(42*var(--u))"] { font-size: 36.7px !important; }
  .pg [style*="font-size: calc(46*var(--u))"] { font-size: 39.8px !important; }
  .pg [style*="font-size: calc(50*var(--u))"] { font-size: 43px !important; }
  .pg [style*="font-size: calc(60*var(--u))"] { font-size: 50.8px !important; }
  .pg [style*="font-size: calc(64*var(--u))"] { font-size: 53.9px !important; }
}
@media (max-width: 900px) {
  .pg [style*="font-size: calc(18.5*var(--u))"] { font-size: 18.2px !important; }
  .pg [style*="font-size: calc(19*var(--u))"] { font-size: 18.5px !important; }
  .pg [style*="font-size: calc(19.5*var(--u))"] { font-size: 18.8px !important; }
  .pg [style*="font-size: calc(20*var(--u))"] { font-size: 19px !important; }
  .pg [style*="font-size: calc(21*var(--u))"] { font-size: 19.5px !important; }
  .pg [style*="font-size: calc(22*var(--u))"] { font-size: 20px !important; }
  .pg [style*="font-size: calc(23*var(--u))"] { font-size: 20.5px !important; }
  .pg [style*="font-size: calc(24*var(--u))"] { font-size: 21px !important; }
  .pg [style*="font-size: calc(26*var(--u))"] { font-size: 22px !important; }
  .pg [style*="font-size: calc(27*var(--u))"] { font-size: 22.5px !important; }
  .pg [style*="font-size: calc(28*var(--u))"] { font-size: 23px !important; }
  .pg [style*="font-size: calc(29*var(--u))"] { font-size: 23.5px !important; }
  .pg [style*="font-size: calc(30*var(--u))"] { font-size: 24px !important; }
  .pg [style*="font-size: calc(31*var(--u))"] { font-size: 24.5px !important; }
  .pg [style*="font-size: calc(32*var(--u))"] { font-size: 25px !important; }
  .pg [style*="font-size: calc(33*var(--u))"] { font-size: 25.5px !important; }
  .pg [style*="font-size: calc(34*var(--u))"] { font-size: 26px !important; }
  .pg [style*="font-size: calc(36*var(--u))"] { font-size: 27px !important; }
  .pg [style*="font-size: calc(38*var(--u))"] { font-size: 28px !important; }
  .pg [style*="font-size: calc(40*var(--u))"] { font-size: 29px !important; }
  .pg [style*="font-size: calc(42*var(--u))"] { font-size: 30px !important; }
  .pg [style*="font-size: calc(46*var(--u))"] { font-size: 32px !important; }
  .pg [style*="font-size: calc(50*var(--u))"] { font-size: 34px !important; }
  .pg [style*="font-size: calc(60*var(--u))"] { font-size: 39px !important; }
  .pg [style*="font-size: calc(64*var(--u))"] { font-size: 41px !important; }
}
