/* /arti page styles. Mobile-first (min-width queries only). Every color is a token from styles.css :root;
   transparency is color-mix() on a token, so there are no raw hex/rgb/hsl values in this file.
   The quiz engine's --qz-* variables are mapped onto the site's tokens at the bottom. */

.ap { --arti-cedar: var(--cedar); --arti-bg: var(--bg); }

/* ---------- hero: Arti first ---------- */
.ap-hero { position: relative; overflow: hidden; text-align: center; padding: clamp(6.5rem, 14vh, 9rem) 0 clamp(2rem, 5vh, 3rem); }
.ap-hero > .container { position: relative; z-index: 1; }
.ap-glow { position: absolute; left: 50%; top: 6%; width: min(720px, 90vw); aspect-ratio: 1; translate: -50% 0; border-radius: 50%; pointer-events: none;
           background: radial-gradient(circle, var(--gold-glow) 0%, transparent 68%); }

/* Arti: the carved bezel image with his live SVG face on top (same geometry as the chat widget's avatar). */
.ap-bezel { position: relative; aspect-ratio: 1; background: url('/images/arti-bezel.webp') center / contain no-repeat;
            filter: drop-shadow(0 18px 28px color-mix(in srgb, var(--bg) 85%, transparent)); }
.ap-bezel .arti-face { position: absolute; left: 17%; top: 23%; width: 66%; height: 55%; }
.ap-face-host { display: contents; }
.ap-big { width: clamp(168px, 24vw, 264px); margin: 0 auto 1.4rem; }

.ap-h1 { font-family: var(--serif); font-weight: 700; color: var(--kiln); letter-spacing: -0.02em; line-height: 1.04;
         font-size: clamp(2.75rem, 7vw, 5rem); text-wrap: balance; margin: 0; }
.ap-sub { font-family: var(--body); color: var(--barn); font-size: clamp(1.02rem, 1.3vw, 1.2rem); line-height: 1.65; max-width: 34rem; margin: 1.1rem auto 0; }

