/*
  The stylesheet of ptmconnect.dsonix.com.

  The colours, the two fonts, the corner sizes and the button height are those of the app
  (mobile/ptm_connect/lib/core/design_system: app_colors.dart, app_text.dart, app_theme.dart).
  Sizes are in rem, so the page follows the text size a reader has set in the browser.
  Run website/tool/contrast.py after a change to a colour.
*/

@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/assets/fonts/bricolage-grotesque-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Figtree";
  src: url("/assets/fonts/figtree.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

:root {
  --teal: #0f5257;
  --teal-light: #1a6e73;
  --marigold: #f4b63f;
  --marigold-light: #f7c463;
  --ground: #f4f6f6;
  --white: #fff;
  --text: #132a2d;
  --text-2: #47595b;
  --line: #dce3e3;
  --teal-tint: #e2f0ef;
  --teal-tint-border: #bfdad8;
  --accent-tint: #fcefd2;
  --on-accent-tint: #7a4a00;
  --on-teal-muted: #d9ecea;

  --font-text: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Bricolage Grotesque", "Figtree", system-ui, -apple-system, "Segoe UI", sans-serif;

  --page: 70rem;
  --gutter: 1.25rem;
  --radius-card: 1rem;
  --radius-inner: 0.75rem;
  --radius-button: 0.875rem;
  --section-space: clamp(3.5rem, 2.25rem + 5vw, 6.5rem);

  color-scheme: light;
}

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

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

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--font-text);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-wrap: break-word;
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

p,
ul,
ol,
dl,
dd,
figure {
  margin: 0;
  padding: 0;
}

/* Where the browser can, it keeps a single word from standing alone on the last line. */
p,
li,
dd,
figcaption {
  text-wrap: pretty;
}

ul,
ol {
  list-style: none;
}

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

a {
  color: var(--teal);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 0.16em;
}

:focus-visible {
  outline: 0.1875rem solid var(--teal);
  outline-offset: 0.1875rem;
  border-radius: 0.25rem;
}

main {
  flex: 1 0 auto;
}

/* The skip link lands here. The ring is for links and buttons, not for the whole page. */
main:focus {
  outline: none;
}

.wrap {
  width: min(100% - 2 * var(--gutter), var(--page));
  margin-inline: auto;
}

/* Words that belong together stay on one line while there is room for them. */
.phrase {
  display: inline-block;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -5rem;
  z-index: 10;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-inner);
  background: var(--white);
  color: var(--teal);
  font-weight: 700;
}

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

/* The link is white and lies on the teal header: a white ring, with teal between. */
.skip-link:focus-visible {
  outline-color: var(--white);
}

/* Buttons: 52 high with a 14 corner, as in the app. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.5rem 1.5rem;
  border: 0.09375rem solid transparent;
  border-radius: var(--radius-button);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.button-accent {
  background: var(--marigold);
  color: var(--text);
}

.button-outline {
  border-color: var(--white);
  color: var(--white);
}

.button-accent:hover {
  background: var(--marigold-light);
}

.button-outline:hover {
  background: var(--teal-light);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* The top of the page: the teal header of the app's sign-in screen, with the logo tile. */

.site-header {
  background: var(--teal);
  color: var(--white);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  padding-block: 0.875rem;
}

.site-header :focus-visible,
.hero :focus-visible,
.contact :focus-visible {
  outline-color: var(--white);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand img {
  width: 2.75rem;
  height: 2.75rem;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
  margin-inline: -0.875rem;
}

.site-nav li {
  display: none;
}

.site-nav li.always {
  display: block;
}

.site-nav a {
  display: block;
  padding: 0.625rem 0.875rem;
  border-radius: 0.625rem;
  color: var(--white);
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.5;
  text-decoration: none;
}

.site-nav a:hover {
  background: var(--teal-light);
}

@media (min-width: 48rem) {
  .site-nav li {
    display: block;
  }
}

/* The first view. */

.hero {
  overflow: hidden;
  background: var(--teal);
  color: var(--white);
}

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
  padding-block: 1.75rem 3.5rem;
}

