/* ==========================================================================
   elohim.ro — pagina principală
   Pânza e produsul. Graful ocupă tot ecranul, interfața plutește peste el.
   Lumină: hârtie caldă, cerneală fină, aur folosit cu zgârcenie.
   ========================================================================== */

:root {
  --paper:   #fbf9f4;   /* fundalul întregii pânze */
  --paper-2: #f4f1e9;
  --white:   #ffffff;

  --edge:    rgba(22,22,15,.10);
  --edge-2:  rgba(22,22,15,.19);

  --text:    #16160f;
  --dim:     #5b564c;
  --faint:   #948d80;

  --gold:    #957429;   /* accent care se citește pe deschis */
  --gold-2:  #7a5f20;

  --serif: "Newsreader", "Iowan Old Style", Georgia, serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono:  ui-monospace, "SF Mono", "Cascadia Mono", Menlo, monospace;

  --ease:  cubic-bezier(.22,.61,.36,1);
  --swift: cubic-bezier(.4,0,.2,1);
  --pad:   clamp(1rem, 2.4vw, 2.25rem);
  --drawer: 27rem;

  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }
p { margin: 0; }
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.022em; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
::selection { background: color-mix(in srgb, var(--gold) 24%, transparent); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 3px; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(22,22,15,.16); border-radius: 3px; }

/* ==========================================================================
   PÂNZA
   ========================================================================== */

.stage { position: fixed; inset: 0; }

.canvas { position: absolute; inset: 0; transition: opacity .65s var(--swift); }
/* preluăm gesturile: altfel browserul mută pagina în loc de hartă */
.canvas svg { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.canvas svg.drag { cursor: grabbing; }

/* Cât timp blocul central e pe ecran, harta se retrage în fundal: altfel
   nodurile și etichetele trec peste titlu. Revine la prima interacțiune. */
body.intro .canvas { opacity: .45; }
body.intro .nd text { display: none; }

/* lumină care cade de sus și o umbrire caldă la margini — adâncime, nu decor */
.stage::before,
.stage::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 1;
}
.stage::before {
  background:
    radial-gradient(52% 44% at 50% 2%, rgba(255,253,246,.95), transparent 72%),
    radial-gradient(40% 34% at 50% 30%, rgba(255,250,235,.55), transparent 74%);
}
.stage::after {
  background: radial-gradient(122% 96% at 50% 46%, transparent 54%, rgba(118,106,78,.13) 100%);
}

