/* The page's own styles: the base, the skip link, the practices, the footer, the other pages
   and the credits pop-up. The hero and the header have their own files (hero.css,
   header.css). Colours are
   Prax-Copperslate's: charcoal abyss #0f1218, basalt deep #090b0f, steel mist #b6c0cc,
   platinum #ffffff, slate tide #1d2b40, the burnished copper gradient. */
/* Inter (assets/fonts/, SIL OFL), roman and italic, the stand-in for Prax-Copperslate's
   Matter. Declared once here, for every page. */
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable-latin.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Inter";
  src: url("../fonts/Inter-Variable-latin-italic.woff2") format("woff2");
  font-weight: 100 900;
  font-style: italic;
  font-display: swap;
}
:root {
  --prax-hero-bg: #0f1218; /* Prax-Copperslate charcoal abyss, so the hero never flashes white */
}
/* a focused element, or a link's target, is scrolled clear of the fixed header and its scrim
   (header.css): the scrim's depth, (top x 2 + bar) video px at the picture's width */
html {
  scroll-padding-top: calc(144 * 100vw / 1600);
}
@media (orientation: portrait) {
  html { scroll-padding-top: calc(251.2 * min(100vw, 100svh * 9 / 16) / 1080); }
}
@media (orientation: landscape) and (max-height: 500px) {
  html { scroll-padding-top: calc(149.6 * 100vw / 1920); }
}
html,
body {
  margin: 0;
  background: #090b0f;
  color: #b6c0cc;
  font: 16px/1.5 "Inter", ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* The page's column: text starts on the header's left edge, which is the hero copy's
   margin: 10% of the picture's width on desktop, 6.25% on a phone held sideways, 80/1080
   upright, where the picture is 9:16 and centred. */
.practices,
.page,
.site-footer {
  --fw: 100%;
  --x: 0.1;
  padding-inline: calc((100% - var(--fw)) / 2 + var(--fw) * var(--x));
}
@media (orientation: landscape) and (max-height: 500px) {
  .practices,
  .page,
  .site-footer { --x: 0.0625; }
}
@media (orientation: portrait) {
  .practices,
  .page,
  .site-footer {
    --fw: min(100%, 100svh * 9 / 16);
    --x: 0.0741;
  }
}

/* The section under the hero, in the hero's colour: what Praxcision makes and how, then the
   four practices the hero's supporting line names, in two columns; one on a narrow screen. */
.practices {
  background: #0f1218; /* charcoal abyss */
  padding-block: clamp(56px, 8vw, 120px) clamp(72px, 10vw, 160px);
}
.practices__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(40px, 5vw, 72px) clamp(32px, 6vw, 96px);
  max-width: 1120px;
}
@media (orientation: portrait) and (max-width: 700px), (max-width: 600px) {
  .practices__grid { grid-template-columns: 1fr; }
}
.practice h3 {
  margin: 0 0 12px;
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
  color: #ffffff;
}
.practice p {
  margin: 0;
  max-width: 34em;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.6;
  color: #b6c0cc;
}

/* the skip link: first in the tab order, shown only while it has focus */
.skip-link {
  position: absolute;
  z-index: 100;
  left: 16px;
  top: -100px;
  padding: 10px 16px;
  border-radius: 6px;
  background: #ffffff;
  color: #0f1218;
  font-weight: 500;
  text-decoration: none;
}
.skip-link:focus {
  top: 16px;
  outline: 2px solid #f0bd98;
  outline-offset: 2px;
}

/* The footer: one line, the copyright on the page's column and the links on its right edge;
   the recessed surface. Steel mist, not pewter, for its text: pewter on basalt deep is
   4.3:1, under WCAG AA's 4.5:1 for small text. Where the line does not fit, the links wrap
   under the copyright. */
.site-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  column-gap: 16px;
  padding-block: 12px 16px;
  background: #090b0f; /* basalt deep */
  color: #b6c0cc; /* steel mist */
  font-size: 14px;
}
.site-footer p {
  margin: 0;
  padding-top: calc((44px - 1.5em) / 2); /* as much space above its text as the links have */
}
.site-footer__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.site-footer__links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px; /* a full touch target */
  min-height: 44px;
  color: #b6c0cc; /* steel mist */
  text-underline-offset: 0.2em;
}
.site-footer__links a:hover {
  color: #ffffff; /* platinum */
}

/* A page other than the home page: the header over the canvas, the text below it. The
   header's foot is at most 6% of the width down (16% upright), plus its margin. */