.hero h1 {
  font-size: clamp(2.125rem, 1.3rem + 4.3vw, 3.875rem);
  line-height: 1.04;
}

.lead {
  max-width: 35rem;
  margin-top: 1.25rem;
  color: var(--on-teal-muted);
  font-size: clamp(1.125rem, 1.05rem + 0.4vw, 1.3125rem);
  line-height: 1.55;
}

.hero .actions {
  margin-top: 2rem;
}

.status {
  display: flex;
  gap: 0.75rem;
  max-width: 30rem;
  margin-top: 2rem;
  padding: 0.875rem 1.125rem;
  border-radius: var(--radius-inner);
  background: var(--teal-light);
  font-size: 0.9375rem;
  line-height: 1.45;
}

.status-dot {
  flex: none;
  width: 0.625rem;
  height: 0.625rem;
  margin-top: 0.375rem;
  border-radius: 50%;
  background: var(--marigold);
}

/* A picture of the app, in the outline of a phone. */

.phone-frame {
  display: block;
  width: min(100%, var(--phone-width, 16.25rem));
  margin-inline: auto;
  padding: 0.4375rem;
  border-radius: 2.125rem;
  background: var(--text);
  box-shadow: 0 1.75rem 3rem -1.5rem rgba(19, 42, 45, 0.45);
}

.phone-frame img {
  width: 100%;
  border-radius: 1.6875rem;
  background: var(--ground);
}

.phone figcaption {
  max-width: 21rem;
  margin: 1rem auto 0;
  color: var(--text-2);
  font-size: 0.9375rem;
  line-height: 1.45;
  text-align: center;
}

.hero-figure {
  position: relative;
  padding-bottom: 0.5rem;
}

.hero-figure::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 4.5rem;
  width: min(100% + 2.5rem, 27rem);
  height: 130%;
  border-radius: 2.5rem;
  background: var(--teal-light);
  transform: translateX(-50%);
}

.hero-figure .phone-frame,
.hero-figure figcaption {
  position: relative;
}

.hero-figure figcaption {
  color: var(--on-teal-muted);
}

@media (min-width: 60rem) {
  .hero .wrap {
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    align-items: center;
    gap: 3.5rem;
    padding-block: 2.5rem 4rem;
  }

  .hero-figure {
    --phone-width: 18.75rem;
  }
}

/* Sections. */

.section {
  padding-block: var(--section-space);
}

.section-white {
  background: var(--white);
}

.section-head {
  max-width: 40rem;
  margin-bottom: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.section-head::before {
  content: "";
  display: block;
  width: 3rem;
  height: 0.375rem;
  margin-bottom: 1.25rem;
  border-radius: 0.1875rem;
  background: var(--marigold);
}

.section-head h2 {
  font-size: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);
  letter-spacing: -0.015em;
}

.section-head p {
  margin-top: 1rem;
  color: var(--text-2);
  font-size: 1.125rem;
}

.section-head p + p {
  margin-top: 0.75rem;
}

/* The six steps, laid out as the app lays out a schedule: one card, one row for each. */

.how {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3rem;
}

.steps {
  border: 0.0625rem solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
}

.step {
  display: grid;
  grid-template-columns: 2.75rem minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem 0.875rem;
  padding: 1.25rem;
}

/* On a narrow screen the number sits beside the heading, and the text below uses the
   whole width of the card. */
.step-text {
  display: contents;
}

.step-text p,
.step .chip {
  grid-column: 1 / -1;
}

.step + .step {
  border-top: 0.0625rem solid var(--line);
}