/* elementele grafului */
.ln { stroke: #16160f; stroke-opacity: .13; stroke-width: .65; transition: stroke-opacity .25s, stroke .25s; }
.ln.hot { stroke: var(--gold); stroke-opacity: .72; stroke-width: 1.1; }
.ln.cold { stroke-opacity: .04; }

.nd { cursor: pointer; transition: opacity .25s; }
.nd circle { transition: fill .25s, r .25s var(--ease); }
.nd.cold { opacity: .22; }
.nd.sel circle { stroke: var(--gold); stroke-width: 1.6; }
.nd text {
  font-family: var(--sans); font-size: 9px; fill: var(--dim);
  pointer-events: none; transition: fill .25s;
}
.nd.hot text { fill: var(--text); }
.canvas svg.tiny .nd text { display: none; }

/* intrarea în scenă */
.canvas g.fadein { opacity: 0; }
.canvas g.fadein.in { opacity: 1; transition: opacity 1.1s var(--ease); }

/* ==========================================================================
   INTERFAȚA PLUTITOARE
   ========================================================================== */

.float { position: fixed; z-index: 10; }

/* ---------------------------------------------------- bară de sus */

.bar {
  top: 0; left: 0; right: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1.5rem;
  padding: var(--pad);
  pointer-events: none;
}
.bar > * { pointer-events: auto; }

.mark {
  display: inline-flex; align-items: center; gap: 0.7rem;
  font-family: var(--serif); font-size: 1.0625rem;
  letter-spacing: 0.34em; text-transform: uppercase; color: var(--text);
}
.mark::before {
  content: ""; width: 8px; height: 8px; flex: none;
  border: 1px solid var(--gold); transform: rotate(45deg);
}

.links { display: flex; align-items: center; gap: 0.25rem; }
.links a {
  font-size: 0.8125rem; color: var(--dim);
  padding: 0.4rem 0.75rem; border-radius: 3px;
  transition: color .2s, background .2s;
}
.links a:hover { color: var(--text); background: rgba(22,22,15,.055); }

/* ---------------------------------------------------- blocul central */

.core {
  top: 50%; left: 50%;
  translate: -50% -50%;
  width: min(46rem, calc(100vw - var(--pad) * 2));
  text-align: center;
  transition: opacity .5s var(--swift), translate .5s var(--swift);
  /* blocul acoperă o bună parte din hartă; doar ce e de apăsat prinde
     atingerea, restul o lasă să treacă la noduri */
  pointer-events: none;
}
.core .seek, .core .starts { pointer-events: auto; }
.core.away {
  opacity: 0; translate: -50% calc(-50% - 2rem); pointer-events: none;
}

/* halou care desparte textul de hartă, fără o margine vizibilă */
.core::before {
  content: ""; position: absolute; inset: -16vh -14vw; z-index: -1;
  background: radial-gradient(56% 52% at 50% 48%,
              rgba(251,249,244,.96) 0%, rgba(251,249,244,.86) 44%, transparent 78%);
  pointer-events: none;
}

.core__eye {
  font-size: 0.625rem; font-weight: 500; letter-spacing: 0.26em;
  text-transform: uppercase; color: var(--gold-2); margin-bottom: 1.1rem;
}
.core h1 {
  font-size: clamp(2.1rem, 5.2vw, 3.9rem);
  line-height: 1.04; letter-spacing: -0.035em;
  margin-bottom: 0.85rem;
}
.core h1 em { font-style: italic; color: var(--gold); }
.core__lead {
  font-family: var(--serif); font-size: clamp(.98rem, 1.4vw, 1.1rem);
  color: var(--dim); max-width: 34rem; margin: 0 auto clamp(1.6rem, 3.5vh, 2.4rem);
}

/* ---------------------------------------------------- căutare */

.seek { position: relative; }
.seek__box {
  display: flex; align-items: center; gap: 0.8rem;
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(16px) saturate(1.2);
  border: 1px solid var(--edge-2);
  border-radius: 4px; padding: 0 1rem;
  transition: border-color .25s var(--ease), background .25s var(--ease), box-shadow .25s var(--ease);
}
.seek__box:focus-within {
  border-color: var(--gold);
  background: var(--white);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--gold) 13%, transparent);
}
.seek__box svg { width: 17px; height: 17px; color: var(--faint); flex: none; transition: color .25s; }
.seek__box:focus-within svg { color: var(--gold); }
.seek input {
  flex: 1; min-width: 0; background: none; border: 0; outline: none;
  color: var(--text); font-family: var(--serif);
  font-size: clamp(.98rem, 1.4vw, 1.1rem);
  padding: 0.95rem 0;
}
.seek input::placeholder { color: var(--faint); }
.seek__k {
  font-family: var(--mono); font-size: 0.5625rem; color: var(--faint);
  border: 1px solid var(--edge-2); border-radius: 2px; padding: 0.1rem 0.32rem; flex: none;
}

.seek__out {
  position: absolute; left: 0; right: 0; top: calc(100% + 0.5rem);
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(18px);
  border: 1px solid var(--edge-2); border-radius: 4px;
  overflow: hidden auto; max-height: min(26rem, 52vh);
  text-align: left; display: none; z-index: 3;
  box-shadow: 0 26px 60px -28px rgba(60,52,30,.4);
}
.seek__out.on { display: block; }
.hit {
  display: flex; align-items: baseline; gap: 0.8rem;
  padding: 0.62rem 0.95rem; border-bottom: 1px solid rgba(22,22,15,.07);
  cursor: pointer; width: 100%; text-align: left;
}
.hit:last-child { border-bottom: 0; }
.hit:hover, .hit.sel { background: rgba(149,116,41,.09); }
.hit b { font-family: var(--serif); font-weight: 400; font-size: 1rem; }
.hit em {
  font-style: normal; font-size: 0.8125rem; color: var(--faint); flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.hit i {
  font-style: normal; font-family: var(--mono); font-size: 0.5625rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-2); flex: none;
}
.seek__none { padding: 0.9rem 0.95rem; font-size: 0.8125rem; color: var(--faint); }

