/*
 * Nova's website: athletes' shared pages (contract/links.md).
 *
 * The look is the apps' (ios/Sources/Nova/UI/Theme.swift, android/core/ui/.../theme/): turpial yellow for the one
 * action and the mark, ink, paper and night, Barlow Condensed for names and titles, the system font for the rest.
 * An athlete's page is set like a race bib, pinned at its four corners. On a wide screen Nova's mark opens into a
 * cover beside the page, as Arodeni ID's sign-in pages open Arodeni's, and its route draws itself once.
 *
 * Mobile first: people arrive from a link in WhatsApp on a phone. No script and no inline styles (the CSP forbids
 * both). Light and dark follow the system.
 *
 * Contrast (WCAG 2.2 AA): text 16.3:1 on paper; muted text 6.0:1 on paper and 5.4:1 on chips; the handle's amber
 * 5.4:1 on white; ink on turpial 10.1:1 (6.9:1 hovered). Dark: muted 6.5:1 on chips, turpial 9.8:1 on the card.
 */

@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("barlow-condensed-bold-latin.woff2?v=9267f2f42822") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2013-2014,
    U+2018-201A, U+201C-201E, U+2022, U+2026, U+20AC, U+2122, U+2212;
}

@font-face {
  font-family: "Barlow Condensed";
  font-style: italic;
  font-weight: 800;
  font-display: swap;
  src: url("barlow-condensed-extrabold-italic-latin.woff2?v=11a0c413ed00") format("woff2");
  unicode-range: U+0020-007E, U+00A0-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2013-2014,
    U+2018-201A, U+201C-201E, U+2022, U+2026, U+20AC, U+2122, U+2212;
}

/* ---------------------------------------------------------------- tokens */

:root {
  color-scheme: light dark;

  --turpial: #ffb300;
  --turpial-deep: #e88a00;
  --ink: #15161a;

  --page: #f2f3f5;
  --card: #ffffff;
  --chip: #e6e7eb;
  --text: #15161a;
  --muted: #5c5c66;
  --accent: #9a5b00; /* the apps' accent text: turpial can't be read on white */
  --hole: rgb(21 22 26 / 0.2);
  --focus: #15161a;

  --cover: #ffb300;
  --cover-mark: #15161a;

  --display: "Barlow Condensed", "Arial Narrow", system-ui, sans-serif;
  --body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --page: #0b0c0f;
    --card: #17191e;
    --chip: #1c1e24;
    --text: #ffffff;
    --muted: #a1a1aa;
    --accent: #ffb300;
    --hole: rgb(0 0 0 / 0.7);
    --focus: #ffb300;

    --cover: #17191e;
    --cover-mark: #ffb300;
  }
}

/* ---------------------------------------------------------------- page */

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

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

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font: 400 1rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.frame {
  display: flex;
  min-height: 100vh;
  min-height: 100dvh;
}

.cover {
  display: none;
}

.side {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom))
    max(16px, env(safe-area-inset-left));
}

.bar,
.main {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  border-radius: 10px;
  text-decoration: none;
}

.bar .mark-tile {
  width: 34px;
  height: 34px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.language {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--chip);
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration: none;
}

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  padding: 28px 0 32px;
}

.credit {
  text-align: center;
  font-size: 0.875rem;
}

.credit a {
  color: var(--muted);
  text-decoration: none;
}

.credit a:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------- the mark */

.mark-bg {
  fill: var(--turpial);
}

.mark-route {
  stroke: var(--ink);
}

.mark-ring {
  fill: var(--ink);
}

.mark-hole {
  fill: var(--turpial);
}

/* ---------------------------------------------------------------- the bib */

.bib {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 44px 28px 40px;
  border-radius: 22px;
  background: var(--card);
  text-align: center;
}

/* The four pin holes: punched through to the page. */
.pins {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.bib::before,
.bib::after,
.pins::before,
.pins::after {
  content: "";
  position: absolute;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--page);
  box-shadow: inset 0 1.5px 2px var(--hole);
}

.pins::before {
  top: 15px;
  left: 15px;
}

.pins::after {
  top: 15px;
  right: 15px;
}

.bib::before {
  bottom: 15px;
  left: 15px;
}

.bib::after {
  right: 15px;
  bottom: 15px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  margin-bottom: 22px;
  padding-right: 0.06em; /* the italic leans right; this centres it by eye */
  border-radius: 50%;
  background: var(--turpial);
  color: var(--ink);
  font-family: var(--display);
  font-size: 3.4rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
}

.name {
  max-width: 100%;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.5rem, 12.5vw, 3.4rem);
  font-style: italic;
  font-weight: 800;
  line-height: 0.98;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.name.long {
  font-size: clamp(1.75rem, 8.5vw, 2.4rem);
  line-height: 1.04;
}

.handle {
  margin: 10px 0 0;
  color: var(--accent);
  font-size: 1.0625rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- actions */

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 56px;
  padding: 14px 24px;
  border-radius: 16px;
  background: var(--turpial);
  color: var(--ink);
  font-size: 1.0625rem;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
}

.button:hover {
  background: var(--turpial-deep);
}

.button:active {
  transform: translateY(1px);
}

.button.quiet {
  background: var(--chip);
  color: var(--text);
}

.stores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.store {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--chip);
  color: var(--muted);
}

.store-icon {
  flex: none;
  width: 22px;
  height: 22px;
}

.store-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}

.store-name {
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  white-space: nowrap;
}

.store-soon {
  font-size: 0.8125rem;
}

/* ---------------------------------------------------------------- home and messages */

.home {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 18px;
  text-align: center;
}

.home .mark-tile {
  width: 112px;
  height: 112px;
  margin-bottom: 22px;
}

.home-title {
  margin: 0;
  font-family: var(--display);
  font-size: 5rem;
  font-style: italic;
  font-weight: 800;
  line-height: 0.9;
}

.home-line {
  max-width: 28ch;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.0625rem;
  text-wrap: balance;
}

.message {
  display: flex;
  flex-direction: column;
  text-align: center;
}

.message-title {
  margin: 0 0 24px;
  font-family: var(--display);
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.04;
  text-wrap: balance;
}

.message-line {
  margin: -12px 0 24px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- wide screens */

@media (min-width: 960px) {
  .cover {
    position: sticky;
    top: 0;
    display: flex;
    flex: 0 0 46%;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: var(--cover);
  }

  .mark-art {
    width: min(62%, 30rem);
    height: auto;
    overflow: visible;
  }

  .cover .mark-route {
    stroke: var(--cover-mark);
    stroke-dasharray: 1610;
  }

  .cover .mark-ring {
    fill: var(--cover-mark);
  }

  .cover .mark-hole {
    fill: var(--cover);
  }

  .side {
    padding: 28px 48px 28px;
  }

  .home .mark-tile {
    display: none;
  }
}

/* The route draws itself from the ring, once. */
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .cover .mark-route {
    animation: route 1.1s cubic-bezier(0.65, 0, 0.35, 1) 0.15s both;
  }

  .cover .mark-ring,
  .cover .mark-hole {
    transform-box: fill-box;
    transform-origin: center;
    animation: start 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  }
}

@keyframes route {
  from {
    stroke-dashoffset: 1610;
  }
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes start {
  from {
    transform: scale(0);
  }
}