.step-number {
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: var(--radius-inner);
  background: var(--marigold);
  color: var(--text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.375rem;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.step h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.step-text p {
  color: var(--text-2);
}

.chip {
  justify-self: start;
  padding: 0.25rem 0.75rem;
  border-radius: 62.5rem;
  background: var(--teal-tint);
  color: var(--teal);
  font-weight: 700;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.chip-accent {
  background: var(--accent-tint);
  color: var(--on-accent-tint);
}

@media (min-width: 40rem) {
  .step {
    grid-template-columns: 3.5rem minmax(0, 1fr) auto;
    align-items: start;
    gap: 0.5rem 1.25rem;
    padding: 1.5rem;
  }

  .step-text {
    display: block;
  }

  .step-text p {
    margin-top: 0.375rem;
  }

  .step-number {
    width: 3.5rem;
    height: 3.5rem;
    font-size: 1.625rem;
  }

  .step .chip {
    grid-column: 3;
    margin-top: 0.125rem;
  }
}

@media (min-width: 60rem) {
  .how {
    grid-template-columns: minmax(0, 1fr) 19rem;
    align-items: start;
    gap: 3.5rem;
  }

  .how-figure {
    --phone-width: 17.5rem;
  }
}

/* The picture stays in view beside the steps only in a window tall enough to show all of it. */
@media (min-width: 60rem) and (min-height: 44rem) {
  .how-figure {
    position: sticky;
    top: 2rem;
  }
}

/* Who uses it: one column for each, a picture and what they do. */

.roles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3.5rem;
}

.role-head h3 {
  font-size: 1.625rem;
}

.role-head p {
  margin-top: 0.375rem;
  color: var(--text-2);
}

.role .phone {
  margin-top: 1.5rem;
  padding: 2rem 1.25rem 1.25rem;
  border-radius: var(--radius-card);
  background: var(--ground);
}

.points {
  display: grid;
  align-content: start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.points li {
  position: relative;
  padding-left: 1.5rem;
}

.points li::before {
  content: "";
  position: absolute;
  left: 0.125rem;
  top: 0.625rem;
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  background: var(--marigold);
}

/* On a screen of middle width: the picture on the left, the heading and the list beside it. */
@media (min-width: 40rem) and (max-width: 59.99rem) {
  .role {
    display: grid;
    grid-template-columns: 19rem minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas:
      "picture head"
      "picture points";
    column-gap: 2rem;
  }

  .role-head {
    grid-area: head;
    padding-top: 0.5rem;
  }

  .role .phone {
    grid-area: picture;
    margin-top: 0;
  }

  .points {
    grid-area: points;
  }
}

/* Side by side, the three columns share their rows, so the headings, the pictures and the
   lists line up whatever the length of a heading or a caption. */
@media (min-width: 60rem) {
  .roles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: repeat(3, auto);
    gap: 0 2.5rem;
  }

  .role {
    display: grid;
    grid-row: span 3;
    grid-template-rows: subgrid;
  }

  .role .phone {
    padding-inline: 0.75rem;
  }

  .role .phone-frame {
    --phone-width: 18.75rem;
  }
}

/* The band that says what the app is for, and what it leaves alone. */

.scope {
  padding-block: clamp(3rem, 2rem + 4vw, 5rem);
  border-block: 0.0625rem solid var(--teal-tint-border);
  background: var(--teal-tint);
}

.scope h2 {
  max-width: 46rem;
  font-size: clamp(1.625rem, 1.3rem + 1.5vw, 2.375rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
  text-wrap: wrap;
}

/* On the narrowest phones the three phrases run on as one sentence: kept whole, each would
   leave a word alone on its line. */
@media (max-width: 23.99rem) {
  .scope .phrase {
    display: inline;
  }
}

.scope p {
  max-width: 40rem;
  margin-top: 1rem;
  color: var(--text-2);
  font-size: 1.125rem;
}

@media (min-width: 60rem) {
  .scope .wrap {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
    align-items: end;
    gap: 3.5rem;
  }

  .scope p {
    margin-top: 0;
    padding-bottom: 0.375rem;
  }
}

/* Signing in: the text on one side, three rows on the other. */

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.rows {
  border: 0.0625rem solid var(--line);
  border-radius: var(--radius-card);
  background: var(--white);
}

.row {
  padding: 1.25rem;
}

.row + .row {
  border-top: 0.0625rem solid var(--line);
}

.row dt {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.row dd {
  max-width: 40rem;
  margin-top: 0.375rem;
  color: var(--text-2);
}

@media (min-width: 40rem) {
  .row {
    padding: 1.5rem;
  }
}

@media (min-width: 60rem) {
  .split {
    grid-template-columns: minmax(0, 0.85fr) minmax(0, 1fr);
    align-items: start;
    gap: 4rem;
  }

  .split .section-head {
    margin-bottom: 0;
  }
}

/* What is stored: four short answers under a line each. */

.facts {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
}

.fact {
  padding-top: 1.25rem;
  border-top: 0.125rem solid var(--teal);
}

.fact h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.fact p {
  margin-top: 0.5rem;
  color: var(--text-2);
}

.note {
  margin-top: 2.5rem;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-inner);
  background: var(--teal-tint);
  color: var(--teal);
}

@media (min-width: 40rem) {
  .facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2.5rem;
  }
}

@media (min-width: 60rem) {
  .facts {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
  }
}

/* Contact: a teal card, with the lighter tile the app uses on teal. */

.contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 2rem;
  padding: 1.75rem 1.25rem;
  border-radius: var(--radius-card);
  background: var(--teal);
  color: var(--white);
}

.contact h2 {
  font-size: clamp(1.875rem, 1.45rem + 1.9vw, 2.75rem);
  letter-spacing: -0.015em;
}

.contact-main p {
  max-width: 32rem;
  margin-top: 1rem;
  color: var(--on-teal-muted);
  font-size: 1.125rem;
}

.contact a:not(.button) {
  color: var(--white);
}

.contact .actions {
  margin-top: 1.75rem;
}

.contact-aside {
  padding: 1.25rem;
  border-radius: var(--radius-inner);
  background: var(--teal-light);
}

.contact-aside h3 {
  font-size: 1.25rem;
  line-height: 1.2;
}

.contact-aside p {
  margin-top: 0.5rem;
}

@media (min-width: 40rem) {
  .contact {
    padding: 2.5rem;
  }

  .contact-aside {
    padding: 1.5rem;
  }
}

@media (min-width: 60rem) {
  .contact {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    align-items: center;
    gap: 3.5rem;
    padding: 3.5rem;
  }
}

/* The foot of the page. It is white, because the artwork without its tile is for white only. */

.site-footer {
  border-top: 0.0625rem solid var(--line);
  background: var(--white);
}

/* Room for a finger around the two links. */
.site-footer a {
  display: inline-block;
  padding-block: 0.75rem;
}

.site-footer .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.25rem;
  padding-block: 2.5rem;
}