/* pastile de pornire */
.starts { display: flex; flex-wrap: wrap; gap: 0.4rem; justify-content: center; margin-top: 1.1rem; }
.starts button {
  font-size: 0.8125rem; color: var(--dim);
  border: 1px solid var(--edge); border-radius: 100px; padding: 0.3rem 0.8rem;
  background: rgba(255,255,255,.6);
  transition: border-color .2s, color .2s, background .2s;
}
.starts button:hover { border-color: var(--gold); color: var(--text); background: var(--white); }

/* căutare compactă, după ce blocul central se retrage */
.mini-seek {
  top: var(--pad); left: 50%; translate: -50% 0;
  width: min(30rem, calc(100vw - 20rem));
  opacity: 0; pointer-events: none;
  transition: opacity .4s var(--swift);
}
.mini-seek.on { opacity: 1; pointer-events: auto; }
.mini-seek .seek input { padding: 0.62rem 0; font-size: 0.9375rem; }

/* ---------------------------------------------------- filtre jos-stânga */

.filters {
  left: var(--pad); bottom: var(--pad);
  display: flex; flex-wrap: wrap; gap: 0.3rem; max-width: 30rem;
}
.filters button {
  font-size: 0.75rem; color: var(--dim);
  border: 1px solid var(--edge); border-radius: 100px;
  padding: 0.26rem 0.7rem;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(8px);
  transition: border-color .2s, color .2s, background .2s;
}
.filters button:hover { border-color: var(--edge-2); color: var(--text); background: var(--white); }
.filters button.on { background: var(--text); border-color: var(--text); color: var(--paper); }
.filters button i {
  font-style: normal; font-family: var(--mono); font-size: 0.5625rem;
  opacity: .62; margin-left: 0.32rem;
}

/* ---------------------------------------------------- stare jos-dreapta */

.state {
  right: var(--pad); bottom: var(--pad);
  display: flex; align-items: center; gap: 0.9rem;
  font-family: var(--mono); font-size: 0.5625rem;
  letter-spacing: 0.08em; color: var(--faint);
}
.state button {
  font-family: var(--sans); font-size: 0.75rem; letter-spacing: 0; color: var(--dim);
  border: 1px solid var(--edge); border-radius: 3px; padding: 0.26rem 0.6rem;
  background: rgba(255,255,255,.72); backdrop-filter: blur(8px);
  transition: border-color .2s, color .2s;
}
.state button:hover { border-color: var(--gold); color: var(--text); }

/* eticheta de sub cursor */
.tip {
  position: fixed; z-index: 12; pointer-events: none;
  background: rgba(255,255,255,.97); backdrop-filter: blur(10px);
  border: 1px solid var(--edge-2); border-radius: 3px;
  padding: 0.45rem 0.65rem; max-width: 17rem;
  translate: -50% calc(-100% - 13px);
  opacity: 0; transition: opacity .15s;
  box-shadow: 0 14px 30px -16px rgba(60,52,30,.4);
}
.tip.on { opacity: 1; }
.tip b { display: block; font-family: var(--serif); font-weight: 400; font-size: 0.9375rem; }
.tip i {
  font-style: normal; font-family: var(--mono); font-size: 0.5625rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--gold-2);
}
.tip span { display: block; font-size: 0.75rem; color: var(--faint); margin-top: 0.1rem; }

/* ==========================================================================
   SERTARUL DE DETALII
   ========================================================================== */

.drawer {
  top: 0; right: 0; bottom: 0; width: var(--drawer);
  max-width: 100vw;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(20px) saturate(1.1);
  border-left: 1px solid var(--edge-2);
  box-shadow: -24px 0 60px -40px rgba(60,52,30,.45);
  translate: 100% 0; opacity: 0;
  transition: translate .42s var(--ease), opacity .3s var(--ease);
  display: flex; flex-direction: column;
  z-index: 14;
}
.drawer.on { translate: 0 0; opacity: 1; }

