/* Hata site. Colors and fonts follow the app (engine/src/overlay.rs) and the "Site" board of canvas v3. */

@font-face {
  font-family: "Tektur Hata";
  src: url("fonts/Tektur-Hata.ttf") format("truetype");
  font-weight: 400 900;
  font-display: swap;
}
@font-face {
  font-family: "Fira Hata";
  src: url("fonts/FiraSans-Hata.ttf") format("truetype");
  font-weight: 400 700;
  font-display: swap;
}

:root {
  --carbon: #0B0B0A;
  --surface: #151513;
  --surface2: #1C1B19;
  --hairline: #23211E;
  --edge: #3A3732;
  --gold: #F4B223;
  --shade: #9A6700;
  --text: #ECE4D6;
  --soft: #B8B1A4;
  --secondary: #8F897E;
  --muted: #6A665E;
  --assist: #B79CFF;
  --wire: #EE4F37;
  --pipe: #7FB4D9;
  --frame: #8CC084;
  --head: "Tektur Hata", "Arial Narrow", sans-serif;
  --body: "Fira Hata", "Helvetica Neue", Arial, sans-serif;
  --cut: 14px;
  --page: 1760px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  overflow-x: hidden;
  background: var(--carbon);
  color: var(--text);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img, video, canvas { display: block; max-width: 100%; }
::selection { background: var(--gold); color: var(--carbon); }

.wrap { width: min(100% - 48px, var(--page)); margin: 0 auto; }
@media (min-width: 900px) { .wrap { width: min(100% - 160px, var(--page)); } }

/* Loading screen (loader.js) */
html.loading, html.loading body { overflow: hidden; }
.loader {
  position: fixed; inset: 0; z-index: 100;
  background: var(--carbon);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
}
.loader-brand { display: flex; align-items: flex-end; gap: clamp(12px, 1.6vw, 24px); }
.loader-brand svg { height: clamp(64px, 9vw, 128px); width: auto; overflow: visible; }
.loader-word { display: flex; padding-bottom: 0.04em; }
.loader-word span {
  display: inline-block; opacity: 0;
  font-family: var(--head); font-weight: 800; font-style: italic;
  font-size: clamp(56px, 8vw, 116px); line-height: 0.8; letter-spacing: 0.06em; color: var(--text);
}
.loader-note { position: absolute; bottom: 14%; opacity: 0; transition: opacity 0.4s; }
.loader-note.shown { opacity: 1; }
.loader-note::after { content: ""; animation: dots 1.2s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }

/* Type helpers */
.label {
  font-family: var(--head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--secondary);
}
.title {
  font-family: var(--head);
  font-weight: 800;
  font-style: italic;
  line-height: 0.95;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  margin: 0;
}
.stripes { display: flex; gap: 6px; }
.stripes i { display: block; height: 6px; background: var(--gold); transform: skewX(-24deg); }
.stripes i:first-child { width: 44px; }
.stripes i:last-child { width: 18px; opacity: 0.55; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--head);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--carbon);
  background: var(--gold);
  border: 0;
  cursor: pointer;
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%);
  transition: filter 0.15s, transform 0.15s;
}
.btn:hover { filter: brightness(1.08); }
.btn:active { transform: translateY(1px); }
.btn:focus-visible { outline: 2px solid var(--text); outline-offset: 4px; }
.btn.big { height: 60px; padding: 0 34px; font-size: 18px; }
.btn.small { height: 36px; padding: 0 18px; font-size: 13px; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }
.btn.ghost { background: var(--surface2); color: var(--text); }
.btn.later { background: var(--surface2); color: var(--secondary); cursor: default; pointer-events: none; }

