/* =====================================================================
   LE BUNKER — Design System
   Glassmorphism + skeuomorphism, Plex amber identity, motion-aware.
   Authored for tools.bunkerbva.eu — shared across every page.
   ===================================================================== */

/* ---------- Design tokens ---------- */
:root {
  /* Backgrounds */
  --bg-0: #0a0a0c;
  --bg-1: #101013;
  --bg-2: #16161b;

  /* Plex amber identity */
  --amber: #e5a00d;
  --amber-bright: #ffba2e;
  --amber-deep: #b67c08;
  --amber-soft: rgba(229, 160, 13, 0.14);

  /* Glass surfaces */
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.10);
  --glass-border-strong: rgba(255, 255, 255, 0.16);
  --hairline: rgba(255, 255, 255, 0.08);

  /* Text */
  --text: #ededf1;
  --text-dim: #adadb8;
  --text-faint: #74747f;

  /* Status colors */
  --green: #34c759;
  --red: #ff453a;
  --orange: #ff9f0a;
  --blue: #0a84ff;
  --grey: #8e8e93;

  /* Geometry */
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --blur: 16px;
  --blur-strong: 26px;

  /* Elevation */
  --shadow-1: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.35);
  --shadow-2: 0 4px 10px rgba(0,0,0,.45), 0 18px 50px rgba(0,0,0,.5);
  --glow: 0 0 0 1px rgba(229,160,13,.35), 0 8px 30px rgba(229,160,13,.28);

  /* Layout */
  --maxw: 1120px;
  --nav-h: 68px;

  /* Motion */
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);

  --font-display: 'Roboto', system-ui, sans-serif;
  --font-body: 'Open Sans', system-ui, -apple-system, sans-serif;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  background: var(--bg-0);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
::selection { background: var(--amber); color: #1a1304; }

/* ---------- Ambient background (aurora + grain + vignette) ---------- */
.bg-stage {
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(60% 50% at 18% 8%, rgba(229,160,13,.18), transparent 60%),
    radial-gradient(55% 45% at 85% 18%, rgba(255,123,40,.12), transparent 60%),
    radial-gradient(70% 60% at 50% 110%, rgba(120,70,200,.10), transparent 60%),
    linear-gradient(180deg, var(--bg-1), var(--bg-0) 60%);
}
.bg-stage::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(40% 40% at 30% 30%, rgba(229,160,13,.10), transparent 70%),
    radial-gradient(35% 35% at 70% 60%, rgba(255,180,46,.08), transparent 70%);
  filter: blur(30px);
  animation: drift 24s var(--ease) infinite alternate;
}
/* Film grain */
.bg-stage::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: .05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@keyframes drift {
  0%   { transform: translate3d(0,0,0) scale(1); }
  100% { transform: translate3d(4%, 3%, 0) scale(1.12); }
}
@media (prefers-reduced-motion: reduce) {
  .bg-stage::before { animation: none; }
}

/* scroll progress */
.scroll-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, var(--amber-deep), var(--amber-bright));
  box-shadow: 0 0 12px rgba(229,160,13,.6);
  z-index: 200; transition: width .1s linear;
}

