/* The download page, in kumulativ.dk's colours: ink, green, coral on paper. */

@font-face {
  font-family: "Albert Sans";
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url("/v1/download/fonts/albert-sans.woff2") format("woff2");
}

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("/v1/download/fonts/inter.woff2") format("woff2");
}

:root {
  --ink: #282828;
  --ink-70: rgba(40, 40, 40, 0.7);
  --line: rgba(40, 40, 40, 0.12);
  --green: #96ff8f;
  --coral: #ff715e;
  --paper: #faf9f8;
  --paper-90: rgba(250, 249, 248, 0.9);
  --font-display: "Albert Sans", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-code: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --wrap: 48rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --header-h: 4.5rem;
}

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

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

body {
  margin: 0;
  min-height: 100svh;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-color: var(--coral); text-decoration-thickness: 2px; text-underline-offset: 0.18em; }
a:hover { text-decoration-color: var(--ink); }

:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 2px; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper-90);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: 72rem;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
}

.brand { display: block; }
.brand img { display: block; height: 1.375rem; width: auto; }

.language {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.25rem 0;
  border-bottom: 3px solid transparent;
}
.language:hover { border-bottom-color: var(--coral); }

/* Centred on the whole window: the header above is paid for by as much room below. */
.hero {
  min-height: calc(100svh - var(--header-h));
  display: flex; align-items: center;
  padding-block: 1.5rem calc(var(--header-h) + 1.5rem);
  background-color: var(--paper);
  background-image: radial-gradient(rgba(40, 40, 40, 0.1) 1px, transparent 1.2px);
  background-size: 22px 22px;
}

.title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.05;
  letter-spacing: -0.015em;
  margin: 0 0 1.5rem;
}

/* The box is as wide as the row of cells and no wider, so the cells sit the same distance from both its sides; nothing in it wraps or appears, the message included. */
.download {
  width: fit-content;
  max-width: 100%;
  display: flex; flex-direction: column; gap: 0.75rem;
  padding: 2rem;
  border-radius: 20px;
  background: #fff;
  border: 1px solid var(--line);
}

.field {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-70);
}

.code { margin: 0 0 0.5rem; padding: 0; border: 0; min-width: 0; }
.code legend { padding: 0; margin-bottom: 0.5rem; }

/* Four groups of four cells in one row, a dash between the groups; on a narrow screen two rows of two groups. */
.cells { display: grid; grid-template-columns: repeat(4, max-content); gap: 0.75rem 0; }
.group { display: flex; align-items: center; gap: 0.25rem; }
.group:not(:last-child)::after { content: "\2013" / ""; margin-inline: 0.6rem; color: var(--ink-70); }
@media (max-width: 44rem) {
  .cells { grid-template-columns: repeat(2, max-content); }
  .group:nth-child(2)::after { content: none; }
}
@media (max-width: 26rem) {
  .download { padding: 1.25rem; }
  .group:not(:last-child)::after { margin-inline: 0.4rem; }
  .cell { width: 1.65rem; height: 2.25rem; font-size: 1.05rem; }
}

.cell { width: 1.9rem; height: 2.6rem; font-size: 1.2rem; }
}
.group { display: flex; gap: 0.3rem; }

.cell {
  width: 1.75rem;
  height: 2.4rem;
  padding: 0;
  text-align: center;
  font: inherit;
  font-family: var(--font-code);
  font-size: 1.1rem;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink);
}
.cell:focus { border-color: var(--ink); outline: none; }
.cell[aria-invalid="true"] { border-color: var(--coral); }

/* Half the box wide. The native list is what the form sends; the script hides it behind a button and a list of the page's own. */
.select { position: relative; width: 50%; }
@media (max-width: 44rem) { .select { width: 100%; } }
.select::after {
  content: "";
  position: absolute;
  top: 50%; right: 0.9rem;
  width: 0.45rem; height: 0.45rem;
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.native, .select-button {
  appearance: none;
  -webkit-appearance: none;
  display: block;
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  text-align: left;
  padding: 0.55rem 2.25rem 0.55rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
/* Focus never changes the field's border; keyboard focus alone draws the page's ring. */
.native:focus:not(:focus-visible), .select-button:focus:not(:focus-visible) { outline: none; }
/* The script hides the native list and shows its own; `hidden` must win over the rules above. */
.native[hidden], .select-button[hidden], .select-list[hidden] { display: none; }
.select-button.placeholder { color: var(--ink-70); }
.select-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.3rem); z-index: 10;
  margin: 0; padding: 0.3rem; list-style: none;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(40, 40, 40, 0.12);
}
.select-list [role="option"] {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: 0.45rem 0.7rem;
  border-radius: 7px;
  font-size: 0.95rem;
  cursor: pointer;
}
.select-list [role="option"]:hover, .select-list [role="option"]:focus { background: var(--paper); outline: none; }
.select-list [role="option"][aria-selected="true"] { font-weight: 600; }
.select-list [role="option"][aria-selected="true"]::after { content: "✓" / ""; color: var(--ink-70); }

/* The button and, beside it, the message when there is one: the row never moves the box's height or width. */
.actions {
  width: 0;
  min-width: 100%;
  margin-top: 1rem;
  min-height: 3.6rem;
  display: flex; align-items: center; gap: 1.25rem;
}

.button {
  flex: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  background: var(--green);
  border: 0;
  padding: 1rem 2.5rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 160ms ease;
}
.button:hover { background: var(--ink); color: var(--green); transform: translateY(-2px); }
.button:active { transform: translateY(0); }

/* The page after a download: the thanks, and the link for a browser that did not follow the refresh. */
.thanks { text-align: center; }
.thanks .title { margin-bottom: 0.75rem; }
.thanks .lead { margin: 0; }

.message {
  margin: 0;
  color: var(--coral);
  line-height: 1.3;
}