/* Header */
.top {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(11, 11, 10, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.top .wrap { height: 72px; display: flex; align-items: center; gap: 14px; }
.brand { display: flex; align-items: center; gap: 14px; text-decoration: none; }
.brand svg { width: 36px; height: 26px; overflow: visible; }
.brand span {
  font-family: var(--head);
  font-weight: 800;
  font-style: italic;
  font-size: 26px;
  line-height: 1;
  letter-spacing: 0.06em;
}
.top nav { margin-left: auto; display: flex; align-items: center; gap: 26px; }
.top nav a.link {
  font-family: var(--head);
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--secondary);
  transition: color 0.15s;
}
.top nav a.link:hover { color: var(--text); }
@media (max-width: 860px) { .top nav a.link { display: none; } }

/* Hero: the house fills the first screen, the words sit on the left */
.hero {
  position: relative;
  height: calc(100vh - 72px);
  min-height: 640px;
  max-height: 1200px;
  overflow: hidden;
}
.hero canvas { position: absolute; inset: 0; width: 100%; height: 100%; cursor: grab; touch-action: pan-y; }
.hero canvas:active { cursor: grabbing; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(11, 11, 10, 0.97) 0%, rgba(11, 11, 10, 0.88) 24%, rgba(11, 11, 10, 0.4) 40%, rgba(11, 11, 10, 0) 52%),
    linear-gradient(0deg, rgba(11, 11, 10, 1) 0%, rgba(11, 11, 10, 0) 16%);
}
.hero-in { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; pointer-events: none; }
.hero-text { display: flex; flex-direction: column; gap: 26px; max-width: 640px; pointer-events: auto; padding-bottom: 40px; }
.hero h1 { font-size: clamp(44px, 5vw, 88px); }
.hero h1 .gold { color: var(--gold); }
.hero h1 .who {
  display: block;
  margin-top: 14px;
  font-size: 0.42em;
  line-height: 1.05;
  color: var(--text);
}
.notsure {
  display: inline-block;
  margin-top: 10px;
  padding: 5px 12px 4px;
  font-family: var(--head);
  font-weight: 700;
  font-style: normal;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--carbon);
  background: var(--gold);
  transform: rotate(-3deg);
  clip-path: polygon(6px 0, 100% 0, calc(100% - 6px) 100%, 0 100%);
  cursor: help;
}
.hero p.lead { margin: 0; font-size: 20px; line-height: 1.5; max-width: 600px; text-shadow: 0 1px 12px rgba(11, 11, 10, 0.8); }
.hero .cta { display: flex; flex-wrap: wrap; align-items: center; gap: 22px; }
.hero .cta small { font-size: 14px; color: var(--secondary); line-height: 1.4; }
.hero .fallback { position: absolute; right: 8%; top: 45%; display: none; color: var(--secondary); max-width: 360px; z-index: 2; }
.hero.no-gl .fallback { display: block; }
.hero.no-gl .panel { display: none; }
/* Ближче and Гуляти: the house takes the whole first screen, the words step aside */
.hero-in, .hero::after { transition: opacity 0.45s ease, transform 0.45s ease; }
@media (min-width: 1100px) {
  .hero.free .hero-in { opacity: 0; transform: translateX(-24px); pointer-events: none; }
  .hero.free .hero-in .hero-text { pointer-events: none; }
  .hero.free::after { opacity: 0; }
}
.hero.free canvas { touch-action: none; }
.hero.no-trace [data-mode="1"], .hero.no-trace [data-mode="2"] { display: none; }

/* The panel over the house: what is shown, like the app's top bar */
.panel {
  position: absolute;
  z-index: 3;
  right: max(24px, calc((100vw - var(--page)) / 2));
  bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-end;
  max-width: calc(100vw - 48px);
}
.panel .row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(11, 11, 10, 0.92);
  border: 1px solid var(--edge);
  padding: 5px 6px 5px 12px;
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
  max-width: 100%;
}
.panel .row svg { width: 20px; height: 15px; overflow: visible; flex-shrink: 0; margin-right: 4px; }
.panel .caption { padding: 6px 12px; background: rgba(11, 11, 10, 0.92); color: var(--text); }
.panel .status { min-width: 110px; text-align: right; padding-right: 8px; }
.stages, .modes { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.stages button, .modes button {
  font-family: var(--head);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--secondary);
  background: transparent;
  border: 0;
  padding: 7px 10px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}
