/* Antique Archive • final identity implementation starter
 * Canonical colors: Ink #30312D, Paper #F3F0E8, Accent #C49535.
 * This is a framework-neutral starter, not a full accessibility audit.
 * Paths resolve from THIS CSS FILE. Adapt paths if your build relocates it.
 * Keep fonts with the OFL notice in ../licenses/OFL-1.1.txt.
 */

@font-face {
  font-family: "Noto Serif";
  src: url("../fonts/NotoSerif-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("../fonts/NotoSerif-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: "Noto Serif";
  src: url("../fonts/NotoSerif-Italic.ttf") format("truetype");
  font-style: italic;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/NotoSans-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "Noto Sans";
  src: url("../fonts/NotoSans-Bold.ttf") format("truetype");
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  /* The only canonical brand color primitives. */
  --aa-ink: #30312D;
  --aa-paper: #F3F0E8;
  --aa-accent: #C49535;

  --aa-font-heading: "Noto Serif", Georgia, "Times New Roman", serif;
  --aa-font-body: "Noto Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --aa-weight-regular: 400;
  --aa-weight-bold: 700;
  --aa-text-small: 0.875rem;
  --aa-text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --aa-text-lead: 1.125rem;
  --aa-text-display: clamp(2.5rem, 2rem + 2.5vw, 3.5rem);
  --aa-text-h1: clamp(2rem, 1.5rem + 2.5vw, 2.5rem);
  --aa-text-h2: clamp(1.5rem, 1.25rem + 1.25vw, 1.75rem);
  --aa-text-h3: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --aa-leading-body: 1.6;
  --aa-leading-display: 1.1;
  --aa-leading-heading: 1.2;
  --aa-leading-section: 1.3;
  --aa-leading-control: 1.5;

  /* Recommended UI spacing and geometry, not additional logo rules. */
  --aa-space-1: 0.25rem;
  --aa-space-2: 0.5rem;
  --aa-space-3: 0.75rem;
  --aa-space-4: 1rem;
  --aa-space-6: 1.5rem;
  --aa-space-8: 2rem;
  --aa-space-12: 3rem;
  --aa-space-16: 4rem;
  --aa-content-max: 75rem;
  --aa-reading-max: 65ch;
  --aa-gutter: clamp(1rem, 4vw, 3rem);
  --aa-radius: 0.125rem;
  --aa-control-min: 2.75rem;
  --aa-duration: 160ms;
  --aa-easing: ease-out;
}

/* Theme semantic tokens are reassigned together, including local surfaces.
 * Keep the theme attribute on <html> for a whole-page theme.
 * Explicit only: system dark mode does not silently change brand presentation.
 */
:root,
[data-aa-theme="light"],
.aa-surface--paper {
  color-scheme: light;
  --aa-bg: var(--aa-paper);
  --aa-fg: var(--aa-ink);
  --aa-border: var(--aa-ink);
  --aa-focus: var(--aa-ink);
  --aa-action-bg: var(--aa-ink);
  --aa-action-fg: var(--aa-paper);
  --aa-action-hover-bg: var(--aa-paper);
  --aa-action-hover-fg: var(--aa-ink);
}
[data-aa-theme="dark"],
.aa-surface--ink {
  color-scheme: dark;
  --aa-bg: var(--aa-ink);
  --aa-fg: var(--aa-paper);
  --aa-border: var(--aa-paper);
  --aa-focus: var(--aa-paper);
  --aa-action-bg: var(--aa-paper);
  --aa-action-fg: var(--aa-ink);
  --aa-action-hover-bg: var(--aa-ink);
  --aa-action-hover-fg: var(--aa-paper);
}

/* Scoped baseline. Apply class="aa-site" to <body> or a full-page wrapper. */
.aa-site,
.aa-site *,
.aa-site *::before,
.aa-site *::after { box-sizing: border-box; }
.aa-site {
  margin: 0;
  background: var(--aa-bg);
  color: var(--aa-fg);
  font-family: var(--aa-font-body);
  font-weight: var(--aa-weight-regular);
  font-size: var(--aa-text-base);
  line-height: var(--aa-leading-body);
  font-synthesis: none;
  overflow-wrap: break-word;
}
.aa-surface--paper,
.aa-surface--ink {
  background: var(--aa-bg);
  color: var(--aa-fg);
}
.aa-site :where(h1, h2, h3, h4, h5, h6) {
  margin-block: 0 var(--aa-space-4);
  font-family: var(--aa-font-heading);
  font-weight: var(--aa-weight-regular);
  line-height: var(--aa-leading-heading);
  text-wrap: balance;
}
.aa-site h1 { font-size: var(--aa-text-h1); }
.aa-site h2 { font-size: var(--aa-text-h2); line-height: var(--aa-leading-section); }
.aa-site h3 { font-size: var(--aa-text-h3); line-height: var(--aa-leading-section); }
.aa-site .aa-display {
  font-family: var(--aa-font-heading);
  font-weight: var(--aa-weight-regular);
  font-size: var(--aa-text-display);
  line-height: var(--aa-leading-display);
  text-wrap: balance;
}
.aa-site :where(h4, h5, h6) { font-size: 1.125rem; }
.aa-site :where(p, ul, ol, figure) { margin-block: 0 var(--aa-space-6); }
.aa-site :where(strong, b) { font-weight: var(--aa-weight-bold); }
/* Noto Sans italic and serif bold italic are not bundled. Avoid faux faces. */
.aa-site em {
  font-family: var(--aa-font-heading);
  font-weight: var(--aa-weight-regular);
  font-style: italic;
}
.aa-site :where(img, svg, video) { max-inline-size: 100%; block-size: auto; }
.aa-site :where(button, input, select, textarea) { font: inherit; }
.aa-site :where(a) {
  color: var(--aa-fg);
  text-decoration-line: underline;
  text-underline-offset: 0.18em;
  text-decoration-thickness: 0.08em;
}
.aa-site :where(a:hover) { text-decoration-thickness: 0.14em; }
/* Visible focus is not an accent-only treatment. Keep space for the outline. */
.aa-site :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--aa-focus);
  outline-offset: 4px;
}
.aa-site :where([id]) { scroll-margin-block-start: 2rem; }