.drawer__hd {
  padding: var(--pad) var(--pad) 1rem;
  border-bottom: 1px solid var(--edge);
  flex: none;
}
.drawer__top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 0.9rem; }
.drawer__kind {
  font-family: var(--mono); font-size: 0.5625rem; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--gold-2);
}
.drawer__x { color: var(--faint); padding: 0.25rem; line-height: 0; transition: color .2s; }
.drawer__x:hover { color: var(--text); }
.drawer__x svg { width: 17px; height: 17px; }

.drawer h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); line-height: 1.1; }
.drawer__sub { font-family: var(--serif); font-size: 1rem; color: var(--dim); margin-top: 0.4rem; }
.drawer__meta { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.9rem; }
.drawer__meta i {
  font-style: normal; font-family: var(--mono); font-size: 0.625rem;
  color: var(--dim); border: 1px solid var(--edge); border-radius: 2px; padding: 0.2rem 0.5rem;
}
.drawer__meta i.orig { font-family: var(--serif); font-size: 0.95rem; color: var(--gold); }

.drawer__body { flex: 1; overflow-y: auto; padding: 1.1rem var(--pad) var(--pad); }
.drawer__text {
  font-family: var(--serif); font-size: 1rem; line-height: 1.7; color: var(--dim);
  padding-bottom: 1.2rem; border-bottom: 1px solid var(--edge); margin-bottom: 1.2rem;
}

.grp { margin-bottom: 1.15rem; }
.grp > h3 {
  font-family: var(--sans); font-size: 0.5625rem; font-weight: 600;
  letter-spacing: 0.17em; text-transform: uppercase; color: var(--faint);
  margin-bottom: 0.5rem;
}
.grp > h3 b { font-family: var(--mono); font-weight: 400; color: var(--gold-2); }
.grp button {
  display: block; width: 100%; text-align: left;
  padding: 0.33rem 0; border-bottom: 1px solid rgba(22,22,15,.06);
  font-family: var(--serif); font-size: 0.9375rem; color: var(--dim);
  transition: color .2s, padding-left .2s var(--ease);
}
.grp button:last-child { border-bottom: 0; }
.grp button:hover { color: var(--gold); padding-left: 0.3rem; }

.drawer__ft { flex: none; padding: 0.9rem var(--pad); border-top: 1px solid var(--edge); }
.drawer__ft a {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 0.8125rem; color: var(--dim); transition: color .2s;
}
.drawer__ft a:hover { color: var(--gold); }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 900px) {
  .links a:not(.keep) { display: none; }
  .mini-seek { width: calc(100vw - 2 * var(--pad)); top: calc(var(--pad) + 3.2rem); }
  .filters { max-width: calc(100vw - 2 * var(--pad)); bottom: calc(var(--pad) + 2.2rem); }
  .state { bottom: var(--pad); }

  /* Pe telefon sertarul urcă de jos și lasă harta la vedere: altfel, pe toată
     lățimea, ar acoperi exact conexiunile pe care le-ai deschis. */
  .drawer {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: 56svh;
    translate: 0 100%;
    border-left: 0; border-top: 1px solid var(--edge-2);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -22px 55px -30px rgba(60,52,30,.5);
  }
  .drawer.on { translate: 0 0; }
  .drawer__hd { padding-top: 1.1rem; }
  .drawer__hd::before {
    content: ""; position: absolute; top: 0.45rem; left: 50%; translate: -50% 0;
    width: 2.25rem; height: 3px; border-radius: 2px; background: var(--edge-2);
  }
  .drawer__hd { position: relative; }
}

@media (max-width: 620px) {
  .core { width: calc(100vw - 2 * var(--pad)); }
  .core__lead { display: none; }
  .seek__k { display: none; }
  .filters { gap: 0.25rem; }
  .filters button { font-size: 0.6875rem; padding: 0.22rem 0.55rem; }
  .state { font-size: 0.5rem; gap: 0.6rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: .01ms !important; animation-duration: .01ms !important; }
  .canvas g.fadein { opacity: 1; }
}
