/* Layout and components. Colours, sizes and spacing come from tokens.css; directions are logical so the
   same rules mirror for Hebrew and Arabic. */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: var(--text-m);
  line-height: var(--leading-body);
}

:focus-visible {
  outline: var(--focus-width) solid var(--ink);
  outline-offset: var(--focus-offset);
}

.skip {
  position: absolute;
  inset-block-start: var(--space-2);
  inset-inline-start: var(--space-2);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  min-block-size: var(--tap);
  padding-inline: var(--space-6);
  background: var(--surface);
  color: var(--ink);
  border: var(--frame) solid var(--ink);
  border-radius: var(--radius-m);
  font-weight: var(--weight-bold);
  transform: translateY(-200%);
}
.skip:focus-visible { transform: none; }

/* The poster: a thin outer frame with a second hairline inside it */
.page {
  max-inline-size: var(--page-max);
  min-block-size: 100vh;
  min-block-size: 100dvh;
  margin-inline: auto;
  padding: var(--space-2);
  display: flex;
}
.frame {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  border: var(--frame) solid var(--ink);
  border-radius: var(--radius-s);
  padding: var(--space-2);
  background: var(--surface);
}
.frame__inner {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  border: var(--frame) solid var(--border-strong);
  border-radius: var(--radius-s);
}

.masthead { padding: var(--space-6) var(--space-4) var(--space-4); }
.masthead__title {
  margin: 0;
  font-family: var(--font-story);
  font-size: var(--text-xl);
  line-height: var(--leading-heading);
  color: var(--ink);
}
.masthead__tagline {
  margin: var(--space-2) 0 0;
  color: var(--ink-soft);
}

/* Stripe band: rust, teal, mustard, sage; never orange */
.stripes {
  block-size: calc(var(--stripe-height) * 4);
  background: linear-gradient(
    var(--stripe-rust) 0 25%,
    var(--stripe-teal) 0 50%,
    var(--stripe-mustard) 0 75%,
    var(--stripe-sage) 0 100%);
}

.stage {
  flex: 1;
  min-inline-size: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-6);
  padding: var(--space-8) var(--space-4);
}

/* The main action: a round emblem with a text label under it */
.emblem {
  display: flex;
  flex-direction: column;
  align-items: center;
  max-inline-size: 100%;
  gap: var(--space-4);
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-l);
  background: transparent;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.emblem__art {
  inline-size: var(--emblem);
  max-inline-size: 100%;
  aspect-ratio: 1;
  transition: transform var(--motion);
}
.emblem__art svg { display: block; inline-size: 100%; block-size: 100%; }
.emblem:active .emblem__art { transform: scale(0.96); }
.emblem__label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: var(--tap);
  padding: var(--space-2) var(--space-8);
  border-radius: var(--radius-pill);
  background: var(--action-fill);
  text-align: center;
  color: var(--action-label);
  font-size: var(--text-l);
  font-weight: var(--weight-bold);
}

.status {
  min-block-size: calc(var(--leading-body) * 2em);
  margin: 0;
  max-inline-size: var(--measure-story);
  text-align: center;
  color: var(--ink-soft);
}

.foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  border-block-start: var(--frame) solid var(--hairline);
}
.foot__label { font-weight: var(--weight-bold); }
.foot__select {
  min-block-size: var(--tap);
  padding-inline: var(--space-4);
  border: var(--frame) solid var(--border-strong);
  border-radius: var(--radius-m);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

/* Star shapes and the sun in the emblem take their colour from tokens */
.art-ring { fill: var(--surface); stroke: var(--ink); stroke-width: 5; }
.art-sun { fill: var(--sun); }
.art-star { fill: var(--star); }
.art-arc { fill: none; stroke-width: 6; }
.art-arc--rust { stroke: var(--stripe-rust); }
.art-arc--teal { stroke: var(--stripe-teal); }
.art-arc--mustard { stroke: var(--stripe-mustard); }
.art-arc--sage { stroke: var(--stripe-sage); }

@media (min-width: 48em) {
  .page { padding: var(--space-6); }
  .masthead { padding: var(--space-8) var(--space-8) var(--space-6); }
  .masthead__title { font-size: var(--text-xxl); }
  .stage { padding: var(--space-12) var(--space-8); }
  .emblem__art { inline-size: var(--emblem-wide); }
  .frame__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "head tools" "stripes stripes" "stage stage";
  }
  .masthead { grid-area: head; }
  .stripes { grid-area: stripes; }
  .stage { grid-area: stage; }
  .foot { grid-area: tools; align-self: start; border-block-start: 0; padding: var(--space-8) var(--space-8) 0; }
}

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