/* Forty Four Systems landing page: the lockup on its ground, one line under the name, and one small line at the foot. */

/* The brand's text face: Saira at its expanded width. Light, wide and square-shouldered, to sit with the wordmark.
   The file is kept with the site, so the page loads nothing from elsewhere. Licence: assets/saira-OFL.txt. */
@font-face {
  font-family: "Saira";
  src: url("assets/saira-expanded-latin.woff2") format("woff2");
  font-weight: 300 400;
  font-stretch: 125%;
  font-display: swap;
}

:root {
  --ground: #0d0b1a;          /* logo background, so the image has no visible edge */
  --ink: #e9e6f2;             /* logo letters */
  --soft: #c4c0d2;            /* ink at about 80%, for the line under the name: 10.9:1 on the ground */
  --quiet: #8a869c;           /* ink at about 55%: 5.6:1 on the ground */
  --line: #3a3846;            /* the lockup's grid-line colour */
  --width: min(100% - 2.5rem, 80rem);
  /* When the name starts to arrive and how long it takes, from the lockup's animation (build_lockup.py:
     T_TEXT + 0.1 = 1.95s, and WIPE). The text below fades in over the same span, 0.15s behind, so that if the
     artwork loads a moment late the text still never leads the name. Change these if that timing changes. */
  --name-at: 2.1s;
  --name-for: 0.9s;
  --text: "Saira", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;   /* system face until Saira arrives */
}

html { background: var(--ground); color-scheme: dark; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  /* Macs thicken light text on a dark ground unless told not to. This keeps Saira Light looking light. */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  /* More room below than above, so the lockup sits a little over the middle. */
  padding-block: 2rem clamp(1rem, 9vh, 6rem);
}

.block { width: var(--width); }
h1 { margin: 0; }

/* The one line under the name. It starts at the left edge of the wordmark's first letter, which is
   1060 of the lockup's 1920 units (55.2%), and fades in while the name arrives. */
.line {
  margin: clamp(1.1rem, 2.6vw, 2.25rem) 0 0 55.2%;
  color: var(--soft);
  font: 300 clamp(0.9375rem, 1.2vw, 1.125rem)/1.5 var(--text);
  font-stretch: 125%;
  letter-spacing: 0.03em;
  opacity: 0;
  animation: text-in var(--name-for) ease-out var(--name-at) forwards;
}
@keyframes text-in { to { opacity: 1; } }

/* Phones show the lockup cropped to the grid's last columns and the name, so the first letter sits at 160 of
   the crop's 1020 units (15.7%). The line starts under it, as on desktop. To stay on one line there, its size
   follows the screen: at 3.9% of the artwork's width the line is about as wide as the wordmark, so it runs
   from under the F to under the final S. That figure fits the current wording; recheck it if the words change. */
@media (max-width: 719px) {
  :root { --name-at: 1.65s; }   /* the phone's animation starts 0.45s in (build_assets.py: NARROW_START) */
  .line { margin-left: 15.7%; font-size: clamp(0.6875rem, calc((100vw - 2.5rem) * 0.039), 1rem); white-space: nowrap; }
}

picture, img { display: block; }
img { width: 100%; height: auto; }

/* The foot line: the legal name and the email address. */
footer {
  box-sizing: border-box;
  width: var(--width);
  margin-inline: auto;
  padding-block: 1.5rem 2rem;
  /* The foot line's edges match the artwork's. On the right, the wordmark and grid end 60 units short of the
     lockup's 1920, so the email ends exactly under the final S. On the left, the pattern's first column sits
     20 units in, so the legal line starts there. */
  padding-right: calc(var(--width) * 0.03125);
  padding-left: calc(var(--width) * 0.010417);
  opacity: 0;
  animation: text-in var(--name-for) ease-out var(--name-at) forwards;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
  color: var(--quiet);
  font: 300 0.8125rem/1.5 var(--text);
  font-stretch: 125%;
  letter-spacing: 0.03em;
}
/* On the phone crop the same 60 units are a larger share of the width (60 of 1020), and the grid runs to the
   crop's left edge, so there is no inset on the left. This rule has to come after the one above to take effect. */
@media (max-width: 719px) {
  footer { padding-right: calc(var(--width) * 0.05882); padding-left: 0; }
}

a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.4em;
  transition: text-decoration-color 0.2s ease;
}
a:hover { text-decoration-color: var(--ink); }
a:focus-visible { outline: 1px solid var(--ink); outline-offset: 5px; border-radius: 2px; }

@media (prefers-reduced-motion: reduce) {
  a { transition: none; }
  .line, footer { animation: none; opacity: 1; }
}

@media print {
  html { background: #fff; }
  footer, a, .line { color: #0d0b1a; }
  .line, footer { animation: none; opacity: 1; }
}
