/* The Academy's front page (/academy, academy_pages/index; idea 46 "Homepage D", docs/idea/46-samples/d-mix.html): a
   paper-coloured front page in DM Serif Display and Archivo. Everything is under .ac; the find boxes and chips (.ac-js)
   show once academy-find connects (.finds). */
@font-face { font-family: "DM Serif Display"; src: url("/assets/dm-serif-display-latin-3f6a6125.woff2") format("woff2"); font-display: swap; unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "DM Serif Display"; src: url("/assets/dm-serif-display-latin-ext-5e515044.woff2") format("woff2"); font-display: swap; unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }

.ac {
  --paper: #fbf6ec; --ink: #1d1f3a; --muted: #5f5b6b; --rule: #1d1f3a; --hair: #e3dccd; --coral: #d9603f; --coral-ink: #a8432a; --teal: #1f6c69;
  --serif: "DM Serif Display", Georgia, serif;
  color-scheme: light; background: var(--paper); color: var(--ink); font-family: var(--font-sans, Archivo, system-ui, sans-serif);
}
.ac [hidden] { display: none !important; }
.ac:not(.finds) .ac-js { display: none; }
.ac ::selection { background: #f3d3c6; color: var(--ink); }
.ac input { caret-color: var(--coral-ink); }
.ac a { color: inherit; }
.ac h1, .ac h2, .ac h3 { font-family: var(--serif); font-weight: 400; }
.ac :focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; }
.ac-wrap { max-width: 90rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }
.ac-k { color: var(--coral-ink); font-size: .8rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.ac-k-quiet { color: var(--muted); }
.ac-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem; min-height: 44px; padding: .55rem 1.05rem;
  border: 2px solid var(--ink); border-radius: var(--radius-control, .625rem); background: var(--ink); color: var(--paper) !important;
  font: inherit; font-weight: 700; text-decoration: none; white-space: nowrap; cursor: pointer;
}
.ac-btn.ac-ghost { background: transparent; color: var(--ink) !important; }

/* Masthead */
.ac-mast { display: grid; gap: .6rem; padding: clamp(2rem, 5vw, 3.5rem) 0 1.4rem; border-bottom: 3px double var(--rule); text-align: center; }
.ac-mast h1 { margin: 0; font-size: clamp(3.4rem, 11vw, 8.5rem); line-height: .9; letter-spacing: -.01em; }
.ac-sub { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem 1.5rem; margin: 0; color: var(--muted); font-size: .95rem; font-weight: 700; }
.ac-sub b { color: var(--ink); }
.ac-topfind { display: grid; justify-items: center; gap: .6rem; width: min(38rem, 100%); margin: .6rem auto .2rem; }
.ac-topfind .ac-box { width: 100%; }
.ac-try { display: flex; flex-wrap: wrap; justify-content: center; gap: .3rem 1rem; }
.ac-try button { all: unset; padding: .45rem .1rem; border-radius: 4px; font-weight: 700; text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 4px; cursor: pointer; }
.ac-try button:hover { color: var(--coral-ink); }
.ac-try button:focus-visible { outline: 3px solid var(--coral); outline-offset: 2px; }

/* Find box */
.ac-box { position: relative; display: block; max-width: 44rem; }
.ac-box input {
  width: 100%; min-height: 3.4rem; padding: 0 1rem 0 3rem; border: 2px solid var(--ink); border-radius: var(--radius-control, .625rem);
  background: #fff; color: var(--ink); font: inherit; font-size: 1.1rem;
}
.ac-box svg { position: absolute; top: 50%; left: 1rem; width: 1.25rem; height: 1.25rem; translate: 0 -50%; pointer-events: none; }