/* ---------- Layout helpers ---------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); }
.section { padding-block: clamp(2.5rem, 6vw, 5rem); }
.stack > * + * { margin-top: 1rem; }
.text-amber { color: var(--amber); }
.center { text-align: center; }

/* ---------- Navigation (glass, sticky, condensing) ---------- */
.nav {
  position: sticky; top: 0; z-index: 100;
  height: var(--nav-h);
  display: flex; align-items: center;
  backdrop-filter: blur(var(--blur-strong)) saturate(140%);
  -webkit-backdrop-filter: blur(var(--blur-strong)) saturate(140%);
  background: linear-gradient(180deg, rgba(12,12,14,.72), rgba(12,12,14,.45));
  border-bottom: 1px solid transparent;
  transition: height .35s var(--ease), background .35s var(--ease), border-color .35s var(--ease);
}
.nav.scrolled {
  height: 56px;
  background: linear-gradient(180deg, rgba(10,10,12,.92), rgba(10,10,12,.78));
  border-bottom-color: var(--hairline);
}
.nav__inner { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: clamp(1rem, 4vw, 2.5rem); display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-family: var(--font-display); font-weight: 900; letter-spacing: -.01em; font-size: 1.05rem; white-space: nowrap; }
.brand__logo {
  width: 30px; height: 30px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: linear-gradient(145deg, var(--amber-bright), var(--amber-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.5), 0 4px 12px rgba(229,160,13,.4);
  color: #1a1304; font-weight: 900;
}
.brand small { color: var(--text-faint); font-weight: 600; font-family: var(--font-body); }
.nav__links { display: flex; align-items: center; gap: .25rem; margin-left: auto; }
.nav__link {
  padding: .5rem .8rem; border-radius: 10px; color: var(--text-dim);
  font-size: .92rem; font-weight: 600; transition: color .2s var(--ease), background .2s var(--ease);
  position: relative; white-space: nowrap;
}
.nav__link:hover { color: var(--text); background: var(--glass); }
.nav__link.is-active { color: var(--amber); }
.nav__link.is-active::after {
  content: ""; position: absolute; left: .8rem; right: .8rem; bottom: 2px; height: 2px;
  background: var(--amber); border-radius: 2px; box-shadow: 0 0 8px var(--amber);
}
.nav__cta { margin-left: .35rem; }
.nav__burger {
  display: none; margin-left: auto; width: 42px; height: 42px; border-radius: 11px;
  background: var(--glass); border: 1px solid var(--glass-border); cursor: pointer;
  color: var(--text); align-items: center; justify-content: center;
}
.nav__burger svg { width: 22px; height: 22px; }

/* Mobile drawer */
.drawer {
  position: fixed; inset: 0; z-index: 150; visibility: hidden; opacity: 0;
  transition: opacity .3s var(--ease), visibility 0s .3s;
}
.drawer.open { visibility: visible; opacity: 1; transition: opacity .3s var(--ease); }
.drawer__scrim { position: absolute; inset: 0; background: rgba(0,0,0,.6); backdrop-filter: blur(6px); }
.drawer__panel {
  position: absolute; top: 0; right: 0; height: 100%; width: min(82vw, 340px);
  background: linear-gradient(180deg, rgba(20,20,24,.96), rgba(12,12,14,.98));
  backdrop-filter: blur(var(--blur-strong));
  border-left: 1px solid var(--glass-border);
  padding: 1.5rem 1.25rem; display: flex; flex-direction: column; gap: .35rem;
  transform: translateX(100%); transition: transform .38s var(--ease);
  box-shadow: -20px 0 60px rgba(0,0,0,.5);
}
.drawer.open .drawer__panel { transform: translateX(0); }
.drawer__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.drawer__close { width: 40px; height: 40px; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text); font-size: 1.5rem; cursor: pointer; line-height: 1; }
.drawer__link {
  display: flex; align-items: center; gap: .75rem; padding: .85rem 1rem; border-radius: 12px;
  color: var(--text-dim); font-weight: 600; transition: background .2s, color .2s;
}
.drawer__link:hover, .drawer__link.is-active { background: var(--glass); color: var(--text); }
.drawer__link .ic { font-size: 1.2rem; }
.drawer__sep { height: 1px; background: var(--hairline); margin: .75rem 0; }

/* ---------- Hero ---------- */
.hero { position: relative; padding-block: clamp(3rem, 9vw, 6.5rem) clamp(2rem, 5vw, 3.5rem); text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: .5rem; padding: .4rem .9rem; border-radius: 999px;
  background: var(--amber-soft); border: 1px solid rgba(229,160,13,.3); color: var(--amber-bright);
  font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  margin-bottom: 1.4rem;
}
.eyebrow .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 8px var(--amber); animation: pulse 2.4s var(--ease) infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

