/* The home page's design. index.html adds a "look-<name>" class to <html> for each name, by default
   masonry, pal-cool and wide; "?look=…" in the address picks others to compare:
   index.html?look=tiles        each paper is a tile with a red edge; click it to see the full abstract
   index.html?look=tiles,grid   the same tiles, in two columns on wide screens
   index.html?look=masonry      tiles in masonry columns, title on a coloured strip, section names as tiles
   index.html?look=...,wide     one width for the cover and every page; the cover as a grid of squares
   index.html?look=...,pal-…    a palette (below); a switcher in the corner offers the others
   index.html?look=original     the site as it was before the redesign */

/* ---------- Turning cards (both looks) ----------
   js/looks.js builds a card inside each paper: .tile-card holding a .tile-front and a .tile-back. */

html.look-tiles #research .tile-card,
html.look-masonry #research .tile-card {
	position: relative;
	transform-style: preserve-3d;
	transition: transform 0.55s ease, min-height 0.3s ease;
}
/* The normal arrow on tiles; links and buttons keep the hand. */
html.look-tiles #research ul.listitems > li,
html.look-masonry #research ul.listitems > li,
html.look-masonry #research .section-tile {
	cursor: default;
}

/* The fixed navigation tiles stay above the paper tiles, which form layers of their own. */
html.look-tiles nav.navfix,
html.look-masonry nav.navfix {
	z-index: 100;
}
html.look-tiles #research .tile-card.flipped,
html.look-masonry #research .tile-card.flipped {
	transform: rotateY(180deg);
}
html.look-tiles #research .tile-face,
html.look-masonry #research .tile-face {
	position: relative;
	box-sizing: border-box;
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
}
/* The back stays the tile's size until it is turned over: a hidden back that stuck out below
   its tile would still count toward the height of a masonry column. */
html.look-tiles #research .tile-back,
html.look-masonry #research .tile-back {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	overflow: hidden;
	transform: rotateY(180deg);
}
html.look-tiles #research .tile-card.flipped .tile-back,
html.look-masonry #research .tile-card.flipped .tile-back {
	height: auto;
	min-height: 100%;
	overflow: visible;
}
html.look-tiles #research li[tabindex]:focus,
html.look-masonry #research li[tabindex]:focus {
	outline: none;
}
html.look-tiles #research li[tabindex]:focus-visible .tile-face,
html.look-masonry #research li[tabindex]:focus-visible .tile-face {
	outline: 2px solid #e04f39;
	outline-offset: 2px;
}

/* ---------- look=tiles: papers as tiles with a red edge ---------- */

/* Space under a list is padding, not margin: a margin would escape the section and leave a
   white strip between Research and Employment. */
html.look-tiles #research ul.listitems {
	list-style: none;
	margin: 0.3em 0 0;
	padding: 0 0 1.2em;
}

/* The tile's surface; until js/looks.js has built the card, the paper itself is the tile. */
html.look-tiles #research li,
html.look-tiles #research .tile-face {
	background: #ffffff;
	border-left: 4px solid #8f0000;                 /* publications: deep red */
	padding: 0.55em 0.85em 0.5em 0.95em;
	box-shadow: 0 1px 2px rgba(17, 22, 50, 0.08);
}
html.look-tiles #research li.wp,
html.look-tiles #research li.wp .tile-face {
	border-left-color: #e04f39;                     /* working papers: the palette's lighter red */
}

/* Type: the title stands out; everything else in the tile is set smaller. */
html.look-tiles #research li {
	list-style: none;
	position: relative;
	margin: 0.45em 0;
	font-size: 0.8em;
	line-height: 1.4;
	transform: perspective(1200px) rotateY(0deg);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}
