/* Type and color follow the interview deck's system:
   one serif family, no bold, one accent used only on annotations. */

/* Tiempos, served from the site's own fonts folder so every visitor sees it. */
@font-face { font-family: "Tiempos Headline"; src: url("../fonts/tiempos-headline-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Tiempos Text"; src: url("../fonts/tiempos-text-regular.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Tiempos Text"; src: url("../fonts/tiempos-text-regular-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }

:root {
  --paper: #f4f4f1;
  --ink: #1a1a18;
  --quiet: #6f6f69;
  --rule: #d2d2cc;
  --redline: #d8402b;
  --headline: "Tiempos Headline", Georgia, "Times New Roman", serif;
  --text: "Tiempos Text", Georgia, "Times New Roman", serif;
  --measure: 40rem;
  --wide: 75rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.125rem;
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  font-synthesis: none;
}

h1, h2, h3, strong, b { font-weight: 400; }

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.15s ease;
}
a:hover { text-decoration-color: var(--ink); }

img { display: block; max-width: 100%; height: auto; }

/* Header and footer */

.site-header,
.site-footer {
  max-width: var(--wide);
  margin: 0 auto;
  padding: 1.5rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1.5rem;
  font-size: 1rem;
}

/* One rule for the whole site: if you can click it, it has a faint underline in the divider grey,
   and the underline darkens on hover. Nothing else is underlined, and grey text
   is never a link. A heavier black line marks the page you are on. The one exception is the name in the header, which works the
   way a logo does. */

.site-header > a,
.site-footer > a { text-decoration-color: transparent; text-underline-offset: 0.4em; white-space: nowrap; }
.site-header > a:hover,
.site-footer > a:hover { text-decoration-color: var(--ink); }

.site-header nav { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }

/* Work opens a short list of the three case studies. It hangs from Work's right
   edge with its text set right, so it stays inside the page. It appears on hover
   and on keyboard focus. On touch screens there is no hover, so Work simply goes
   to Home, where the three case studies are listed. */
.menu { position: relative; }
.submenu {
  display: none;
  position: absolute; right: -0.75rem; top: 100%;
  padding: 0.85rem 0.75rem 0.9rem;
  background: var(--paper);
  text-align: right; white-space: nowrap;
  z-index: 10;
}
.submenu a { display: block; padding: 0.22rem 0; }
@media (hover: hover) and (min-width: 761px) {
  .menu:hover .submenu,
  .menu:focus-within .submenu { display: block; }
}

/* The footer is a small map of the whole site, set on a fixed grid: the name in
   the left half, then two equal columns that start at the half and three-quarter
   marks. Each column is one heading link with three links stepped in beneath it:
   the work, then the person. It marks the exact page you are on. */
.site-footer { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; align-items: start; }
.site-footer nav { display: grid; grid-template-columns: 1fr 1fr; column-gap: 2rem; }
.site-footer .col { display: flex; flex-direction: column; align-items: flex-start; gap: 0.55rem; }
.site-footer .col a:not(:first-child) { margin-left: 1.25rem; }

/* The page you are on: full black with a solid, heavier line. It stays a link. */
.site-header .here,
.site-header .here:hover,
.site-footer .here,
.site-footer .here:hover { text-decoration-color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 0.4em; }
.site-header nav a,
.site-footer nav a { text-underline-offset: 0.4em; }

/* In the header, an underline means one thing only: this is the page you are on.
   The other link carries no line until you hover it. With only two links there is
   no pattern to compare against, so two kinds of underline could not be told apart. */
.site-header nav a:not(.here) { text-decoration-color: transparent; }
.site-header nav a:not(.here):hover { text-decoration-color: var(--ink); }

.site-footer {
  margin-top: 6rem;
  padding-top: 2rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--rule);
  color: var(--quiet);
}
.site-footer a { color: var(--ink); }

/* Shared blocks */

main { display: block; }

.wide { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.column { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: 0 var(--gutter); }
.wide > .column-left { max-width: var(--measure); }

.statement {
  font-family: var(--headline);
  font-size: clamp(2rem, 5.2vw, 4.5rem);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin: 0;
}

.statement-2 {
  font-family: var(--headline);
  font-size: clamp(1.6rem, 3.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.005em;
  margin: 0;
}

.label { color: var(--quiet); font-size: 1rem; margin: 0; }
.quiet { color: var(--quiet); }
.pull { font-style: italic; margin: 0; }

section { margin-top: 5.5rem; }
section > .column > h2,
section > .wide > h2 { margin: 0 0 1.25rem; }
/* Paragraphs avoid ending on a single stranded word. */
p { margin: 0 0 1.1rem; text-wrap: pretty; }

/* Figures */

figure { margin: 2.25rem 0; }
figure img,
.frame { border: 1px solid var(--rule); background: #fff; }
/* A component shown on its own sits on a white panel with the same padding on all four sides. */
.frame.pad { padding: clamp(0.625rem, 1.75vw, 1.5rem); }
.frame.pad img { border: 0; background: none; width: 100%; }
figcaption {
  margin-top: 0.75rem;
  font-style: italic;
  font-size: 1rem;
  color: var(--quiet);
  max-width: var(--measure);
}

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 figure, .grid-2 figure { margin: 0; }
.grid-3 figcaption, .grid-2 figcaption { color: var(--quiet); font-style: normal; }

/* Annotated screens. Each note points at the thing it describes: a red dot on the
   screen, joined to its note by a red line. --x and --y place the dot on the image;
   --ny is the height at which the note sits. On small screens there is no room for
   lines, so the dots carry numbers and the notes are numbered to match. */

.annotated { display: grid; grid-template-columns: minmax(0, 2fr) minmax(14rem, 1fr); gap: 2rem; align-items: stretch; }
.annotated + .annotated { margin-top: 1rem; }
.annotated .shot { position: relative; }
.annotated .shot img { width: 100%; }

.pin { position: absolute; left: var(--x); top: var(--y); width: 0; height: 0; }
.pin::before {
  content: "";
  position: absolute; left: -3.5px; top: -3.5px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--redline);
}

.lead { position: absolute; left: var(--x); right: -2rem; top: var(--y); height: 0; border-top: 1px solid var(--redline); pointer-events: none; }
.lead.up { top: var(--ny); height: calc(var(--y) - var(--ny)); border-left: 1px solid var(--redline); }
.lead.down { top: var(--y); height: calc(var(--ny) - var(--y)); border-top: 0; border-left: 1px solid var(--redline); border-bottom: 1px solid var(--redline); }

.annotations { list-style: none; margin: 0; padding: 0; position: relative; font-style: italic; font-size: 1rem; line-height: 1.4; }
.annotations li { position: absolute; left: 0; right: 0; top: var(--ny); transform: translateY(-50%); padding-left: 0.6rem; }

/* Home */

/* Home opens as a short introduction, not a full-screen statement: one line, then
   two plain paragraphs, compact enough that the first case study follows closely. */
.opening { padding-top: clamp(3rem, 8vh, 6rem); }
.opening .label { color: var(--quiet); margin-bottom: 1.25rem; }
.opening .statement { max-width: 18em; }
.intro { max-width: var(--measure); }
.opening .intro { margin-top: 2.25rem; }
.intro p:last-child { margin-bottom: 0; }

.cases { margin-top: 3.5rem; }
.case {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(1.5rem, 4vw, 4rem);
  align-items: center;
  padding: 3rem 0;
  border-top: 1px solid var(--rule);
  text-decoration: none;
}
.case:last-child { border-bottom: 1px solid var(--rule); }
.case h2 { font-family: var(--headline); font-size: clamp(1.8rem, 3.4vw, 3rem); line-height: 1.1; margin: 0 0 0.9rem; }
.case p { margin: 0; }
.case h2 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.14em; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s ease; }
.case .more { display: inline-block; margin-top: 1.25rem; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--rule); transition: text-decoration-color 0.15s ease; }
.case .more::after,
.next a::after { content: "\00a0\2192"; display: inline-block; text-decoration: none; color: var(--rule); transition: color 0.15s ease; }
.case:hover .more::after,
.next a:hover::after { color: var(--ink); }
.case:hover h2,
.case:hover .more { text-decoration-color: var(--ink); }
.case img { border: 1px solid var(--rule); background: #fff; }
.case .phones { display: flex; gap: 0.75rem; justify-content: center; }
.case .phones img { width: 30%; border: 0; background: none; }

.closing { margin-top: 5rem; }
.closing .statement-2 { margin-bottom: 1.5rem; }

/* A case study written as one continuous story: text and figures alternate
   with even spacing and no section headings. */
.story { margin-top: 3.5rem; }
.story > * + * { margin-top: 2.75rem; }
.story figure { margin: 0; }
.story .column p:last-child { margin-bottom: 0; }
/* An exhibit set in the run of the text: centered like the text column, and a
   little wider than it on both sides. */
.outset { max-width: calc(var(--measure) + 6rem + 2 * var(--gutter)); margin-left: auto; margin-right: auto; padding: 0 var(--gutter); }
.outset figcaption { font-size: 1rem; margin-top: 0.85rem; text-wrap: pretty; }

/* The opening lines of a page, set larger. Shared by Home and the case studies. */
.lede { font-family: var(--headline); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.3; margin-bottom: 1.5rem; }
/* A caption belongs to its figure, so it runs the figure's full width, not the text column's. */
.story .wide > figure > figcaption { font-size: 1rem; margin-top: 0.85rem; max-width: none; text-wrap: pretty; }
.story .draw { margin-top: 0; }
.story .pitched { margin: 2.25rem 0; }
/* Each case study ends on the same pair as its card on Home: the ask in grey, the need in black. */
.story .pitched.ending { margin: 3rem 0 0; }
/* Recognition: a labelled list, set apart from the story above it. */
.story .recognition { margin-top: 3.5rem; }
.closing .recognition { margin-top: 2.5rem; }
.recognition .label { margin-bottom: 0.4rem; }
.recognition ul { list-style: none; margin: 0; padding: 0; }
.recognition li { margin: 0; }
.recognition li + li { margin-top: 0.75rem; }
.recognition .note { display: block; color: var(--quiet); font-size: 1rem; }
/* A link inside the grey note stays dark, so grey text is still never a link. */
.recognition .note a { color: var(--ink); }
.story .annotated + figcaption,
.story .annotated ~ figcaption { margin-top: 1.25rem; }

/* Case pages */

.case-head { padding-top: 4rem; }
.case-head .statement { margin-bottom: 1rem; }
.case-head .pull { font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.3; margin-bottom: 1rem; }

/* The two arguments on Queues, set in the same larger size as a page's opening lines. */
.pitched { margin: 2.25rem 0; font-family: var(--headline); font-size: clamp(1.35rem, 2.2vw, 1.75rem); line-height: 1.3; }
.pitched .was { color: var(--quiet); display: block; }
.pitched .now { display: block; }

.next { margin-top: 5rem; }
.next a { font-family: var(--headline); font-size: clamp(1.6rem, 3.2vw, 2.6rem); text-decoration-line: underline; text-decoration-thickness: 1px; text-underline-offset: 0.14em; text-decoration-color: var(--rule); }
.next a:hover { text-decoration-color: var(--ink); }

/* The ten seconds */

.draw { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(0.5rem, 1.5vw, 1.25rem); margin: 2.25rem 0 0.75rem; }
.draw img,
figure .draw img { width: 100%; border: 0; background: none; transition: opacity 0.35s ease; }
.draw.playing img { opacity: 0.22; }
.draw.playing img.on { opacity: 1; }
.draw-meta { display: flex; gap: 1.5rem; align-items: baseline; color: var(--quiet); font-size: 1rem; }
.draw-meta button {
  font: inherit; color: var(--ink); background: none; border: 0; padding: 0;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 0.2em; cursor: pointer;
  text-decoration-color: var(--rule); transition: text-decoration-color 0.15s ease;
}
.draw-meta button:hover { text-decoration-color: var(--ink); }
.draw-clock { font-variant-numeric: tabular-nums; }

/* Small screens */

@media (max-width: 760px) {
  body { font-size: 1.0625rem; }
  .site-footer { grid-template-columns: 1fr; row-gap: 1.5rem; }
  .site-footer nav { column-gap: 1.5rem; }
  .site-footer .col a:not(:first-child) { margin-left: 0.75rem; }
  section { margin-top: 4rem; }
  .grid-3, .grid-2, .annotated, .case { grid-template-columns: 1fr; }
  .annotated { gap: 0.5rem; }
  .lead { display: none; }
  .pin::before {
    content: attr(data-n);
    left: -0.6rem; top: -0.6rem; width: 1.2rem; height: 1.2rem;
    color: #fff; font-size: 0.7rem; line-height: 1.2rem; text-align: center; font-style: normal;
  }
  .annotations li { position: relative; top: auto; transform: none; padding: 0.7rem 0 0.7rem 1.75rem; border-top: 1px solid var(--rule); }
  .annotations li:first-child { border-top: 0; }
  .annotations li::before { content: attr(data-n); position: absolute; left: 0.25rem; color: var(--redline); font-style: normal; }
  .case { padding: 2.25rem 0; }
  .case .shot { order: -1; }
  .draw { grid-template-columns: repeat(5, 62%); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 0.5rem; }
  .draw img { scroll-snap-align: center; }
  .draw.playing img { opacity: 1; }
  .draw-meta button, .draw-clock { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .draw img { transition: none; }
}