.stages button:hover, .modes button:hover { color: var(--text); background: var(--surface2); }
.stages button[aria-pressed="true"], .modes button[aria-pressed="true"] { color: var(--carbon); background: var(--gold); }
.modes button { font-size: 13px; padding: 7px 16px; }
.panel .hour { gap: 14px; padding-right: 14px; }
.panel .hour input[type="range"] { -webkit-appearance: none; appearance: none; width: 240px; height: 4px; background: var(--track, #2A2825); outline: none; cursor: pointer; }
.panel .hour input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 18px; background: var(--gold); clip-path: polygon(4px 0, 100% 0, calc(100% - 4px) 100%, 0 100%); }
.panel .hour input[type="range"]::-moz-range-thumb { width: 14px; height: 18px; border: 0; border-radius: 0; background: var(--gold); }
.panel .clock { font-family: var(--head); font-weight: 700; font-size: 16px; letter-spacing: 0.04em; min-width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .panel .hour input[type="range"] { width: 100%; flex: 1; } }

@media (max-width: 1099px) {
  .hero { height: auto; max-height: none; min-height: 0; display: flex; flex-direction: column; }
  .hero::after { display: none; }
  .hero-in { order: 0; height: auto; padding: 48px 0 24px; }
  .hero canvas { position: relative; inset: auto; order: 1; height: 64vh; min-height: 380px; }
  .panel { position: relative; order: 2; right: auto; bottom: auto; align-items: stretch; margin: 8px 24px 32px; }
}

/* The moving shelf of things under the first screen */
.shelf { padding: 40px 0 56px; overflow: hidden; }
.shelf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px 22px; margin-bottom: 26px; }
.shelf-head .title { font-size: clamp(28px, 2.6vw, 40px); }
.shelf-head .more { color: var(--secondary); font-size: 16px; }
.lanes {
  display: flex; flex-direction: column; gap: 8px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0, #000 6%, #000 94%, transparent 100%);
}
.lane { display: flex; gap: 8px; width: max-content; animation: drift 140s linear infinite; will-change: transform; }
.lane.back { animation-direction: reverse; animation-duration: 170s; }
.lanes:hover .lane, .lanes.still .lane { animation-play-state: paused; }
@keyframes drift { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.thing {
  margin: 0; width: 216px; flex: none; background: var(--surface2);
  clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px);
}
.thing img { width: 216px; height: 135px; object-fit: cover; }
.thing figcaption {
  padding: 8px 12px 10px; font-size: 13px; line-height: 1.3; color: var(--soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (prefers-reduced-motion: reduce) {
  .lane { animation: none; }
  .lanes { overflow-x: auto; }
}

/* Sections */
section.block { padding: 72px 0; border-top: 1px solid var(--hairline); }
.head { display: flex; flex-direction: column; gap: 18px; margin-bottom: 40px; max-width: 860px; }
.head h2 { font-size: clamp(34px, 3.6vw, 54px); }
.head p { margin: 0; color: var(--soft); font-size: 18px; }

/* Feature cards */
.cards { display: grid; gap: 8px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card {
  position: relative;
  background: var(--surface);
  padding: 24px 24px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
  transition: background 0.15s;
}
.card:hover { background: var(--surface2); }
.card h3 { font-family: var(--head); font-weight: 800; font-style: italic; font-size: 26px; line-height: 1; letter-spacing: 0.01em; margin: 0; }
.card p { margin: 0; color: var(--soft); }
.card .tag { position: absolute; right: 18px; top: 18px; width: 10px; height: 10px; transform: skewX(-24deg); }
.card.wide { grid-column: 1 / -1; }
@media (min-width: 1100px) { .card.wide { grid-column: span 2; } }

/* Assistant card */
.assist { border-left: 3px solid var(--assist); }
.assist h3 { color: var(--assist); }
.chat { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; font-size: 15px; }
.chat .me, .chat .ai { max-width: 92%; padding: 10px 14px; }
.chat .me { align-self: flex-end; background: var(--surface2); border: 1px solid var(--edge); }
.chat .ai { background: rgba(183, 156, 255, 0.08); border: 1px solid rgba(183, 156, 255, 0.35); color: var(--text); }
.chat .ai code { font-family: var(--head); font-size: 13px; letter-spacing: 0.04em; color: var(--assist); }

/* Videos: big rows, video and words, every other row mirrored */
.reels { display: flex; flex-direction: column; gap: 56px; }
.reel { display: grid; gap: 28px 56px; align-items: center; }
@media (min-width: 1000px) {
  .reel { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); }
  .reel:nth-child(even) { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); }
  .reel:nth-child(even) .frame { order: 2; }
}
.reel .frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    repeating-linear-gradient(-24deg, transparent 0 18px, rgba(244, 178, 35, 0.04) 18px 20px),
    var(--surface);
  border: 1px solid var(--hairline);
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
  overflow: hidden;
}
.reel video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.4s; }
.reel .frame.playing video { opacity: 1; }
.reel .soon { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: var(--secondary); transition: opacity 0.4s; }
.reel .frame.playing .soon { opacity: 0; }
.reel .soon svg { width: 54px; height: 54px; }
.reel .chip { position: absolute; left: 14px; top: 14px; padding: 6px 12px; background: rgba(11, 11, 10, 0.9); color: var(--text); }
.reel-text { display: flex; flex-direction: column; gap: 14px; }
.reel-text .num { font-family: var(--head); font-weight: 700; font-size: 40px; line-height: 1; color: var(--gold); }
.reel-text h3 { font-size: clamp(28px, 2.6vw, 42px); }
.reel-text p { margin: 0; color: var(--soft); font-size: 18px; max-width: 520px; }