html.look-tiles #research li > a:first-child,
html.look-tiles #research .tile-front > a:first-of-type {
	font-size: 1.45em;
	font-weight: 500;
	line-height: 1.3;
}
html.look-tiles #research li:has(> .tile-card) {
	background: none;
	border: 0;
	padding: 0;
	box-shadow: none;
	perspective: 1400px;
}
html.look-tiles.no-touch #research li:hover {
	transform: perspective(1200px) rotateY(-2.5deg);
	box-shadow: 0 6px 18px rgba(17, 22, 50, 0.12);
}
html.look-tiles.no-touch #research li:has(> .tile-card):hover {
	box-shadow: none;
}
html.look-tiles.no-touch #research li:hover .tile-face {
	box-shadow: 0 6px 18px rgba(17, 22, 50, 0.12);
}
html.look-tiles #research .tile-back p {
	margin: 0;
	color: #333333;
	line-height: 1.5;
}
html.look-tiles #research .tile-summary,
html.look-tiles #research .abstract {
	margin-top: 0.3em;
	padding-top: 0.3em;
	border-top: 1px solid #eceff8;
	color: grey;
}
html.look-tiles #research .tile-hint {
	float: right;
	margin: -0.05em -0.2em 0 0.6em;
	color: #c3c8da;
	font-size: 1.2em;
	line-height: 1;
	transition: color 0.2s ease;
}
html.look-tiles #research li:hover .tile-hint {
	color: #8f0000;
}
html.look-tiles #research li.wp:hover .tile-hint {
	color: #e04f39;
}
@media screen and (max-width: 700px) {
	html.look-tiles #research li {
		margin: 0.35em 0;
	}
	html.look-tiles #research li,
	html.look-tiles #research .tile-face {
		padding: 0.4em 0.55em 0.4em 0.65em;
		border-left-width: 3px;
	}
	html.look-tiles #research .tile-summary,
	html.look-tiles #research .abstract {
		margin-top: 0.25em;
		padding-top: 0.25em;
	}
}

/* look=tiles,grid: two columns of tiles on wide screens */
@media screen and (min-width: 760px) {
	html.look-tiles.look-grid #research ul.listitems {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.9em;
		align-items: stretch;
	}
	html.look-tiles.look-grid #research li {
		margin: 0;
	}
	html.look-tiles.look-grid #research li:has(> .tile-card) {
		display: flex;
	}
	html.look-tiles.look-grid #research .tile-card {
		flex: 1 1 auto;
		display: flex;
	}
	html.look-tiles.look-grid #research .tile-front {
		flex: 1 1 auto;
	}
}

/* ---------- look=masonry: masonry columns, title strips, section tiles ----------
   Research: each paper is a tile (js/looks.js). Employment, Activities and Teaching: each heading
   becomes a section tile and each group under a sub-heading an .info-tile, in a .tile-wall. */

/* Research: the section names move into the columns as tiles. */
html.look-masonry #research .research_title,
html.look-masonry #research h3.topic {
	display: none !important;
}

/* Columns: the browser fits as many as there is room for, each at least this wide (3 on a laptop,
   4 on wide screens, 1 on phones); js/looks.js sets where each column starts. The space under a
   block is padding, so that no white strip escapes below a section. */
html.look-masonry #research ul.listitems,
html.look-masonry .tile-wall {
	list-style: none;
	margin: 0;
	padding: 0 0 0.9em;
	column-width: 15.5em;
	column-gap: 0.9em;
}
/* Every gap below a tile equals the column gap (0.9em of the list's text); tiles set their own
   em sizes (0.8em, section tiles 1.9em), hence the division. */
html.look-masonry #research ul.listitems > li,
html.look-masonry .tile-wall > .info-tile,
html.look-masonry .section-tile {
	break-inside: avoid;
	margin: 0;
}
html.look-masonry #research ul.listitems > li,
html.look-masonry .tile-wall > .info-tile {
	margin-bottom: calc(0.9em / 0.8);
}
html.look-masonry .section-tile {
	margin-bottom: calc(0.9em / 1.9);
}

/* Colours: Research by kind of paper; the other pages in their navigation tile's colour,
   darkened where white text needs it (Activities, Teaching). */
html.look-masonry #research   { --tone: #b11b1b; }
html.look-masonry #employment { --tone: #e04f39; }
html.look-masonry #activities { --tone: #c46e00; }
html.look-masonry #teaching   { --tone: #b08600; }

