/* evervalid.app. Swiss layout on a twelve-column grid: left-aligned type with strong scale
   contrast, hairline rules, no shadows or gradients. The palette is the app's light theme;
   the signal color marks warnings and nothing else. Fonts are the app's own four faces. */

@font-face {
  font-family: 'Space Grotesk';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/SpaceGrotesk_700Bold.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter_400Regular.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter_500Medium.ttf') format('truetype');
}

@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('/fonts/Inter_600SemiBold.ttf') format('truetype');
}

:root {
  --white: #FFFFFF;
  --ink: #0B0B0C;
  --muted: #5B6068;
  --line: #E6E8EB;
  --signal: #D23C00;

  --font-display: 'Space Grotesk', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-text: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;

  --text-small: 0.875rem;
  --text-label: 0.8125rem;
  --text-base: 1.0625rem;
  --text-lede: clamp(1.125rem, 1rem + 0.5vw, 1.375rem);
  --text-h2: clamp(1.375rem, 1.15rem + 0.9vw, 1.875rem);
  --text-h1: clamp(2.5rem, 1.25rem + 5.2vw, 6rem);
  --text-statement: clamp(2.125rem, 1rem + 4.6vw, 5.25rem);
  --text-index: clamp(1.5rem, 1rem + 2.2vw, 3rem);
  --text-address: clamp(1.375rem, 0.8rem + 3.2vw, 3.25rem);

  --gutter: clamp(16px, 4vw, 56px);
  --column-gap: clamp(16px, 2vw, 32px);
  --measure: 64ch;
  --page-max: 1200px;
  --space-section: clamp(3.5rem, 2.5rem + 5vw, 9rem);
  --space-block: clamp(2rem, 1.5rem + 2vw, 3.5rem);

  --duration-fast: 150ms;
  --duration-normal: 300ms;
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

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

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

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-text);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection {
  background: var(--ink);
  color: var(--white);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: 700;
  margin: 0;
}

p,
ul,
ol {
  margin: 0;
}

strong {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

/* ---- Frame ------------------------------------------------------------------------------- */

/* The frame is the content width itself, so every hairline ends exactly at the text edges. */
.masthead,
main,
.colophon {
  width: calc(100% - 2 * var(--gutter));
  max-width: var(--page-max);
  margin-inline: auto;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: 0;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--white);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-120%);
}

.skip:focus-visible {
  transform: translateY(0);
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}

.mark {
  flex: none;
  width: 28px;
  height: 28px;
}

.wordmark {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  letter-spacing: -0.023em;
  line-height: 1;
}

.masthead ul {
  display: flex;
  gap: 1.5rem;
  list-style: none;
  padding: 0;
}

.masthead a:not(.brand) {
  font-size: 0.9375rem;
  font-weight: 500;
  text-decoration-color: transparent;
}

.masthead a:not(.brand):hover,
.masthead a[aria-current='page'] {
  text-decoration-color: currentColor;
}

/* ---- Grid -------------------------------------------------------------------------------- */

.page-head,
.entry,
.contact,
.intro {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--column-gap);
}

.label {
  font-family: var(--font-text);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Home -------------------------------------------------------------------------------- */

.intro {
  padding-block: var(--space-section) clamp(3rem, 2rem + 4vw, 6rem);
}

.statement {
  grid-column: 1 / span 10;
  max-width: 19ch;
  font-size: var(--text-statement);
  letter-spacing: -0.035em;
  line-height: 1.02;
}

.index {
  padding-bottom: var(--space-section);
}

.index .label {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--ink);
}

.index ol {
  list-style: none;
  padding: 0;
}

.index a {
  position: relative;
  display: grid;
  grid-template-columns: 4rem minmax(0, 7fr) minmax(0, 4fr) 2.5rem;
  align-items: baseline;
  column-gap: var(--column-gap);
  padding-block: clamp(1.25rem, 1rem + 1vw, 2rem);
  border-bottom: 1px solid var(--line);
  text-decoration: none;
}

.index a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--duration-normal) var(--ease-out-expo);
}

.index a:hover::after,
.index a:focus-visible::after {
  transform: scaleX(1);
}

