/* nicotaylor.com
   ----------------------------------------------------------------
   The six values below control the whole site. Change one and every
   page follows. Everything else in this file depends on them.
   ---------------------------------------------------------------- */

:root {
  --size:     15px;    /* type size, everywhere */
  --leading:  1.6;     /* line height */
  --measure:  400px;   /* width of the text column */
  --measure-teaching: 520px;  /* wider column on the teaching pages, so the overview
                                 fits a 14" laptop window */
  --pad:      40px;    /* margin around the page */
  --rail:     90px;    /* width of the sidebar (and the portrait) */
  --gutter:   30px;    /* sidebar to rule to text */

  /* spacing, derived from the above */
  --gap:      20px;    /* between paragraphs */
  --gap-lg:   40px;    /* between sections */

  /* colour */
  --ink:      #000000;
  --ground:   #ffffff;
  --rule:     #8a8378;
  --mark:     #3a3a3a;
  --quiet:    #6b6357;  /* descriptions under listed pieces */
  --hover:    #6b6357;
  --pale:     #f1efeb;   /* fill for the teaching section links */
  --pale-2:   #e3ded6;   /* the same, on hover */
  --pale-3:   #d8d3cb;   /* the divider between the two */

  --sans: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Helvetica,
          "Segoe UI", Arial, sans-serif;
}

/* ---------------------------------------------------------------- */

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--size);
  line-height: var(--leading);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

a { color: var(--ink); }
a:hover { color: var(--hover); }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

/* layout ---------------------------------------------------------- */

.page {
  min-height: 100vh;
  padding: var(--pad) max(16px, var(--pad));
  display: flex;
  flex-direction: column;
}

.body {
  flex-grow: 1;
  display: flex;
  gap: var(--gutter);
  align-items: stretch;
}

.rail {
  width: var(--rail);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.portrait {
  width: var(--rail);
  height: calc(var(--rail) * 1.216);
  object-fit: cover;
  display: block;
}

.home { display: block; line-height: 0; flex-shrink: 0; }
.home:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }

.ident { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

.name { font-weight: 500; text-decoration: none; }

nav { display: flex; flex-direction: column; gap: 4px; }
nav a { text-decoration: none; }
nav a[aria-current="page"] { font-weight: 500; }

.spine {
  width: 1px;
  flex-shrink: 0;
  background: var(--rule);
}

main {
  flex-grow: 1;
  max-width: var(--measure);
  display: flex;
  flex-direction: column;
  gap: var(--gap-lg);
}
@media (min-width: 701px) { .teaching main { max-width: var(--measure-teaching); } }

/* text ------------------------------------------------------------ */

.block { display: flex; flex-direction: column; gap: var(--gap); }

h1 {
  margin: 0;
  font-size: var(--size);
  font-weight: 500;
  line-height: var(--leading);
}

p { margin: 0; }

hr { border: 0; height: 1px; background: var(--rule); margin: 0; }

ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

li a, main p a { text-underline-offset: 0.2em; }

/* one quiet line describing a piece, under its title */
.note {
  display: block;
  font-size: calc(var(--size) - 2px);
  line-height: 1.45;
  color: var(--quiet);
  margin-top: 2px;
}

footer {
  margin-top: var(--gap-lg);
  padding-top: 12px;
  border-top: 1px solid var(--rule);
}

/* phones and narrow windows --------------------------------------- */

@media (max-width: 700px) {
  :root { --rail: 64px; }

  .body { flex-direction: column; gap: var(--gap-lg); }
  .rail { width: auto; flex-direction: row; align-items: flex-start; gap: 20px; }
  .ident { flex-grow: 1; gap: 12px; }
  nav { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; }
  .spine { width: auto; height: 1px; }
  main { max-width: none; }
}

/* projects page ---------------------------------------------------- */

.marks {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  min-height: 28px;
  margin: 6px 0;
}

.marks a { display: block; line-height: 0; }
.marks a:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.marks img, .marks svg { display: block; }
.marks svg { color: var(--mark); }

/* sized by optical weight, not by height: a wide solid mark and a
   thin round one need different boxes to carry the same presence */
.m-harpers { width: 26px; height: 26px; }
.m-fsg     { width: 25px; height: 28px; }
.m-cca     { width: 38px; height: 18px; }
.m-osmo    { width: 33px; height: 21px; }
.m-eno     { width: 40px; height: 25px; }

/* teaching section ------------------------------------------------- */

.subnav { flex-direction: row; flex-wrap: wrap; gap: 4px 20px; font-size: var(--size); }
.subnav a { text-decoration: none; color: var(--hover); white-space: nowrap; }
.subnav a:hover { color: var(--ink); }
.subnav a[aria-current="page"] { color: var(--ink); font-weight: 500; }

/* On phones the row is too narrow for "test prep & subjects", so the
   last two words drop and the gaps tighten to keep the menu on one line. */
@media (max-width: 520px) {
  .subnav { gap: 4px 12px; }
  .subnav .wide { display: none; }
}

/* email link on the teaching pages: the address, then a small black
   arrow tab that greys on hover while the arrow nudges right */
.cta {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 500;
  text-decoration: none;
}
.cta:hover { color: var(--ink); }
.cta:focus-visible { outline: 1px solid var(--ink); outline-offset: 3px; }
.cta-tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--ink);
  color: var(--ground);
  font-size: 14px;
}
.cta:hover .cta-tab { background: var(--hover); }
.cta-arrow { display: inline-block; transition: transform 120ms ease-out; }
.cta:hover .cta-arrow { transform: translateX(3px); }
@media (prefers-reduced-motion: reduce) { .cta-arrow { transition: none; } }