html.look-masonry .section-tile {
	background: var(--tone);
	color: #ffffff;
	font-size: 1.9em;
	font-weight: 300;
	line-height: 1.1;
	padding: 0.45em 0.55em 1.5em;
	cursor: default;
}
html.look-masonry #research ul.pub > .section-tile {
	background: var(--pub-tile, var(--pub, #8f0000));
}
html.look-masonry #research ul.wp > .section-tile {
	background: var(--wp-tile, var(--wp, #e04f39));
}
/* By topic: each topic in a colour of its own, for its publications and working papers alike
   (js/looks.js gives each topic's list its --topic, in the topics' order). Stanford colours with
   white text at contrast 4.8 or more: Cardinal, Plum light, Spirited dark, Archway; then Brick
   and Plum for a fifth and sixth topic. */
html.look-masonry #research {
	--topic-1: #8C1515;
	--topic-2: #734675;
	--topic-3: #C74632;
	--topic-4: #5D4B3C;
	--topic-5: #651C32;
	--topic-6: #620059;
}
html.look-masonry #research ul.topic-list > .section-tile,
html.look-masonry #research ul.topic-list > li .tile-strip,
html.look-masonry #research ul.topic-list > li .tile-link {
	background: var(--topic);
}

/* The second section of a page (Education, Professional Activities) in a second shade of the
   page's colour, as Working Papers are in a lighter red than Publications: the same hue, lightness
   moved by 0.08 in OKLCH (two thirds of the step from Cardinal to Cardinal light), white text at
   contrast 4.9 or more. js/looks.js marks these sections. */
html.look-masonry #employment { --tone-alt: #c33600; }
html.look-masonry #activities { --tone-alt: #aa5500; }
html.look-masonry .tile-wall-alt {
	--strip: var(--strip-alt, var(--tone-alt, var(--tone)));
}
html.look-masonry .tile-wall-alt .section-tile {
	background: var(--tone-alt, var(--tone));
}

/* Tiles: white, small text, the navigation tiles' tilt on hover. */
html.look-masonry #research ul.listitems > li,
html.look-masonry .info-tile {
	list-style: none;
	position: relative;
	font-size: 0.8em;
	line-height: 1.4;
	transform: perspective(1200px) rotateY(0deg);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	cursor: default;
}
html.look-masonry #research ul.listitems > li {
	perspective: 1400px;
}
html.look-masonry.no-touch #research ul.listitems > li:hover,
html.look-masonry.no-touch .info-tile:hover {
	transform: perspective(1200px) rotateY(-3deg);
}
html.look-masonry #research .tile-face,
html.look-masonry .info-tile {
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(17, 22, 50, 0.1);
}
html.look-masonry #research .tile-face {
	transition: box-shadow 0.2s ease;
}
html.look-masonry.no-touch #research li:hover .tile-face,
html.look-masonry.no-touch .info-tile:hover {
	box-shadow: 0 6px 18px rgba(17, 22, 50, 0.14);
}

/* The coloured strip with the title in large, light white type. */
html.look-masonry .tile-strip {
	background: var(--strip, var(--tone));
	padding: 0.5em 0.75em 0.55em;
}
html.look-masonry #research li.pub .tile-strip {
	background: var(--pub, #8f0000);
}
html.look-masonry #research li.wp .tile-strip {
	background: var(--wp, #e04f39);
}
html.look-masonry .tile-strip > a,
html.look-masonry .tile-strip > span:not(.tile-hint),
html.look-masonry .tile-strip > h3 {
	display: inline;
	margin: 0;
	padding: 0;
	background: none;
	color: #ffffff !important;                      /* main.js colours links inline; main.css sets headings black */
	font-size: 1.45em;
	font-weight: 300;                               /* Lato Light, like the section tiles */
	line-height: 1.25;
	text-decoration: none;
}
html.look-masonry #research .tile-hint,
html.look-masonry .pager-tile .tile-hint {
	float: right;
	margin: 0.05em -0.15em 0 0.5em;
	color: rgba(255, 255, 255, 0.55);
	font-size: 1.2em;
	line-height: 1;
	transition: color 0.2s ease;
}
html.look-masonry #research li:hover .tile-hint,
html.look-masonry .pager-tile:hover .tile-hint {
	color: #ffffff;
}

