/* No Agenda, landing hero. See docs/features/landing-hero.md */

/* Arimo is metrically identical to Arial. It is only downloaded where Arial is
   missing (most Android phones), so line breaks match on every device. */
@font-face {
  font-family: "Arimo";
  src: url("/assets/fonts/arimo-latin-400-normal.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Arimo";
  src: url("/assets/fonts/arimo-latin-400-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --ink: #000;
  --paper: #fff;
  --accent: #f7542b; /* the brand's vivid orange: the dot and text selection */
  --font: Arial, "Arimo", "Helvetica Neue", Helvetica, sans-serif;

  /* Proportions measured from the reference screenshot (1130 px wide frame).
     The copy column is as wide as its longest line, "simply for the pleasure
     of making them.", which is 17.45 em in Arial. */
  --edge: clamp(10px, 0.9vw, 20px);
  --mark-size: clamp(28px, 3.8vw, 140px);
  --copy-size: clamp(15px, 1.47vw, 34px);
  /* The copy's actual size: shrinks on very narrow screens so the longest line
     still fits. The link and the dot are sized from it too. */
  --copy-font: min(var(--copy-size), calc((100vw - 2 * var(--edge)) / 17.6));

  --dot: var(--accent);
  --dot-scale: 0.8; /* dot diameter in em of the copy size; tweakable */
  --dot-scale-mobile: 1.3; /* the same on phones, where the dot is the contact button */
  --dot-size: calc(var(--copy-font) * var(--dot-scale));

  /* The corners: dot top left, link bottom right, both at the edge padding. */
  --inset-top: calc(var(--edge) + env(safe-area-inset-top));
  --inset-right: calc(var(--edge) + env(safe-area-inset-right));
  --inset-bottom: calc(var(--edge) + env(safe-area-inset-bottom));
  --inset-left: calc(var(--edge) + env(safe-area-inset-left));
}

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

html,
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

body {
  font-family: var(--font);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

::selection {
  background: var(--accent);
  color: var(--paper);
}

/* Wide screens: one row across the vertical centre of the screen.
   No | copy | Agenda, the two words pushed to the side edges. The orange dot
   (top left) and the link (bottom right) sit in the corners, out of the grid,
   and balance each other on the diagonal. */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto 1fr; /* equal side columns keep the copy on the true centre */
  align-items: center;
  column-gap: calc(var(--edge) * 2);
  min-height: 100vh;
  min-height: 100svh;
  padding: var(--inset-top) var(--inset-right) var(--inset-bottom) var(--inset-left);
  overflow: hidden;
}

.hero__word {
  display: block;
  font-size: var(--mark-size);
  line-height: 1;
  white-space: nowrap;
}

.hero__word--no {
  grid-column: 1;
  justify-self: start;
}

.hero__word--agenda {
  grid-column: 3;
  justify-self: end;
}

/* Top left corner. */
.hero__dot {
  position: absolute;
  top: var(--inset-top);
  left: var(--inset-left);
  width: var(--dot-size);
  height: var(--dot-size);
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--dot);
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: scale 200ms cubic-bezier(0.23, 1, 0.32, 1);
}

/* With a mouse, the dot grows a little under the pointer: it is a button.
   (The independent scale property does not fight the drift's transform.) */
@media (hover: hover) and (pointer: fine) {
  .hero__dot:hover {
    scale: 1.25;
  }
}

/* An invisible ring that makes the tap target 44 px or more (WCAG 2.5.5). */
.hero__dot::before {
  content: "";
  position: absolute;
  inset: min(-12px, calc((44px - var(--dot-size)) / -2));
  border-radius: 50%;
}

.hero__dot:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Bottom right corner: the one link, the copy's size, in capitals. */
.hero__contact {
  position: absolute;
  right: var(--inset-right);
  bottom: var(--inset-bottom);
  font-size: var(--copy-font);
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: border-color 200ms ease;
}

/* Hover only where there is a real pointer: touch fires false hovers on tap. */
@media (hover: hover) and (pointer: fine) {
  .hero__contact:hover {
    border-bottom-color: currentColor;
  }
}

.hero__contact:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* The centred, fully justified block of copy. The line breaks are set by
   hand, one span per line, exactly as in the reference (no font reproduces
   them on its own). Every line is stretched to the full column width, which is
   what gives "paying attention." its wide gap. On very narrow screens the
   font shrinks so the longest line still fits instead of re-wrapping. */
.hero__copy {
  grid-column: 2;
  justify-self: center;
  width: 17.6em;
  margin: 0;
  font-size: var(--copy-font);
  line-height: 1.16;
  text-align: justify;
  text-align-last: justify;
  hyphens: none;
}

.hero__copy span {
  display: block;
  white-space: nowrap;
}

.hero__copy em {
  font-style: italic;
}

/* Narrow screens (phones in portrait): the copy cannot sit between the words,
   so the same idea turns diagonal. No top left (under the dot), Agenda bottom
   right (above the link), the copy in the middle. */
@media (max-width: 559px) {
  :root {
    --mark-size: clamp(28px, 9vw, 44px);
    --dot-size: calc(var(--copy-font) * var(--dot-scale-mobile));
  }

  /* On phones the dot is the contact, so the link goes. */
  .hero__contact {
    display: none;
  }

  .hero {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
  }

  .hero__word--no {
    grid-area: 1 / 1;
    justify-self: start;
    align-self: start;
    margin-top: calc(var(--dot-size) + var(--edge));
  }

  .hero__copy {
    grid-area: 2 / 1;
    align-self: center;
    margin: 1.5em 0;
  }

  .hero__word--agenda {
    grid-area: 3 / 1;
    justify-self: end;
    align-self: end;
  }
}

/* The contact overlay (phones, from the dot). Full screen in the brand orange,
   the title top left where the dot was, Close bottom right where the link is
   on wide screens. */
.overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: var(--inset-top) var(--inset-right) var(--inset-bottom) var(--inset-left);
  border: 0;
  background: var(--accent);
  color: var(--ink);
  font-size: var(--copy-font);
  line-height: 1.16;
}

.overlay[open] {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.overlay::backdrop {
  background: transparent;
}

/* Takes the focus when the overlay opens (so the browser does not ring Close);
   it is not a control, so no ring. */
.overlay__body:focus {
  outline: none;
}

.overlay__title {
  margin: 0 0 1em;
  font-size: inherit;
  font-weight: 400;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.overlay__text {
  margin: 0;
  max-width: 17.6em;
}

.overlay__close {
  align-self: flex-end;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  /* At least 44 px to tap, without moving the text. */
  min-height: 44px;
  min-width: 44px;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
}

.overlay__close:focus-visible {
  outline: 1px solid var(--ink);
  outline-offset: 4px;
}

/* Before the intro starts, keep the animated elements invisible. */
.is-pending .hero__word,
.is-pending .hero__copy,
.is-pending .hero__dot,
.is-pending .hero__contact {
  opacity: 0;
}

@media (prefers-reduced-motion: reduce) {
  .hero__contact,
  .hero__dot {
    transition: none;
  }
}
