:root {
  --bg: #eef1f2;
  --fg: #111a20;
  --muted: #56646c;
  --line: rgba(17, 26, 32, .12);
  --line2: rgba(17, 26, 32, .3);
  --accent: #1a7fae;
  --accent-soft: rgba(26, 127, 174, .07);
  --display: 'Jura', system-ui, sans-serif;
  --sans: 'IBM Plex Sans', system-ui, sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --pad: clamp(16px, 4vw, 40px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.6 var(--sans);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
::selection { background: var(--fg); color: var(--bg); }
:focus-visible { outline: 1px solid var(--accent); outline-offset: 4px; }

.hud-label {
  font: 12px/1.4 var(--mono);
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- background layers ---------- */
#field { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
main, .top, .foot { position: relative; z-index: 2; }


.frame { position: fixed; inset: var(--pad); z-index: 3; pointer-events: none; }
.frame .c { position: absolute; width: 18px; height: 18px; border: 0 solid var(--line2); }
.frame .tl { top: 0; left: 0; border-width: 1px 0 0 1px; }
.frame .tr { top: 0; right: 0; border-width: 1px 1px 0 0; }
.frame .bl { bottom: 0; left: 0; border-width: 0 0 1px 1px; }
.frame .br { bottom: 0; right: 0; border-width: 0 1px 1px 0; }
.frame .ruler {
  position: absolute; top: 30%; height: 40%; width: 8px;
  background: repeating-linear-gradient(to bottom, var(--line2) 0 1px, transparent 1px 12px);
}
.frame .ruler.l { left: 0; }
.frame .ruler.r { right: 0; }
@media (max-width: 720px) { .frame .ruler { display: none; } }

/* ---------- boot ---------- */
.boot {
  position: fixed; inset: 0; z-index: 50;
  display: grid; place-content: center; gap: 18px;
  background: var(--bg);
  clip-path: inset(0 0 0 0);
  transition: clip-path .9s var(--ease);
}
.boot.done { clip-path: inset(50% 0 50% 0); }
html:not(.js) .boot { display: none; }
.boot-log {
  font: 13px/1.9 var(--mono); letter-spacing: .12em; color: var(--muted);
  width: min(440px, 84vw); min-height: 11.4em; white-space: pre-wrap;
}
.boot-log b { color: var(--accent); font-weight: 400; }
.boot-bar { height: 1px; width: min(440px, 84vw); background: var(--line); }
.boot-bar i { display: block; height: 100%; width: var(--p, 0%); background: var(--fg); transition: width .25s var(--ease); }
.boot-skip { font: 10px var(--mono); letter-spacing: .3em; text-transform: uppercase; color: var(--muted); opacity: .6; }

/* ---------- top bar ---------- */
.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: calc(var(--pad) + 6px) calc(var(--pad) + 28px);
  font: 12px var(--mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
}
.status { display: flex; align-items: center; gap: 10px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 10px var(--accent); animation: blink 2.4s infinite; }
.lang { display: flex; }
.lang button {
  min-width: 44px; min-height: 44px; padding: 0 6px;
  background: none; border: 0; cursor: pointer;
  font: inherit; letter-spacing: inherit; color: var(--muted);
  position: relative; transition: color .25s;
}
.lang button::after {
  content: ''; position: absolute; left: 30%; right: 30%; bottom: 8px; height: 1px;
  background: var(--fg); transform: scaleX(0); transition: transform .35s var(--ease);
}
.lang button:hover, .lang button[aria-pressed="true"] { color: var(--fg); }
.lang button[aria-pressed="true"]::after { transform: scaleX(1); }
@media (max-width: 720px) {
  .top { padding: calc(var(--pad) + 4px) calc(var(--pad) + 10px); font-size: 11px; letter-spacing: .14em; }
}

/* ---------- hero ---------- */
.hero {
  position: relative; overflow: hidden;
  height: 100svh; min-height: 560px;
  background: linear-gradient(#c9d5dc, #f0f3f4 52%, #d3dbdf 53%, var(--bg));
}
.scene, .scene canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.hero::after { /* melt the water into the page and keep the copy readable */
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 30%; z-index: 1; pointer-events: none;
  background: linear-gradient(rgba(238, 241, 242, 0), rgba(238, 241, 242, .82) 45%, var(--bg));
}


.readout {
  position: absolute; z-index: 2; top: 40%; left: calc(var(--pad) + 28px);
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 14px; border-left: 1px solid var(--line2);
  font-size: 11px;
}
.readout span:first-child { color: var(--fg); }
@media (max-width: 720px) { .readout { display: none; } }
@media (max-width: 480px) { .status [data-i18n] { display: none; } }

.hero-title {
  position: absolute; z-index: 3; left: 0; right: 0; top: calc(var(--pad) + 76px);
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 0 var(--pad); text-align: center;
}
.name {
  display: flex; gap: .45em; flex-wrap: wrap; justify-content: center;
  font-family: var(--display);
  font-weight: 300; font-size: clamp(2.1rem, 4.2vw, 3.6rem); line-height: 1.05;
  letter-spacing: .16em; text-transform: uppercase;
  margin-right: -.16em; /* compensate trailing tracking */
}
.name span:last-child { font-weight: 700; }

.hero-copy {
  position: absolute; z-index: 3; left: 0; right: 0; bottom: 0;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 32px;
  padding: 0 calc(var(--pad) + 28px) calc(var(--pad) + 40px);
}
.tagline { max-width: 34em; color: var(--muted); font-size: clamp(16px, 1.5vw, 18px); }
@media (max-width: 900px) {
  .hero-copy { flex-direction: column; align-items: center; text-align: center; gap: 20px; padding: 0 var(--pad) calc(var(--pad) + 28px); }
}
@media (max-width: 720px) {
  .hero-title { top: calc(var(--pad) + 60px); }
  .name { flex-direction: column; gap: 0; }
}

/* entrance */
.js body:not(.ready) .hero-copy,
.js body:not(.ready) .readout,
.readout { transition: opacity 1.6s ease .4s; }
.js body:not(.ready) .scene { opacity: 0; transform: scale(1.04); }
.scene { transition: opacity 1.8s ease, transform 2.6s var(--ease); }
.ready .hero-label { animation: up .9s var(--ease) .6s backwards; }
.ready .name { animation: up 1s var(--ease) .4s backwards; }
.ready .tagline { animation: up .9s var(--ease) .8s backwards; }
.js body:not(.ready) .hero-title { opacity: 0; }
.ready .hero-cta { animation: up .9s var(--ease) 1s backwards; }

/* ---------- telegram button: a HUD panel — glass plate, hairline frame, corner brackets ---------- */
.tg-btn {
  --mx: 0px; --my: 0px; --br: 12px; --bc: var(--fg);
  position: relative; flex: none; display: inline-block;
  padding: 5px; /* gap between the brackets and the plate */
  text-decoration: none;
  background:
    linear-gradient(var(--bc), var(--bc)) top left / var(--br) 1px,
    linear-gradient(var(--bc), var(--bc)) top left / 1px var(--br),
    linear-gradient(var(--bc), var(--bc)) top right / var(--br) 1px,
    linear-gradient(var(--bc), var(--bc)) top right / 1px var(--br),
    linear-gradient(var(--bc), var(--bc)) bottom left / var(--br) 1px,
    linear-gradient(var(--bc), var(--bc)) bottom left / 1px var(--br),
    linear-gradient(var(--bc), var(--bc)) bottom right / var(--br) 1px,
    linear-gradient(var(--bc), var(--bc)) bottom right / 1px var(--br);
  background-repeat: no-repeat;
  transform: translate(var(--mx), var(--my));
  transition: transform .5s var(--ease), --br .4s;
}
.tg-body {
  position: relative; overflow: hidden;
  display: flex; align-items: center; gap: 14px;
  min-height: 52px; padding: 14px 24px 14px 26px;
  border: 1px solid var(--line2);
  background: rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: var(--fg);
  font: 500 13px/1 var(--mono); letter-spacing: .2em; text-transform: uppercase;
  transition: background-color .3s, border-color .3s, color .3s;
}
.tg-body::before { /* status bar */
  content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent);
  transform: scaleY(.3); transition: transform .4s var(--ease);
}
.tg-body::after { /* scanning sheen */
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, rgba(26, 127, 174, .16) 50%, transparent 65%);
  transform: translateX(-110%);
  animation: sheen 5s var(--ease) 3s infinite;
}
.tg-icon { display: grid; place-items: center; color: var(--accent); flex: none; }
.tg-arrow { font-style: normal; color: var(--muted); margin-left: 6px; transition: transform .4s var(--ease), color .3s; }
.tg-btn:hover, .tg-btn:focus-visible { --br: 20px; outline: none; }
.tg-btn:hover .tg-body, .tg-btn:focus-visible .tg-body { background-color: rgba(255, 255, 255, .85); border-color: var(--fg); }
.tg-btn:hover .tg-body::before, .tg-btn:focus-visible .tg-body::before { transform: scaleY(1); }
.tg-btn:hover .tg-body::after { animation: sheen .9s var(--ease); }
.tg-btn:hover .tg-arrow, .tg-btn:focus-visible .tg-arrow { transform: translateX(5px); color: var(--accent); }
.tg-big .tg-body { min-height: 64px; padding: 18px 32px 18px 34px; font-size: clamp(14px, 2vw, 17px); }
.tg-big .tg-icon svg { width: 20px; height: 20px; }
@property --br { syntax: '<length>'; inherits: true; initial-value: 12px; }

/* ---------- modules ---------- */
.modules { max-width: 1120px; margin: 0 auto; padding: 16vh calc(var(--pad) + 28px) 10vh; }
.sec-head { margin-bottom: 48px; }
h2 {
  font-family: var(--display);
  font-weight: 300; font-size: clamp(2rem, 5.4vw, 3.6rem); line-height: 1.05;
  letter-spacing: .08em; text-transform: uppercase; margin-top: 12px;
}
.mod-list { list-style: none; }
.mod {
  position: relative;
  display: grid; grid-template-columns: 72px 1fr auto; gap: 24px; align-items: start;
  padding: 34px 20px 34px 0;
  border-top: 1px solid var(--line);
  transition: background-color .4s;
}
.mod:last-child { border-bottom: 1px solid var(--line); }
.mod::before { /* scan line that draws on reveal */
  content: ''; position: absolute; top: -1px; left: 0; height: 1px; width: 100%;
  background: linear-gradient(90deg, var(--fg), transparent);
  transform: scaleX(0); transform-origin: left; transition: transform 1.2s var(--ease);
}
.mod.in::before { transform: scaleX(1); }
.mod:hover { background: linear-gradient(90deg, var(--accent-soft), transparent 70%); }
.mod-n { font: 14px var(--mono); color: var(--accent); letter-spacing: .1em; padding-top: 8px; }
.mod h3 { font-family: var(--display); font-weight: 600; font-size: clamp(22px, 3vw, 30px); letter-spacing: .05em; text-transform: uppercase; line-height: 1.2; }
.mod p { color: var(--muted); max-width: 58ch; margin-top: 8px; }
.mod-tag {
  font: 11px var(--mono); letter-spacing: .2em; color: var(--muted);
  border: 1px solid var(--line); padding: 6px 10px; margin-top: 6px;
  transition: color .3s, border-color .3s;
}
.mod:hover .mod-tag { color: var(--fg); border-color: var(--fg); }
@media (max-width: 720px) {
  .mod { grid-template-columns: 1fr; gap: 10px; padding-right: 0; }
  .mod-n { padding-top: 0; }
  .mod-tag { display: none; }
}

/* ---------- contact ---------- */
.contact {
  min-height: 80vh; padding: 14vh var(--pad) 18vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px;
  text-align: center;
}
.contact-text { color: var(--muted); max-width: 32em; margin-bottom: 18px; }

.foot {
  display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  padding: 28px calc(var(--pad) + 28px) calc(var(--pad) + 20px);
  border-top: 1px solid var(--line); font-size: 11px;
}

/* ---------- reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(24px); transition: opacity 1s var(--ease), transform 1s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- keyframes ---------- */
@keyframes up { from { opacity: 0; transform: translateY(18px); filter: blur(6px); } }
@keyframes blink { 50% { opacity: .3; } }
@keyframes sheen { 0% { transform: translateX(-110%); } 30%, 100% { transform: translateX(110%); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  html { scroll-behavior: auto; }
}