/* Below the strip: small grey details, then dark text. */
html.look-masonry .tile-body {
	padding: 0.45em 0.75em 0.6em;
	font-size: 1.25em;                               /* the tile's text at the page's size (tiles are set at 0.8em) */
}
html.look-masonry .tile-meta {
	margin: 0;
	color: #5a5a5a;
}
/* Extra links (arXiv, ACM EC) as small flat buttons in the section's colour. */
html.look-masonry #research .tile-link {
	display: inline-block;
	margin-left: 0.2em;
	padding: 0.05em 0.45em 0.1em;
	background: var(--pub, #8f0000);
	color: #ffffff !important;                      /* main.js colours every link inline */
	font-size: 0.85em;
	font-style: normal;
	line-height: 1.35;
	text-decoration: none;
	vertical-align: 0.05em;
	transition: opacity 0.2s ease;
}
html.look-masonry #research li.wp .tile-link {
	background: var(--wp, #e04f39);
}
html.look-masonry.no-touch #research .tile-link:hover {
	opacity: 0.8;
}
html.look-masonry #research .tile-summary {
	margin: 0.35em 0 0;
	color: #111111;
}
html.look-masonry #research .tile-back .tile-body p {
	margin: 0;
	color: #222222;
	line-height: 1.45;
}

/* Space between the "View my Curriculum Vitae" line and the first tiles. */
html.look-masonry .col > p + .tile-wall {
	margin-top: 0.8em;
}

/* Lists inside info tiles (positions, degrees, journals, talks by year): one item a line, no bullets. */
html.look-masonry .info-tile .tile-body ul {
	list-style: none;
	margin: 0;
	padding: 0;
}
html.look-masonry .info-tile .tile-body li {
	margin: 0 0 0.3em;
	color: #222222;
}
html.look-masonry .info-tile .tile-body li:last-child {
	margin-bottom: 0;
}
html.look-masonry .info-tile .activity-toggle-wrap {
	margin: 0.4em 0 0;
}

/* Talks: a tile that turns to earlier years (js/looks.js). The white surface is on its two faces;
   the groups of years share one place on each face, so the tile has its tallest group's height. */
html.look-masonry .info-tile.pager-tile {
	background: none;
	box-shadow: none;
	perspective: 1400px;
}
html.look-masonry.no-touch .info-tile.pager-tile:hover {
	box-shadow: none;
}
html.look-masonry .pager-card {
	display: grid;
	transform-style: preserve-3d;
	transition: transform 0.55s ease;
}
html.look-masonry .pager-face {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(17, 22, 50, 0.1);
	-webkit-backface-visibility: hidden;
	backface-visibility: hidden;
	transition: box-shadow 0.2s ease;
}
html.look-masonry .pager-back {
	transform: rotateY(180deg);
}
html.look-masonry.no-touch .pager-tile:hover .pager-face {
	box-shadow: 0 6px 18px rgba(17, 22, 50, 0.14);
}
html.look-masonry .pager-pages {
	flex: 1 1 auto;
	display: grid;
}
html.look-masonry .pager-page {
	grid-area: 1 / 1;
	display: flex;
	flex-direction: column;
	visibility: hidden;
}
html.look-masonry .pager-page.on {
	visibility: visible;
}
/* Below the years: a dot for each group, the shown one in the section's colour. */
html.look-masonry .pager-foot {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin-top: auto;
	padding-top: 0.6em;
	color: grey;
	font-size: 0.85em;
}
html.look-masonry .pager-dot {
	width: 0.5em;
	height: 0.5em;
	border-radius: 50%;
	background: #d6d6d6;
}
html.look-masonry .pager-dot.on {
	background: var(--strip, var(--tone));
}
html.look-masonry .pager-label {
	margin-left: auto;
}
html.look-masonry .pager-tile:focus {
	outline: none;
}
html.look-masonry .pager-tile:focus-visible .pager-face {
	outline: 2px solid var(--tone);
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	html.look-masonry .pager-card {
		transition: none;
	}
}

