/* ==========================================================================
   ArchangelsBabe — "heavenly" theme
   Soft sky blue → blush pink → cream yellow, gold highlights, black text.
   ========================================================================== */

:root {
  --ink: #111111;
  --ink-soft: #2b2b33;
  --cloud: rgba(255, 255, 255, .94);
  --sky-1: #cfe5fa;
  --sky-2: #e4e5f8;
  --sky-3: #fde3ed;
  --sky-4: #fff3c9;
  --blue-chip: #dcecfb;
  --blue-line: #8fb5dc;
  --gold-1: #f8dc7e;
  --gold-2: #e3b53f;
  --gold-line: #b8861a;
  --gold-text: #7a5c0c;      /* darker gold, readable on white */
  --focus: #1a2f6b;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-head: 'Cormorant Garamond', Georgia, serif;
  --radius: 28px;
  --shadow: drop-shadow(0 8px 14px rgba(70, 110, 160, .22));
}

/* Accessibility fonts (set from the Options panel) */
@font-face {
  font-family: 'OpenDyslexic';
  src: url('https://cdn.jsdelivr.net/npm/@fontsource/opendyslexic@5/files/opendyslexic-latin-400-normal.woff2') format('woff2');
  font-display: swap;
}
html.font-atkinson  { --font-body: 'Atkinson Hyperlegible', system-ui, sans-serif; --font-head: 'Atkinson Hyperlegible', system-ui, sans-serif; }
html.font-dyslexic  { --font-body: 'OpenDyslexic', 'Comic Sans MS', sans-serif;     --font-head: 'OpenDyslexic', 'Comic Sans MS', sans-serif; }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; }
body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.55;
  color: var(--ink);
  background: linear-gradient(180deg, var(--sky-1) 0%, var(--sky-2) 32%, var(--sky-3) 64%, var(--sky-4) 100%) fixed;
  display: flex;
  flex-direction: column;
}
body::before { /* soft golden glow from above */
  content: ""; position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background: radial-gradient(ellipse 60% 38% at 50% -6%, rgba(255, 230, 140, .65), transparent 70%);
}
a { color: inherit; }
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 5px rgba(255, 255, 255, .9); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 8px; top: -60px; background: #fff; padding: 10px 14px; border-radius: 10px; z-index: 300; }
.skip-link:focus { top: 8px; }

/* ---------- Drifting clouds ---------- */
.sky { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.cloud {
  position: absolute; left: 0;
  width: 12em; height: 3.4em;
  background: #fff; border-radius: 3.4em;
  opacity: var(--op, .75);
  filter: blur(1.5px);
  transform: translateX(var(--xs, 20vw));
  animation: drift var(--dur, 120s) linear infinite;
  animation-delay: var(--delay, 0s);
}
.cloud::before, .cloud::after { content: ""; position: absolute; background: #fff; border-radius: 50%; }
.cloud::before { width: 5.2em; height: 5.2em; left: 1.6em; top: -2.6em; }
.cloud::after  { width: 6.6em; height: 6.6em; left: 4.6em; top: -3.6em; }
@keyframes drift { from { transform: translateX(-30vw); } to { transform: translateX(125vw); } }
html.reduce-motion .cloud { animation: none; }
@media (prefers-reduced-motion: reduce) { .cloud { animation: none; } }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(255, 255, 255, .78);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--gold-2);
}
.header-inner {
  max-width: 1200px; margin: 0 auto; padding: 8px 16px;
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
}
.brand {
  position: relative; text-decoration: none;
  font-family: var(--font-head); font-weight: 700; font-size: 1.7rem; letter-spacing: .01em;
  padding-top: 10px; margin-right: auto; white-space: nowrap;
}
.brand::before { /* the halo */
  content: ""; position: absolute; top: 0; left: 50%; width: 46px; height: 12px; margin-left: -23px;
  border: 3px solid var(--gold-2); border-radius: 50%; box-shadow: 0 0 8px rgba(227, 181, 63, .8);
}
.main-nav { order: 3; width: 100%; overflow-x: auto; scrollbar-width: none; position: relative; }
.main-nav::-webkit-scrollbar { display: none; }
.main-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; }
.main-nav a {
  display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 0 16px;
  border-radius: 999px; text-decoration: none; font-weight: 600; white-space: nowrap;
  border: 1.5px solid transparent;
}
.main-nav a:hover { background: var(--blue-chip); border-color: var(--blue-line); }
.main-nav a[aria-current="page"] { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-line); }
.main-nav a .ext { font-size: .8em; opacity: .7; }
@media (min-width: 900px) { .main-nav { order: 1; width: auto; } .opt-wrap { order: 2; } }