.aa-container {
  inline-size: 100%;
  max-inline-size: var(--aa-content-max);
  margin-inline: auto;
  padding-inline: var(--aa-gutter);
}
.aa-section { padding-block: clamp(2.5rem, 7vw, 6rem); }
.aa-prose { max-inline-size: var(--aa-reading-max); }
.aa-lead { font-size: var(--aa-text-lead); }
.aa-meta { font-size: var(--aa-text-small); }
.aa-stack > * + * { margin-block-start: var(--aa-space-6); }
.aa-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  gap: var(--aa-space-8);
}
.aa-grid > * { min-inline-size: 0; }
.aa-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--aa-space-4); }

/* Logo art must use the approved SVG files, never live typesetting. */
.aa-brand { display: inline-block; max-inline-size: 100%; }
.aa-brand img { display: block; inline-size: 100%; block-size: auto; }
/* Recommended canvas widths. Included SVG padding already supplies clear space. */
.aa-brand--horizontal { inline-size: clamp(240px, 24vw, 360px); }
.aa-brand--stacked { inline-size: 180px; }
.aa-brand--mark { inline-size: 40px; }

.aa-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--aa-space-2);
  min-block-size: var(--aa-control-min);
  max-inline-size: 100%;
  padding: 0.7rem 1.25rem;
  border: 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  background: var(--aa-action-bg);
  color: var(--aa-action-fg);
  font-family: var(--aa-font-body);
  font-size: var(--aa-text-base);
  font-weight: var(--aa-weight-bold);
  line-height: var(--aa-leading-control);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color var(--aa-duration) var(--aa-easing),
              color var(--aa-duration) var(--aa-easing);
}
.aa-button:hover {
  background: var(--aa-action-hover-bg);
  color: var(--aa-action-hover-fg);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}
.aa-button--secondary { background: var(--aa-bg); color: var(--aa-fg); }
.aa-button--secondary:hover { background: var(--aa-fg); color: var(--aa-bg); }
/* Optional accent-filled treatment. Ink text is required in both themes.
 * The ink border supplies a clear boundary against paper (gold/paper is <3:1).
 */
.aa-button--accent,
.aa-button--accent:hover {
  background: var(--aa-accent);
  color: var(--aa-ink);
  border-color: var(--aa-ink);
}
.aa-button:disabled,
.aa-button[aria-disabled="true"] {
  border-style: dashed;
  cursor: not-allowed;
  transition: none;
}
/* JS must suppress actions on aria-disabled links/custom controls. Native
 * <button disabled> is preferred. Explain why a control is unavailable. */
.aa-button:disabled:hover,
.aa-button[aria-disabled="true"]:hover { text-decoration: none; }

.aa-field { display: grid; gap: var(--aa-space-2); }
.aa-field label { font-weight: var(--aa-weight-bold); }
.aa-input {
  inline-size: 100%;
  min-block-size: var(--aa-control-min);
  border: 1px solid var(--aa-border);
  border-radius: var(--aa-radius);
  background: var(--aa-bg);
  color: var(--aa-fg);
  padding: 0.7rem 0.875rem;
}
.aa-input::placeholder { color: var(--aa-fg); opacity: 1; }
textarea.aa-input { min-block-size: 8rem; resize: vertical; }
.aa-input[aria-invalid="true"] { border-width: 2px; border-style: dashed; }
.aa-field-message { margin: 0; font-size: var(--aa-text-small); }
/* Label status in text; color is never the only success/error signal. */
.aa-notice { border: 1px solid var(--aa-border); padding: var(--aa-space-6); }
.aa-card { border-block-start: 1px solid var(--aa-border); padding-block: var(--aa-space-6); }
.aa-accent-rule {
  display: block;
  inline-size: 3rem;
  block-size: 3px;
  background: var(--aa-accent);
  margin-block: var(--aa-space-6);
}
.aa-badge {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border: 1px solid var(--aa-ink);
  background: var(--aa-accent);
  color: var(--aa-ink);
  font-size: var(--aa-text-small);
  font-weight: var(--aa-weight-bold);
}
.aa-sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.aa-skip-link {
  position: absolute;
  inset-inline-start: var(--aa-space-4);
  inset-block-start: var(--aa-space-4);
  transform: translateY(-250%);
  z-index: 100;
  background: var(--aa-bg);
  color: var(--aa-fg);
  padding: var(--aa-space-3) var(--aa-space-4);
  border: 1px solid var(--aa-border);
}
.aa-skip-link:focus { transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .aa-site { --aa-duration: 0ms; }
  .aa-site *, .aa-site *::before, .aa-site *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
@media (forced-colors: active) {
  .aa-site :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline-color: Highlight;
  }
  .aa-button, .aa-input, .aa-badge { border-color: ButtonText; }
  /* Keep forced-color adjustment enabled; do not preserve brand at its expense. */
}
