/* Yoop Works – yoopworks.com */

@font-face {
  font-family: "Libre Baskerville";
  src: url("fonts/libre-baskerville.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("fonts/ibm-plex-mono.woff") format("woff");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light dark;
  --paper: #ffffff;
  --ink: #0e2236;
  --muted: #4e5d6d;
  --quiet: #5a6878;
  --rule: #dde2e7;
  --underline: rgba(14, 34, 54, 0.35);
  --flag-edge: rgba(14, 34, 54, 0.16);
  --serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0b1626;
    --ink: #e9eef4;
    --muted: #b6c1cf;
    --quiet: #9aa7b8;
    --rule: rgba(233, 238, 244, 0.14);
    --underline: rgba(233, 238, 244, 0.4);
    --flag-edge: transparent;
  }
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(16px, 0.9rem + 0.2vw, 18px);
  line-height: 1.7;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
  text-decoration-line: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.25em;
  text-decoration-color: var(--underline);
  transition: text-decoration-color 0.2s ease;
}

a:hover {
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 2px;
}

/* Home page: the flags hang from the top edge, the name below them */

.home {
  /* Flag width; the name scales with it, so the composition stays the same on every screen */
  --flag: clamp(56px, 6vw, 88px);
  align-items: center;
  text-align: center;
}

@supports (height: 1svh) {
  .home {
    /* Also follow the screen height: larger on tablets, smaller on a phone held sideways */
    --flag: clamp(40px, min(max(56px, 6vw, 7svh), 10svh), 88px);
  }
}

.home main {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hoist {
  display: block;
  width: var(--flag);
  height: auto;
  overflow: visible;
  color: var(--ink);
}

.hoist .edge {
  stroke: var(--flag-edge);
}

/* The flags slide down the halyard from above the page. Without animation
   support, or with reduced motion switched on, they simply hang in place. */
@media (prefers-reduced-motion: no-preference) {
  .hoist .flags {
    transform-box: fill-box;
    animation: drop 1.4s cubic-bezier(0.22, 1, 0.36, 1) 0.2s both;
  }
}

@keyframes drop {
  from {
    /* Own height plus the space above the first flag, with a small margin: starts fully above the page */
    transform: translateY(calc(-100% - 200px));
  }
}

.home h1 {
  margin: clamp(20px, 6vh, 64px) 0 0;
  padding: 0 20px;
  font-weight: 400;
  font-size: calc(var(--flag) * 0.73);
  line-height: 1.2;
  letter-spacing: 0.01em;
}

.home footer {
  padding: clamp(16px, 4vh, 40px) 20px 28px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--quiet);
  text-underline-offset: 0.4em;
}

/* Contact page */

.wrap {
  width: 100%;
  max-width: 760px;
  margin-inline: auto;
  padding-inline: clamp(20px, 5vw, 40px);
}

.contact header {
  padding-block: 18px;
}

.brand {
  display: inline-flex;
  /* The flag stands on the text baseline; wrap + align-content keeps the line centred in the 44px tap area */
  flex-wrap: wrap;
  align-content: center;
  align-items: baseline;
  gap: 0.7em;
  min-height: 44px;
  font-size: 17px;
  letter-spacing: 0.01em;
  text-decoration: none;
}

.brand svg {
  display: block;
  /* Size and position scale with the text */
  width: 1.3em;
  height: auto;
  /* Lower it by half the difference with the capital height, so it is centred on the capitals */
  transform: translateY(0.147em);
}

.contact main {
  flex: 1 0 auto;
  padding-block: clamp(40px, 9vh, 96px) 48px;
}

.contact h1 {
  margin: 0;
  font-weight: 400;
  font-size: clamp(30px, 1rem + 1.6vw, 40px);
  line-height: 1.25;
  letter-spacing: 0.005em;
}

.role {
  margin: 8px 0 0;
  color: var(--muted);
}

.facts {
  margin: clamp(36px, 6vh, 56px) 0 0;
}

.facts > div {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 24px;
  padding-block: 16px;
  border-top: 1px solid var(--rule);
}

.facts > div:last-child {
  border-bottom: 1px solid var(--rule);
}

.facts dt {
  flex: 0 0 190px;
  margin: 0;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--quiet);
}

.facts dd {
  flex: 999 1 260px;
  margin: 0;
  overflow-wrap: anywhere;
}

/* Readable groups without real spaces, so copying stays exact */
.grouped span + span {
  margin-left: 0.3em;
}

/* Decoy text for address harvesters, never shown */
.trap {
  display: none;
}

.note {
  margin: clamp(32px, 5vh, 48px) 0 0;
  max-width: 30em;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

/* Not found: the home page layout, with the signal flags Z and L ("not understood") */

.notfound h1 {
  font-size: calc(var(--flag) * 0.6);
}

.notfound .note {
  padding: 0 20px;
}

@media (prefers-color-scheme: dark) {
  /* Z and L contain black, so outline them against the dark background */
  .notfound .hoist .edge {
    stroke: rgba(233, 238, 244, 0.3);
  }
}