.index-no {
  font-size: var(--text-small);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.index-title {
  font-family: var(--font-display);
  font-size: var(--text-index);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

.index-note {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.45;
}

.index-arrow {
  justify-self: end;
  font-size: 1.5rem;
  line-height: 1;
  transition: transform var(--duration-fast) var(--ease-out-expo);
}

.index a:hover .index-arrow,
.index a:focus-visible .index-arrow {
  transform: translateX(6px);
}

/* ---- Pages ------------------------------------------------------------------------------- */

.page-head {
  padding-block: var(--space-section) var(--space-block);
  row-gap: 1.5rem;
}

.page-head .label,
.page-head h1 {
  grid-column: 1 / -1;
}

.page-head h1 {
  font-size: var(--text-h1);
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.lede {
  grid-column: 5 / -1;
  max-width: 40ch;
  margin-top: clamp(0.5rem, 0.25rem + 1vw, 1.5rem);
  font-size: var(--text-lede);
  line-height: 1.5;
}

/* The legal pages: the draft note and the effective date sit in the lede's column. */
.page-head .warning,
.page-head .note {
  grid-column: 5 / -1;
  max-width: 40ch;
}

.entries {
  counter-reset: entry;
  padding-bottom: var(--space-section);
}

.entry,
.contact {
  padding-block: var(--space-block);
  border-top: 1px solid var(--line);
}

.entry h2,
.contact h2 {
  grid-column: 1 / span 4;
  font-size: var(--text-h2);
  letter-spacing: -0.015em;
  line-height: 1.15;
}

.entry h2::before {
  counter-increment: entry;
  content: counter(entry, decimal-leading-zero);
  display: block;
  margin-bottom: 0.75rem;
  font-family: var(--font-text);
  font-size: var(--text-label);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.text {
  grid-column: 5 / -1;
  max-width: var(--measure);
}

.text > * + * {
  margin-top: 1rem;
}

.text h3 {
  margin-top: 2rem;
  font-size: 1.125rem;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.note {
  color: var(--muted);
}

.contact h2 {
  font-family: var(--font-text);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.address {
  font-family: var(--font-display);
  font-size: var(--text-address);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.address a {
  text-decoration-thickness: 2px;
  text-underline-offset: 0.14em;
}

.address a:hover {
  text-decoration-thickness: 4px;
}

/* Ordered steps: the number set in the display face, hung in the left margin of the text. */
.steps {
  counter-reset: step;
  list-style: none;
  padding: 0;
}

.steps li {
  position: relative;
  padding: 0.875rem 0 0.875rem 2.75rem;
  border-top: 1px solid var(--line);
}

.steps li:last-child {
  border-bottom: 1px solid var(--line);
}

.steps li::before {
  counter-increment: step;
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.875rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.25rem;
  line-height: 1.35;
}

.ruled {
  list-style: none;
  padding: 0;
}

.ruled li {
  padding-block: 0.75rem;
  border-top: 1px solid var(--line);
}

.ruled li:last-child {
  border-bottom: 1px solid var(--line);
}

.warning {
  padding-left: 1rem;
  border-left: 2px solid var(--signal);
  color: var(--signal);
}

.warning-label {
  display: block;
  margin-bottom: 0.25rem;
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--signal);
}

/* ---- Licenses ---------------------------------------------------------------------------- */

.licenses {
  width: 100%;
  border-collapse: collapse;
  font-size: 1rem;
}

.licenses th,
.licenses td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.licenses th {
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.licenses td:first-child,
.licenses th:first-child {
  padding-right: 1.5rem;
}

.licenses td:first-child {
  font-weight: 500;
  overflow-wrap: anywhere;
}

.licenses td:last-child:not(.packages) {
  white-space: nowrap;
}

.pkg-names {
  display: block;
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: var(--text-small);
  font-weight: 400;
  line-height: 1.5;
}

.packages {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

details {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

summary {
  padding-block: 0.875rem;
  font-weight: 600;
  cursor: pointer;
}

details[open] summary {
  border-bottom: 1px solid var(--line);
}

details .packages {
  padding-block: 1rem;
}

/* ---- Colophon ---------------------------------------------------------------------------- */

.colophon {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: var(--column-gap);
  row-gap: 1.5rem;
  padding-block: 2.5rem 3rem;
  border-top: 1px solid var(--line);
  font-size: var(--text-small);
  color: var(--muted);
}

.colophon p {
  grid-column: 1 / span 4;
}

.colophon nav {
  grid-column: 5 / -1;
}

.colophon ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  list-style: none;
  padding: 0;
}

.colophon a {
  color: var(--ink);
  text-decoration-color: var(--line);
}

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

/* ---- Narrow screens ---------------------------------------------------------------------- */

@media (max-width: 60rem) {
  .index a {
    grid-template-columns: 2.5rem minmax(0, 1fr) 1.5rem;
    row-gap: 0.375rem;
  }

  .index-note {
    grid-column: 2;
    grid-row: 2;
  }

  .index-arrow {
    grid-column: 3;
    grid-row: 1;
  }
}

@media (max-width: 48rem) {
  .statement,
  .lede,
  .page-head .warning,
  .page-head .note,
  .entry h2,
  .contact h2,
  .text,
  .colophon p,
  .colophon nav {
    grid-column: 1 / -1;
  }

  .statement {
    max-width: none;
  }

  .entry,
  .contact {
    row-gap: 1.25rem;
  }

  .lede {
    margin-top: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .index a::after,
  .index-arrow {
    transition: none;
  }
}