.footer-logo {
  width: 7.5rem;
}

.footer-text p + p {
  margin-top: 0.25rem;
}

.footer-small {
  color: var(--text-2);
  font-size: 0.9375rem;
}

@media (min-width: 40rem) {
  .site-footer .wrap {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 2rem;
  }
}

/* The page for an address that does not exist. */

.missing {
  padding-block: clamp(3.5rem, 2rem + 8vw, 8rem);
}

.missing h1 {
  max-width: 40rem;
  font-size: clamp(2.25rem, 1.6rem + 3vw, 3.5rem);
  line-height: 1.06;
}

.missing p {
  max-width: 34rem;
  margin-top: 1.25rem;
  color: var(--text-2);
  font-size: 1.125rem;
}

.missing .actions {
  margin-top: 2rem;
}

.button-primary {
  background: var(--teal);
  color: var(--white);
}

.button-primary:hover {
  background: var(--teal-light);
}

.button-quiet {
  border-color: var(--teal);
  color: var(--teal);
}

.button-quiet:hover {
  background: var(--teal-tint);
}

/* Movement only for readers who have not asked for none. */

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  .button,
  .site-nav a {
    transition: background-color 0.15s ease;
  }
}

/* On paper a browser leaves backgrounds out, so the three teal blocks get dark text. */
@media print {
  .site-header,
  .hero,
  .contact {
    background: none;
    color: var(--text);
  }

  .site-header a,
  .hero a,
  .hero p,
  .hero h1,
  .hero figcaption,
  .contact a,
  .contact p,
  .contact h2,
  .contact h3 {
    color: var(--text);
  }

  .site-nav,
  .skip-link {
    display: none;
  }
}
