/* Montserrat, close to the face of the wordmark, served from the site. Licence: fonts/OFL.txt. */
@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-300.woff2") format("woff2");
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Montserrat";
  src: url("/assets/fonts/montserrat-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

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

:root {
  --ground: #ffffff;
  --ink: #16181d;
  --quiet: #565c66;
  --rule: #e2e5ea;
  --edge: #747a85;
  /* The logo's blue runs from #0b81c5 at the top of the triangle to #135b96 at its foot.
     Text and links take the deeper end, which holds its contrast on white. */
  --blue: #0c64a1;
  --blue-light: #0b81c5;
  --blue-deep: #135b96;
  --tint: #f1f6fa;
  /* The frame holds the header, the wide blocks and the footer. Text keeps to the column inside it. */
  --frame: 62rem;
  --column: 43rem;
  --gutter: 1.25rem;
  --heavy: 700;
  --semibold: 600;
  --light: 300;
}

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

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

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  font-family: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.6;
}

/* One frame, the same on every page, and one column of text along its left edge. */
.masthead,
main,
.colophon {
  width: 100%;
  max-width: calc(var(--frame) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

main > *,
article > * {
  max-width: var(--column);
}

main > article,
main > .trio {
  max-width: none;
}

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

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

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 3px;
  border-radius: 2px;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.5rem 0.75rem;
  background: var(--ground);
}

.skip:focus {
  top: 0.5rem;
}

/* Header: the logo, then the five links, on a line of their own until there is room beside it. */
.masthead {
  padding-top: 2rem;
}

.logo {
  display: inline-block;
}

.logo img {
  display: block;
  width: auto;
  height: 3.5rem;
}

.masthead ul,
.colophon ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.masthead nav {
  margin-top: 1.5rem;
  padding-block: 0.6rem;
  border-block: 1px solid var(--rule);
  font-size: 1rem;
}

/* On Home the logo is in the page, so the links open the header. */
.masthead nav:first-child {
  margin-top: 0;
  border-top: 0;
}

.masthead nav ul {
  column-gap: 1.25rem;
}

.masthead nav a {
  display: inline-block;
  padding-block: 0.25rem;
  color: var(--ink);
  text-decoration: none;
}

.masthead nav a:hover {
  color: var(--blue);
}

.masthead nav a[aria-current] {
  color: var(--blue);
  box-shadow: 0 2px 0 var(--blue);
}

/* Text. */
main {
  position: relative;
  padding-top: 3.5rem;
  padding-bottom: 1rem;
}

/* Home's logo, in place of the header's: the mark, then "Nordinson", then "Studios", each
   centred. Centred on the page above the heading on a narrow screen, beside the opening on a wide one.
   The two lines keep the wordmark's proportions: "Studios" is 0.695 the width of "Nordinson",
   with a gap of 0.036 of that width between them. */
.stacked-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: fit-content;
  margin: 0 auto 4rem;
  --line: 13.2rem;
}

.stacked-logo img {
  display: block;
  height: auto;
}

.stacked-logo img:nth-child(1) {
  width: auto;
  height: 8.6rem;
  margin-bottom: 0.75rem;
}

.stacked-logo img:nth-child(2) {
  width: var(--line);
}

.stacked-logo img:nth-child(3) {
  width: calc(var(--line) * 0.695);
  margin-top: calc(var(--line) * 0.036);
}

@media (min-width: 64rem) {
  .stacked-logo {
    position: absolute;
    top: 4.5rem;
    right: var(--gutter);
    margin: 0;
    --line: 17.4rem;
  }

  .stacked-logo img:nth-child(1) {
    height: 11.5rem;
    margin-bottom: 1rem;
  }

  /* Home's text column narrows to leave the logo room. */
  .beside-logo > * {
    max-width: 39rem;
  }
}

h1,
h2,
h3 {
  font-weight: var(--heavy);
  line-height: 1.15;
  text-wrap: balance;
}

