/* AVA is built for partially-sighted users, so its own site had better be
   readable: large type, high contrast, generous spacing, no fixed pixel
   layouts that break on zoom. */

:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --ink: #16130f;
  --ink-soft: #4d453b;
  --rule: #e2dbcf;
  --accent: #a8431f;
  --accent-soft: #f6ece5;
  --measure: 40rem;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14120f;
    --surface: #1d1a16;
    --ink: #f2ede4;
    --ink-soft: #b5aa99;
    --rule: #35302a;
    --accent: #f08c5e;
    --accent-soft: #2a201a;
  }
}

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

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

body {
  margin: 0;
  padding: 2.5rem 1.25rem 6rem;
  background: var(--bg);
  color: var(--ink);
  font: 400 1.125rem/1.65 ui-sans-serif, system-ui, -apple-system,
        "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

main, header, footer { max-width: var(--measure); margin-inline: auto; }

h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); margin: 0 0 .5rem; letter-spacing: -.02em; }
h2 {
  font-size: 1.4rem; margin: 3rem 0 .75rem;
  padding-top: 1.5rem; border-top: 1px solid var(--rule);
}
h3 { font-size: 1.125rem; margin: 2rem 0 .5rem; color: var(--ink-soft); }

p, li { max-width: var(--measure); }
li { margin-bottom: .4rem; }

a { color: var(--accent); text-underline-offset: .18em; }
a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.lede { font-size: 1.3rem; color: var(--ink-soft); margin-bottom: 2.5rem; }

.eyebrow {
  font-size: .8rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}

.callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.callout p:first-child { margin-top: 0; }
.callout p:last-child { margin-bottom: 0; }

.langbar {
  display: flex; flex-wrap: wrap; gap: .75rem;
  margin-bottom: 2rem; padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--rule);
}
.langbar a {
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .3rem 1rem; text-decoration: none; font-size: .95rem;
}

footer {
  margin-top: 4rem; padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  color: var(--ink-soft); font-size: .95rem;
}

.skip {
  position: absolute; left: -9999px;
}
.skip:focus {
  position: static; display: inline-block; margin-bottom: 1rem;
}

/* ---- Project grid -------------------------------------------------------
   Each tile is a flat colour square with the project name underneath. The
   icon is a *background image* rather than an <img> on purpose: until the
   file exists the browser paints nothing and the flat colour stands on its
   own, where a missing <img> would show a broken-image glyph. So adding an
   icon later is a file drop into assets/tiles/ with no markup change.

   The label sits under the square, never on it, so tile colours never have
   to pass a contrast check against text — and the name stays readable when
   the page is zoomed, which is the standing rule for this site.           */

.grid li { margin-bottom: 0; max-width: none; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(8.5rem, 11rem));
  gap: 1.5rem;
  justify-content: start;
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
}

.tile {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.tile__art {
  display: block;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid var(--rule);
  background-color: var(--tile-bg, var(--rule));
  background-image: var(--tile-icon, none);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 62%;
  transition: transform .12s ease, box-shadow .12s ease;
}

.tile__name {
  display: block;
  margin-top: .7rem;
  font-weight: 600;
  font-size: 1.05rem;
}

.tile__note {
  display: block;
  color: var(--ink-soft);
  font-size: .92rem;
  line-height: 1.4;
}

.tile:hover .tile__art,
.tile:focus-visible .tile__art {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgb(0 0 0 / 18%);
}

.tile:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  .tile__art { transition: none; }
  .tile:hover .tile__art,
  .tile:focus-visible .tile__art { transform: none; }
}

/* Secondary links under the grid — small, quiet, still real targets. */
.subnav {
  display: flex; flex-wrap: wrap; gap: .5rem 1.25rem;
  margin-top: 2.5rem; font-size: .95rem;
}
