/*
  Turn Key Tech: one stylesheet for the whole site.
  Mobile first. Class selectors only, one level deep where possible, so the
  order of rules in this file decides which wins. Nothing here is rounded
  beyond 4px, nothing is shaded, and nothing moves unless it is clicked.

  Contents
   1. Tokens
   2. Base type and elements
   3. Skip link
   4. Layout: .wrap, .section and its modifiers
   5. Header: header.site-head
   6. Buttons and links: .btn, .btn-quiet
   7. .split (the two column section)
   8. .prose, .lede, .source
   9. .plain-list
  10. .fact-table
  11. .script and the handover mark
  12. .steps
  13. details.qa
  14. .photo (figures)
  15. .portraits (the assistants)
  16. Home hero and the phone number display
  17. Contact section: section#contact.contact
  18. Footer: footer.site-foot
*/

/* 1. Tokens ------------------------------------------------------------- */

:root {
  /* Palette from the brief. No other colours are used anywhere. */
  --ink: #16232A;
  --harbour: #2F4852;
  --mist: #EEF2F1;
  --white: #FFFFFF;
  --signal: #00AEEF;
  --signal-deep: #006E9C;
  --quiet: #4A5A62;
  --hairline: #D5DDDC;

  /* Roles. Components read these, and the ink bands swap them (see below),
     so every component works on a light or a dark ground without variants. */
  --fg: var(--ink);
  --fg-head: var(--ink);
  --fg-quiet: var(--quiet);
  --line: var(--hairline);
  --link: var(--signal-deep);
  --btn-bg: var(--signal-deep);
  --btn-fg: var(--white);
  --btn-bg-hover: var(--ink);
  --focus: var(--signal-deep);

  --font-head: "Archivo", "Arial Narrow", Arial, sans-serif;
  --font-text: "Source Serif 4", Georgia, "Times New Roman", serif;

  --gap-section: 3.5rem;
  --gap-col: 2rem;
}

@media (min-width: 60rem) {
  :root {
    --gap-section: 6rem;
  }
}

/* The dark grounds: header, home hero, the one mid page band, footer.
   Body text on ink is mist, because harbour on ink is too faint to read;
   harbour is kept for rules. */
.site-head,
.hero,
.section--ink,
.site-foot {
  --fg: var(--mist);
  --fg-head: var(--white);
  --fg-quiet: var(--mist);
  --line: var(--harbour);
  --link: var(--white);
  --btn-bg: var(--signal);
  --btn-fg: var(--ink);
  --btn-bg-hover: var(--white);
  --focus: var(--signal);
  background: var(--ink);
  color: var(--fg);
}

/* 2. Base type and elements --------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--white);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.6;
}

/* Headings: wide Archivo, echoing the letterforms of the TKT mark. */
h1,
h2,
h3 {
  margin: 0 0 1rem;
  color: var(--fg-head);
  font-family: var(--font-head);
  font-stretch: 112%;
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.012em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 5.6vw, 4.5rem);
}

h2 {
  font-size: clamp(1.8rem, 3.1vw, 2.6rem);
}

/* h3 runs a little looser than h1 and h2 so two line h3s do not collide. */
h3 {
  font-size: 1.3rem;
  line-height: 1.15;
}

/* Running text never runs wider than 62 characters. */
p {
  margin: 0 0 1.1em;
  max-width: 62ch;
}