.page {
  min-height: 70vh;
  min-height: 70svh;
  background: #0f1218; /* charcoal abyss */
  padding-block: calc(6cqw + 72px) clamp(72px, 10vw, 160px);
}
@media (orientation: portrait) {
  .page { padding-top: calc(16cqw + 40px); }
}
/* without JavaScript on a phone the header is in the page's flow (header.css), on the canvas */
.prax-top--page {
  background: #0f1218; /* charcoal abyss */
}
@media (scripting: none) and (orientation: portrait),
  (scripting: none) and (orientation: landscape) and (max-height: 500px) {
  .page { padding-top: 40px; }
}
.page h1 {
  margin: 0 0 24px;
  max-width: 20em;
  color: #ffffff; /* platinum */
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.1;
  font-weight: 500;
  letter-spacing: -0.03em;
}
.page h2 {
  margin: 48px 0 12px;
  color: #ffffff; /* platinum */
  font-size: clamp(20px, 1.6vw, 26px);
  line-height: 1.3;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.page h3 {
  margin: 32px 0 8px;
  color: #ffffff; /* platinum */
  font-size: 18px;
  line-height: 1.4;
  font-weight: 500;
}
.page p,
.page li {
  max-width: 38em;
  font-size: clamp(16px, 1.15vw, 18px);
  line-height: 1.6;
}
.page p {
  margin: 0 0 16px;
}
.page ul {
  margin: 0 0 16px;
  padding-left: 1.25em;
}
.page a {
  color: #f0bd98; /* ember */
  text-underline-offset: 0.2em;
}
.page a:hover {
  color: #ffffff; /* platinum */
}
.page .meta {
  font-size: 14px;
}
/* a link on its own line: a full touch target, 44 px tall, with the layout unchanged */
.page h2 > a,
.page .more a {
  display: inline-block;
  padding-block: 10px;
  margin-block: -10px;
}
/* text still to be written before launch: marked so it cannot be missed */
[data-placeholder] {
  border-left: 2px dashed #f0bd98; /* ember */
  padding-left: 16px;
}

/* the blog's list of posts */
.page .post-list {
  padding: 0;
  list-style: none;
}
.post-list h2 {
  margin-top: 32px;
  margin-bottom: 4px;
}

/* the credits pop-up (the HTML popover attribute, no script). Where popover is not
   supported it is an ordinary section of the page. */
.credits {
  box-sizing: border-box;
  max-width: 640px;
  padding: clamp(20px, 4vw, 36px);
  border: 0;
  border-radius: 16px;
  background: #1d2b40; /* slate tide: the raised surface, a step up from the page */
  color: #b6c0cc; /* steel mist */
}
.credits:popover-open {
  display: flex;
  flex-direction: column;
  width: calc(100% - 32px);
  max-height: calc(100dvh - 32px);
  overflow: auto; /* in a very short window the pop-up itself scrolls */
}
/* the table scrolls inside the pop-up; its title row stays put. Never shorter than the
   title row and two rows; a focused link is scrolled clear of the title row. */
.credits__scroll {
  min-height: 10em;
  max-height: 22em;
  overflow: auto;
  scroll-padding-top: 4em;
}
.credits__table {
  width: 100%;
  border-collapse: separate; /* collapsed borders do not travel with a sticky row */
  border-spacing: 0;
  font-size: 15px;
  line-height: 1.4;
}
.credits__table th,
.credits__table td {
  padding: 10px 12px 10px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.2); /* platinum at 20% */
  text-align: left;
  vertical-align: top;
}
.credits__table thead th {
  position: sticky;
  top: 0;
  background: #1d2b40; /* slate tide */
  color: #ffffff; /* platinum */
  font-size: 12px;
  font-weight: 400;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.credits__table tbody th {
  color: #ffffff; /* platinum */
  font-weight: 500;
}
.credits__scroll:focus-visible {
  outline: 2px solid #f0bd98; /* ember */
  outline-offset: 4px;
  border-radius: 4px;
}
/* the title, and the close button on its right: neither scrolls */
.credits__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.credits__close {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px; /* a full touch target */
  height: 44px;
  margin-right: -16px; /* the cross on the text's right edge */
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: none;
  color: #b6c0cc; /* steel mist */
  cursor: pointer;
}
.credits__close svg {
  width: 22px;
  height: 22px;
}
.credits__close:hover {
  color: #ffffff; /* platinum */
}
.credits__close:focus-visible {
  outline: 2px solid #f0bd98; /* ember */
  outline-offset: 0;
}
/* opening it moves focus to the pop-up itself (autofocus), so a screen reader reads it; open,
   it is not a control and takes no focus outline */
.credits:popover-open:focus {
  outline: none;
}
.credits::backdrop {
  background: rgba(9, 11, 15, 0.7); /* basalt deep */
}
.credits h2 {
  margin: 0;
}

.page a:focus-visible,
.site-footer a:focus-visible {
  outline: 2px solid #f0bd98; /* ember */
  outline-offset: 4px;
  border-radius: 4px;
}
