@font-face {
  font-family: "Bricolage Grotesque";
  src: url("/bricolage-grotesque-latin.woff2") format("woff2");
  font-display: swap;
  font-weight: 400 800;
}

:root {
  --night: #0d1b2e;
  --blue: #152f4c;
  --ivory: #fbfaf8;
  --amber: #ffc37a;
  --muted: #b9c8d8;
  --line: #39516a;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  font: 1rem/1.5 system-ui, sans-serif;
  color: var(--ivory);
  background: var(--night);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(ellipse at 86% 6%, #1a3652, transparent 63%);
}
[dir="rtl"] body { background: radial-gradient(ellipse at 14% 6%, #1a3652, transparent 63%); }
a { color: var(--amber); text-underline-offset: .24em; }
a:hover { color: #ffdbad; }
:focus-visible { outline: 2px solid var(--ivory); outline-offset: 4px; }

.shell { width: min(86rem, calc(100% - 2 * clamp(1.25rem, 5vw, 4.5rem))); margin-inline: auto; }
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .75rem 1.25rem;
  padding-block: clamp(1.2rem, 3.2vw, 2.6rem);
}
.brand { display: block; width: clamp(10rem, 26vw, 15.5rem); height: auto; max-width: 100%; }
.language select {
  max-width: 100%;
  min-height: 44px;
  padding: .5rem .7rem;
  border: 1px solid #526b83;
  border-radius: .55rem;
  color: var(--ivory);
  background: var(--blue);
  font: 600 .875rem/1.4 system-ui, sans-serif;
  cursor: pointer;
}

.welcome {
  display: grid;
  grid-template-areas: "content art";
  grid-template-columns: minmax(0, .98fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 5vw, 5.75rem);
  align-items: stretch;
  border-block: 1px solid var(--line);
  padding-block: clamp(.85rem, 1.8vw, 1.6rem);
  margin-block-end: 2rem;
}
.art {
  grid-area: art;
  position: relative;
  min-height: 33rem;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--blue);
}
.art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 51%; }
.art::before, .art::after {
  content: "";
  position: absolute;
  z-index: 1;
  width: 2rem;
  height: 2rem;
  border: solid var(--amber);
  pointer-events: none;
}
.art::before { top: 1.2rem; left: 1.2rem; border-width: 2px 0 0 2px; border-top-left-radius: .45rem; }
.art::after { bottom: 1.2rem; right: 1.2rem; border-width: 0 2px 2px 0; border-bottom-right-radius: .45rem; }

.content { grid-area: content; align-self: center; min-width: 0; padding-block: clamp(1rem, 3.5vw, 3.25rem); }
h1 { margin: 0; font: 750 clamp(2.6rem, 5.5vw, 5.1rem)/.99 var(--display); letter-spacing: -.052em; text-wrap: balance; overflow-wrap: anywhere; }
[dir="rtl"] h1 { line-height: 1.2; letter-spacing: 0; }
.intro { margin: 1.05rem 0 0; max-width: 39ch; color: var(--muted); font-size: clamp(1rem, 1.45vw, 1.25rem); }
.steps { list-style: none; margin: clamp(1.5rem, 3vw, 2.55rem) 0 0; padding: 0; max-width: 36rem; }
.steps li { display: flex; align-items: flex-start; gap: .85rem; padding: .85rem 0; border-block-start: 1px solid var(--line); }
.steps li:last-child { padding-block-end: 0; }
.step-number {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  flex: none;
  border-radius: 50%;
  border: 1px solid #8e6d4c;
  background: #2b2c33;
  color: var(--amber);
  font: 720 .875rem/1 var(--display);
}
h2 { margin: .13rem 0 .1rem; font-size: clamp(1rem, 1.6vw, 1.12rem); line-height: 1.3; }
.steps p { margin: 0; color: var(--muted); font-size: .92rem; }

.interaction { margin-block-start: 1.65rem; }
.primary {
  display: inline-flex;
  min-height: 3.2rem;
  max-width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: clamp(1.25rem, 3vw, 2rem);
  padding: .65rem 1rem;
  border: 1px solid transparent;
  border-radius: .58rem;
  color: var(--night);
  background: var(--amber);
  font: 750 1rem/1.35 system-ui, sans-serif;
  text-align: start;
  text-decoration: none;
  cursor: pointer;
}
.primary:hover { color: var(--night); background: #ffdbad; }
.primary[aria-disabled="true"] { opacity: .73; cursor: progress; }
.arrow { flex: none; font-size: 1.45rem; line-height: 1; }
[dir="rtl"] .arrow { transform: scaleX(-1); }
.status { display: flex; align-items: baseline; gap: .6rem; margin: 0 0 .9rem; color: var(--muted); font-size: .925rem; }
.status:empty { display: none; }
.status::before {
  content: "";
  width: .44rem;
  height: .44rem;
  flex: none;
  align-self: flex-start;
  margin-block-start: .49rem;
  border-radius: 50%;
  background: var(--amber);
}
.status[data-state="ready"] { color: var(--ivory); }
.status[data-state="ready"]::before { background: #7deac4; }
.status[data-state="checking"]::before { animation: pulse 1.35s ease-in-out infinite alternate; }
@keyframes pulse { from { opacity: .35; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .status[data-state="checking"]::before { animation: none; } }

details { margin-block-start: 1.05rem; max-width: 36rem; }
summary { width: fit-content; color: var(--muted); cursor: pointer; font-size: .92rem; font-weight: 650; }
summary:hover { color: var(--ivory); }
.help-content { margin: .65rem 0 0; padding: .68rem .9rem .9rem; border: 1px solid var(--line); border-radius: .6rem; background: #10233a; color: var(--muted); font-size: .875rem; }
.help-content p { margin: .22rem 0 .6rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.missing { padding-block: 2rem; }
.missing h1 { margin-block: 2rem 1.5rem; }

@media (max-width: 52rem) {
  .welcome { grid-template-areas: "art" "content"; grid-template-columns: minmax(0, 1fr); gap: 1.2rem; padding-block-end: 1.2rem; }
  .art { min-height: 0; height: clamp(9rem, 27vw, 15rem); border-radius: .7rem; }
  .art::before, .art::after { width: 1.35rem; height: 1.35rem; }
  .art::before { top: .7rem; left: .7rem; }
  .art::after { bottom: .7rem; right: .7rem; }
  .content { padding-block: 0; }
  h1 { font-size: clamp(2.25rem, 7.7vw, 4rem); line-height: 1.02; text-wrap: wrap; }
  .intro { margin-block-start: .7rem; }
  .steps { margin-block-start: 1.25rem; }
}