a {
  color: var(--link);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* One focus style for everything interactive. */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

/* 3. Skip link: first element in body, appears on keyboard focus. -------- */
/* It shows over the ink header, so its focus ring is the brand cyan. */

.skip-link {
  --focus: var(--signal);
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 10;
  padding: 0.6rem 1rem;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
}

.skip-link:focus {
  top: 1rem;
}

/* 4. Layout -------------------------------------------------------------- */

/* .wrap: the container. Every band has exactly one, directly inside it. */
.wrap {
  width: min(1180px, 100% - 3rem);
  margin-inline: auto;
}

/* .section: a block of the page, separated from its neighbours by white
   space. Pick at most one ground modifier and at most one join modifier. */
.section {
  padding-block: var(--gap-section);
}

/* Ground modifiers. Plain .section is white. */
.section--mist {
  background: var(--mist);
}

/* .section--ink is the single mid page dark band (colours set in tokens). */

/* Join modifiers, for a section that follows another on the SAME ground:
   --joined drops its own top padding, so one gap separates the two.
   --ruled draws one hairline between the two and keeps a full gap above
   and below it, the same distance as between two grounds. Do not use
   either after a change of ground. */
.section--joined,
.section--ruled {
  padding-top: 0;
}

.section--ruled > .wrap {
  border-top: 1px solid var(--line);
  padding-top: var(--gap-section);
}

/* 5. Header: header.site-head -------------------------------------------- */
/* Ink band. Mark at left (links home), four text links, phone number at
   right. On phones the links wrap under the mark; there is no menu button. */

.site-head {
  padding-block: 0.9rem;
}

.site-head-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 2.25rem;
  row-gap: 0.5rem;
}

.site-mark {
  display: block;
  flex: none;
}

.site-mark img {
  display: block;
  width: 87px;
  height: 36px;
}

.site-nav {
  order: 3;
  flex-basis: 100%;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a,
.site-phone {
  display: inline-block;
  padding-block: 0.4rem;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
}

.site-nav a:hover,
.site-phone:hover {
  text-decoration: underline;
  text-underline-offset: 0.4em;
}

/* The page you are on. */
.site-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--signal);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.4em;
}

