/* elitesoft — motion and light, on every page (assets/js/motion.js sets .has-motion).
 * One idea throughout: the page behaves like a drawing board under a lamp. Drawings are
 * scanned in, headings are set word by word, a warm light follows the pointer.
 * With «reduced motion», or without JavaScript, nothing here hides or moves anything. */

/* ---------- section heads: a dimension line that is drawn once ---------- */
.sec__head { position: relative; }
.sec__head::after { content: ''; position: absolute; left: 0; right: 0; bottom: calc(clamp(28px, 4vw, 52px) / -2); height: 1px; background: linear-gradient(90deg, var(--tungsten) 0, var(--tungsten-line) 12%, var(--line) 46%, transparent 100%); transform-origin: left; transition: transform 1200ms var(--ease-in-out) 120ms; pointer-events: none; }
.has-motion .sec__head[data-rv]:not(.is-in)::after { transform: scaleX(0); }

/* ---------- reveal on scroll ---------- */
.has-motion [data-rv="up"] { opacity: 0; transform: translateY(28px); }
.has-motion [data-rv="up"].is-in { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out) var(--rv-d, 0ms), transform 950ms var(--ease-out) var(--rv-d, 0ms); }

.has-motion [data-rv="head"] .w { display: inline-block; clip-path: inset(-0.3em -0.12em -0.28em); }
.has-motion [data-rv="head"] .w > span { display: inline-block; transform: translateY(150%) rotate(4deg); transform-origin: left bottom; }
.has-motion [data-rv="head"].is-in .w > span { transform: none; transition: transform 1000ms var(--ease-out) calc(var(--i, 0) * 60ms); }
.has-motion [data-rv="head"] > p, .has-motion [data-rv="head"] > .btn { opacity: 0; transform: translateY(14px); }
.has-motion [data-rv="head"].is-in > p, .has-motion [data-rv="head"].is-in > .btn { opacity: 1; transform: none; transition: opacity 700ms var(--ease-out) 320ms, transform 900ms var(--ease-out) 320ms; }

/* .es-motion is set in <head> (inc/setup.php), so titles rise from the first paint, not when motion.js runs */
.es-motion .hero__copy h1.rise[data-enter] { animation: none; }
.es-motion h1.rise .w { display: inline-block; clip-path: inset(-0.3em -0.12em -0.28em); }
.es-motion h1.rise .w > span { display: inline-block; animation: wordrise 1100ms var(--ease-out) calc(140ms + var(--i, 0) * 90ms) both; transform-origin: left bottom; }
@keyframes wordrise { from { transform: translateY(150%) rotate(5deg); } }

/* a drawing is scanned in from the left, the way a scanner head passes over it */
.has-motion [data-rv="scan"] { position: relative; }
.has-motion [data-rv="scan"] > svg { clip-path: inset(0 100% 0 0); }
.has-motion [data-rv="scan"].is-in > svg { clip-path: inset(0 0 0 0); transition: clip-path 1400ms var(--ease-in-out); }
.has-motion [data-rv="scan"]::after { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 2px; background: var(--tungsten); box-shadow: 0 0 26px 5px rgba(242, 176, 94, .45), 0 0 4px 1px rgba(242, 176, 94, .9); opacity: 0; pointer-events: none; }
.has-motion [data-rv="scan"].is-in::after { animation: scanline 1400ms var(--ease-in-out) both; }
@keyframes scanline { 0% { left: 0; opacity: 0; } 8%, 90% { opacity: 1; } 100% { left: calc(100% - 2px); opacity: 0; } }

/* ---------- a warm light under the pointer ---------- */
.is-lit { background-image: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 176, 94, .11), rgba(242, 176, 94, .03) 45%, transparent 70%); }
.hero__copy.is-lit { background-image: radial-gradient(620px circle at var(--mx, 50%) var(--my, 50%), rgba(242, 176, 94, .1), transparent 70%); }
.card.is-lit, .feat__item.is-lit, .chain__node.is-lit, .mini.is-lit, .rec.is-lit { border-color: rgba(242, 176, 94, .36); }

