/* UPSHIFT Somalia Platform: base styles (Sunrise).

   Built only on tokens.css, which is copied unchanged from the identity. Every
   colour and size below is a token, or a measure the design system's components
   give, built from the tokens in the block "Measures" below. Phone first: the
   layout grows at 641 px, the width where tokens.css steps the titles up.

   Order: font, measures, ground, type, links, layout, buttons, tags, card,
   field, focus, motion. */

/* --- Font: Inter, one variable file, weights 400 to 800, Latin ------------------ */

@font-face {
  font-family: Inter;
  src: url("../fonts/inter-latin.034ab8b195b2.woff2") format("woff2-variations"),
       url("../fonts/inter-latin.034ab8b195b2.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* --- Measures ------------------------------------------------------------------- */
/* The component sizes of the design system, each built from the space tokens.
   The three line widths are the only values tokens.json does not hold yet. */

:root {
  --control-height: calc(var(--space-12) + var(--space-1));          /* 52 px, main button */
  --control-height-compact: calc(var(--space-12) - var(--space-1));  /* 44 px, every target */
  --field-height: var(--space-12);                                   /* 48 px */
  --tag-height: calc(var(--space-6) + var(--space-1));               /* 28 px */
  --dot-size: var(--space-2);                                        /* the dot in a tag */
  --icon-size: var(--space-6);                                       /* 24 px */
  --icon-spot: var(--space-8);                                       /* 32 px beside a heading */
  --page-width: calc(var(--space-18) * 16);                          /* 1152 px */
  --text-width: calc(var(--space-12) * 13);                          /* 624 px, about 70 characters */
  --line-width: 1px;          /* hairlines, the tag edge, the quiet link's line */
  --edge-width: 1.5px;        /* the edge of a second button and a field */
  --focus-width: 2px;         /* the focus ring, and a field in error */
  --focus-gap: 2px;
  --motion-fast: 160ms;       /* hover and focus changes; the design system allows 160 to 340 ms */
}

/* --- Ground ---------------------------------------------------------------------- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--body-weight);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img,
svg {
  display: block;
  max-width: 100%;
}

/* --- Type ------------------------------------------------------------------------ */
/* One family. Size and weight carry the hierarchy. Titles are tight and balanced. */

h1, h2, h3, p, ul, ol, figure, dl, dd {
  margin: 0;
}

.t-display,
.t-h2-home,
.t-h1,
.t-h2,
.t-h3 {
  color: var(--night);
  text-wrap: balance;
}

.t-display {
  font-size: var(--display-size);
  line-height: var(--display-line);
  font-weight: var(--display-weight);
  letter-spacing: var(--display-tracking);
}

.t-h2-home {
  font-size: var(--h2-home-size);
  line-height: var(--h2-home-line);
  font-weight: var(--h2-home-weight);
  letter-spacing: var(--h2-home-tracking);
}

.t-h1 {
  font-size: var(--h1-size);
  line-height: var(--h1-line);
  font-weight: var(--h1-weight);
  letter-spacing: var(--h1-tracking);
}

.t-h2 {
  font-size: var(--h2-size);
  line-height: var(--h2-line);
  font-weight: var(--h2-weight);
  letter-spacing: var(--h2-tracking);
}

.t-h3 {
  font-size: var(--h3-size);
  line-height: var(--h3-line);
  font-weight: var(--h3-weight);
}

.t-lead {
  font-size: var(--lead-size);
  line-height: var(--lead-line);
  font-weight: var(--lead-weight);
  color: var(--ink-soft);
  max-width: var(--text-width);
}

.t-body {
  font-size: var(--body-size);
  line-height: var(--body-line);
  font-weight: var(--body-weight);
}

.t-label {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: var(--label-weight);
}

.t-small {
  font-size: var(--small-size);
  line-height: var(--small-line);
  font-weight: var(--small-weight);
  color: var(--ink-muted);
}

.t-figure {
  font-size: var(--figure-size);
  line-height: var(--figure-line);
  font-weight: var(--figure-weight);
  letter-spacing: var(--figure-tracking);
  font-variant-numeric: tabular-nums;
  color: var(--night);
}

/* The one phrase per page in clay, inside the main title, about people. */
.t-clay {
  color: var(--clay);
}

/* --- Links ----------------------------------------------------------------------- */

a {
  color: var(--clay);
  text-decoration-thickness: var(--line-width);
  text-underline-offset: var(--space-1);
}

a:hover {
  text-decoration-thickness: var(--focus-width);
}

/* --- Layout ---------------------------------------------------------------------- */

.page {
  width: 100%;
  max-width: var(--page-width);
  margin-inline: auto;
  padding-inline: var(--space-4);
}

.stack > * + * {
  margin-block-start: var(--space-4);
}

.section {
  padding-block: var(--space-12);
}

.section + .section {
  border-block-start: var(--line-width) solid var(--line);
}

.grid {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: 1fr;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3) var(--space-6);
}

.panel {
  background: var(--white);
  border-radius: var(--radius-l);
  padding: var(--space-6);
}

.panel--dawn {
  background: var(--dawn);
}

/* The one dark band on a page. */
.band {
  background: var(--night);
  color: var(--on-night);
  border-radius: var(--radius-xl);
  padding: var(--space-8) var(--space-6);
}

.band .t-h2,
.band .t-h3 {
  color: var(--white);
}

.band .t-small {
  color: var(--on-night);
}

.band > * + * {
  margin-block-start: var(--space-3);
}

.skip-link {
  position: absolute;
  inset-inline-start: var(--space-4);
  inset-block-start: calc(var(--space-12) * -2);
  z-index: 10;
  padding: var(--space-3) var(--space-4);
  background: var(--night);
  color: var(--white);
  border-radius: var(--radius-m);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
}

.skip-link:focus {
  inset-block-start: var(--space-4);
}

.visually-hidden {
  position: absolute;
  width: var(--line-width);
  height: var(--line-width);
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (min-width: 641px) {
  .page {
    padding-inline: var(--space-8);
  }

  .section {
    padding-block: var(--space-18);
  }

  .grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .grid--3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .band {
    padding: var(--space-12);
  }
}

/* --- Buttons --------------------------------------------------------------------- */
/* One main button per view (sun, ink label, arrow at the end); second buttons for
   other real actions; quiet links for the other way forward. */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  min-height: var(--control-height-compact);
  padding-inline: var(--space-4);
  border: 0;
  border-radius: var(--radius-m);
  font-family: inherit;
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: var(--label-weight);
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--motion-fast) ease-out, box-shadow var(--motion-fast) ease-out;
}