/* A page's heading is semibold, lighter than the section headings, so it sits easily beside Home's logo. */
h1 {
  margin: 0 0 1.5rem;
  font-size: clamp(2rem, 1.35rem + 3vw, 3.125rem);
  font-weight: var(--semibold);
  letter-spacing: -0.015em;
}

h2 {
  margin: 4rem 0 1rem;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  letter-spacing: -0.01em;
}

/* A short blue bar opens each section of a page. */
main > h2::before,
article > h2::before {
  content: "";
  display: block;
  width: 2.5rem;
  height: 0.2rem;
  margin-bottom: 1.1rem;
  background: linear-gradient(to right, var(--blue-light), var(--blue-deep));
}

h3 {
  margin: 2.5rem 0 0.75rem;
  font-size: 1.25rem;
}

p,
ul,
ol,
dl,
figure,
blockquote {
  margin: 0 0 1.25rem;
}

strong {
  font-weight: var(--heavy);
}

/* The opening paragraph of a page, in the logo's light weight. */
main > h1 + p,
article > h1 + p:not(.state) {
  font-size: 1.25rem;
  font-weight: var(--light);
  line-height: 1.5;
}

main ul,
main ol {
  padding-left: 1.25rem;
}

main li {
  margin-bottom: 0.5rem;
  padding-left: 0.25rem;
}

main li::marker {
  color: var(--blue);
}

/* A list of stories under a principle: each marked with the logo's triangle. */
ul.stories {
  margin-top: 1.75rem;
  padding: 0;
  list-style: none;
}

ul.stories li {
  position: relative;
  margin: 0;
  padding: 0.75rem 0 0.75rem 1.5rem;
  border-top: 1px solid var(--rule);
}

ul.stories li:last-child {
  border-bottom: 1px solid var(--rule);
}

ul.stories li::before,
.next-action::before {
  content: "";
  position: absolute;
  background: linear-gradient(var(--blue-light), var(--blue-deep));
  clip-path: polygon(0 0, 0 100%, 78% 100%);
}

ul.stories li::before {
  left: 0;
  top: 1.2rem;
  width: 0.7rem;
  height: 0.9rem;
}

/* Three things side by side, where there is room: the principles on Home. */
.trio {
  display: grid;
  gap: 1.25rem;
  margin-block: 2rem 2.5rem;
}

.trio p {
  margin: 0;
  padding: 1.5rem;
  border-top: 3px solid var(--blue);
  background: var(--tint);
}

.trio strong {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
  line-height: 1.25;
}

