/* Tangudu — one page. Three colours: paper, ink and one red. */

@font-face {
  font-family: "Radio Canada Big";
  src: url("fonts/radio-canada-big.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Radio Canada";
  src: url("fonts/radio-canada.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #000000;
  --red: #c8102e;
  --grey: #595959;
  --edge: clamp(1.25rem, 4.5vw, 4.5rem);
  --display: "Radio Canada Big", "Helvetica Neue", Arial, sans-serif;
  --text: "Radio Canada", "Helvetica Neue", Arial, sans-serif;

  /* The red mark between the two headline words. All in units of the headline size. */
  --mark-h: 5.3;        /* height of the mark */
  --pull-first: 2.55;   /* how far "projects" tucks into the mark's upper-left corner */
  --pull-second: 1.6;   /* how far "partnerships." tucks into its lower-right corner */
  --second-at: 4.33;    /* where "partnerships." starts, measured from the left edge */
  --lock-vw: 8.5vw;     /* headline size as a share of the screen width */

  /* Size of the headline. Limited by screen width and by screen height so it fits one screen. */
  --lock: clamp(2.5rem, min(var(--lock-vw), (100vh - 24.5rem) / var(--mark-h)), 7rem);
}

*,
*::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: grid;
  grid-template-rows: auto 1fr auto;
  padding-inline: var(--edge);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 1.0625rem;
  line-height: 1.5;
  overflow-x: hidden;
}

::selection { background: var(--red); color: #fff; }

a { color: inherit; }
a:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 5px;
  border-radius: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.masthead,
.page,
.colophon {
  width: min(100%, 87rem);
  margin-inline: auto;
}

/* Name */

.masthead { padding-block: clamp(1.25rem, 3.5vh, 2.5rem); }

.wordmark {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1;
  text-decoration: none;
}

/* Headline: two words and the red mark that joins them */

.page {
  align-self: center;
  padding-block: clamp(1rem, 3vh, 2.5rem);
}

.lockup {
  display: grid;
  grid-template-columns: auto auto 1fr;
  margin: 0;
  font-family: var(--display);
  font-size: var(--lock);
  font-weight: 560;
  letter-spacing: -0.03em;
  line-height: 1;
}

.lockup-first {
  position: relative;
  z-index: 1;
  align-self: start;
  margin-top: 0.3em;
  margin-right: calc(var(--pull-first) * -1em);
}

.lead {
  display: block;
  margin-bottom: 0.9rem;
  color: var(--grey);
  font-family: var(--text);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.3;
}

.mark {
  display: block;
  width: auto;
  height: calc(var(--mark-h) * 1em);
  fill: var(--red);
}

.lockup-second {
  position: relative;
  z-index: 1;
  align-self: end;
  margin-left: calc(var(--pull-second) * -1em);
  margin-bottom: 0.02em;
}

/* What Tangudu does, and how to reach it.
   On large screens the second column starts under the "p" of "partnerships." */

.details {
  display: grid;
  grid-template-columns: max(calc(var(--second-at) * var(--lock)), 26rem) minmax(0, 1fr);
  align-items: start;
  margin-top: clamp(2rem, 6.5vh, 4.5rem);
}

.intro {
  max-width: 33rem;
  margin: 0;
  padding-right: 2.5rem;
  font-size: 1.25rem;
  line-height: 1.5;
}

.email {
  font-family: var(--display);
  font-size: clamp(1.5rem, 2.3vw, 2rem);
  font-weight: 560;
  letter-spacing: -0.02em;
  line-height: 1.2;
  text-decoration: underline;
  text-decoration-color: var(--red);
  text-decoration-thickness: 0.09em;
  text-underline-offset: 0.22em;
  overflow-wrap: anywhere;
}
.email:hover { color: var(--red); }

.contact p {
  max-width: 21rem;
  margin: 0.75rem 0 0;
  color: var(--grey);
}

.colophon {
  padding-block: 1.25rem clamp(1.25rem, 3.5vh, 2.25rem);
  color: var(--grey);
  font-size: 0.9375rem;
}

/* One moment on load: the two words come together around the mark */

@keyframes from-left {
  from { opacity: 0; transform: translateX(-0.45em); }
}
@keyframes from-right {
  from { opacity: 0; transform: translateX(0.45em); }
}
@keyframes settle {
  from { opacity: 0; transform: scale(0.965); }
}

.lockup-first { animation: from-left 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both; }
.lockup-second { animation: from-right 900ms cubic-bezier(0.2, 0.7, 0.2, 1) 120ms both; }
.mark { animation: settle 900ms cubic-bezier(0.2, 0.7, 0.2, 1) both; transform-origin: 50% 50%; }

@media (prefers-reduced-motion: reduce) {
  .lockup-first,
  .lockup-second,
  .mark { animation: none; }
}

/* Narrow screens: the same three pieces, stacked */

@media (max-width: 47.5rem) {
  :root { --lock: clamp(2.25rem, 11.4vw, 3.75rem); }
  .lockup { grid-template-columns: 1fr; }
  .lockup-first { margin: 0; }
  .lockup-second { margin: 0; }
  .mark {
    height: 3.4em;
    margin: 0.12em 0 0.2em 14%;
  }
  .details {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    margin-top: 2.25rem;
  }
  .intro { padding-right: 0; font-size: 1.125rem; }
  .email { font-size: 1.5rem; }
}