/* This month: the lead story, Maya and the next issue */
.ac-front { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(0, 1fr); gap: clamp(1.25rem, 3vw, 2.5rem); padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-bottom: 1px solid var(--rule); scroll-margin-top: 4rem; }
.ac-lead { display: grid; align-content: start; gap: .9rem; text-decoration: none; }
.ac-lead .ac-pic { display: block; aspect-ratio: 1200 / 630; overflow: hidden; border-radius: 6px; background: #e9e0cf; }
.ac-lead img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.ac-lead:hover img { transform: scale(1.02); }
.ac-lead h2 { margin: 0; font-size: clamp(2.2rem, 4.6vw, 3.8rem); line-height: 1; }
.ac-lead-say { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem 1.1rem; }
.ac-lead-say .ac-line { font-size: clamp(1.05rem, 1.6vw, 1.3rem); }
.ac-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; }
.ac-side { display: grid; align-content: start; gap: 1.25rem; padding-left: clamp(1.25rem, 3vw, 2.5rem); border-left: 1px solid var(--hair); }
.ac-maya { display: grid; grid-template-columns: 8.5rem 1fr; align-items: start; gap: 1rem; text-decoration: none; }
.ac-maya img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border: 3px solid var(--ink); box-shadow: 4px 4px 0 var(--ink); }
.ac-ravi img { border: 0; border-radius: 10px; box-shadow: 0 12px 24px -14px rgba(20, 24, 40, .6); }
.ac-maya h3, .ac-soon h3 { margin: .35rem 0 .3rem; font-size: 1.55rem; line-height: 1.05; }
.ac-line { color: var(--muted); }
.ac-soon { display: grid; justify-items: start; gap: .5rem; padding: 1.1rem 1.2rem; border-radius: 10px; background: var(--teal); color: #fff; }
.ac-soon .ac-k { color: #bfe8e4; }
.ac-soon h3 { margin: 0; }
.ac-soon p { margin: 0 0 .3rem; color: #d7efec; }
.ac-soon .ac-btn { border-color: #fff; background: #fff; color: var(--teal) !important; }

/* The five cards */
.ac-strip { display: grid; gap: 1rem; padding: clamp(1.5rem, 3vw, 2.5rem) 0; border-bottom: 1px solid var(--rule); }
.ac-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1.2rem; }
.ac-head h2 { margin: 0; font-size: clamp(1.8rem, 3.4vw, 2.6rem); line-height: 1; }
.ac-more { margin-left: auto; font-weight: 700; text-decoration: none; }
.ac-more:hover { text-decoration: underline; }
.ac-cards { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.ac-cards a { display: grid; gap: .5rem; text-decoration: none; }
.ac-cards img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; border-radius: 8px; box-shadow: 0 10px 24px -14px rgba(29, 31, 58, .5); }
.ac-cards span { font-family: var(--serif); font-size: 1.15rem; line-height: 1.15; }

/* The printables: each one's real sheet, small (academy_pages/_paper; its look in academy_printable.css) */
.ac-prints ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.ac-prints a { display: grid; grid-template-columns: 8.5rem 1fr; gap: 1.25rem; align-items: center; height: 100%; padding: 1rem 1.25rem 1rem 1.5rem; border-radius: 12px; background: #ece3d1; text-decoration: none; }
.ac-prints a:hover { background: #e6dbc4; }
.ac-prints .ac-paper { rotate: -2deg; transition: rotate .2s ease; }
.ac-prints li:nth-child(2n) .ac-paper { rotate: 1.5deg; }
.ac-prints a:hover .ac-paper { rotate: 0deg; }
.ac-prints .ac-txt { display: grid; gap: .3rem; }
.ac-prints b { font: 400 1.6rem/1.05 var(--serif); }
.ac-prints small { color: var(--muted); font-size: .98rem; line-height: 1.35; }
.ac-item.ac-item-print .ac-pic { display: grid; place-items: start center; padding: .9rem 1.4rem 0; background: #ece3d1; }
.ac-item-print .ac-paper { width: 58%; }
.ac-item.ac-item-print h3 { font: 400 1.3rem/1.1 var(--serif); }

/* Find anything */
.ac-find { display: grid; gap: .9rem; padding: clamp(1.5rem, 3vw, 2.5rem) 0 4rem; scroll-margin-top: 1rem; }
.ac-chips { display: flex; gap: .45rem; padding: .1rem 0 .3rem; overflow-x: auto; scrollbar-width: thin; }
.ac-chip {
  flex: none; min-height: 40px; padding: .45rem .9rem; border: 1.5px solid #d9d0bf; border-radius: 999px; background: #fff;
  color: var(--ink); font: inherit; font-size: .95rem; font-weight: 700; cursor: pointer;
}
.ac-chip[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.ac-chip small { margin-left: .3rem; font-weight: 600; opacity: .7; }
.ac-count { margin: .2rem 0 .3rem; color: var(--muted); font-weight: 600; }

/* At rest: the nine chapters */
.ac-chapters { margin-top: .6rem; columns: 3 17rem; column-gap: 2.5rem; column-rule: 1px solid var(--hair); }
.ac-ch { margin: 0 0 1.75rem; break-inside: avoid; }
.ac-ch h3 { display: flex; align-items: baseline; gap: .6rem; margin: 0; font-size: 1.5rem; line-height: 1.1; }
.ac-ch h3 small { color: var(--coral-ink); font: 800 .8rem var(--font-sans, Archivo, sans-serif); letter-spacing: .12em; }
.ac-ch ul { display: grid; margin: .6rem 0 0; padding: 0; list-style: none; }
.ac-ch li a { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem; padding: .5rem 0; border-bottom: 1px dotted #cdc4b3; font-weight: 600; text-decoration: none; }
.ac-ch li a:hover { color: var(--coral-ink); }
.ac-in-story { flex: none; color: var(--teal); font-size: .78rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }

/* Results */
.ac-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: 1rem; margin: 0; padding: 0; list-style: none; }
.ac-item a { display: grid; grid-template-rows: auto 1fr; height: 100%; overflow: hidden; border-radius: 12px; background: #fff; text-decoration: none; box-shadow: 0 0 0 1px var(--hair); }
.ac-item a:hover { box-shadow: 0 12px 26px -16px rgba(29, 31, 58, .5), 0 0 0 2px var(--ink); }
.ac-item .ac-pic { display: block; aspect-ratio: 3 / 2; overflow: hidden; padding: .6rem .8rem 0; background: #eef0f8; }
.ac-item .ac-pic svg { display: block; width: 100%; height: 100%; }
.ac-txt { display: grid; align-content: start; gap: .3rem; padding: .75rem .9rem .9rem; }
.ac-txt .ac-k { font-size: .74rem; }
.ac-item h3 { margin: 0; font-family: var(--font-sans, Archivo, sans-serif); font-size: 1.05rem; font-weight: 700; line-height: 1.25; }
.ac-item-story .ac-pic { padding: 0; background: #e9e0cf; }
.ac-item-story .ac-pic > img { display: block; width: 100%; height: 100%; object-fit: cover; }
.ac-item-story h3 { font: 400 1.3rem/1.1 var(--serif); }
.ac-five { display: grid; grid-template-columns: repeat(5, 1fr); gap: .3rem; height: 100%; padding: .6rem; background: #f4ead6; }
.ac-five img { width: 100%; height: 100%; object-fit: cover; border-radius: 5px; }
.ac-empty { display: grid; justify-items: center; gap: .8rem; padding: 2.5rem 1rem; text-align: center; }
.ac-empty p { margin: 0; font-size: 1.1rem; }
.ac-more-btn { justify-self: start; }

/* A lesson's drawing (learn/drawings/<slug>.svg), in the same colours as its page (papers/learn.css .ln-draw) */
.ac-draw .d-ink, .ac-draw .d-ok, .ac-draw .d-check { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.ac-draw .d-ink { stroke: var(--color-ink); }
.ac-draw .d-ok { stroke: var(--color-ok); }
.ac-draw .d-check { stroke: #fff; }
.ac-draw .is-thin { stroke: var(--color-line-strong); stroke-width: 2; }
.ac-draw .is-dash { stroke: var(--color-ink-soft); stroke-dasharray: 1 7; }
.ac-draw .is-bold { stroke-width: 4.5; }
.ac-draw .d-paper, .ac-draw [class^="d-tint"], .ac-draw .d-soft-line { stroke: var(--color-ink); stroke-width: 2.5; stroke-linejoin: round; }
.ac-draw .d-paper { fill: var(--color-white); }
.ac-draw .d-soft-line { fill: var(--color-indigo-50); stroke-width: 2; }
.ac-draw .d-tint-a { fill: color-mix(in srgb, var(--color-indigo) 18%, var(--color-white)); }
.ac-draw .d-tint-b { fill: color-mix(in srgb, var(--color-key-amber) 30%, var(--color-white)); }
.ac-draw .d-tint-b-strong { fill: color-mix(in srgb, var(--color-key-amber) 60%, var(--color-white)); }
.ac-draw .d-tint-c { fill: color-mix(in srgb, var(--color-key-green) 26%, var(--color-white)); }
.ac-draw .d-tint-bad { fill: color-mix(in srgb, var(--color-bad) 18%, var(--color-white)); }
.ac-draw .d-wash-a { fill: color-mix(in srgb, var(--color-indigo) 22%, var(--color-white)); }
.ac-draw .d-shade { fill: color-mix(in srgb, var(--color-indigo) 14%, transparent); }
.ac-draw .d-mist { fill: var(--color-mist); }
.ac-draw .d-ink-fill { fill: var(--color-ink); }
.ac-draw .d-a { fill: var(--color-indigo); }
.ac-draw .d-b { fill: var(--color-key-amber); }
.ac-draw .d-c { fill: var(--color-key-green); }
.ac-draw .d-d { fill: var(--color-line-strong); }
.ac-draw .d-bad { fill: var(--color-bad); }

@media (max-width: 900px) {
  .ac-front { grid-template-columns: 1fr; }
  .ac-side { padding: 1.25rem 0 0; border-top: 1px solid var(--hair); border-left: 0; }
  .ac-cards { grid-template-columns: repeat(5, 72%); overflow-x: auto; padding-bottom: .5rem; scroll-snap-type: x mandatory; }
  .ac-cards li { scroll-snap-align: start; }
}
@media (max-width: 640px) {
  .ac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem; }
  .ac-item h3 { font-size: .98rem; }
}
@media (prefers-reduced-motion: reduce) {
  .ac-prints .ac-paper { transition: none; }
  .ac-lead img { transition: none; }
  .ac-lead:hover img { transform: none; }
}

/* The site's footer stays light under this always-light page, in the dark theme too. */
.site-foot { color-scheme: light; }