h1, .h1 {
  font-family: var(--font-display); font-weight: 900; line-height: 1.05; letter-spacing: -.025em;
  font-size: clamp(2.3rem, 6vw, 4rem);
}
.h1 .grad, h1 .grad {
  background: linear-gradient(120deg, var(--amber-bright), var(--amber) 45%, #ff7b28);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { color: var(--text-dim); font-size: clamp(1.02rem, 2.2vw, 1.2rem); max-width: 60ch; margin: 1.1rem auto 0; }

.page-head { text-align: center; padding-block: clamp(2rem, 5vw, 3.2rem) 1rem; }
.page-head h1 { font-size: clamp(1.9rem, 5vw, 3rem); }
.page-head .lede { margin-top: .8rem; }

/* ---------- Section titles ---------- */
.section-title {
  font-family: var(--font-display); font-weight: 700; font-size: clamp(1.35rem, 3vw, 1.7rem);
  color: var(--amber); margin-bottom: 1.25rem; padding-bottom: .6rem;
  border-bottom: 1px solid var(--hairline); display: flex; align-items: center; gap: .6rem;
}

/* ---------- Glass card ---------- */
.glass {
  position: relative; border-radius: var(--radius);
  background: linear-gradient(160deg, var(--glass-strong), var(--glass));
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(var(--blur)) saturate(130%);
  -webkit-backdrop-filter: blur(var(--blur)) saturate(130%);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.glass::before { /* top inner highlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(180deg, rgba(255,255,255,.10), transparent 28%);
  opacity: .8;
}
.card { padding: clamp(1.4rem, 3vw, 2rem); }

/* Tilt + spotlight reactive card */
.tilt {
  transform: perspective(900px) rotateX(var(--ry,0deg)) rotateY(var(--rx,0deg)) translateZ(0);
  transition: transform .25s var(--ease), box-shadow .3s var(--ease), border-color .3s var(--ease);
  transform-style: preserve-3d; will-change: transform;
}
.tilt::after { /* moving spotlight */
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: radial-gradient(220px circle at var(--mx,50%) var(--my,0%), rgba(255,255,255,.12), transparent 45%);
  opacity: 0; transition: opacity .3s var(--ease);
}
.tilt:hover::after { opacity: 1; }
.tilt:hover { border-color: var(--glass-border-strong); box-shadow: var(--shadow-2), 0 0 0 1px rgba(229,160,13,.18); }
@media (prefers-reduced-motion: reduce) { .tilt { transform: none !important; } }

/* ---------- Tool grid (hub) ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.4rem; }
.tool-card { display: flex; flex-direction: column; min-height: 230px; cursor: pointer; }
.tool-card__icon {
  width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem;
  background: linear-gradient(150deg, rgba(229,160,13,.22), rgba(229,160,13,.05));
  border: 1px solid rgba(229,160,13,.25);
  box-shadow: inset 0 1px 1px rgba(255,255,255,.18); margin-bottom: 1rem;
}
.tool-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.3rem; color: var(--text); margin-bottom: .5rem; }
.tool-card__desc { color: var(--text-dim); font-size: .94rem; flex-grow: 1; }
.tool-card__foot { display: flex; align-items: center; gap: .4rem; margin-top: 1.1rem; color: var(--amber); font-weight: 700; font-size: .92rem; }
.tool-card__foot .arrow { transition: transform .3s var(--ease); }
.tool-card:hover .tool-card__foot .arrow { transform: translateX(5px); }
.tool-card .ext-badge { position: absolute; top: 1rem; right: 1rem; font-size: .65rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text-faint); border: 1px solid var(--hairline); border-radius: 6px; padding: .15rem .4rem; }

/* ---------- Buttons (skeuomorphic) ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 12px; font-weight: 700; font-size: .96rem; cursor: pointer;
  border: 1px solid transparent; user-select: none; overflow: hidden;
  transition: transform .12s var(--ease), box-shadow .25s var(--ease), filter .2s var(--ease), background .2s var(--ease);
}
.btn--primary {
  color: #1c1404;
  background: linear-gradient(180deg, var(--amber-bright), var(--amber) 55%, var(--amber-deep));
  box-shadow: inset 0 1px 1px rgba(255,255,255,.55), inset 0 -2px 4px rgba(120,80,0,.4), 0 6px 18px rgba(229,160,13,.32);
}
.btn--primary:hover { filter: brightness(1.06); box-shadow: inset 0 1px 1px rgba(255,255,255,.6), 0 8px 26px rgba(229,160,13,.45); }
.btn--ghost { color: var(--text); background: var(--glass); border-color: var(--glass-border); box-shadow: inset 0 1px 1px rgba(255,255,255,.08); }
.btn--ghost:hover { background: var(--glass-strong); border-color: var(--glass-border-strong); }
.btn--danger { color: #fff; background: linear-gradient(180deg, #ff5a4f, #d6342a); box-shadow: inset 0 1px 1px rgba(255,255,255,.3), 0 6px 18px rgba(214,52,42,.35); }
.btn:active { transform: translateY(2px) scale(.99); }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: grayscale(.4); transform: none; }
.btn--block { width: 100%; }
.btn--sm { padding: .55rem 1rem; font-size: .86rem; border-radius: 10px; }
/* ripple */
.ripple { position: absolute; border-radius: 50%; transform: scale(0); background: rgba(255,255,255,.35); pointer-events: none; animation: ripple .6s var(--ease); }
@keyframes ripple { to { transform: scale(2.6); opacity: 0; } }

/* ---------- Inputs ---------- */
.field { display: block; margin-bottom: 1rem; }
.field > label { display: block; font-weight: 600; color: var(--text); margin-bottom: .5rem; }
.input, textarea.input, select.input {
  width: 100%; padding: .8rem .9rem; border-radius: 12px; color: var(--text); font-size: 1rem;
  background: rgba(0,0,0,.28); border: 1px solid var(--glass-border);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4); transition: border-color .2s, box-shadow .2s;
}
.input::placeholder { color: var(--text-faint); }
.input:focus, textarea.input:focus, select.input:focus {
  outline: none; border-color: var(--amber);
  box-shadow: inset 0 2px 6px rgba(0,0,0,.4), 0 0 0 3px rgba(229,160,13,.25);
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.6; }

/* ---------- Spinner ---------- */
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.25); border-top-color: currentColor; animation: spin 1s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Alerts ---------- */
.alert { padding: .85rem 1rem; border-radius: 12px; font-size: .92rem; border: 1px solid; }
.alert--error { color: #ffb4ae; background: rgba(255,69,58,.10); border-color: rgba(255,69,58,.4); }
.alert--info { color: #9bd2ff; background: rgba(10,132,255,.10); border-color: rgba(10,132,255,.4); }

/* ---------- Prose ---------- */
.prose { color: var(--text-dim); }
.prose p { margin-bottom: .9rem; }
.prose strong { color: var(--text); font-weight: 700; }
.prose a { color: var(--amber); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--amber-bright); }
.prose ul { margin: .5rem 0 1rem 1.3rem; }
.prose li { margin-bottom: .35rem; }
.prose code { background: rgba(0,0,0,.4); color: var(--amber); padding: .15em .45em; border-radius: 6px; font-size: .88em; }
.tip {
  background: var(--amber-soft); border-left: 3px solid var(--amber); border-radius: 10px;
  padding: 1rem 1.1rem; margin: 1.3rem 0; color: var(--text-dim);
}
.tip strong { color: var(--amber-bright); }

/* ---------- Accordion (FAQ) ---------- */
.accordion { border-radius: var(--radius); overflow: hidden; }
.acc-item + .acc-item { border-top: 1px solid var(--hairline); }
.acc-trigger {
  width: 100%; display: flex; align-items: center; gap: 1rem; text-align: left; cursor: pointer;
  padding: 1.15rem 1.3rem; background: transparent; border: 0; color: var(--text);
  font-family: var(--font-display); font-weight: 600; font-size: 1.08rem; transition: background .2s;
}
.acc-trigger:hover { background: var(--glass); }
.acc-trigger .chev { margin-left: auto; flex-shrink: 0; transition: transform .35s var(--ease); color: var(--amber); }
.acc-item.open .acc-trigger .chev { transform: rotate(180deg); }
.acc-body { max-height: 0; overflow: hidden; transition: max-height .4s var(--ease); }
.acc-body__inner { padding: 0 1.3rem 1.3rem; }
@media (prefers-reduced-motion: reduce) { .acc-body { transition: none; } }

/* status pill used inline in FAQ */
.status-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: middle; box-shadow: 0 0 8px currentColor; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 70ms); }
.reveal.in { opacity: 1; transform: none; }
.reveal--scale { transform: translateY(26px) scale(.96); }
.reveal--scale.in { transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ---------- Footer ---------- */
.footer { margin-top: clamp(3rem, 8vw, 6rem); padding-block: 2.5rem; border-top: 1px solid var(--hairline); text-align: center; color: var(--text-faint); font-size: .88rem; }
.footer a { color: var(--text-dim); }
.footer a:hover { color: var(--amber); }
.footer__links { display: flex; flex-wrap: wrap; gap: 1.2rem; justify-content: center; margin-bottom: 1rem; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 180; display: grid; place-items: center; padding: 1rem;
  background: rgba(0,0,0,.7); backdrop-filter: blur(8px); opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility 0s .3s; }
.modal.open { opacity: 1; visibility: visible; transition: opacity .3s var(--ease); }
.modal__box { width: min(520px, 100%); padding: clamp(1.4rem, 4vw, 2rem); transform: translateY(16px) scale(.97); transition: transform .35s var(--ease-spring); position: relative; max-height: 86vh; overflow-y: auto; }
.modal.open .modal__box { transform: none; }
.modal__box h3 { font-family: var(--font-display); color: var(--amber); font-size: 1.3rem; margin-bottom: 1rem; }
.modal__close { position: absolute; top: .8rem; right: .9rem; width: 36px; height: 36px; border-radius: 9px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-dim); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.modal__close:hover { color: var(--text); }
.modal__actions { display: flex; gap: .8rem; margin-top: 1.3rem; }
.modal__actions .btn { flex: 1; }

/* ---------- Pagination ---------- */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; margin-top: 2rem; }
.page-btn { min-width: 40px; padding: .5rem .7rem; border-radius: 10px; background: var(--glass); border: 1px solid var(--glass-border); color: var(--text-dim); cursor: pointer; font-weight: 600; transition: all .2s; }
.page-btn:hover:not(:disabled) { color: var(--amber); border-color: rgba(229,160,13,.4); }
.page-btn.active { background: linear-gradient(180deg, var(--amber-bright), var(--amber-deep)); color: #1c1404; border-color: transparent; }
.page-btn:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- Utilities ---------- */
.hidden { display: none !important; }
.muted { color: var(--text-faint); font-size: .86rem; }
.flex { display: flex; }
.spin-gap { gap: .5rem; }

/* ---------- Responsive ---------- */
@media (max-width: 820px) {
  .nav__links { display: none; }
  .nav__burger { display: inline-flex; }
}
