/* The home page: header, portrait, intro and project list. The sections
   below the grid are in home-more.css. Andada Pro for names and reading
   text, Inter for small labels (both in fonts.css). */

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #fff;
  color: #222;
  font: 400 1rem/normal "Andada Pro", Georgia, serif;
}

a { color: inherit; text-decoration: none; }

:focus-visible { outline: 2px solid #222; outline-offset: 5px; }

.page { max-width: 1480px; margin: auto; padding: 0 5vw; }

@media (max-width: 700px) {
  .page { padding: 0 20px; }
}

/* ---------- Header ---------- */

.home-header { display: flex; justify-content: space-between; padding: 28px 0; font-size: 1rem; line-height: 1.5; }
.home-header > a { font-size: 1.125rem; font-weight: 500; letter-spacing: .01em; }
.home-header nav { display: flex; gap: 22px; }
.home-header nav a { display: inline-flex; align-items: center; min-height: 44px; padding: 6px 2px; }

@media (max-width: 700px) {
  .home-header { padding: 20px 0; }
}

/* ---------- Portrait and intro ----------
   One pose shows at a time; js/home.js turns the head toward the card
   under the pointer or in focus. */

.masthead { display: flex; justify-content: center; padding: 5px 0 12px; }
.masthead .head { position: relative; width: 140px; height: 140px; mix-blend-mode: multiply; contain: paint; }
.masthead .head svg { position: absolute; inset: 0; width: 100%; height: 100%; display: none; }
.masthead .head[data-pose="neutral"] .pose-neutral,
.masthead .head[data-pose="left"] .pose-left,
.masthead .head[data-pose="right"] .pose-right,
.masthead .head[data-pose="down"] .pose-down { display: block; }

.portrait-intro {
  max-width: 860px;
  margin: 0 auto 34px;
  color: #222;
  font: italic 400 clamp(1.375rem, 2.3vw, 1.875rem)/1.4 "Andada Pro", Georgia, serif;
  text-align: center;
  text-wrap: balance;
}
.portrait-intro span { display: block; margin-top: 10px; color: #888; font: 400 clamp(1rem, 1.3vw, 1.125rem)/1.55 "Andada Pro", Georgia, serif; }

/* Short, wide screens: a smaller portrait, so the grid stays in view */
@media (min-width: 1000px) and (max-height: 800px) {
  .home-header { padding: 20px 0; }
  .masthead { padding-top: 0; }
  .masthead .head { width: 100px; height: 100px; }
}
@media (max-width: 850px) {
  .masthead .head { width: 110px; height: 110px; }
}
@media (max-width: 800px) {
  .portrait-intro { font-size: 1.25rem; }
}
@media (max-width: 500px) {
  .masthead { padding-top: 0; }
  .masthead .head { width: 90px; height: 90px; }
  .portrait-intro { margin-bottom: 26px; padding: 0 8px; }
}

/* ---------- Project list ----------
   One row per project: its years and my title on the left; its name, label
   and a line on it in the middle; and two small pictures on the right,
   tilted and overlapping a little, standing on the row's bottom edge, which
   cuts them. The pictures lift when the row is hovered. */

.work { display: block; margin-top: 8px; border-bottom: 1px solid #e4e6e5; }
.project {
  position: relative;
  display: grid;
  grid-template-columns: minmax(120px, 2fr) minmax(0, 6fr) minmax(0, 3fr);
  column-gap: clamp(20px, 3vw, 48px);
  padding: 22px 0;
  overflow: hidden;
  border-top: 1px solid #e4e6e5;
  color: #222;
}
.project .when { padding-top: 5px; font: 400 .8125rem/1.6 "Inter", Arial, sans-serif; letter-spacing: .02em; }
.project .when span { display: block; }
.project .when span:first-child { color: #666; font-variant-numeric: tabular-nums; }
.project .when span + span { margin-top: 2px; color: #222; }
.project h2 { margin: 0; font: 500 1.25rem/1.3 "Andada Pro", Georgia, serif; letter-spacing: -.005em; }
.project h2 span { color: #666; font-weight: 400; }
.project h2 span::before { content: "· "; }
.project .about > p { max-width: 66ch; margin: 6px 0 0; font: 400 .9375rem/1.5 "Andada Pro", Georgia, serif; color: #555; }
.project .award { display: inline-flex; align-items: center; gap: 10px; margin-top: 10px; font: 400 .8125rem/1.4 "Inter", Arial, sans-serif; color: #666; }
.project .award img { width: auto; height: 20px; filter: grayscale(1); opacity: .7; transition: filter .3s, opacity .3s; }
.project:hover .award img, .project:focus-visible .award img { filter: none; opacity: 1; }

/* The pictures: the column runs the full height of the row, so the cards
   stand on its bottom edge. They're sized by the column, and the second
   overlaps the first a little. On hover they rise, one after the other. */
.project .stack { position: relative; container-type: inline-size; min-height: 132px; margin: -22px 0; }
.project .card {
  --r: 0deg;
  position: absolute;
  bottom: -26px;
  left: var(--x, 0);
  width: 50cqw;
  aspect-ratio: 176 / 124;
  overflow: hidden;
  border: 1px solid #e4e6e5;
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 14px 26px #181d2729, 0 4px 7px #181d271f;
  transform: rotate(var(--r));
  transition: transform .42s cubic-bezier(.18, .86, .28, 1.14) var(--d, 0s);
}
.project .card:nth-child(1) { --r: -3.7deg; }
.project .card:nth-child(2) { --x: 46cqw; --r: 7.8deg; --d: .04s; }
/* Every other row leans the other way, so the rows don't repeat */
.project:nth-child(even) .card:nth-child(1) { --r: 4.8deg; }
.project:nth-child(even) .card:nth-child(2) { --r: -5.6deg; }
.project:hover .card, .project:focus-visible .card { transform: translateY(-16px) rotate(var(--r)); }
.project .card img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top; }
@media (prefers-reduced-motion: reduce) { .project .card { transition: none; } }

/* A rebuilt documentation page as one of the pictures (the Clario row):
   the same miniature as the case study's hero, sized by its card */
.docs-host { container-type: inline-size; width: 100%; height: 100%; }
.docs-host > .docs-mini { width: 100%; }
.docs-mini { display: grid; grid-template-columns: 28% 72%; height: 100%; font: 400 calc(100cqw / 26) / 1.3 Inter, system-ui, sans-serif; color: #3b3440; text-align: left; }
.dm-side { padding: 1.2em .8em; background: #faf9fb; border-right: 1px solid #ece9ee; }
.dm-side b { display: flex; align-items: center; gap: .45em; margin: 0 0 .6em .3em; font-size: .95em; font-weight: 600; }
.dm-side b::before { content: ""; width: .95em; height: .95em; background: #a12a6f; clip-path: polygon(25% 0, 75% 0, 100% 40%, 50% 100%, 0 40%); }
.dm-side small { display: block; margin: 1.1em 0 .3em .3em; font-size: .62em; letter-spacing: .05em; text-transform: uppercase; color: #9a93a0; }
.dm-side i { display: block; width: 70%; height: .5em; margin: .7em .3em; border-radius: .25em; background: #e6e2ea; }
.dm-side i.on { width: auto; height: 1.7em; margin: .35em 0; border-radius: .4em; background: #f6eef3; box-shadow: inset .2em 0 #a12a6f; }
.dm-main { min-width: 0; padding: 1.3em 1.6em; }
.dm-crumb { font-size: .72em; color: #a12a6f; }
.dm-title { display: block; margin-top: .15em; font-size: 1.4em; font-weight: 500; color: #222; }
.dm-canvas { display: flex; justify-content: center; gap: .6em; margin: .9em 0 .8em; padding: 1.9em 1em; border-radius: .6em; background: #f8f7f9; }
.dm-canvas span { padding: .45em 1.1em; border-radius: .35em; background: #fff; box-shadow: 0 1px 3px #0000001f; font-size: .8em; font-weight: 500; }
.dm-canvas span.p { background: #a12a6f; color: #fff; box-shadow: none; }
.dm-links { display: flex; gap: .45em; }
.dm-links span { width: 6em; height: 1.6em; border: 1px solid #ece9ee; border-radius: .35em; }
.dm-tabs { display: flex; gap: 1.3em; margin-top: 1em; border-bottom: 1px solid #ece9ee; font-size: .72em; color: #8b8490; }
.dm-tabs span { padding-bottom: .5em; }
.dm-tabs .on { color: #a12a6f; box-shadow: inset 0 -2px #a12a6f; }
.dm-lines i { display: block; height: .45em; margin-top: .8em; border-radius: .25em; background: #efedf1; }
.dm-lines i:nth-child(2) { width: 82%; }
.dm-lines i:nth-child(3) { width: 64%; }

@media (max-width: 700px) {
  .project { grid-template-columns: 1fr; row-gap: 6px; padding: 22px 0 0; }
  .project.mention { padding-bottom: 22px; }
  .project .when { display: flex; gap: 12px; padding-top: 0; }
  .project .when span + span { margin-top: 0; }
  .project h2 { font-size: 1.125rem; }
  .project .stack { height: 90px; min-height: 0; margin: 12px 0 0; }
  .project .card { width: 140px; bottom: -20px; }
  .project .card:nth-child(2) { --x: 128px; }
}