.opt-wrap { position: relative; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px; font-weight: 700; text-decoration: none;
  background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); border: 1.5px solid var(--gold-line); color: var(--ink);
}
.btn:hover { filter: brightness(1.05); box-shadow: 0 2px 10px rgba(227, 181, 63, .55); }
.btn.ghost { background: #fff; }
.btn.small { min-height: 40px; padding: 0 14px; font-size: .92rem; }
.options-panel {
  position: absolute; right: 0; top: calc(100% + 10px); width: min(340px, 92vw); z-index: 150;
  background: #fff; border: 2px solid var(--gold-2); border-radius: 22px; padding: 16px 18px;
  box-shadow: 0 14px 40px rgba(60, 90, 140, .3);
}
.options-panel[hidden] { display: none; }
.options-panel h2 { font-family: var(--font-head); margin: 0 0 8px; font-size: 1.4rem; }
.options-panel fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.options-panel legend, .options-panel .lbl { font-weight: 700; font-size: .9rem; margin-bottom: 6px; padding: 0; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button {
  min-height: 42px; padding: 0 12px; border-radius: 12px; background: #fff; border: 1.5px solid var(--blue-line);
}
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-line); font-weight: 700; }
.opt-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 44px; }
.opt-row input[type="checkbox"] { width: 24px; height: 24px; accent-color: var(--gold-2); }
.opt-row input[type="range"] { width: 100%; accent-color: var(--gold-2); }

/* ---------- Layout ---------- */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 16px 40px; }
.hero { text-align: center; padding: 18px 0 10px; }
.hero h1 { font-family: var(--font-head); font-size: clamp(2.2rem, 6vw, 3.6rem); line-height: 1.05; margin: 0 0 6px; }
.hero p { margin: 0 auto; max-width: 46ch; font-size: 1.08rem; color: var(--ink-soft); }
.hero .halo { display: block; width: 74px; height: 18px; margin: 0 auto 8px; border: 4px solid var(--gold-2); border-radius: 50%; box-shadow: 0 0 14px rgba(227, 181, 63, .85); }

.site-footer { text-align: center; padding: 22px 16px 30px; font-size: .92rem; color: var(--ink-soft); }
.site-footer a { text-underline-offset: 3px; }

/* ---------- Toolbar & category pills ---------- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 10px; }
.field {
  flex: 1 1 240px; min-height: 46px; padding: 0 16px; border-radius: 999px;
  background: rgba(255, 255, 255, .95); border: 1.5px solid var(--blue-line);
}
select.field { flex: 0 0 auto; padding-right: 12px; }
.pills {
  display: flex; gap: 6px; padding: 4px 2px 10px; margin: 0;
  overflow-x: auto; scrollbar-width: thin; list-style: none; position: relative;
  mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 12px, #000 calc(100% - 20px), transparent 100%);
}
@media (min-width: 900px) { .pills { flex-wrap: wrap; overflow: visible; mask-image: none; -webkit-mask-image: none; justify-content: center; } }
.pill {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px;
  min-height: 42px; padding: 0 12px; border-radius: 999px; font-weight: 600; font-size: .92rem; white-space: nowrap;
  background: rgba(255, 255, 255, .92); border: 1.5px solid var(--blue-line);
}
.pill:hover { background: var(--blue-chip); }
.pill[aria-pressed="true"] { background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); border-color: var(--gold-line); }
.pill .n { font-size: .78rem; opacity: .75; }
.result-count { margin: 4px 2px 0; font-size: .95rem; color: var(--ink-soft); }

/* ---------- Cloud cards ---------- */
.grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 310px), 1fr));
  gap: 18px 28px; padding-top: 14px; margin-top: 10px;
}
.card-wrap { position: relative; margin-top: 34px; filter: var(--shadow); }
.card {
  position: relative; background: var(--cloud); border-radius: var(--radius);
  padding: 24px 16px 18px; display: flex; flex-direction: column; gap: 10px; height: 100%;
}
.card > *:not(.p) { position: relative; z-index: 1; }
.p { position: absolute; background: var(--cloud); border-radius: 50%; z-index: 0; --s: 0%; }
.p1 { width: 32%; height: 64px; top: -28px; left: calc(7% + var(--s)); }
.p2 { width: 38%; height: 84px; top: -42px; left: calc(30% + var(--s)); }
.p3 { width: 28%; height: 60px; top: -26px; left: calc(60% + var(--s)); }
.p4 { width: 44px; height: 44px; top: 34px; left: -12px; }
.p5 { width: 52px; height: 52px; bottom: 26px; right: -14px; }
.card-wrap:nth-child(2n)  .p { --s: 5%; }
.card-wrap:nth-child(3n)  .p { --s: 11%; }
.card-wrap:nth-child(3n+1) .p5 { bottom: 70px; }

