/* Angel Numbers (Tool 15, prefix an-) — the lookup (night surface, one massive field) and the directory (architectural grid).
   Loaded through the `styles:` list in angel-numbers.njk, so it sits in <head>, BEFORE the tool kit's inline <style> blocks.
   Rules are scoped `.an .x`; where one restyles a kit class it carries one more class than the kit's `.tk .x`.
   Depends on tokens.css, partials/tool-kit-css.njk and partials/result-kit-css.njk.

   Language: the numeral is the interface. 800 weight, geometric, set very large; amber on night for the lookup, ink on white for the
   directory. No illustration, no glow beyond a soft halo behind the digits. */
.tk.an {
  --tk-accent: var(--accent-numerology, #D97706);
  --night: var(--bg-ink, #0B1020);
  --night-text: #F8FAFC;
  --night-muted: #94A3B8;
  --night-soft: #CBD5E1;
  --night-line: rgba(248, 250, 252, 0.14);
  --gold: #FBBF24;
}
.tk.an > * + * { margin-top: 16px; }
.tk.an > .tk-head { margin-bottom: 20px; }
.tk.an > .tk-head + * { margin-top: 0; }
.tk.an > .sr-only { margin: 0; }

/* ================= Lookup mode ================= */
.an .an-lookup { position: relative; overflow: hidden; border-radius: var(--r-card); background: var(--night); color: var(--night-text); padding: 32px 16px 28px; text-align: center; }
@media (min-width: 720px) { .an .an-lookup { padding: 56px 40px 44px; } }
.an .an-lookup::before { content: ""; position: absolute; left: 50%; top: -30%; width: 140%; aspect-ratio: 1; transform: translateX(-50%); background: radial-gradient(closest-side, rgba(251, 191, 36, 0.13), rgba(251, 191, 36, 0)); pointer-events: none; }
.an .an-lookup > * { position: relative; }
.an .an-ask { display: block; max-width: 22ch; margin: 0 auto; font-size: clamp(1.5rem, 1.1rem + 2.2vw, 2.5rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; text-wrap: balance; }
.an .an-field { position: relative; max-width: 760px; margin: 22px auto 0; }
.an .an-input { display: block; width: 100%; height: auto; padding: 4px 56px 6px; border: 0; border-bottom: 3px solid var(--night-line); border-radius: 0; background: transparent; color: var(--gold); font: inherit; font-weight: 800; font-size: clamp(3.5rem, 22vw, 8.5rem); line-height: 1.05; letter-spacing: -0.05em; text-align: center; caret-color: var(--gold); transition: border-color 0.2s; }
.an .an-input::placeholder { color: rgba(248, 250, 252, 0.16); }
.an .an-input:hover:not(:disabled) { border-color: rgba(248, 250, 252, 0.3); }
.an .an-input:focus { outline: none; border-color: var(--gold); box-shadow: none; }
.an .an-input:focus-visible { outline: none; }
.an .an-clear { position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--night-line); border-radius: 50%; background: rgba(248, 250, 252, 0.06); color: var(--night-soft); cursor: pointer; }
.an .an-clear:hover { background: rgba(248, 250, 252, 0.14); color: var(--night-text); }
.an .an-clear svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.an .an-lookup :focus-visible:not(.an-input) { outline: 3px solid color-mix(in srgb, var(--gold) 60%, transparent); outline-offset: 2px; border-radius: 6px; }
.an .an-hint { margin-top: 12px; font-size: 0.875rem; color: var(--night-muted); }
.an .an-note { max-width: 56ch; margin: 14px auto 0; padding: 10px 14px; border: 1px solid var(--night-line); border-radius: 12px; background: rgba(248, 250, 252, 0.05); font-size: 0.9375rem; font-weight: 600; color: var(--night-soft); }
.an .an-suggest { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; margin-top: 12px; }
.an .an-suggest-k { flex-basis: 100%; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--night-muted); }
.an .an-chip { min-width: 72px; height: 44px; padding: 0 16px; border: 1px solid var(--night-line); border-radius: 999px; background: rgba(248, 250, 252, 0.06); font: inherit; font-size: 1.125rem; font-weight: 800; color: var(--night-text); cursor: pointer; transition: background 0.15s, border-color 0.15s; }
.an .an-chip:hover { background: rgba(251, 191, 36, 0.16); border-color: var(--gold); color: var(--gold); }

/* the reading: opens from zero height */
.an .an-reveal { display: grid; grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows 0.45s var(--ease), visibility 0s linear 0.45s; }
.an .an-reveal[data-open="true"] { grid-template-rows: 1fr; visibility: visible; transition: grid-template-rows 0.45s var(--ease), visibility 0s; }
.an .an-reveal-in { overflow: hidden; min-height: 0; }
.an .an-card { margin: 28px auto 0; max-width: 760px; padding: 28px 16px 8px; border-top: 1px solid var(--night-line); text-align: center; }
@media (min-width: 720px) { .an .an-card { padding: 36px 24px 8px; } }
.an .an-card.is-in > * { animation: rise 0.55s var(--ease) both; }
.an .an-card.is-in > *:nth-child(2) { animation-delay: 0.04s; }
.an .an-card.is-in > *:nth-child(3) { animation-delay: 0.08s; }
.an .an-card.is-in > *:nth-child(4) { animation-delay: 0.12s; }
.an .an-card.is-in > *:nth-child(n+5) { animation-delay: 0.16s; }
.an .an-kick { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--night-muted); }
.an .an-big { margin: 6px 0 0; outline: none; font-weight: 800; font-size: clamp(5rem, 30vw, 11rem); line-height: 0.9; letter-spacing: -0.06em; color: var(--gold); text-shadow: 0 0 64px rgba(251, 191, 36, 0.3); }
.an .an-label { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--night-muted); }
.an .an-essence { margin-top: 18px; display: grid; gap: 10px; justify-items: center; }
.an .an-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.an .an-pills li { display: inline-flex; align-items: center; min-height: 36px; padding: 0 16px; border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 999px; background: rgba(251, 191, 36, 0.08); font-size: 1rem; font-weight: 800; letter-spacing: -0.01em; color: var(--night-text); }
.an .an-body { display: grid; gap: 22px; margin-top: 26px; text-align: left; }
@media (min-width: 720px) { .an .an-body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 36px; } }
.an .an-signal { margin-top: 8px; font-size: 1.125rem; font-weight: 600; line-height: 1.5; color: var(--night-text); }
.an .an-dir { padding-left: 16px; border-left: 3px solid var(--gold); }
.an .an-directive { margin-top: 8px; font-size: 1.125rem; font-weight: 800; line-height: 1.35; letter-spacing: -0.01em; color: var(--gold); }
.an .an-math { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 4px 14px; margin-top: 26px; padding: 12px 14px; border: 1px solid var(--night-line); border-radius: 12px; background: rgba(248, 250, 252, 0.05); font-size: 1.0625rem; font-weight: 700; color: var(--night-soft); }
.an .an-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 12px; margin-top: 18px; }
.an .an-actions .btn-sm { background: rgba(248, 250, 252, 0.06); border-color: var(--night-line); color: var(--night-text); }
.an .an-actions .btn-sm:hover:not(:disabled) { background: rgba(248, 250, 252, 0.14); border-color: rgba(248, 250, 252, 0.3); }
.an .an-actions .fine-print { margin: 0; color: var(--night-muted); }