.ap-cta { display: grid; grid-template-columns: 1fr; gap: 0.9rem; margin: 1.8rem auto 0; max-width: 34rem; }
.ap-cta .btn { min-height: 48px; justify-content: center; padding-inline: 1.2rem; }
@media (min-width: 600px) { .ap-cta { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* The eight expressions: a row of small bezels that also works as the gallery. */
.ap-faces[hidden], .ap-pause[hidden] { display: none; }
.ap-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.5rem 0.4rem; max-width: 44rem; margin: 2.2rem auto 0; padding: 0; list-style: none; }
@media (min-width: 720px) { .ap-row { grid-template-columns: repeat(8, 1fr); } }
.ap-chip { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; width: 100%; min-height: 44px; padding: 0.3rem 0.1rem; border: 0; background: none; cursor: pointer;
           font-family: var(--mono); font-size: 0.75rem; letter-spacing: 0.02em; color: var(--barn); }
.ap-bezel--chip { width: clamp(52px, 8.5vw, 68px); opacity: 0.62; transition: opacity 0.3s, filter 0.3s; }
.ap-chip:hover { color: var(--kiln); }
.ap-chip:hover .ap-bezel--chip { opacity: 0.9; }
.ap-chip[aria-pressed="true"] { color: var(--gold); }
.ap-chip[aria-pressed="true"] .ap-bezel--chip { opacity: 1; filter: drop-shadow(0 8px 10px color-mix(in srgb, var(--gold) 32%, transparent)); }
.ap-chip:focus-visible, .ap-pause:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
.ap-pause { display: block; margin: 1rem auto 0; min-height: 44px; padding: 0.5rem 1rem; font-family: var(--mono); font-size: 0.8rem; color: var(--barn);
            background: none; border: 1px solid color-mix(in srgb, var(--barn) 40%, transparent); border-radius: 2px; cursor: pointer; }
.ap-pause:hover { color: var(--kiln); border-color: var(--barn); }

/* Reading text only fades in (never moves); the glow breathes behind it. Content is visible without any of this. */
@media (prefers-reduced-motion: no-preference) {
  .ap-fade { animation: apFade 0.7s ease-out both; }
  .ap-sub.ap-fade { animation-delay: 0.15s; }
  .ap-cta.ap-fade { animation-delay: 0.3s; }
  .ap-glow { animation: apBreathe 7s ease-in-out infinite; }
  @keyframes apFade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes apBreathe { 0%, 100% { opacity: 0.75; scale: 1; } 50% { opacity: 1; scale: 1.06; } }
}

/* ---------- quiz ---------- */
.ap-quiz { padding: 1rem 0 clamp(3rem, 7vw, 5rem); }
.ap-quiz .container { max-width: 760px; }
.ap-quiz__mount { scroll-margin-top: 6rem; }
.ap-quiz__fallback { color: var(--barn); margin: 0; }
.ap-quiz__fallback a, .ap-prose a, .ap-lead a { color: var(--gold); text-decoration: underline; text-underline-offset: 0.18em; }
.ap-quiz__fallback a:hover, .ap-prose a:hover, .ap-lead a:hover { color: var(--kiln); }
.ap-quiz__fallback a:focus-visible, .ap-prose a:focus-visible, .ap-lead a:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* Map the engine's variables onto the site's tokens. */
.ap-quiz .qz {
  --qz-bg: var(--bg2);
  --qz-surface: var(--bg3);
  --qz-text: var(--lime);
  --qz-muted: var(--barn);
  --qz-accent: var(--gold);
  --qz-accent-text: var(--bg);
  --qz-border: color-mix(in srgb, var(--barn) 40%, transparent);
  --qz-radius: 4px;
  --qz-focus-ring: 0 0 0 3px color-mix(in srgb, var(--gold) 60%, transparent);
  font-family: var(--body);
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 12px;
  box-shadow: 0 24px 48px color-mix(in srgb, var(--bg) 80%, transparent);
}
.ap-quiz .qz h2, .ap-quiz .qz legend { font-family: var(--serif); color: var(--kiln); line-height: 1.3; }
/* Engine leaves these unstyled. Result actions get room; each gap note reads as its own small card. */
.ap-quiz .qz__result-link { display: inline-flex; align-items: center; min-height: 44px; margin: 0 1.1rem 0.4rem 0; }
.ap-quiz .qz__btn--cta { margin-bottom: 0.4rem; }
.ap-quiz .qz__result-note { margin: 0.55rem 0 0; padding: 0.7rem 0.95rem; text-align: left; line-height: 1.55; color: var(--sand);
  background: var(--bg3); border: 1px solid color-mix(in srgb, var(--barn) 22%, transparent); border-radius: 4px; }
.ap-quiz .qz__result .qz__btn--ghost { margin-top: 1.3rem; }
.ap-quiz .qz__result--nomatch .qz__result-link { display: inline-flex; align-items: center; min-height: 48px; padding: 0 1.4rem; margin-top: 0.4rem; color: var(--bg);
  font-family: var(--mono); font-weight: 600; letter-spacing: 0.04em; text-decoration: none; border-radius: 2px;
  background: linear-gradient(135deg, var(--cedar) 0%, var(--amber) 100%); }
.ap-quiz .qz__result--nomatch .qz__result-link:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; }

/* ---------- content blocks ---------- */
.ap-block { padding: clamp(2.5rem, 6vw, 4.5rem) 0; border-top: 1px solid color-mix(in srgb, var(--barn) 18%, transparent); }
.ap-cols { display: grid; gap: 1.4rem 3rem; }
@media (min-width: 900px) { .ap-cols { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.6fr); } }
.ap-narrow { max-width: 46rem; }
.ap-h2 { font-family: var(--serif); font-weight: 700; color: var(--kiln); font-size: clamp(1.7rem, 3.2vw, 2.3rem); line-height: 1.15; letter-spacing: -0.01em; text-wrap: balance; margin: 0; }
.ap-prose { max-width: 42rem; }
.ap-lead { font-family: var(--body); font-size: clamp(1.05rem, 1.5vw, 1.2rem); line-height: 1.7; color: var(--chalk); margin: 0; }
.ap-dl { margin: 1.2rem 0 0; }
.ap-dl > div { padding: 1.05rem 0; border-top: 1px solid color-mix(in srgb, var(--barn) 18%, transparent); }
.ap-dl > div:first-child { border-top: 0; padding-top: 0; }
.ap-dl dt { font-family: var(--serif); font-style: italic; font-weight: 700; color: var(--gold); font-size: 1.12rem; margin: 0 0 0.3rem; }
.ap-dl dd { margin: 0; color: var(--sand); line-height: 1.7; }
.ap-close .ap-cta { margin-left: 0; margin-right: 0; margin-top: 1.6rem; }
.ap-close .ap-lead { margin-top: 1rem; }
