/* ============================================================
   ВАЛЬКІРІЯ — core stylesheet
   ============================================================ */

:root {
  --bg: #0a0a0b;
  --bg-soft: #111113;
  --panel: #141417;
  --line: #27272c;
  --text: #f3f3ee;
  --muted: #97978f;
  --accent: #ccff33;
  --accent-2: #aee000;
  --accent-rgb: 204,255,51;
  --gold: #ffd66b;
  --grad: linear-gradient(120deg, #ccff33 0%, #a6e000 100%);
  --grad-soft: linear-gradient(120deg, rgba(204,255,51,.12), rgba(204,255,51,.04));
  --radius: 18px;
  --maxw: 1280px;
  --ease: cubic-bezier(.16,1,.3,1);
  --font: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }
html.lenis { scroll-behavior: auto; }
.lenis.lenis-smooth { scroll-behavior: auto; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

body.loading { overflow: hidden; height: 100vh; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
ul { list-style: none; }
section { position: relative; }

::selection { background: var(--accent); color: #04111a; }

/* background grain + aurora ---------------------------------- */
.bg-fx {
  position: fixed; inset: 0; z-index: -3; pointer-events: none;
  background:
    radial-gradient(80vw 60vw at 50% -20%, rgba(204,255,51,.05), transparent 55%),
    radial-gradient(60vw 60vw at 100% 110%, rgba(204,255,51,.04), transparent 55%);
}
/* three.js canvas */
#bg-canvas { position: fixed; inset: 0; z-index: -2; pointer-events: none; opacity: 0; transition: opacity 1.2s ease; }
#bg-canvas.ready { opacity: 1; }
.grain {
  position: fixed; inset: -50%; z-index: -1; pointer-events: none; opacity: .05;
  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='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 8s steps(6) infinite;
}
@keyframes grain {
  0%,100%{transform:translate(0,0)} 20%{transform:translate(-5%,3%)}
  40%{transform:translate(3%,-4%)} 60%{transform:translate(-3%,5%)} 80%{transform:translate(4%,2%)}
}

/* container -------------------------------------------------- */
.container { width: min(100% - 48px, var(--maxw)); margin-inline: auto; }

/* ===== custom cursor ===== */
.cursor, .cursor-dot {
  position: fixed; top: 0; left: 0; z-index: 9999; pointer-events: none;
  border-radius: 50%; transform: translate(-50%, -50%);
  mix-blend-mode: difference;
}
.cursor { width: 38px; height: 38px; border: 1.5px solid #fff; transition: width .25s var(--ease), height .25s var(--ease), background .25s; }
.cursor-dot { width: 6px; height: 6px; background: #fff; }
.cursor.hover { width: 64px; height: 64px; background: rgba(255,255,255,.1); }
@media (hover: none) { .cursor, .cursor-dot { display: none; } }

/* ===== preloader ===== */
.preloader {
  position: fixed; inset: 0; z-index: 10000; background: var(--bg);
  display: grid; place-items: center; transition: opacity .6s ease, visibility .6s;
}
.preloader.done { opacity: 0; visibility: hidden; }
.pre-inner { text-align: center; }
.pre-logo { width: 84px; margin: 0 auto 22px; animation: floaty 2.4s var(--ease) infinite; }
.pre-bar { width: 220px; height: 2px; background: var(--line); border-radius: 4px; overflow: hidden; margin: 0 auto; }
.pre-bar i { display: block; height: 100%; width: 0; background: var(--grad); transition: width .2s linear; }
.pre-pct { margin-top: 14px; font-size: 13px; letter-spacing: .3em; color: var(--muted); }
@keyframes floaty { 50% { transform: translateY(-10px); } }

/* ===== nav ===== */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 900;
  padding: 20px 0; transition: padding .4s var(--ease), background .4s;
}
.nav.scrolled { padding: 12px 0; background: rgba(6,8,15,.72); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand .mark { width: 40px; height: 40px; }
.brand .word { font-weight: 700; letter-spacing: .18em; font-size: 18px; }
.brand .word small { display: block; font-size: 9px; letter-spacing: .35em; color: var(--muted); font-weight: 500; }
.nav-links { display: flex; gap: 30px; align-items: center; }
.nav-links a { font-size: 14px; color: var(--muted); position: relative; transition: color .3s; }
.nav-links a::after { content:""; position:absolute; left:0; bottom:-6px; width:0; height:1px; background: var(--accent); transition: width .35s var(--ease); }
.nav-links a:hover { color: var(--text); }
.nav-links a:hover::after { width: 100%; }
.nav-right { display: flex; align-items: center; gap: 18px; }

.lang { display: flex; gap: 2px; border: 1px solid var(--line); border-radius: 30px; padding: 4px; }
.lang button { font-size: 12px; padding: 5px 11px; border-radius: 30px; color: var(--muted); letter-spacing: .08em; transition: .3s; }
.lang button.active { background: var(--grad); color: #04111a; font-weight: 600; }

.burger { display: none; flex-direction: column; gap: 5px; width: 30px; }
.burger span { height: 2px; background: var(--text); border-radius: 2px; transition: .35s var(--ease); }

/* ===== buttons ===== */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 15px 28px;
  border-radius: 40px; font-weight: 600; font-size: 14px; letter-spacing: .02em;
  position: relative; overflow: hidden; transition: transform .3s var(--ease), color .3s;
}
.btn .lab { position: relative; z-index: 2; }
.btn-primary { background: var(--accent); color: #0a0a0b; }
.btn-primary::before { content:""; position:absolute; inset:0; background:#fff; transform: translateY(101%); transition: transform .4s var(--ease); }
.btn-primary:hover::before { transform: translateY(0); }
.btn-ghost { border: 1px solid var(--line); color: var(--text); }
.btn-ghost:hover { border-color: var(--accent); }
.btn svg { width: 17px; height: 17px; position: relative; z-index: 2; transition: transform .3s var(--ease); }
.btn:hover svg { transform: translate(3px,-3px); }

/* ===== hero ===== */
.hero { min-height: 100vh; display: flex; align-items: center; padding-top: 110px; padding-bottom: 60px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.25fr .9fr; gap: 50px; align-items: center; }
.eyebrow { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; letter-spacing: .22em; text-transform: uppercase; color: var(--accent); margin-bottom: 26px; }
.eyebrow .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 rgba(var(--accent-rgb),.6); animation: pulse 2s infinite; }
@keyframes pulse { 70%{box-shadow:0 0 0 12px rgba(var(--accent-rgb),0)} 100%{box-shadow:0 0 0 0 rgba(var(--accent-rgb),0)} }

.hero h1 { font-size: clamp(42px, 7vw, 104px); line-height: .98; font-weight: 700; letter-spacing: -.02em; }
.hero h1 .grad { color: var(--accent); }
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 .line > span { display: inline-block; }
.hero-sub { margin-top: 28px; max-width: 460px; color: var(--muted); font-size: 18px; }
.hero-cta { display: flex; gap: 16px; margin-top: 38px; flex-wrap: wrap; }

.hero-visual { position: relative; aspect-ratio: 4/5; }
.orb {
  position: absolute; inset: 10%; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(var(--accent-rgb),.22), transparent 65%);
  filter: blur(40px); opacity: .8;
  animation: morph 9s ease-in-out infinite;
}
@keyframes morph { 50% { border-radius: 40% 60% 55% 45%; transform: scale(1.05) rotate(20deg); } }
.hero-card {
  position: absolute; inset: 8% 4%; border-radius: 26px; overflow: hidden;
  border: 1px solid var(--line); background: var(--panel);
  box-shadow: 0 40px 80px rgba(0,0,0,.5);
}
.hero-card svg, .hero-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-card::after { content:""; position:absolute; inset:0; background: linear-gradient(180deg, transparent 40%, rgba(10,10,11,.55)); pointer-events:none; }
.float-chip {
  position: absolute; background: rgba(14,20,34,.85); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px; font-size: 13px; box-shadow: 0 20px 40px rgba(0,0,0,.4);
}
.float-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: #2ec27e; box-shadow: 0 0 10px #2ec27e; }
.chip-1 { top: 6%; right: -6%; animation: floaty 4s ease-in-out infinite; }
.chip-2 { bottom: 10%; left: -8%; animation: floaty 5s ease-in-out .5s infinite; }

/* hero intro */
.hero [data-hero] { opacity: 0; transform: translateY(34px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.hero [data-hero].in { opacity: 1; transform: none; }

/* ===== marquee ===== */
.marquee { border-block: 1px solid var(--line); padding: 22px 0; overflow: hidden; white-space: nowrap; background: var(--bg-soft); }
.marquee-track { display: inline-flex; gap: 50px; animation: marquee 28s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee span { font-size: clamp(20px,3vw,34px); font-weight: 600; color: transparent; -webkit-text-stroke: 1px var(--muted); display: inline-flex; align-items: center; gap: 50px; letter-spacing: .02em; }
.marquee span::after { content: "✦"; -webkit-text-stroke: 0; color: var(--accent); font-size: .6em; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ===== section heading ===== */
.sec { padding: 120px 0; }
.sec-head { max-width: 720px; margin-bottom: 64px; }
.tag { display: inline-block; font-size: 12px; letter-spacing: .28em; text-transform: uppercase; color: var(--accent); margin-bottom: 18px; padding: 6px 14px; border: 1px solid var(--line); border-radius: 30px; }
.sec-head h2 { font-size: clamp(32px, 5vw, 60px); line-height: 1.02; font-weight: 700; letter-spacing: -.02em; }
.sec-head p { margin-top: 20px; color: var(--muted); font-size: 18px; }

/* ===== about / stats ===== */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: center; }
.about-text p { color: var(--muted); font-size: 18px; margin-bottom: 18px; }
.about-text p strong { color: var(--text); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.stat { border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; background: var(--panel); position: relative; overflow: hidden; }
.stat::before { content:""; position:absolute; inset:0; background: var(--grad-soft); opacity:0; transition:.4s; }
.stat:hover::before { opacity: 1; }
.stat .num { font-size: 48px; font-weight: 700; color: var(--accent); position: relative; }
.stat .lab { color: var(--muted); font-size: 14px; position: relative; margin-top: 6px; }

/* ===== services ===== */
.services { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.svc {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 34px 30px;
  background: var(--panel); position: relative; overflow: hidden; transition: transform .5s var(--ease), border-color .4s;
}
.svc::after { content:""; position:absolute; left:0; top:0; height:2px; width:0; background: var(--grad); transition: width .5s var(--ease); }
.svc:hover { transform: translateY(-8px); border-color: rgba(var(--accent-rgb),.4); }
.svc:hover::after { width: 100%; }
.svc-ico { width: 56px; height: 56px; border-radius: 14px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line); margin-bottom: 22px; }
.svc-ico svg { width: 28px; height: 28px; stroke: var(--accent); }
.svc h3 { font-size: 21px; margin-bottom: 12px; font-weight: 600; }
.svc p { color: var(--muted); font-size: 15px; }
.svc .idx { position: absolute; top: 26px; right: 28px; font-size: 13px; color: var(--line); font-weight: 700; }

/* ===== works ===== */
.works { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.work {
  border: 1px solid var(--line); border-radius: 22px; overflow: hidden; background: var(--panel);
  position: relative; transition: transform .6s var(--ease);
}
.work:hover { transform: translateY(-6px); }
.work-img { position: relative; overflow: hidden; aspect-ratio: 4/3; }
.work-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.work:hover .work-img img { transform: scale(1.06); }
.work-cat { position: absolute; top: 16px; left: 16px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; background: rgba(6,8,15,.7); backdrop-filter: blur(6px); border: 1px solid var(--line); padding: 6px 12px; border-radius: 30px; color: var(--accent); }
.work-body { padding: 26px 28px 30px; }
.work-body h3 { font-size: 23px; font-weight: 600; margin-bottom: 10px; }
.work-body p { color: var(--muted); font-size: 15px; }
.work-meta { display: flex; gap: 18px; margin-top: 20px; flex-wrap: wrap; }
.work-meta span { font-size: 13px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; }
.work-meta b { color: var(--text); font-weight: 600; }

/* ===== process ===== */
.process-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; counter-reset: step; }
.step { border-top: 2px solid var(--line); padding-top: 24px; position: relative; transition: border-color .4s; }
.step:hover { border-color: var(--accent); }
.step .n { font-size: 14px; color: var(--accent); letter-spacing: .2em; margin-bottom: 16px; }
.step h3 { font-size: 20px; margin-bottom: 10px; font-weight: 600; }
.step p { color: var(--muted); font-size: 15px; }

/* ===== contact ===== */
.contact-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; }
.contact-card { border: 1px solid var(--line); border-radius: 22px; padding: 34px; background: var(--panel); }
.contact-row { display: flex; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.contact-row:last-child { border-bottom: 0; }
.contact-row .ico { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--grad-soft); border: 1px solid var(--line); flex: none; }
.contact-row .ico svg { width: 22px; height: 22px; stroke: var(--accent); }
.contact-row .k { font-size: 13px; color: var(--muted); margin-bottom: 4px; letter-spacing: .04em; }
.contact-row .v { font-size: 17px; font-weight: 500; }
.contact-row a.v:hover { color: var(--accent); }

.form { display: grid; gap: 16px; }
.form .field { position: relative; }
.form label { font-size: 13px; color: var(--muted); display: block; margin-bottom: 8px; }
.form input, .form textarea {
  width: 100%; background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px 16px; color: var(--text); font-family: inherit; font-size: 15px; transition: border-color .3s, box-shadow .3s;
}
.form input:focus, .form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(var(--accent-rgb),.12); }
.form textarea { resize: vertical; min-height: 120px; }
.form-note { font-size: 13px; color: var(--muted); }
.form-note a { color: var(--accent); }
.form-msg { font-size: 14px; color: #2ec27e; min-height: 18px; }

/* ===== map ===== */
.map { margin-top: 24px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; height: 220px; }
.map iframe { width: 100%; height: 100%; border: 0; filter: grayscale(1) invert(.92) contrast(.95) brightness(.95); }

/* ===== footer ===== */
.footer { border-top: 1px solid var(--line); padding: 70px 0 36px; background: var(--bg-soft); }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 50px; border-bottom: 1px solid var(--line); }
.footer .brand { margin-bottom: 18px; }
.footer-col h4 { font-size: 13px; letter-spacing: .2em; text-transform: uppercase; color: var(--muted); margin-bottom: 18px; }
.footer-col a, .footer-col p { display: block; color: var(--muted); font-size: 15px; margin-bottom: 12px; transition: color .3s; }
.footer-col a:hover { color: var(--accent); }
.footer-about { color: var(--muted); max-width: 320px; font-size: 15px; }
.footer-bot { display: flex; justify-content: space-between; align-items: center; padding-top: 28px; gap: 16px; flex-wrap: wrap; }
.footer-bot p { color: var(--muted); font-size: 14px; }
.footer-bot .legal { display: flex; gap: 22px; }
.footer-bot .legal a { color: var(--muted); font-size: 14px; transition: color .3s; }
.footer-bot .legal a:hover { color: var(--accent); }

/* ===== reveal animations ===== */
[data-reveal] { opacity: 0; transform: translateY(40px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
[data-reveal].in { opacity: 1; transform: none; }
[data-reveal-d="1"] { transition-delay: .08s; }
[data-reveal-d="2"] { transition-delay: .16s; }
[data-reveal-d="3"] { transition-delay: .24s; }
[data-reveal-d="4"] { transition-delay: .32s; }
[data-reveal-d="5"] { transition-delay: .40s; }

/* ===== scroll progress ===== */
.scroll-prog { position: fixed; top: 0; left: 0; height: 3px; width: 0; background: var(--grad); z-index: 950; }

/* to-top */
.totop { position: fixed; right: 26px; bottom: 26px; width: 50px; height: 50px; border-radius: 50%; border: 1px solid var(--line); background: rgba(14,20,34,.8); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 800; opacity: 0; transform: translateY(20px); transition: .4s var(--ease); }
.totop.show { opacity: 1; transform: none; }
.totop svg { width: 20px; height: 20px; stroke: var(--accent); }

/* ===== legal page ===== */
.legal-page { padding: 160px 0 100px; }
.legal-page .container { max-width: 860px; }
.legal-page h1 { font-size: clamp(34px,5vw,56px); margin-bottom: 16px; }
.legal-page .updated { color: var(--muted); margin-bottom: 50px; font-size: 14px; }
.legal-page h2 { font-size: 24px; margin: 42px 0 14px; }
.legal-page p, .legal-page li { color: var(--muted); font-size: 16px; margin-bottom: 12px; }
.legal-page ul { padding-left: 22px; list-style: disc; }
.legal-page a { color: var(--accent); }
.back-link { display: inline-flex; align-items: center; gap: 8px; color: var(--accent); margin-bottom: 30px; font-size: 14px; }
.back-link svg { width: 16px; height: 16px; }

/* ===== i18n visibility ===== */
[data-lang-block] { display: none; }
[data-lang-block].active { display: block; }

/* ===== responsive ===== */
@media (max-width: 980px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-visual { max-width: 420px; }
  .about-grid, .contact-wrap, .works { grid-template-columns: 1fr; }
  .services { grid-template-columns: 1fr 1fr; }
  .process-grid { grid-template-columns: 1fr 1fr; }
  .footer-top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 680px) {
  .nav-links { position: fixed; inset: 0 0 0 auto; width: min(78vw, 320px); flex-direction: column; justify-content: center; gap: 26px; background: rgba(8,11,20,.96); backdrop-filter: blur(20px); padding: 40px; transform: translateX(100%); transition: transform .5s var(--ease); border-left: 1px solid var(--line); }
  .nav-links.open { transform: none; }
  .nav-links a { font-size: 20px; }
  .burger { display: flex; }
  .burger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .burger.open span:nth-child(2) { opacity: 0; }
  .burger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .services, .process-grid, .stats, .footer-top { grid-template-columns: 1fr; }
  .sec { padding: 80px 0; }
  .chip-1, .chip-2 { display: none; }
  .footer-bot { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition-duration: .001s !important; }
  [data-reveal] { opacity: 1; transform: none; }
}