/* The date/topic switch: two halves, the chosen one filled; the fill slides across. */
html.look-masonry #research .sort {
	display: none !important;                       /* js/looks.js puts the switch in its place */
}
html.look-masonry #research .sort-toggle {
	position: relative;
	display: inline-grid;
	grid-template-columns: 1fr 1fr;
	margin: 0.8em 0 1em;
	padding: 3px;
	background: #ffffff;
	box-shadow: 0 1px 2px rgba(17, 22, 50, 0.1);
}
html.look-masonry #research .sort-toggle::before {
	content: "";
	position: absolute;
	top: 3px;
	bottom: 3px;
	left: 3px;
	width: calc(50% - 3px);
	background: var(--toggle, #b11b1b);
	transition: transform 0.25s ease;
}
html.look-masonry #research .sort-toggle[data-by="topic"]::before {
	transform: translateX(100%);
}
html.look-masonry #research .sort-toggle button {
	position: relative;
	z-index: 1;
	min-height: 2.2em;
	padding: 0 1.1em;
	border: 0;
	background: none;
	color: var(--toggle-ink, #8f0000);
	font: inherit;
	font-size: 0.9em;
	cursor: pointer;
	transition: color 0.25s ease;
}
html.look-masonry #research .sort-toggle button[aria-pressed="true"] {
	color: #ffffff;
	cursor: default;
}
html.look-masonry #research .sort-toggle button:focus-visible {
	outline: 2px solid #e04f39;
	outline-offset: 2px;
}
@media (prefers-reduced-motion: reduce) {
	html.look-masonry #research .sort-toggle::before {
		transition: none;
	}
}

/* Phones: one column, so tighten every vertical space to keep the pages short. */
@media screen and (max-width: 700px) {
	html.look-masonry #research ul.listitems,
	html.look-masonry .tile-wall {
		padding-bottom: 0.5em;
	}
	html.look-masonry #research ul.listitems > li,
	html.look-masonry .tile-wall > .info-tile {
		margin-bottom: calc(0.5em / 0.8);
	}
	html.look-masonry .section-tile {
		font-size: 1.6em;
		padding: 0.3em 0.45em 0.35em;
		margin-bottom: calc(0.5em / 1.6);
	}
	html.look-masonry .tile-strip {
		padding: 0.3em 0.6em 0.35em;
	}
	html.look-masonry .tile-body {
		padding: 0.3em 0.6em 0.4em;
	}
	html.look-masonry #research .tile-summary {
		margin-top: 0.2em;
	}
	html.look-masonry #research .sort-toggle {
		margin: 0.5em 0 0.6em;
	}
}
/* Phones: two columns from a 390px-wide window (a regular iPhone), one below (iPhone SE and mini).
   The page is the window less 20px, so two columns need 370px: each at least half of that, less
   the gap between them. */
@media screen and (max-width: 499px) {
	html.look-masonry #research ul.listitems,
	html.look-masonry .tile-wall {
		column-width: calc((370px - 0.9em) / 2);
	}
}
/* One column (js/looks.js marks such lists and walls): smaller titles, so that fewer of them run
   to a second line and the page is shorter. */
html.look-masonry .one-column .tile-strip > a,
html.look-masonry .one-column .tile-strip > span:not(.tile-hint),
html.look-masonry .one-column .tile-strip > h3 {
	font-size: 1.2em;
}
html.look-masonry .one-column .section-tile {
	font-size: 1.35em;
	margin-bottom: calc(0.5em / 1.35);
}

/* ---------- Palettes, each led by Stanford's Cardinal red (#8C1515) ----------
   ?look=masonry,pal-warm | pal-cool | pal-wine | pal-stone, or the switcher in the corner (js/looks.js).
   All colours are from Stanford's identity palette; white text on each meets contrast 4.4 or more.
   main.js colours the cover, the navigation tiles, rules and links inline, hence !important. */

html[class*="look-pal-"] section[id="1st"] {
	background-color: var(--cover-bg) !important;
}
/* Each page on its own faint tint, as in the original colours: lightness 0.968 and chroma 0.012 in
   OKLCH (the original tints: 0.97 and 0.010 to 0.016), in the hue of the page's navigation tile. */