/* the referral line under it: smaller, grey, one line where it fits */
.ref { font-size: 13px; color: var(--hover); white-space: nowrap; margin-top: -12px; } /* 8px under the email link it belongs to */
.ref a { color: var(--hover); }
.ref a:hover { color: var(--ink); }
@media (max-width: 520px) { .ref { white-space: normal; } }

/* overview: one pale block split in two; each half darkens on hover.
   The fill hangs 12px past the text column on both sides so the labels
   start on the same left edge as every other line on the page. */
.paths {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-inline: -12px -13px;  /* 13px on the right keeps each half a whole number of pixels */
  gap: 1px;                    /* the divider: container colour shows through */
  background: var(--pale-3);
}
.paths a {
  padding: 9px 12px;
  line-height: 1.35;
  white-space: nowrap;
  text-decoration: none;
  color: var(--ink);
  background: var(--pale);
  transition: background-color 120ms ease-out;
}
/* sits 24px under the credentials (not the usual 40) so it reads as part of
   that group, with the full 40px before the contact block */
.paths { margin-top: -16px; }
.paths a:hover { background: var(--pale-2); color: var(--ink); }
.paths a:focus-visible { outline: 1px solid var(--ink); outline-offset: -4px; }
@media (prefers-reduced-motion: reduce) { .paths a { transition: none; } }
/* on phones the halves stack so each label still fits on one line */
@media (max-width: 520px) {
  .paths { grid-template-columns: minmax(0, 1fr); }
}

/* overview credentials: a short CV-style list, label left, detail right */
.creds {
  margin: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 6px 16px;
  font-size: 14px;
  line-height: 1.45;
}
.creds dt { color: var(--hover); }
.creds dd { margin: 0; }
@media (max-width: 520px) {
  .creds { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .creds dd { margin-bottom: 8px; }
}

/* overview: rotating quotes from families. Every quote is in the HTML,
   stacked in one grid cell so the block keeps the height of the longest
   and the page below never moves. teaching/quotes.js turns them over every
   7 seconds (holds on hover or focus; starts paused for reduced motion).
   Without the script, the first quote shows alone. The serif mark hangs
   in the gutter so the words keep the column's left edge. */
.quotes {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin: -12px 0 -16px;   /* tighter than the usual section gap: the stage already
                              leaves room under shorter quotes, and the controls'
                              tap padding adds more */
}
.quotes-stage {
  display: grid;
  background: var(--ground);
  will-change: opacity;          /* keeps the fade on its own layer: no flash */
  backface-visibility: hidden;
  transition: opacity 400ms ease;
}
.quotes-stage.out { opacity: 0; }
.quote {
  grid-area: 1 / 1;
  margin: 0;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  visibility: hidden;
}
.quote.on { visibility: visible; }
.quote::before {
  content: "\201C";
  content: "\201C" / "";
  position: absolute;
  left: -24px;
  top: -5px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 48px;
  line-height: 1;
  color: var(--rule);
}
.quote blockquote { margin: 0; font-size: 18px; line-height: 1.45; }
.quote figcaption { font-size: 13px; line-height: 1.45; color: var(--hover); }
.quotes-ctl {
  margin-top: -6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 16px;
  font-size: 13px;
  color: var(--hover);
}
.quotes-ctl a { color: var(--hover); }
.quotes-ctl a:hover { color: var(--ink); }
.quotes-nav { display: flex; align-items: center; gap: 12px; }
.quotes-nav[hidden] { display: none; }
.quotes-nav button {
  background: none;
  border: 0;
  margin: 0;
  padding: 10px 2px;
  font: inherit;
  color: var(--hover);
  cursor: pointer;
}
.quotes-nav button:hover { color: var(--ink); }
.quotes-dots { display: flex; gap: 2px; }
.quotes-dots button { padding: 10px 4px; line-height: 0; }
.quotes-dots button span { display: block; width: 6px; height: 6px; border-radius: 50%; background: var(--pale-3); }
.quotes-dots button[aria-current="true"] span { background: var(--hover); }
@media (prefers-reduced-motion: reduce) { .quotes-stage { transition: none; } }

/* families page: the same label/detail grid as the credentials */
.said {
  margin: 0;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 16px;
  font-size: 14px;
  line-height: 1.45;
}
.said dt { color: var(--hover); }
.said dd { margin: 0; display: flex; flex-direction: column; gap: 3px; }
.said blockquote { margin: 0; }
.said .who { font-size: 13px; color: var(--hover); }
@media (max-width: 520px) {
  .said { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .said dd { margin-bottom: 14px; }
}