/* ---------- home: the strip of real screens and renders ---------- */
.reel { padding: clamp(20px, 3vw, 40px) 0 0; overflow: hidden; }
.reel__head { display: flex; align-items: center; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap; margin-bottom: 18px; }
.reel__head p { margin: 0; max-width: none; font-size: var(--t-sm); color: var(--muted); }
.reel__pause { min-height: 36px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-2); background: none; color: var(--ink-soft); font: 600 13px var(--sans); cursor: pointer; transition: border-color var(--d-fast) ease, color var(--d-fast) ease; }
.reel__pause:hover { border-color: var(--tungsten-line); color: var(--ink); }
.reel__rows { display: grid; gap: 14px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.reel__row { display: flex; width: max-content; }
.reel__track { list-style: none; margin: 0; padding: 0 14px 0 0; display: flex; gap: 14px; flex: none; animation: reel var(--reel-t, 80s) linear infinite; }
.reel__row:nth-child(even) .reel__track { animation-direction: reverse; }
/* the strip keeps moving under the pointer (Κώστας 2026-11-18); it stops for the keyboard and with «Pause motion» */
.reel:focus-within .reel__track, .reel.is-paused .reel__track { animation-play-state: paused; }
/* off screen (motion.js): the endless strips wait, and go on from the same place */
.reel.is-away .reel__track, .bf__tape.is-away .bf__tapein { animation-play-state: paused; }
@keyframes reel { to { transform: translateX(-100%); } }
.reel__tile { position: relative; display: block; height: clamp(140px, 16vw, 220px); aspect-ratio: var(--ar, 1.6); overflow: hidden; border-radius: var(--r); border: 1px solid var(--line-2); background: var(--surface); text-decoration: none; }
.reel__tile img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 900ms var(--ease-out), filter 400ms ease; filter: saturate(.92) brightness(.9); }
.reel__cap { position: absolute; inset: auto 0 0 0; display: grid; gap: 2px; padding: 44px 14px 12px; background: linear-gradient(180deg, transparent, rgba(7, 9, 12, .9) 62%); font: 600 17px/1.1 var(--display); letter-spacing: -0.02em; color: var(--ink); }
.reel__cap span { font: 500 12px/1.3 var(--sans); letter-spacing: 0; color: var(--tungsten); }
.reel__tile:hover img, .reel__tile:focus-visible img { transform: scale(1.06); filter: none; }
.reel__tile:focus-visible { outline: 2px solid var(--tungsten); outline-offset: -2px; }
@media (hover: none) { .reel__tile img { filter: none; } }

/* ---------- home: the opening products as a board, not eight equal cards ---------- */
.feat__art--photo .es-photo { transition: transform 900ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .feat__item:hover .feat__art--photo .es-photo { transform: scale(1.035); } }
@media (min-width: 1101px) {
  .feat { grid-auto-flow: dense; }
  .feat__item:first-child { grid-column: span 2; grid-row: span 2; grid-template-rows: minmax(0, 1fr) auto auto auto auto auto; }
  .feat__item:first-child .feat__art { aspect-ratio: auto; min-height: 300px; }
  .feat__item:first-child .feat__name { font-size: clamp(48px, 4.6vw, 72px); }
  .feat__item:nth-child(6) { grid-column: span 2; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); grid-template-rows: auto auto auto 1fr auto; column-gap: 22px; }
  .feat__item:nth-child(6) .feat__art { grid-column: 1; grid-row: 1 / -1; aspect-ratio: auto; min-height: 100%; margin: -22px 0 -20px -22px; border-bottom: 0; border-right: 1px solid var(--line); border-radius: var(--r) 0 0 var(--r); }
  .feat__item:nth-child(6) > :not(.feat__art) { grid-column: 2; }
}

/* ---------- reading progress under the header ---------- */
.sprog { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: linear-gradient(90deg, var(--tungsten), #FFD9A3); transform-origin: left; transform: scaleX(0); animation: sprog linear both; animation-timeline: scroll(root block); pointer-events: none; }
@keyframes sprog { to { transform: scaleX(1); } }

/* ---------- from page to page: a short cross-fade instead of a hard cut ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: vt-out 160ms ease both; }
  ::view-transition-new(root) { animation: vt-in 380ms cubic-bezier(0.23, 1, 0.32, 1) both; }
  .top { view-transition-name: es-top; }
}
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(8px); } }

/* ---------- reduced motion: the strip stands still and can be scrolled by hand ---------- */
@media (prefers-reduced-motion: reduce) {
  .sec__head::after, .reel__tile img, .feat__art--photo .es-photo { transition: none; }
  .reel__track { animation: none; }
  .reel__track[aria-hidden="true"] { display: none; }
  .reel__rows { overflow-x: auto; -webkit-mask-image: none; mask-image: none; }
  .feat__item:hover .feat__art--photo .es-photo { transform: none; }
  .sprog { display: none; }
}