.imgbox { position: relative; border-radius: 20px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--blue-chip); }
.imgbox img { width: 100%; height: 100%; object-fit: cover; display: block; transition: filter .25s; }
.imgbox:not(.revealed) img { filter: blur(22px) saturate(.9); transform: scale(1.12); }
.veil {
  position: absolute; inset: 0; z-index: 3; width: 100%; border: 0; border-radius: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: rgba(255, 255, 255, .45); color: var(--ink); font-weight: 700;
}
.veil small { font-weight: 500; }
.veil > * { pointer-events: none; }
.imgbox.revealed .veil { display: none; }
.rehide {
  position: absolute; top: 8px; right: 8px; z-index: 4; min-height: 36px; padding: 0 12px; border-radius: 999px;
  background: rgba(255, 255, 255, .9); border: 1.5px solid var(--gold-line); font-size: .85rem; opacity: 0; transition: opacity .15s;
}
.imgbox.revealed:hover .rehide, .rehide:focus-visible { opacity: 1; }
@media (hover: none) { .imgbox.revealed .rehide { opacity: 1; } }
.credit {
  position: absolute; left: 8px; bottom: 8px; z-index: 2; max-width: calc(100% - 16px);
  padding: 3px 10px; border-radius: 999px; font-size: .8rem; background: rgba(255, 255, 255, .92);
  text-decoration: none; display: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.imgbox.revealed .credit { display: block; }
html.no-spoiler .veil, html.no-spoiler .rehide { display: none; }
html.no-spoiler .imgbox img { filter: none; transform: none; }
html.no-spoiler .imgbox .credit { display: block; }

.card h2 { font-family: var(--font-head); font-size: 1.55rem; line-height: 1.12; margin: 2px 0 0; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .88rem; color: var(--ink-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.chip {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 11px; border-radius: 999px;
  font-size: .82rem; font-weight: 600; background: var(--blue-chip); border: 1px solid var(--blue-line);
}
.chip.aud { background: #fff3c4; border-color: var(--gold-2); }
button.chip { min-height: 32px; cursor: pointer; }
button.chip:hover { background: #c9e0f7; }
.synopsis { margin: 0; font-size: .96rem; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.synopsis.open { display: block; }
.more { align-self: flex-start; background: none; border: 0; padding: 4px 0; min-height: 36px; font-weight: 700; color: var(--gold-text); text-decoration: underline; text-underline-offset: 3px; }
.tagbox { margin: 0; padding: 2px 0 0; }
.tagbox summary .n { font-weight: 500; font-size: .85em; opacity: .75; }
.tagbox .chips { padding: 4px 0 6px; }
.chip.tag { background: #fff; border-color: var(--blue-line); font-weight: 500; }
.meta a { text-underline-offset: 3px; }
.links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: auto; padding-top: 4px; }
.empty { text-align: center; padding: 40px 16px; font-size: 1.1rem; }

/* ---------- Art gallery ---------- */
.masonry { column-width: 250px; column-gap: 20px; margin-top: 18px; }
.art { break-inside: avoid; margin: 0 0 8px; padding-top: 48px; filter: var(--shadow); }
.art-inner { position: relative; background: var(--cloud); border-radius: var(--radius); padding: 12px 12px 14px; }
.art-inner > *:not(.p) { position: relative; z-index: 1; }
.art-inner .p1 { height: 52px; top: -22px; }
.art-inner .p2 { height: 70px; top: -36px; }
.art-inner .p3 { height: 48px; top: -20px; }
.art-inner .p4 { width: 38px; height: 38px; top: 28px; left: -10px; }
.art-inner .p5 { width: 44px; height: 44px; bottom: 40px; right: -11px; }
.art:nth-child(2n) .p { --s: 5%; }
.art:nth-child(3n) .p { --s: 11%; }
.art .imgbox { aspect-ratio: auto; border-radius: 16px; }
.art .imgbox img { height: auto; min-height: 140px; }
.art-open { position: absolute; inset: 0; z-index: 1; width: 100%; background: transparent; border: 0; }
.art-cap { padding: 8px 6px 0; font-size: .92rem; }
.art-cap b { font-family: var(--font-head); font-size: 1.2rem; display: block; line-height: 1.15; }
.art-cap a { text-underline-offset: 3px; }
dialog.lightbox { border: 3px solid var(--gold-2); border-radius: 26px; padding: 14px; max-width: min(960px, 94vw); background: #fff; color: var(--ink); }
dialog.lightbox::backdrop { background: rgba(40, 60, 100, .55); }
dialog.lightbox img { display: block; max-width: 100%; max-height: 72vh; margin: 0 auto; border-radius: 14px; }
.lb-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-top: 10px; }

/* ---------- Discord info page ---------- */
.panel { background: var(--cloud); border-radius: var(--radius); padding: 22px 22px 24px; filter: var(--shadow); margin: 26px 0 0; }
.panel h2 { font-family: var(--font-head); font-size: 1.8rem; margin: 0 0 8px; }
.steps { list-style: none; counter-reset: s; margin: 14px 0 0; padding: 0; display: grid; gap: 14px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 46px 1fr; gap: 14px; align-items: start; }
.steps li::before {
  content: counter(s); display: grid; place-items: center; width: 46px; height: 46px; border-radius: 50%;
  font-weight: 800; font-size: 1.2rem; background: linear-gradient(180deg, var(--gold-1), var(--gold-2)); border: 1.5px solid var(--gold-line);
}
.steps b { display: block; font-size: 1.08rem; }
.cta { text-align: center; margin-top: 22px; }
details { border-top: 1px solid var(--blue-line); padding: 6px 0; }
details summary { min-height: 44px; display: flex; align-items: center; font-weight: 700; cursor: pointer; }
details p { margin: 0 0 10px; }

/* ---------- Age gate ---------- */
html.age-locked body { overflow: hidden; }
html.age-locked body > *:not(.age-gate):not(.sky) { visibility: hidden; }
.age-gate { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; padding: 16px; background: rgba(207, 229, 250, .6); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); visibility: visible; }
.age-box { max-width: 460px; text-align: center; background: #fff; border: 3px solid var(--gold-2); border-radius: 30px; padding: 30px 26px; box-shadow: 0 20px 60px rgba(60, 90, 140, .35); }
.age-box h2 { font-family: var(--font-head); font-size: 2.1rem; margin: 6px 0 8px; }
.age-box .halo { display: block; width: 70px; height: 16px; margin: 0 auto; border: 4px solid var(--gold-2); border-radius: 50%; box-shadow: 0 0 12px rgba(227, 181, 63, .85); }
.age-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 18px; }

/* ---------- High contrast ---------- */
html.hc { --cloud: #ffffff; --blue-chip: #ffffff; --blue-line: #000; --gold-line: #000; --ink-soft: #000; --gold-text: #000; }
html.hc body { background: #fffbe8; }
html.hc body::before, html.hc .sky { display: none; }
html.hc .card, html.hc .art-inner, html.hc .panel, html.hc .pill, html.hc .chip, html.hc .field, html.hc .options-panel { border: 2px solid #000; }
html.hc .p { display: none; }
html.hc .site-header { background: #fff; border-bottom: 3px solid #000; }
html.hc .imgbox:not(.revealed) img { filter: blur(22px); }