.site-phone {
  margin-left: auto;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

@media (min-width: 54rem) {
  .site-nav {
    order: 0;
    flex-basis: auto;
  }
}

/* 6. Buttons and links ---------------------------------------------------- */

/* .btn: the one filled button. Deep cyan with white text on light grounds,
   brand cyan with ink text on the ink bands (the tokens swap by themselves).
   Use one per group of choices at most. */
.btn {
  display: inline-block;
  padding: 0.8rem 1.25rem;
  border-radius: 4px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.btn:hover {
  background: var(--btn-bg-hover);
  color: var(--btn-fg);
}

/* .btn-quiet: a text link in the heading face with a 1px underline. For the
   second choice beside a .btn, and for "read more" links at the end of a
   section. The label says where it goes; no arrows. */
.btn-quiet {
  display: inline-block;
  color: var(--link);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.btn-quiet:hover {
  text-decoration-thickness: 2px;
}

/* 7. .split: the recurring two column section ------------------------------ */
/* On wide screens a 12 column grid: .split-head takes the left five columns
   (the h2 alone, optionally a .photo under it) and .split-body the right
   seven (prose, lists, tables). The heading is the label, so nothing sits
   above it. Stacks on narrow screens.
   .split--flip is for a band that leads with a photo: write .split-body
   first and the photo's .split-head second, so phones read heading, text,
   photo, while wide screens still show the photo on the left. */

.split {
  display: grid;
  gap: 1.5rem;
}

.split-head > :last-child,
.split-body > :last-child {
  margin-bottom: 0;
}

/* A second split inside the same section keeps a clear distance from the
   first. A photo or a portrait grid after a split resets its own margin, so
   each has its own rule further down (.split + .photo, .split + .portraits). */
.split + * {
  margin-top: 3rem;
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap-col);
    row-gap: 0;
  }

  .split-head {
    grid-column: 1 / span 5;
    padding-right: 1.5rem;
  }

  .split-body {
    grid-column: 6 / span 7;
  }

  .split--flip > .split-head,
  .split--flip > .split-body {
    grid-row: 1;
  }

  .split + * {
    margin-top: 4rem;
  }

  /* .split--label: a split whose head is an h3 naming the .plain-list in its
     body. The h3 drops to the first line of the list, so the two read as one
     row under the list's top hairline. */
  .split--label > .split-head {
    padding-top: 1.1rem;
  }
}

/* .page-head: the opening section of an inner page (a plain .section holding
   the h1 and a lede). Gives the h1 the same room as the home hero's. */
.page-head h1 {
  margin-bottom: 1.5rem;
}

/* 8. .prose, .lede, .source ------------------------------------------------ */

/* .prose: running text set to the measure. Wrap paragraphs, short lists and
   h3 subheadings in it. */
.prose {
  max-width: 62ch;
}

.prose > :first-child {
  margin-top: 0;
}

.prose > :last-child {
  margin-bottom: 0;
}

.prose h3 {
  margin-top: 2.2rem;
  margin-bottom: 0.5rem;
}

.prose ul {
  margin: 0 0 1.1em;
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 0.35em;
}

/* A short run of prose that introduces a list, table, step list or question
   list keeps a clear line of space before it. */
.prose + .plain-list,
.prose + .fact-table,
.prose + .steps,
.prose + details.qa {
  margin-top: 1.75rem;
}

/* .lede: the one or two opening sentences under an h1. Slightly larger. */
.lede {
  font-size: 1.25rem;
  line-height: 1.5;
}

/* .source: a citation line under the text it supports. Put the title of the
   work in a cite element (italic by default, which is what italic is for). */
.source {
  font-size: 0.95rem;
  color: var(--fg-quiet);
}

/* 9. .plain-list ------------------------------------------------------------ */
/* A list of things with a hairline between each and no bullets or numbers.
   Each li is either one sentence, or an h3 (the name of the thing) followed
   by one p. */

.plain-list {
  margin: 0 0 1.75rem;
  padding: 0;
  border-top: 1px solid var(--line);
  list-style: none;
}

.plain-list > li {
  padding-block: 1.1rem;
  border-bottom: 1px solid var(--line);
}

.plain-list h3 {
  margin: 0 0 0.3rem;
}

.plain-list p {
  margin: 0;
}

/* 10. .fact-table ------------------------------------------------------------ */
/* A two column table with hairline rules: the thing in a th scope="row", the
   fact about it in the td. Stacks on phones. No header row is needed. */

.fact-table {
  width: 100%;
  margin: 0 0 1.75rem;
  border-top: 1px solid var(--line);
  border-collapse: collapse;
}

.fact-table th,
.fact-table td {
  display: block;
  padding: 0;
  text-align: left;
  vertical-align: top;
}

.fact-table th {
  padding-top: 0.9rem;
  color: var(--fg-head);
  font-family: var(--font-head);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
}

.fact-table td {
  padding-top: 0.2rem;
  padding-bottom: 0.9rem;
  border-bottom: 1px solid var(--line);
}

@media (min-width: 40rem) {
  .fact-table th,
  .fact-table td {
    display: table-cell;
    padding-block: 0.9rem;
    border-bottom: 1px solid var(--line);
  }

  .fact-table th {
    width: 34%;
    padding-right: 1.5rem;
    line-height: 1.6;
  }
}

/* 11. .script and the handover mark ------------------------------------------ */
/* A phone call set like a play. Each line is a p holding the speaker in
   b.script-who and their words in a span. No bubbles, portraits or times.
   Wrap it in figure.script-figure with a figcaption saying the call is an
   illustration. The moment the assistant hands over to a person is a
   p.script-handover that starts with the handover mark. */

.script-figure {
  margin: 0;
}

.script-figure figcaption {
  margin-top: 0.9rem;
  color: var(--fg-quiet);
  font-size: 0.95rem;
}

.script {
  padding-block: 0.75rem;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.script p {
  display: grid;
  max-width: none;
  margin: 0;
  padding-block: 0.55rem;
}

.script-who {
  color: var(--fg-head);
  font-family: var(--font-head);
  font-size: 0.95rem;
  font-weight: 600;
}

.script .script-handover {
  row-gap: 0.5rem;
  margin-top: 0.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 30rem) {
  .script p {
    grid-template-columns: 5.5rem minmax(0, 1fr);
    column-gap: 1.25rem;
    align-items: baseline;
  }
}

/* The handover mark: the cyan diagonal stroke from the K of the logo. It
   marks the point in a call where the assistant hands over to a person and
   appears nowhere else. Never a bullet, never a divider. Always
   aria-hidden, with the handover said in words beside it. */
.handover-mark {
  display: inline-block;
  width: 14px;
  height: 22px;
  margin-inline: 9px;
  background: var(--signal);
  transform: skewX(-38deg);
}

/* 12. .steps ------------------------------------------------------------------ */
/* An ol for a real sequence only (the four step path). Each li holds an h3
   and one or two p. The large numeral is drawn by CSS from the list order,
   so do not type the numbers. */

.steps {
  margin: 0 0 1.75rem;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

/* A .fact-table inside a step (the week by week table in discovery) keeps a
   clear line of space above and below it. */
.steps .fact-table {
  margin: 1.1rem 0;
}

.steps > li {
  display: grid;
  grid-template-columns: 3rem minmax(0, 1fr);
  column-gap: 1rem;
  padding-block: 1.4rem;
  border-top: 1px solid var(--line);
  counter-increment: step;
}

.steps > li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps > li::before {
  content: counter(step);
  grid-column: 1;
  grid-row: 1 / span 4;
  color: var(--fg-head);
  font-family: var(--font-head);
  font-size: 3rem;
  font-stretch: 125%;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 0.85;
}

.steps > li > * {
  grid-column: 2;
}

.steps h3 {
  margin: 0 0 0.4rem;
}

.steps p {
  margin: 0;
}

.steps p + p {
  margin-top: 0.6rem;
}

@media (min-width: 40rem) {
  .steps > li {
    grid-template-columns: 4.5rem minmax(0, 1fr);
  }

  .steps > li::before {
    font-size: 3.75rem;
  }
}

/* 13. details.qa ---------------------------------------------------------------- */
/* A question and its answer, closed until the reader clicks. The summary is
   the question; the answer goes in a div.prose after it. Stack several in a
   row for a question list. Never open one from script. */

details.qa {
  border-top: 1px solid var(--line);
}

details.qa:last-of-type {
  border-bottom: 1px solid var(--line);
}

details.qa > summary {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1.5rem;
  padding-block: 1.1rem;
  color: var(--fg-head);
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.3;
  cursor: pointer;
  list-style: none;
}

details.qa > summary::-webkit-details-marker {
  display: none;
}

/* The native triangle is replaced by a plain plus, and a minus when open. */
details.qa > summary::after {
  content: "+";
  flex: none;
  width: 1ch;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1;
  text-align: center;
}

details.qa[open] > summary::after {
  content: "\2212";
}

details.qa > .prose {
  padding-bottom: 1.4rem;
}

/* 14. .photo ---------------------------------------------------------------------- */
/* A figure holding one real img with width, height and honest alt text.
   Square corners, no frame. Inside .split-head it sits under the heading. */

.photo {
  margin: 0;
}

.photo img {
  display: block;
  width: 100%;
  height: auto;
}

.split-head > h2 + .photo {
  margin-top: 1.75rem;
}

/* A photo that follows a split in the same section keeps clear of it
   (.photo resets its own margin, so this restores it). */
.split + .photo {
  margin-top: 3rem;
}

/* 15. .portraits -------------------------------------------------------------------- */
/* A ul of square portraits with plain text under each: the assistant's name
   (h3.portrait-name), their role (p.portrait-role) and, where a page wants
   it, one more line (p.portrait-line). No box around anything.
   Default: two across on phones, three on tablets, six on wide screens (a
   single row of six on the home page). .portraits--directory keeps to five
   across on wide screens, for the full directory with more text per person. */

.portraits {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 2rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.portrait img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  background: var(--mist);
}

.portrait-name {
  margin: 0.8rem 0 0.15rem;
  font-size: 1.15rem;
}

.portrait-role {
  margin: 0;
  color: var(--fg-quiet);
  font-size: 0.95rem;
  line-height: 1.4;
}

.portrait-line {
  margin: 0.5rem 0 0;
  font-size: 0.95rem;
  line-height: 1.5;
}

@media (min-width: 34rem) {
  .portraits {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: 1.5rem;
  }
}

@media (min-width: 60rem) {
  .portraits {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    column-gap: var(--gap-col);
  }

  .portraits--directory {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    row-gap: 3rem;
  }
}

/* A portrait grid that follows a split keeps clear of a heading that wraps
   to two lines (.portraits resets its own margin, so this restores it). */
.split + .portraits {
  margin-top: 2.5rem;
}

/* 16. Home hero and the phone number display ------------------------------------------ */
/* section.hero is the ink band under the header on the home page only.
   Order in the HTML: .hero-text (h1 and lede), .hero-call (the number), then
   .hero-photo. Phones read them in that order; wide screens put the photo
   beside the text and the number in a full width row beneath. Inner pages
   do not use .hero: they open with a plain .section and an h1. */

.hero {
  padding-block: 2.5rem 3.5rem;
}

.hero-grid {
  display: grid;
  gap: 2.25rem;
}

.hero-text h1 {
  margin-bottom: 1.5rem;
}

.hero-text > :last-child {
  margin-bottom: 0;
}

.hero-call {
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.hero-call p {
  margin: 0 0 1rem;
  max-width: 44ch;
}

.hero-call-text > :last-child {
  margin-bottom: 0;
}

/* .phone-display: the one bold thing on the site. The phone number, very
   large, as a tel link. Used once, in the home hero. The second size in
   min() only matters under about 400px wide, where it keeps the eleven
   characters on one line. */
.phone-display {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--fg-head);
  font-family: var(--font-head);
  font-size: min(clamp(2.75rem, 8.5vw, 6.5rem), (100vw - 3rem) / 8);
  font-stretch: 125%;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  text-decoration: none;
}

.phone-display:hover {
  text-decoration: underline;
  text-decoration-thickness: 0.05em;
  text-underline-offset: 0.12em;
}

@media (min-width: 60rem) {
  .hero {
    padding-block: 4.5rem 5rem;
  }

  .hero-grid {
    grid-template-columns: repeat(12, minmax(0, 1fr));
    column-gap: var(--gap-col);
    row-gap: 3.5rem;
  }

  .hero-text {
    grid-column: 1 / span 7;
    grid-row: 1;
  }

  /* The photo fills the height of the text beside it, cropped as needed,
     so the text decides how tall the row is. */
  .hero-photo {
    position: relative;
    grid-column: 8 / span 5;
    grid-row: 1;
    min-height: 22rem;
  }

  .hero-photo img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% center;
  }

  .hero-call {
    grid-column: 1 / -1;
    grid-row: 2;
    padding-top: 2.75rem;
  }
}

@media (min-width: 75rem) {
  .hero-call {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    column-gap: 3rem;
    align-items: center;
  }

  .phone-display {
    margin-bottom: 0;
  }
}

/* 17. Contact section: section#contact.contact ------------------------------------------- */
/* The same block on every page, just above the footer:
   section#contact.section.section--mist.contact. An h2, then
   ul.contact-options with three li, each an h3, one sentence and one link
   (.btn for the phone, .btn-quiet for the two emails). */

.contact h2 {
  margin-bottom: 2.25rem;
}

.contact-options {
  display: grid;
  gap: 2rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.contact-options > li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.contact-options h3 {
  margin-bottom: 0.5rem;
}

.contact-options p {
  margin-bottom: 1.25rem;
}

.contact-options a {
  margin-top: auto;
}

@media (min-width: 52rem) {
  .contact-options {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: var(--gap-col);
  }
}

/* 18. Footer: footer.site-foot --------------------------------------------------------------- */
/* Ink band. Mark, tagline (the only place it appears) and location; email
   and phone; the four nav links; the copyright line. */

.site-foot {
  padding-block: 3.5rem 2rem;
  font-size: 0.95rem;
}

.site-foot-grid {
  display: grid;
  gap: 2rem;
}

.site-foot-brand p {
  margin: 0;
}

.site-foot-brand .site-foot-tagline {
  margin-top: 1rem;
  margin-bottom: 0.2rem;
  color: var(--white);
  font-family: var(--font-head);
  font-size: 1.15rem;
  font-stretch: 112%;
  font-weight: 600;
  line-height: 1.2;
}

.site-foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-foot li + li {
  margin-top: 0.35rem;
}

.site-foot li a {
  display: inline-block;
  padding-block: 0.15rem;
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 500;
  text-decoration: none;
}

.site-foot li a:hover {
  text-decoration: underline;
  text-underline-offset: 0.35em;
}

.site-foot-legal {
  max-width: none;
  margin: 3rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

@media (min-width: 48rem) {
  .site-foot-grid {
    grid-template-columns: 5fr 3fr 4fr;
    column-gap: var(--gap-col);
  }
}