html[class*="look-pal-"] section:not([id="1st"]) {
	background-color: var(--bg, var(--page-bg)) !important;
}
html[class*="look-pal-"] .card0 { background-color: var(--card0) !important; }
html[class*="look-pal-"] .card1 { background-color: var(--card1) !important; }
html[class*="look-pal-"] .card2 { background-color: var(--card2) !important; }
html[class*="look-pal-"] nav .box:nth-of-type(1) { background-color: var(--nav1) !important; }
html[class*="look-pal-"] nav .box:nth-of-type(2) { background-color: var(--nav2) !important; }
html[class*="look-pal-"] nav .box:nth-of-type(3) { background-color: var(--nav3) !important; }
html[class*="look-pal-"] nav .box:nth-of-type(4) { background-color: var(--nav4) !important; }
html[class*="look-pal-"] nav .box:nth-of-type(5) { background-color: var(--nav5) !important; }
html[class*="look-pal-"] section hr {
	background-color: var(--tone) !important;
}
html[class*="look-pal-"] section .col > p a,
html[class*="look-pal-"] pagetitle .titletext {
	color: var(--link, var(--tone)) !important;
}

/* Cardinal & wine: only the reds and berries (Cardinal, Cardinal light, Brick, Plum). */
html.look-pal-wine {
	--cover-bg: #2E2D29; --page-bg: #F4F4F4;
	--card0: #620059; --card1: #651C32; --card2: #8C1515;
	--nav1: #820000; --nav2: #8C1515; --nav3: #B83A4B; --nav4: #651C32; --nav5: #620059;
}
html.look-pal-wine #research   { --bg: #FDF2F0; --tone: #8C1515; --pub: #8C1515; --wp: #B83A4B; --toggle: #8C1515; --toggle-ink: #8C1515; }
html.look-pal-wine #employment { --bg: #FDF1F1; --tone: #B83A4B; --tone-alt: #9D1E2B; }
html.look-pal-wine #activities { --bg: #FCF1F3; --tone: #651C32; --tone-alt: #7D334C; }
html.look-pal-wine #teaching   { --bg: #FAF2F8; --tone: #620059; }

/* Cardinal to Palo Alto in even steps: Research in Cardinal, Teaching in Palo Alto, the two pages
   between them in colours spaced evenly on the way (computed in OKLCH at equal lightness); Cover is
   the neutral "home" tile in Stanford cool grey. Working papers use Stanford's Cardinal light. */

/* Warm way round: through bronze and moss. */
html.look-pal-warm {
	--cover-bg: #2E2D29; --page-bg: #F4F4F4;
	--card0: #8C1515; --card1: #7D4800; --card2: #436318;
	--nav1: #53565A; --nav2: #8C1515; --nav3: #7D4800; --nav4: #436318; --nav5: #175E54;
}
html.look-pal-warm #research   { --bg: #FDF2F0; --tone: #8C1515; --pub: #8C1515; --wp: #B83A4B; --toggle: #8C1515; --toggle-ink: #8C1515; }
html.look-pal-warm #employment { --bg: #FAF3EC; --tone: #7D4800; --tone-alt: #985D28; }
html.look-pal-warm #activities { --bg: #F2F6EE; --tone: #436318; --tone-alt: #60792B; }
html.look-pal-warm #teaching   { --bg: #ECF7F5; --tone: #175E54; }

/* Cool way round: through violet and blue. Cover is Stanford Brick, a deeper red ahead of Cardinal. */
html.look-pal-cool {
	--cover-bg: #2E2D29; --page-bg: #F4F4F4;
	--card0: #8C1515; --card1: #763488; --card2: #145A96;
	--nav1: #651C32; --nav2: #8C1515; --nav3: #763488; --nav4: #145A96; --nav5: #175E54;
}
html.look-pal-cool #research   { --bg: #FDF2F0; --tone: #8C1515; --pub: #8C1515; --wp: #B83A4B; --toggle: #8C1515; --toggle-ink: #8C1515; }
html.look-pal-cool #employment { --bg: #F8F2FA; --tone: #763488; --tone-alt: #894EA6; }
html.look-pal-cool #activities { --bg: #EFF5FC; --tone: #145A96; --tone-alt: #2374AE; }
html.look-pal-cool #teaching   { --bg: #ECF7F5; --tone: #175E54; }

/* Cardinal & stone: Cardinal on every title strip and link; section and navigation tiles in
   Stanford's warm neutrals (Black, Cool grey, Archway, Stone). */