/* Steps */
.steps { display: grid; gap: 30px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.step { display: flex; gap: 16px; align-items: baseline; }
.step .n { font-family: var(--head); font-weight: 700; font-size: 34px; line-height: 1; color: var(--gold); }
.step b { font-family: var(--head); font-weight: 800; font-size: 18px; letter-spacing: 0.03em; text-transform: uppercase; }
.step span { display: block; color: var(--secondary); font-size: 15px; }

/* Download */
.download {
  display: grid;
  gap: 40px;
  align-items: center;
  background: var(--surface);
  padding: 48px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% 100%, 0 100%, 0 var(--cut));
}
@media (min-width: 1000px) { .download { grid-template-columns: 1fr auto; } }
.download h2 { font-size: clamp(34px, 3.6vw, 54px); }
.download dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 24px; margin: 24px 0 0; font-size: 15px; }
.download dt { color: var(--secondary); }
.download dd { margin: 0; }
.download .side { display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }
.download .side small { color: var(--secondary); font-size: 14px; max-width: 340px; }

/* FAQ */
.faq { display: grid; gap: 8px; max-width: 1100px; }
.faq details { background: var(--surface); clip-path: polygon(10px 0, 100% 0, 100% 100%, 0 100%, 0 10px); }
.faq summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 24px;
  font-family: var(--head);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.02em;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--gold); font-size: 22px; line-height: 1; }
.faq details[open] summary::after { content: "–"; }
.faq details p { margin: 0; padding: 0 24px 20px; color: var(--soft); max-width: 860px; }

/* Footer */
footer { padding: 28px 0 48px; border-top: 1px solid var(--hairline); color: var(--secondary); font-size: 14px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 14px 34px; align-items: center; }
footer .bold { color: var(--text); }
footer a { text-decoration: none; }
footer a:hover { color: var(--text); }
footer .grow { flex-grow: 1; }

/* Legal pages */
.doc { padding: 64px 0 80px; }
.doc .wrap { max-width: 860px; }
.doc h1 { font-size: clamp(36px, 4vw, 56px); margin-bottom: 12px; }
.doc h2 { font-family: var(--head); font-weight: 800; font-size: 22px; letter-spacing: 0.02em; text-transform: uppercase; margin: 40px 0 10px; }
.doc p, .doc li { color: var(--soft); }
.doc strong { color: var(--text); }
.doc .draft {
  margin: 24px 0 8px;
  padding: 14px 18px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
  color: var(--text);
}
.doc table { width: 100%; border-collapse: collapse; font-size: 14px; margin: 16px 0; }
.doc th, .doc td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hairline); vertical-align: top; }
.doc th { font-family: var(--head); font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; font-size: 12px; color: var(--secondary); }
.doc td code { font-size: 12px; color: var(--muted); }
.doc .wide-table { overflow-x: auto; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

@media (max-width: 600px) {
  /* a phone: shorter first words, so the house already shows on the first screen */
  .hero-in { padding: 26px 0 14px; }
  .hero-text { gap: 16px; padding-bottom: 0; }
  .hero h1 { font-size: clamp(32px, 9.4vw, 44px); }
  .hero h1 .who { margin-top: 8px; }
  .notsure { font-size: 12px; margin-top: 8px; }
  .hero p.lead { font-size: 16px; line-height: 1.45; }
  .hero .btn.big { height: 52px; padding: 0 26px; font-size: 16px; }
  .hero .cta { gap: 14px; }
  .hero canvas { height: 58vh; min-height: 320px; }
  /* the panel under it: every button in sight, rows wrap instead of hiding their ends */
  .panel { margin: 8px 16px 28px; max-width: none; }
  .panel .row { flex-wrap: wrap; padding: 5px 6px; }
  .panel .row svg { display: none; }
  .stages, .modes { flex-wrap: wrap; overflow: visible; width: 100%; }
  .stages button { flex: 1 1 30%; padding: 9px 6px; }
  .modes button { flex: 1 1 0; padding: 10px 8px; }
  .panel .status { min-width: 0; width: 100%; text-align: left; padding: 4px 6px 2px; }
  .panel .status:empty { display: none; }
  .panel .caption { font-size: 11px; line-height: 1.4; }
  .download { padding: 28px 22px; }
}