/* ================= Directory mode ================= */
.an .an-grid { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .an .an-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 980px) { .an .an-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.an .an-cell { display: flex; min-width: 0; transition: opacity 0.25s; }
.an .an-cell.is-dim { opacity: 0.32; }
.an .an-tile { position: relative; display: flex; flex-direction: column; width: 100%; padding: 20px; border: 1px solid var(--c-line); border-radius: var(--r-box); background: #fff; transition: transform 0.2s var(--ease), box-shadow 0.2s, border-color 0.2s; }
.an .an-tile:hover { transform: translateY(-4px); box-shadow: 0 16px 32px -8px rgba(15, 23, 42, 0.1); border-color: color-mix(in srgb, var(--c-accent) 45%, #fff); }
.an .an-cell.is-match .an-tile { border-color: var(--c-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 22%, transparent); }
.an .an-cell.is-near .an-tile { border-style: dashed; border-color: var(--c-accent); }
.an .an-tile-h { margin: 0; line-height: 0.95; }
.an .an-tile-a { color: var(--c-ink); text-decoration: none; }
.an .an-tile-a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.an .an-tile-a:focus-visible { outline: none; }
.an .an-tile-a:focus-visible::after { outline: 3px solid color-mix(in srgb, var(--c-accent) 55%, transparent); outline-offset: 2px; }
.an .an-tile-n { display: block; font-size: clamp(3rem, 2.4rem + 2.4vw, 4.25rem); font-weight: 800; letter-spacing: -0.06em; line-height: 0.95; }
.an .an-tile-e { margin-top: 12px; font-size: 0.8125rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--c-accent-ink); }
.an .an-tile-s { margin-top: 10px; font-size: 0.9375rem; color: #334155; }
.an .an-tile-d { margin-top: 12px; padding-left: 12px; border-left: 3px solid var(--c-accent); font-size: 0.9375rem; font-weight: 700; line-height: 1.4; }
.an .an-tile-d b { display: block; margin-bottom: 2px; font-size: 0.6875rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c-muted); }
.an .an-tile-m { margin-top: auto; padding-top: 14px; font-size: 0.875rem; font-weight: 700; color: var(--c-muted); }

/* ================= Method ================= */
.an .an-rules { display: grid; gap: 14px 28px; }
@media (min-width: 720px) { .an .an-rules { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.an .an-rules dt { font-weight: 800; letter-spacing: -0.01em; }
.an .an-rules dd { margin-top: 2px; color: var(--c-muted); font-size: 0.9375rem; }
.an .an-digits { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .an .an-digits { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.an .an-digits li { display: flex; align-items: baseline; gap: 10px; padding: 10px 14px; border: 1px solid var(--c-line); border-radius: 12px; background: #fff; }
.an .an-digits b { font-size: 1.5rem; font-weight: 800; line-height: 1; }
.an .an-digits span { font-size: 0.875rem; font-weight: 700; color: var(--c-accent-ink); }

/* ---- Next ---- */
.an .an-nexts { display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 640px) { .an .an-nexts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.an .sub-h { margin: 22px 0 10px; }