html.look-pal-stone {
	--cover-bg: #2E2D29; --page-bg: #F4F4F4;
	--card0: #8C1515; --card1: #43423E; --card2: #5D4B3C;
	--nav1: #820000; --nav2: #8C1515; --nav3: #53565A; --nav4: #5D4B3C; --nav5: #7F7776;
}
html.look-pal-stone section { --strip: #8C1515; --strip-alt: #B83A4B; --link: #8C1515; }
html.look-pal-stone #research   { --bg: #F7F3F3; --tone: #8C1515; --pub: #8C1515; --wp: #B83A4B; --pub-tile: #2E2D29; --wp-tile: #53565A; --toggle: #8C1515; --toggle-ink: #8C1515; }
html.look-pal-stone #employment { --bg: #F2F5F8; --tone: #53565A; --tone-alt: #696D71; }
html.look-pal-stone #activities { --bg: #F8F4F0; --tone: #5D4B3C; --tone-alt: #756153; }
html.look-pal-stone #teaching   { --bg: #F8F3F2; --tone: #7F7776; }

/* The palette switcher (shown while a look is on). */
.palette-switcher {
	position: fixed;
	right: 14px;
	bottom: 14px;
	z-index: 200;
	padding: 8px 10px 6px;
	background: #ffffff;
	box-shadow: 0 4px 16px rgba(17, 22, 50, 0.18);
	font: 13px/1.3 Lato, "Segoe UI", sans-serif;
	color: #2E2D29;
}
.palette-switcher p {
	margin: 0 0 4px;
	font-weight: 500;
}
.palette-switcher button {
	display: flex;
	align-items: center;
	gap: 8px;
	width: 100%;
	min-height: 28px;
	margin: 0 0 2px;
	padding: 2px 6px;
	border: 1px solid transparent;
	background: none;
	font: inherit;
	color: inherit;
	text-align: left;
	cursor: pointer;
}
.palette-switcher button:hover {
	background: #F4F4F4;
}
.palette-switcher button[aria-pressed="true"] {
	border-color: #2E2D29;
}
.palette-switcher .sw {
	display: inline-flex;
	gap: 2px;
}
.palette-switcher .sw i {
	width: 11px;
	height: 11px;
}

/* ---------- look=wide: one width for the cover and every page ----------
   On computer screens the cover, the navigation tiles and the pages share one width: 1000px (half
   the window on screens wider than 2000px), less in a narrow window, and less in a short one so
   that the cover fits the window.
   In a landscape window the cover is a grid of five equal columns: the photo is a 2x2 square, the
   three cards fill the three columns beside it, and the five navigation tiles are the bottom row.
   In a portrait or narrow window (phones, tablets held upright) the cover keeps its tall layout,
   scaled to the width of the pages. main.js sets widths, heights and font sizes inline, hence
   !important. */
@media screen and (orientation: landscape) and (min-width: 760px) {
	html.look-wide {
		--g: 8px;                                                        /* the gap between cover tiles */
		--w: min(max(1000px, 50vw), calc(100vw - 48px), max(720px, calc((100vh - 40px) / 0.6)));
		--c: calc((var(--w) - 4 * var(--g)) / 5);                        /* one column of the cover */
	}
	html.look-wide .col {
		width: var(--w) !important;
	}
	html.look-wide .col1 {
		min-height: 100vh !important;
	}

	/* The cover. The space above centres the cover and the navigation row in the window; it is
	   padding, not flex centring, because main.js takes the navigation row out of the flow when it
	   fixes it to the top, and a centred cover would then move. */
	html.look-wide .intro {
		display: grid;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		grid-template-rows: var(--c) var(--c);
		gap: var(--g);
		width: var(--w);
		margin: 0 auto var(--g);
		padding-top: max(20px, calc((100vh - 3 * var(--c) - 2 * var(--g)) / 2));
		font-size: calc(var(--c) * 0.074);
		line-height: 1.35;
	}
	html.look-wide .right {
		display: contents;
	}
	html.look-wide .left {
		grid-area: 1 / 1 / 3 / 3;
		width: auto;
		height: auto;
		margin: 0;
		background-position: 50% 27% !important;                        /* head and shoulders */
	}
	html.look-wide .outfill:nth-of-type(1) { grid-area: 1 / 3 / 2 / 6; }   /* name: three columns */
	html.look-wide .outfill:nth-of-type(2) { grid-area: 2 / 3 / 3 / 4; }   /* position: one square */
	html.look-wide .outfill:nth-of-type(3) { grid-area: 2 / 4 / 3 / 6; }   /* fields and contact: two columns */
	html.look-wide .fill,
	html.look-wide .card {
		width: 100%;
		height: 100%;
		margin: 0;
	}
	html.look-wide .card .face {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		box-sizing: border-box;
		padding: 0.8em 1em;
	}
	html.look-wide .card .face p {
		margin: 0 !important;                                            /* the cards' inline margins were for the tall cover */
		font-size: 1em;
	}
	html.look-wide .card .face p + p {
		margin-top: 0.9em !important;
	}
	html.look-wide .card0 h1 {
		margin: 0;
		font-size: 3em;
		font-weight: 400;
	}
	html.look-wide .card1 .front p br:last-of-type {
		display: none;                                                   /* no empty line below "Economics" */
	}
	/* The hover tilt moves the far edge of a card as far as it moves on a square. */
	html.look-wide.no-touch .outfill:nth-of-type(1):hover .fill {
		transform: perspective(1200px) rotateY(-4.5deg);
	}
	html.look-wide.no-touch .outfill:nth-of-type(3):hover .fill {
		transform: perspective(1200px) rotateY(-6.5deg);
	}

	/* The navigation row: as wide as the pages, its tiles one cover column each. */
	html.look-wide nav {
		width: var(--w);
		gap: var(--g);
		margin: 0 auto;
	}
	html.look-wide nav .box {
		flex: 1 1 0;
		width: auto;
		margin: 0;
	}
	/* On the cover: squares, the letter and the rest of the word centred. */
	html.look-wide nav:not(.navfix) {
		height: var(--c);
	}
	html.look-wide nav:not(.navfix) .box {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		font-size: calc(var(--c) * 0.12);
	}
	html.look-wide nav:not(.navfix) .box .first {
		margin: -0.12em 0 0;
		padding: 0;
		line-height: 1.05;
	}
	/* Fixed to the top on the pages: the original tabs, now spanning the page width. The tab of the
	   page in view reaches down to the bottom of the rule under the page title (the title area is
	   8.5em of the same font size, the rule 2px). */
	html.look-wide nav.navfix {
		left: 0;
		right: 0;
		height: calc(8.5em + 2px);
		margin: 0 auto;
	}
	html.look-wide nav.navfix .box:not(.box-down) .first {
		margin-top: -0.2em;
	}

	/* Four masonry columns at the full width; section names a little smaller, to stay on one line
	   in the narrower columns. */
	html.look-wide.look-masonry #research ul.listitems,
	html.look-wide.look-masonry .tile-wall {
		column-width: 14.5em;
	}
	html.look-wide.look-masonry .section-tile {
		font-size: 1.7em;
		margin-bottom: calc(0.9em / 1.7);
	}
}

/* look=wide in a portrait or narrow window: the original tall cover, scaled so that its edges are
   the pages' edges. Its parts are sized in em of .col1, 39.6em from the photo's left edge to the
   cards' right edge (40em less the outer margins), hence the font size. The page titles take the
   same font size, so that the fixed tabs still end on the rule below them. */
@media screen and (orientation: portrait), screen and (max-width: 759px) {
	html.look-wide {
		--w: min(1000px, calc(100vw - 20px), max(calc((100vh - 40px) / 1.222), 70vw));
	}
	html.look-wide .col {
		width: var(--w) !important;
	}
	html.look-wide .col1 {
		font-size: calc(var(--w) / 39.6) !important;
		min-height: max(100vh, 50em) !important;
	}
	html.look-wide pagetitle {
		font-size: calc(var(--w) / 39.6) !important;
		height: 8.5em !important;
	}
	html.look-wide nav.navfix {
		height: calc(8.3em + 2px);                                       /* the tabs' top margin is 0.2em */
	}
}
