@import url("./tokens.css?v=5");

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("../fonts/atkinson-hyperlegible-next-latin-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin.woff2") format("woff2");
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
}

@font-face {
  font-family: "Source Serif 4";
  src: url("../fonts/source-serif-4-latin-italic.woff2") format("woff2");
  font-style: italic;
  font-weight: 600 800;
  font-display: swap;
}

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

/* The [hidden] attribute must always win over a component's own display value.
   Without this, any element that sets its own display (flex/block/grid) silently
   stays visible and focusable even after JS sets hidden = true. */
[hidden] {
  display: none !important;
}

html {
  min-width: 20rem;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ay-color-ivory);
  color: var(--ay-color-ink);
  font-family: var(--ay-font-body);
  font-size: var(--ay-step-0);
  line-height: var(--ay-leading-body);
  text-rendering: optimizeLegibility;
}

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

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

a {
  color: var(--ay-color-navy);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--ay-color-paper);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px var(--ay-color-focus);
}

::selection {
  background: var(--ay-color-gold-soft);
  color: var(--ay-color-navy);
}

.ay-shell {
  width: min(calc(100% - clamp(2rem, 7vw, 7.5rem)), var(--ay-shell));
  margin-inline: auto;
}

.ay-reading {
  max-width: var(--ay-reading);
}

.ay-display,
.ay-heading {
  color: var(--ay-color-navy);
  font-family: var(--ay-font-display);
  font-weight: 600;
  text-wrap: balance;
}

.ay-display {
  max-width: 18ch;
  margin-block: 0 var(--ay-space-5);
  font-size: var(--ay-step-4);
  letter-spacing: -0.035em;
  line-height: var(--ay-leading-tight);
}

.ay-heading {
  margin-block: var(--ay-space-8) var(--ay-space-4);
  font-size: var(--ay-step-2);
  line-height: var(--ay-leading-heading);
}

.ay-copy {
  max-width: var(--ay-measure);
  margin-block: 0 var(--ay-space-5);
  color: var(--ay-color-ink-muted);
}

.ay-button,
.ay-control {
  min-width: var(--ay-target);
  min-height: var(--ay-target);
}

.ay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--ay-space-3);
  padding: 0.95rem 1.6rem;
  border: 0;
  border-radius: var(--ay-radius-control);
  background: var(--ay-color-gold);
  box-shadow: var(--ay-shadow-gold);
  color: #3a2700;
  font-weight: 750;
  line-height: 1.25;
  text-align: center;
  text-decoration: none;
  transition: transform 180ms var(--ay-ease-out), box-shadow 180ms var(--ay-ease-out), background 180ms var(--ay-ease-out);
}

.ay-button:hover {
  background: var(--ay-color-gold-dark);
  transform: translateY(-0.1rem);
}

.ay-button:active {
  transform: translateY(0);
  box-shadow: 0 0.4rem 0.9rem -0.4rem rgba(207, 138, 0, 0.4);
}

.ay-button--secondary {
  border-color: rgba(9, 43, 76, 0.5);
  background: var(--ay-color-paper);
  box-shadow: var(--ay-shadow-control);
  color: var(--ay-color-navy);
}

.ay-button--secondary:hover {
  border-color: var(--ay-color-navy);
  background: var(--ay-color-sage-soft);
  box-shadow: var(--ay-shadow-control);
  transform: translateY(-0.1rem);
}

.ay-button:disabled {
  cursor: not-allowed;
  opacity: 0.56;
}

.ay-field {
  display: grid;
  gap: var(--ay-space-2);
}

.ay-label {
  color: var(--ay-color-navy);
  font-weight: 700;
}

.ay-input {
  width: 100%;
  min-height: var(--ay-target);
  padding: 0.65rem 0.85rem;
  border: 1px solid var(--ay-color-line-strong);
  border-radius: var(--ay-radius-control);
  background: var(--ay-color-paper);
  color: var(--ay-color-navy);
}

.ay-input[aria-invalid="true"] {
  border-color: var(--ay-color-danger);
  box-shadow: 0 0 0 1px var(--ay-color-danger);
}

.ay-help,
.ay-error {
  margin: 0;
  font-size: var(--ay-step--1);
}

.ay-help {
  color: var(--ay-color-ink-muted);
}

.ay-error {
  color: var(--ay-color-danger);
  font-weight: 650;
}

.ay-message {
  max-width: 42rem;
  padding: var(--ay-space-4) var(--ay-space-5);
  border: var(--ay-border);
  border-radius: var(--ay-radius-panel);
  background: var(--ay-color-paper);
  box-shadow: var(--ay-shadow-control);
}

.ay-message--answer {
  margin-inline-start: auto;
  border-color: transparent;
  background: var(--ay-color-sage-soft);
}

.ay-progress {
  overflow: hidden;
  height: 0.35rem;
  border-radius: var(--ay-radius-round);
  background: var(--ay-color-line);
}

.ay-progress::before {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--ay-color-sage);
  content: "";
  transform: scaleX(var(--ay-progress, 0));
  transform-origin: left center;
  transition: transform var(--ay-duration-base) var(--ay-ease-out);
}

.ay-route-line {
  fill: none;
  stroke: var(--ay-color-gold);
  stroke-dasharray: 1;
  stroke-dashoffset: calc(1 - var(--ay-route-progress, 1));
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
  transition: stroke-dashoffset 700ms var(--ay-ease-out);
}

.ay-rule {
  border: 0;
  border-top: var(--ay-border);
  margin-block: var(--ay-space-7);
}

.ay-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[data-ay-message-reveal] {
  opacity: 1;
  transform: none;
}

.ay-motion-ready [data-ay-message-reveal]:not(.ay-is-visible) {
  opacity: 0;
  transform: translateY(0.6rem);
}

.ay-motion-ready [data-ay-message-reveal] {
  transition: opacity var(--ay-duration-base) var(--ay-ease-out), transform var(--ay-duration-base) var(--ay-ease-out);
}

@media (max-width: 40rem) {
  .ay-shell {
    width: min(calc(100% - 2rem), var(--ay-shell));
  }

  .ay-display {
    max-width: 16ch;
  }

  .ay-button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }

  .ay-motion-ready [data-ay-message-reveal]:not(.ay-is-visible) {
    opacity: 1;
    transform: none;
  }
}

@media (forced-colors: active) {
  :where(a, button, input, select, textarea, [tabindex]):focus-visible {
    outline: 3px solid Highlight;
    box-shadow: none;
  }

  .ay-button,
  .ay-input,
  .ay-message {
    border: 1px solid CanvasText;
  }
}