.button img,
.button svg {
  width: calc(var(--icon-size) - var(--space-1));
  height: calc(var(--icon-size) - var(--space-1));
  flex: none;
}

.button--main {
  min-height: var(--control-height);
  padding-inline: var(--space-6);
  background: var(--sun);
  color: var(--ink);
}

.button--main:hover,
.button--main.is-hover {
  background: var(--sun-hover);
}

/* The hero's main button only. */
.button--hero {
  box-shadow: var(--shadow-sun);
}

.button--second {
  background: transparent;
  color: var(--night);
  box-shadow: inset 0 0 0 var(--edge-width) var(--line-strong);
}

.button--second:hover,
.button--second.is-hover {
  box-shadow: inset 0 0 0 var(--edge-width) var(--night);
}

.link-quiet {
  display: inline-flex;
  border-radius: var(--radius-s);
  align-items: center;
  min-height: var(--control-height-compact);
  color: var(--night);
  font-size: var(--label-size);
  font-weight: var(--label-weight);
  text-decoration: underline;
  text-decoration-thickness: var(--line-width);
  text-underline-offset: calc(var(--space-1) + var(--line-width));
  transition: text-decoration-color var(--motion-fast) ease-out;
}

.link-quiet:hover,
.link-quiet.is-hover {
  text-decoration-color: var(--clay);
  text-decoration-thickness: var(--line-width);
}

.band .link-quiet {
  color: var(--white);
}

/* --- Tags ------------------------------------------------------------------------ */
/* What kind of thing a record is, in one or two words. The dot never carries the
   meaning alone; the word always shows. */

.tag {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--tag-height);
  padding-inline: var(--space-3);
  background: var(--white);
  border-radius: var(--radius-pill);
  box-shadow: inset 0 0 0 var(--line-width) var(--line);
  color: var(--night);
  font-size: var(--small-size);
  line-height: var(--label-line);
  font-weight: var(--label-weight);
}

.tag::before {
  content: "";
  width: var(--dot-size);
  height: var(--dot-size);
  border-radius: var(--radius-pill);
  background: var(--night);
  flex: none;
}

.tag--green::before {
  background: var(--green);
}

.tag--people::before {
  background: var(--clay);
}

.place {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-soft);
}

/* --- Card ------------------------------------------------------------------------ */
/* One young person, team or business in a list. The whole card is one link; the
   photo sits in the U crop; no shadow on paper, the photo carries the card. */

.card {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  color: inherit;
  text-decoration: none;
  border-radius: var(--radius-l);
}

.card__photo {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  aspect-ratio: 4 / 5;
  background: var(--photo-ground);
  border-radius: 0 0 var(--radius-u) var(--radius-u);
  padding: var(--space-6);
  text-align: center;
}

.card__photo img {
  width: var(--icon-spot);
  height: var(--icon-spot);
}

.card__photo span {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-muted);
}

.card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-block-start: var(--space-1);
}

.card__title {
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: var(--focus-width);
  text-underline-offset: var(--space-1);
  transition: text-decoration-color var(--motion-fast) ease-out;
}

.card__text {
  color: var(--ink-soft);
}

@media (hover: hover) {
  .card:hover .card__title {
    text-decoration-color: var(--clay);
  }
}

.card.is-hover .card__title {
  text-decoration-color: var(--clay);
}

/* --- Field ----------------------------------------------------------------------- */
/* One answer: a label above, the input, a help line, and a clear message when
   something is wrong. Required fields say so in words in the label. */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.field__label {
  font-size: var(--label-size);
  line-height: var(--label-line);
  font-weight: var(--label-weight);
  color: var(--ink);
}

.field__input {
  width: 100%;
  min-height: var(--field-height);
  padding-inline: var(--space-3);
  background: var(--white);
  border: var(--edge-width) solid var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--body-size);
  line-height: var(--body-line);
}

.field__input:focus,
.field__input.is-focus {
  border-color: var(--night);
}

.field__help {
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--ink-muted);
}

.field--error .field__input {
  border: var(--focus-width) solid var(--danger);
}

.field__message {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--small-size);
  line-height: var(--small-line);
  color: var(--danger);
}

.field__message svg {
  width: var(--space-4);
  height: var(--space-4);
  flex: none;
  margin-block-start: var(--line-width);
  stroke: var(--danger);
}

/* --- Focus ----------------------------------------------------------------------- */
/* A 2 px night outline with a 2 px gap; on night grounds a sun outline. */

:focus-visible,
.is-focus {
  outline: var(--focus-width) solid var(--night);
  outline-offset: var(--focus-gap);
}

.card:focus-visible,
.card.is-focus {
  outline-offset: var(--space-1);
}

.band :focus-visible,
.band .is-focus {
  outline-color: var(--sun);
}

/* --- Motion ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
