/* Hexagon-laadscherm (Het Glazen Huis). Alles onder .hx-loader / .hx-*; geen globale regels. */
.hx-loader {
  --hx-accent: var(--accent, #e7b46c);
  --hx-ink: var(--ink, #f6f1e8);
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-items: center; overflow: hidden;
  color: var(--hx-ink); font-family: Manrope, 'Inter', system-ui, sans-serif;
}
.hx-loader *, .hx-loader *::before, .hx-loader *::after { box-sizing: border-box; }

/* Achtergrond in een eigen laag, zodat die los van de zeshoeken kan wegvallen */
.hx-loader::before {
  content: ''; position: absolute; inset: 0; z-index: -1;
  background:
    radial-gradient(ellipse 70% 60% at 50% 42%, transparent 0%, #0b0c10 78%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='72' height='41.569'%3E%3Cpath d='M0 20.785 6 0h36l6 20.785L42 41.569H6zM48 20.785h24' fill='none' stroke='%23e7b46c' stroke-opacity='.07' stroke-width='.8'/%3E%3C/svg%3E") center / 72px 41.569px,
    radial-gradient(ellipse at 50% 40%, #25221d 0%, #111114 55%, #0b0c10 100%);
}

.hx-brand { position: absolute; top: 38px; left: 0; right: 0; text-align: center; font-size: 15px; letter-spacing: .32em; margin-right: -.32em; }
.hx-brand span { display: block; font-size: 8px; margin-top: 8px; letter-spacing: .58em; opacity: .8; }
.hx-content { width: min(620px, 100%); text-align: center; padding: 24px; }
.hx-art { position: relative; width: min(420px, 82vw, 52vh); margin: 0 auto; container-type: inline-size; }
.hx-art svg { display: block; width: 100%; height: auto; overflow: visible; }

/* Cellen: --hx-f (0..1) is hoe vol een cel is */
.hx-cell { --hx-f: 0; transform-box: fill-box; transform-origin: center; }
.hx-base {
  fill-opacity: calc(.025 + var(--hx-f) * .3);
  stroke: var(--hx-accent); stroke-opacity: calc(.16 + var(--hx-f) * .55); stroke-width: .8;
  transition: fill-opacity .5s ease, stroke-opacity .5s ease;
}
.hx-glow { fill: none; stroke: #fff1d6; stroke-width: 1.2; opacity: 0; animation: hx-wave 4.2s ease-in-out infinite; animation-delay: var(--hx-wave); }
.hx-filled .hx-glow { stroke: #fff6e4; }
.hx-stop { stop-color: var(--hx-accent); }

/* Glinstering en scanline, geknipt op de zeshoeken */
.hx-fx { pointer-events: none; mix-blend-mode: screen; }
.hx-sheen { transform: skewX(-18deg); animation: hx-sheen 5.5s cubic-bezier(.45, 0, .2, 1) infinite 1.2s; opacity: .55; }
.hx-scan { animation: hx-scan 3.8s linear infinite; opacity: .5; }

/* Kern: percentage + gouden lijn langs de rand */
.hx-core-bg { fill: #121317; stroke: rgba(231, 180, 108, .25); stroke-width: .8; }
.hx-track { fill: none; stroke: rgba(246, 241, 232, .08); stroke-width: 2; }
.hx-bar { fill: none; stroke: var(--hx-accent); stroke-width: 2; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; filter: drop-shadow(0 0 3px rgba(231, 180, 108, .6)); }
.hx-number {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: .08em;
  font-family: Italiana, 'EB Garamond', Georgia, serif; font-size: clamp(15px, 5.6cqw, 27px); line-height: 1;
  font-variant-numeric: lining-nums tabular-nums; pointer-events: none;
}
.hx-number small { font-family: Manrope, 'Inter', system-ui, sans-serif; font-size: .3em; color: var(--hx-accent); letter-spacing: .05em; transform: translateY(-.7em); }

.hx-title { margin: 26px 0 10px; font: 400 clamp(34px, 5vw, 52px)/1.05 Italiana, 'EB Garamond', Georgia, serif; letter-spacing: .01em; }
.hx-subtitle { margin: 0; text-transform: uppercase; letter-spacing: .34em; margin-right: -.34em; font-size: 10px; color: var(--hx-accent); }
.hx-subtitle::before { content: '·'; margin-right: .8em; opacity: .7; }
.hx-subtitle::after { content: '·'; margin-left: .8em; opacity: .7; }
.hx-label { margin: 28px 0 0; min-height: 16px; font-size: 11px; letter-spacing: .08em; color: #b9b2a6; }
.hx-footer { position: absolute; bottom: 32px; left: 0; right: 0; text-align: center; font-size: 8px; letter-spacing: .28em; color: #8f887c; }

/* Uitgang (~1,2 s): tekst eerst, cellen vallen van buiten naar binnen, achtergrond vervaagt mee */
.hx-ready { pointer-events: none; }
.hx-ready::before { animation: hx-fade .9s ease .25s forwards; }
.hx-ready .hx-brand, .hx-ready .hx-footer, .hx-ready .hx-title, .hx-ready .hx-subtitle, .hx-ready .hx-label { animation: hx-rise .45s ease forwards; }
.hx-ready .hx-fx { animation: hx-fade .25s ease forwards; }
.hx-ready .hx-cell { animation: hx-fall .62s cubic-bezier(.55, 0, .75, .4) forwards; animation-delay: var(--hx-exit); }
.hx-ready .hx-core, .hx-ready .hx-number { transform-box: fill-box; transform-origin: center; animation: hx-core .5s ease-in .58s forwards; }
.hx-ready .hx-number { transform-origin: 50% 50%; }

@keyframes hx-wave { 0%, 100% { opacity: 0; } 45% { opacity: .55; } }
@keyframes hx-sheen { from { transform: translateX(0) skewX(-18deg); } 60%, to { transform: translateX(980px) skewX(-18deg); } }
@keyframes hx-scan { from { transform: translateY(0); } to { transform: translateY(700px); } }
@keyframes hx-fade { to { opacity: 0; } }
@keyframes hx-rise { to { opacity: 0; transform: translateY(-8px); } }
@keyframes hx-fall { to { opacity: 0; transform: translateY(46px) rotate(9deg) scale(.82); } }
@keyframes hx-core { 30% { transform: scale(1.08); opacity: 1; } to { transform: scale(.6); opacity: 0; } }

@media (max-width: 480px) {
  .hx-brand { top: 30px; font-size: 13px; }
  .hx-title { margin-top: 22px; }
  .hx-subtitle { font-size: 9px; letter-spacing: .26em; margin-right: -.26em; }
  .hx-footer { bottom: 26px; font-size: 7px; }
}

@media (prefers-reduced-motion: reduce) {
  .hx-loader *, .hx-loader::before { animation: none !important; transition: none !important; }
  .hx-fx { display: none; }
  .hx-ready { animation: hx-fade .4s linear forwards !important; }
}