@media (min-width: 56rem) {
  .trio {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* A story, listed on Home or Work. */
.story,
.fallback {
  margin-top: 2.5rem;
  padding: 2rem 1.5rem 1rem;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--blue);
}

.fallback {
  background: var(--tint);
}

.story > h2 {
  margin-top: 0;
}

.story > h2 a {
  color: var(--ink);
  text-decoration: none;
}

.more a {
  font-weight: var(--heavy);
}

.more a::after {
  content: " \203A";
}

.story > h2 a:hover {
  color: var(--blue);
}

/* The facts at the top of a story. */
.facts {
  display: grid;
  grid-template-columns: 1fr;
  margin-block: 2rem;
  padding-block: 0.5rem;
  border-block: 1px solid var(--rule);
  font-size: 1rem;
}

.facts dt {
  margin-top: 0.75rem;
  color: var(--quiet);
  font-size: 0.8125rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.facts dd {
  margin: 0 0 0.75rem;
}

@media (min-width: 34rem) {
  .facts {
    grid-template-columns: 7rem 1fr;
    column-gap: 1.5rem;
  }

  .facts dt {
    margin-top: 0.95rem;
  }

  .facts dd {
    margin-top: 0.75rem;
  }
}

article > h2 {
  margin-top: 3rem;
}

blockquote {
  margin-inline: 0;
  padding-left: 1.25rem;
  border-left: 3px solid var(--blue);
  font-size: 1.25rem;
  font-weight: var(--light);
}

blockquote footer {
  margin-top: 0.75rem;
  color: var(--quiet);
  font-size: 1rem;
  font-weight: 400;
}

.next-story {
  margin: 3rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

/* A preview's label on a story a visitor would not see. */
.state {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border: 1px dashed var(--edge);
  color: var(--quiet);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
}

/* The photograph on About. */
.photo {
  max-width: 16rem;
  margin-block: 2rem;
}

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

/* The contact form. */
form {
  margin-block: 2.5rem 3.5rem;
}

.field {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: var(--heavy);
}

input[type="text"],
input[type="email"],
textarea {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--edge);
  border-radius: 3px;
  background: var(--ground);
  color: var(--ink);
  font: inherit;
  line-height: 1.4;
}

textarea {
  resize: vertical;
}

input:focus-visible,
textarea:focus-visible {
  outline-offset: 0;
  border-color: var(--blue);
}

[data-problem],
[data-notice] {
  margin: 0.5rem 0 0;
  padding-left: 0.75rem;
  border-left: 3px solid var(--ink);
  font-size: 1rem;
}

[data-notice] {
  margin-bottom: 1.5rem;
  font-weight: var(--heavy);
}

[hidden] {
  display: none;
}

/* Out of sight and out of the way, and still labelled for a screen reader. */
.trap {
  position: absolute;
  left: -200vw;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

button,
.next-action a {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  border: 0;
  border-radius: 3px;
  background: var(--blue);
  color: var(--ground);
  font: inherit;
  font-weight: var(--heavy);
  text-decoration: none;
  cursor: pointer;
}

button:hover,
.next-action a:hover {
  background: var(--blue-deep);
}

/* The one action offered at the foot of a page: a band of the logo's blue, edge to edge,
   with its text on the frame's left edge. */
.next-action {
  position: relative;
  overflow: hidden;
  margin-top: 5rem;
  padding-block: 3.5rem;
  padding-inline: max(var(--gutter), calc((100% - var(--frame)) / 2));
  background: linear-gradient(to right, var(--blue), var(--blue-deep));
  color: var(--ground);
}

.next-action::before {
  right: max(var(--gutter), calc((100% - var(--frame)) / 2));
  bottom: 0;
  width: 13rem;
  height: 15rem;
  background: var(--ground);
  opacity: 0.1;
  clip-path: polygon(0 0, 0 100%, 74% 100%);
}

.next-action p {
  position: relative;
}

.next-action p:first-of-type {
  margin: 0 0 1.5rem;
  font-size: clamp(1.5rem, 1.3rem + 0.9vw, 1.875rem);
  font-weight: var(--light);
  line-height: 1.25;
}

.next-action p:last-of-type {
  margin: 0;
}

.next-action a,
.next-action a:hover {
  background: var(--ground);
  color: var(--blue-deep);
}

.next-action a:hover {
  background: var(--tint);
}

.next-action a:focus-visible {
  outline-color: var(--ground);
}

/* Footer. */
.colophon {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  margin-top: 5rem;
  padding-block: 1.5rem 3rem;
  font-size: 1rem;
}

.colophon::before {
  content: "";
  flex-basis: 100%;
  margin-bottom: 1rem;
  border-top: 1px solid var(--rule);
}

.next-action + .colophon {
  margin-top: 0;
  padding-top: 2rem;
}

.next-action + .colophon::before {
  display: none;
}

.colophon p {
  margin: 0;
  font-weight: var(--heavy);
}

.colophon a {
  color: var(--ink);
}

@media (min-width: 48rem) {
  body {
    font-size: 1.125rem;
  }

  .masthead {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 2rem;
    padding-top: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--rule);
  }

  .masthead nav {
    margin-top: 0;
    margin-left: auto;
    padding-block: 0;
    border: 0;
  }

  .logo img {
    height: 4.5rem;
  }

  main {
    padding-top: 4.5rem;
  }
}
