/* ==========================================================================
   Titlul animat TimeNest — „Time” scris cu peniță peste „NEST” din folie de jad
   1. NEST se condensează din ceață (spațiere largă → strânsă)
   2. „Time” este scris: conturul se desenează, apoi cerneala verde umple literele
   3. ornamentul (lăstar · ceas · lăstar) se desface
   4. o lumină trece lent peste NEST, din când în când
   Fără JS sau cu „reduce motion”: starea finală, statică.
   ========================================================================== */
.lux { display: block; width: 100%; max-width: 860px; user-select: none; }
.lux__svg { width: 100%; height: auto; overflow: visible; }

.lux__nest-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 200px;
  letter-spacing: 12px;
}
.lux__nest-shadow { fill: rgba(16, 41, 29, .12); filter: blur(3px); }
.lux__time {
  font-family: var(--font-script);
  font-size: 300px;
  stroke: #2F7350;
  stroke-width: 1.4;
  stroke-linejoin: round;
  stroke-dasharray: 900;
  stroke-dashoffset: 0;
  fill-opacity: 1;
}
.lux__reveal { transform-box: fill-box; transform-origin: left center; }
.lux__sheen { opacity: 0; }
.lux__sprig { color: #3E8A62; transform-box: fill-box; }
.lux__sprig--l { transform-origin: right center; }
.lux__sprig--r { transform-origin: left center; }
.lux__clock { transform-box: fill-box; transform-origin: center; }
.lux__clock-min { transform-box: view-box; transform-origin: 455px 434px; }
.lux__twinkles use { transform-box: fill-box; transform-origin: center; }

/* ---- Stări inițiale (doar când JS va porni animația) ---- */
.js .lux:not(.is-playing):not(.is-static) .lux__nest { opacity: 0; }
.js .lux:not(.is-playing):not(.is-static) .lux__reveal { transform: scaleX(0); }
.js .lux:not(.is-playing):not(.is-static) .lux__sprig { transform: scaleX(0); }
.js .lux:not(.is-playing):not(.is-static) .lux__clock { opacity: 0; }
.js .lux:not(.is-playing):not(.is-static) .lux__twinkles { opacity: 0; }

/* ---- Coregrafia ---- */
.lux.is-playing .lux__nest { animation: lux-condense 1.6s var(--ease) .05s both; }
.lux.is-playing .lux__reveal { animation: lux-sweep 2.1s var(--ease-in-out) .55s both; }
.lux.is-playing .lux__time { animation: lux-draw 2.5s var(--ease-in-out) .5s both, lux-ink 1.1s ease 1.9s both; }
.lux.is-playing .lux__sprig { animation: lux-unfurl 1s var(--ease) 2.35s both; }
.lux.is-playing .lux__clock { animation: lux-pop .6s var(--spring) 2.6s both; }
.lux.is-playing .lux__clock-min { animation: lux-turn 1.6s var(--ease-in-out) 2.7s both; }
.lux.is-playing .lux__twinkles { animation: lux-fade .8s ease 2.9s both; }
.lux.is-playing .lux__twinkles use,
.lux.is-static .lux__twinkles use { animation: lux-twinkle 3.6s ease-in-out 3.6s infinite; }
.lux.is-playing .lux__twinkles use:nth-child(2) { animation-delay: 4.6s; }
.lux.is-playing .lux__twinkles use:nth-child(3) { animation-delay: 5.4s; }
.lux.is-playing .lux__sheen,
.lux.is-static .lux__sheen { animation: lux-shine 7s var(--ease-in-out) 3.4s infinite; }

@keyframes lux-condense {
  0%   { opacity: 0; letter-spacing: 60px; filter: blur(14px); }
  60%  { filter: blur(0); }
  100% { opacity: 1; letter-spacing: 12px; filter: none; }
}
@keyframes lux-sweep  { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes lux-draw   { from { stroke-dashoffset: 900; } to { stroke-dashoffset: 0; } }
@keyframes lux-ink    { from { fill-opacity: 0; } to { fill-opacity: 1; } }
@keyframes lux-unfurl { from { transform: scaleX(0); opacity: 0; } to { transform: scaleX(1); opacity: 1; } }
@keyframes lux-pop    { from { opacity: 0; transform: scale(.3) rotate(-60deg); } to { opacity: 1; transform: none; } }
@keyframes lux-turn   { from { transform: rotate(-360deg); } to { transform: rotate(0); } }
@keyframes lux-fade   { from { opacity: 0; } to { opacity: 1; } }
@keyframes lux-twinkle { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .4; } }
@keyframes lux-shine {
  0%   { opacity: 0; transform: translateX(0) skewX(-18deg); }
  8%   { opacity: 1; }
  40%  { opacity: 1; transform: translateX(1300px) skewX(-18deg); }
  41%, 100% { opacity: 0; transform: translateX(1300px) skewX(-18deg); }
}

@media (prefers-reduced-motion: reduce) {
  .lux .lux__nest, .lux .lux__reveal, .lux .lux__time, .lux .lux__sprig, .lux .lux__clock,
  .lux .lux__clock-min, .lux .lux__twinkles, .lux .lux__twinkles use, .lux .lux__sheen {
    animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important;
    fill-opacity: 1 !important; stroke-dashoffset: 0 !important;
  }
  .lux .lux__sheen { opacity: 0 !important; }
}
