/* ALGOSETS LTD — landing */
:root {
  --ink: #0F1A3A;
  --ink-2: #16234B;
  --ink-line: rgba(255, 255, 255, .12);
  --cobalt: #2B4BFF;
  --cobalt-dark: #1F37C9;
  --amber: #F5B83D;
  --paper: #EEF1F6;
  --white: #FFFFFF;
  --text: #1B2440;
  --muted: #5B6683;
  --line: #D6DCE7;
  --up: #22B58A;
  --down: #E5574F;

  --f-display: "Unbounded", system-ui, sans-serif;
  --f-body: "Golos Text", system-ui, sans-serif;
  --f-code: "JetBrains Mono", ui-monospace, monospace;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --r-sm: 6px;
  --r-lg: 18px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
body {
  margin: 0;
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.6;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--f-display); font-weight: 500; line-height: 1.15; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.section { padding: clamp(72px, 10vw, 128px) 0; }
.section--paper { background: var(--paper); }
.section--ink { background: var(--ink); color: #C9D1E6; }
.section--ink h2, .section--ink h3 { color: var(--white); }

.h2 { font-size: clamp(30px, 4.2vw, 50px); max-width: 18ch; }
.lead { font-size: clamp(18px, 1.6vw, 20px); color: var(--muted); max-width: 60ch; margin-top: 20px; }
.section--ink .lead { color: #AEB8D3; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  font: 500 16px/1 var(--f-body);
  padding: 17px 26px; border-radius: 999px; border: 0;
  text-decoration: none; cursor: pointer;
  transition: background-color .2s, color .2s, transform .2s;
}
.btn--primary { background: var(--amber); color: var(--ink); }
.btn--primary:hover { background: #FFC85A; }
.btn--ghost { color: var(--white); box-shadow: inset 0 0 0 1.5px var(--ink-line); }
.btn--ghost:hover { box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.5); }
.btn--cobalt { background: var(--cobalt); color: var(--white); }
.btn--cobalt:hover { background: var(--cobalt-dark); }
.btn:disabled { opacity: .6; cursor: progress; }

/* Header */
.header {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  transition: background-color .25s, box-shadow .25s;
}
.header.is-scrolled { background: rgba(15, 26, 58, .92); backdrop-filter: blur(10px); box-shadow: 0 1px 0 var(--ink-line); }
.header__in { display: flex; align-items: center; gap: 32px; height: 76px; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--white); text-decoration: none; font: 600 17px/1 var(--f-display); letter-spacing: .02em; }
.logo svg { width: 30px; height: 30px; }
.logo small { font-weight: 400; opacity: .6; margin-left: 2px; }
.nav { display: flex; gap: 28px; margin-left: auto; }
.nav a { color: #C9D1E6; text-decoration: none; font-size: 15px; }
.nav a:hover { color: var(--white); }
.lang { display: flex; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ink-line); padding: 3px; }
.lang a { color: #AEB8D3; text-decoration: none; font-size: 13px; font-weight: 500; padding: 6px 11px; border-radius: 999px; }
.lang a[aria-current="true"] { background: var(--white); color: var(--ink); }
.header .btn { padding: 12px 20px; font-size: 15px; }
.burger { display: none; background: none; border: 0; color: var(--white); padding: 8px; margin-left: auto; cursor: pointer; }
.burger svg { width: 26px; height: 26px; }

/* Hero */
.hero {
  position: relative; overflow: hidden;
  background: var(--ink); color: var(--white);
  padding: 160px 0 0;
}
.hero__grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: linear-gradient(to bottom, #000 30%, transparent 95%);
  pointer-events: none;
}
.hero__top { position: relative; display: grid; grid-template-columns: 1.35fr 1fr; gap: 48px; align-items: end; }
.hero h1 { font-size: clamp(40px, 6.4vw, 84px); font-weight: 500; line-height: 1.02; letter-spacing: -0.025em; }
.hero__side p { color: #C2CBE3; font-size: 19px; max-width: 40ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

.chart-wrap { position: relative; margin-top: 64px; }
.chart-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px;
  font-family: var(--f-code); font-size: 13px; color: #8F9BBE;
  padding: 0 0 14px; border-bottom: 1px solid var(--ink-line);
}
.chart-head b { color: var(--white); font-weight: 500; }
.chart-head .live { display: inline-flex; align-items: center; gap: 8px; color: var(--up); margin-left: auto; }
.chart-head .live::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 4px rgba(34,181,138,.2); animation: pulse 2s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(34,181,138,0); } }
.chart { width: 100%; height: clamp(220px, 30vw, 360px); }
.chart .c { transform-box: fill-box; transform-origin: center bottom; }
.chart.is-drawing .c { animation: candle .5s cubic-bezier(.2,.8,.2,1) both; }
@keyframes candle { from { opacity: 0; transform: scaleY(0); } }
.chart .ma { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); }
.chart.is-drawing .ma { animation: draw 2.4s .4s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .mk { opacity: 0; }
.chart.is-drawing .mk { animation: fade .4s both; }
@keyframes fade { to { opacity: 1; } }

/* Tech strip */
.stack { background: var(--ink-2); color: #AEB8D3; border-top: 1px solid var(--ink-line); }
.stack__in { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 36px; padding-top: 26px; padding-bottom: 26px; font-family: var(--f-code); font-size: 15px; }
.stack__in span:first-child { font-family: var(--f-body); color: #8F9BBE; font-size: 14px; margin-right: 6px; }
.stack__in b { color: var(--white); font-weight: 500; }

/* Two directions */
.dirs { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--line); margin-top: 56px; }
.dir { padding: 40px 48px 8px 0; }
.dir + .dir { padding-left: 48px; border-left: 1px solid var(--line); }
.dir svg { width: 44px; height: 44px; color: var(--cobalt); }
.dir h3 { font-size: clamp(22px, 2.2vw, 28px); margin: 24px 0 14px; max-width: 20ch; }
.dir p { color: var(--muted); max-width: 46ch; }
.dir a { display: inline-block; margin-top: 20px; color: var(--cobalt); font-weight: 500; text-decoration: none; border-bottom: 1.5px solid currentColor; padding-bottom: 2px; }

/* Services */
.svc-head { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: end; }
.core { margin-top: 56px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.core__item { background: var(--white); border-radius: var(--r-lg); padding: 36px 32px 32px; }
.core__item svg { width: 48px; height: 48px; color: var(--cobalt); }
.core__item h3 { font-size: 21px; margin-top: 44px; }
.core__item p { color: var(--muted); font-size: 16px; margin-top: 12px; }

.extra { margin-top: 72px; }
.extra h3 { font-family: var(--f-body); font-size: 18px; font-weight: 600; }
.extra ul { list-style: none; margin: 24px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); }
.extra li { display: flex; gap: 14px; align-items: flex-start; padding: 22px 20px 22px 0; border-bottom: 1px solid var(--line); font-size: 16px; line-height: 1.4; }
.extra li svg { flex: none; width: 24px; height: 24px; color: var(--cobalt); margin-top: 1px; }
.extra__note { margin-top: 28px; color: var(--muted); }

/* Lifecycle */
.cycle { list-style: none; padding: 0; margin: 64px 0 0; display: grid; grid-template-columns: repeat(5, 1fr); counter-reset: s; }
.cycle li { position: relative; padding: 0 20px 0 0; counter-increment: s; }
.cycle li::before {
  content: counter(s); display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: 50%;
  font: 500 15px/1 var(--f-display); color: var(--cobalt);
  background: var(--white); box-shadow: inset 0 0 0 1.5px var(--cobalt);
  position: relative; z-index: 1;
}
.cycle li::after { content: ""; position: absolute; top: 22px; left: 44px; right: 0; height: 1.5px; background: repeating-linear-gradient(90deg, var(--cobalt) 0 6px, transparent 6px 12px); opacity: .5; }
.cycle li:last-child::after { display: none; }
.cycle h3 { font-size: 18px; margin-top: 24px; }
.cycle p { font-size: 15px; color: var(--muted); margin-top: 8px; }
.about-note { margin-top: 64px; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 40px; }

/* Trading */
.trade { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.trade__list { list-style: none; padding: 0; margin: 36px 0 0; }
.trade__list li { display: flex; gap: 14px; padding: 16px 0; border-top: 1px solid var(--ink-line); color: #DCE2F2; }
.trade__list li:last-child { border-bottom: 1px solid var(--ink-line); }
.trade__list svg { flex: none; width: 22px; height: 22px; color: var(--amber); margin-top: 2px; }
.trade__fine { margin-top: 20px; font-size: 15px; color: #8F9BBE; }
.code {
  background: #0A1230; border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px var(--ink-line), 0 40px 80px -30px rgba(0,0,0,.6);
  overflow: hidden;
}
.code__bar { display: flex; align-items: center; gap: 8px; padding: 14px 18px; border-bottom: 1px solid var(--ink-line); font: 13px var(--f-code); color: #8F9BBE; }
.code__bar i { width: 10px; height: 10px; border-radius: 50%; background: #2A3666; }
.code__bar span { margin-left: 10px; }
.code pre { margin: 0; padding: 22px 22px 26px; font: 14px/1.75 var(--f-code); color: #C9D1E6; overflow-x: auto; }
.code .k { color: #8EA2FF; } .code .t { color: var(--amber); } .code .s { color: #7FD8B8; } .code .c { color: #5E6A91; } .code .n { color: #F59E8B; }
.langs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.langs span { font: 14px var(--f-code); color: var(--white); padding: 7px 12px; border-radius: var(--r-sm); background: rgba(255,255,255,.07); }

/* Order steps */
.order { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(40px, 6vw, 96px); }
.order__aside { position: sticky; top: 110px; align-self: start; }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: o; }
.steps li { counter-increment: o; display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 28px 0; border-top: 1px solid var(--line); }
.steps li:last-child { border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(o); font: 500 34px/1 var(--f-display); color: var(--cobalt); }
.steps h3 { font-family: var(--f-body); font-size: 19px; font-weight: 600; }
.steps p { color: var(--muted); margin-top: 6px; }
.notice { margin-top: 28px; display: flex; gap: 14px; padding: 20px 22px; border-radius: var(--r-lg); background: #FFF6E2; color: #6B4E12; font-size: 15px; }
.notice svg { flex: none; width: 22px; height: 22px; color: #C48A12; }

/* Contact */
.contact { display: grid; grid-template-columns: .85fr 1.15fr; gap: clamp(40px, 6vw, 80px); align-items: start; }
.contact__details { margin-top: 40px; display: grid; gap: 22px; }
.contact__details div { display: flex; gap: 14px; }
.contact__details svg { flex: none; width: 22px; height: 22px; color: var(--amber); margin-top: 3px; }
.contact__details a { color: var(--white); }
.contact__details small { display: block; color: #8F9BBE; font-size: 14px; }

.form { background: var(--white); color: var(--text); border-radius: 22px; padding: clamp(24px, 4vw, 44px); }
.form h3 { font-size: 22px; }
.form > p { color: var(--muted); margin-top: 8px; font-size: 15px; }
.fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 28px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field--full { grid-column: 1 / -1; }
.field label { font-size: 14px; font-weight: 500; }
.field label em { font-style: normal; color: var(--muted); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: 16px; color: var(--text);
  background: var(--paper); border: 1.5px solid transparent; border-radius: 10px;
  padding: 13px 15px; width: 100%;
  transition: border-color .15s, background-color .15s;
}
.field textarea { min-height: 130px; resize: vertical; }
.field select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%235B6683' stroke-width='1.8'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 15px center; padding-right: 40px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--cobalt); background-color: var(--white); }
.field.has-error input, .field.has-error textarea, .field.has-error select { border-color: var(--down); background-color: #FFF5F4; }
.field__err { font-size: 13px; color: #C23A32; min-height: 0; }
.field__err:empty { display: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.consent { grid-column: 1 / -1; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--muted); }
.consent input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--cobalt); flex: none; }
.consent.has-error { color: #C23A32; }
.form__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 26px; }
.form__status { font-size: 15px; }
.form__status.is-error { color: #C23A32; }
.form__done { text-align: left; padding: 12px 0; }
.form__done svg { width: 56px; height: 56px; color: var(--up); }
.form__done h3 { margin-top: 20px; }
.form__done p { color: var(--muted); margin-top: 10px; }
.form__done button { margin-top: 22px; background: none; border: 0; padding: 0; color: var(--cobalt); font: 500 16px var(--f-body); cursor: pointer; border-bottom: 1.5px solid currentColor; }

/* Footer */
.footer { background: var(--ink); color: #8F9BBE; border-top: 1px solid var(--ink-line); font-size: 14px; }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 32px; padding-top: 32px; padding-bottom: 32px; }
.footer nav { display: flex; gap: 24px; margin-left: auto; }
.footer a { color: #C9D1E6; text-decoration: none; }
.footer a:hover { color: var(--white); }

/* Responsive */
@media (max-width: 1080px) {
  .nav { gap: 20px; }
  .extra ul { grid-template-columns: repeat(2, 1fr); }
  .cycle { grid-template-columns: 1fr; gap: 0; }
  .cycle li { display: grid; grid-template-columns: 44px 1fr; column-gap: 20px; padding: 0 0 28px; }
  .cycle li::before { grid-row: span 2; }
  .cycle li::after { top: 44px; bottom: 0; left: 21px; right: auto; width: 1.5px; height: auto; background: repeating-linear-gradient(180deg, var(--cobalt) 0 6px, transparent 6px 12px); }
  .cycle h3 { margin-top: 10px; }
}
@media (max-width: 900px) {
  .burger { display: block; }
  .header .btn { display: none; }
  .nav {
    position: fixed; inset: 76px 0 auto 0; flex-direction: column; gap: 0;
    background: var(--ink); padding: 8px var(--gutter) 24px; border-bottom: 1px solid var(--ink-line);
    transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .2s;
  }
  .nav a { padding: 14px 0; font-size: 18px; border-bottom: 1px solid var(--ink-line); }
  .header.is-open { background: var(--ink); }
  .header.is-open .nav { transform: none; opacity: 1; visibility: visible; }
  .lang { margin-left: auto; }
  .burger { margin-left: 4px; }
  .hero { padding-top: 120px; }
  .hero__top, .svc-head, .trade, .order, .contact, .about-note { grid-template-columns: 1fr; gap: 28px; }
  .dirs { grid-template-columns: 1fr; }
  .dir { padding: 36px 0 32px; }
  .dir + .dir { padding-left: 0; border-left: 0; border-top: 1px solid var(--line); }
  .core { grid-template-columns: 1fr; }
  .core__item h3 { margin-top: 28px; }
  .order__aside { position: static; }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .logo small { display: none; }
  .extra ul { grid-template-columns: 1fr; }
  .fields { grid-template-columns: 1fr; }
  .steps li { grid-template-columns: 52px 1fr; }
  .steps li::before { font-size: 26px; }
  .chart-head .live { margin-left: 0; }
  .footer nav { margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .chart .ma { stroke-dashoffset: 0; }
  .chart .mk { opacity: 1; }
}
.section--ink .form h3 { color: var(--ink); }
.consent .field__err { display: block; margin-top: 4px; }
.consent .field__err:empty { display: none; }

/* Legal pages */
.header--solid { position: sticky; background: var(--ink); box-shadow: 0 1px 0 var(--ink-line); }
.legal-hero { background: var(--ink); color: var(--white); padding: 56px 0 64px; }
.legal-hero h1 { font-size: clamp(32px, 4.6vw, 56px); }
.legal-hero p { color: #AEB8D3; margin-top: 16px; font-size: 15px; }
.legal-hero a { color: #C9D1E6; }
.legal-wrap { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); padding-top: 64px; padding-bottom: 112px; }
.legal-toc { position: sticky; top: 108px; align-self: start; font-size: 14px; }
.legal-toc p { font-weight: 600; margin-bottom: 12px; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; border-left: 1.5px solid var(--line); }
.legal-toc a { display: block; padding: 6px 0 6px 16px; margin-left: -1.5px; border-left: 1.5px solid transparent; color: var(--muted); text-decoration: none; line-height: 1.35; }
.legal-toc a:hover { color: var(--cobalt); border-left-color: var(--cobalt); }
.legal { max-width: 72ch; }
.legal h2 { font-size: 22px; margin: 52px 0 16px; scroll-margin-top: 100px; }
.legal p, .legal li { color: #3A4462; }
.legal p + p { margin-top: 14px; }
.legal ul, .legal ol { padding-left: 22px; margin: 14px 0; }
.legal li { margin: 8px 0; padding-left: 4px; }
.legal li::marker { color: var(--cobalt); }
.legal strong { color: var(--text); font-weight: 600; }
.legal a { color: var(--cobalt); }
.legal__intro { font-size: 19px; line-height: 1.55; color: var(--text) !important; }
.legal__note { margin-top: 18px !important; padding: 14px 18px; border-radius: 12px; background: var(--paper); font-size: 15px; }
.legal__table { width: 100%; border-collapse: collapse; margin: 18px 0; font-size: 15px; }
.legal__table th, .legal__table td { text-align: left; vertical-align: top; padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); }
.legal__table th { font-weight: 600; color: var(--text); border-bottom-width: 1.5px; }
.legal__table td:first-child { width: 52%; }
#risk + p { padding: 18px 20px; border-radius: 12px; background: #FFF6E2; color: #6B4E12; }
#risk + p strong { color: inherit; }
.legal-print { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 15px; color: var(--muted); }
@media (max-width: 900px) {
  .legal-wrap { grid-template-columns: 1fr; padding-top: 40px; }
  .legal-toc { position: static; }
  .header--solid .nav { display: none; }
}
@media (max-width: 560px) {
  .legal__table, .legal__table tbody, .legal__table tr, .legal__table td { display: block; width: 100% !important; }
  .legal__table thead { display: none; }
  .legal__table tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
  .legal__table td { border: 0; padding: 2px 0; }
  .legal__table td:first-child { font-weight: 600; color: var(--text); }
}
@media print {
  .header, .footer, .legal-toc, .legal-print { display: none !important; }
  .legal-hero { background: none; color: #000; padding: 0 0 16px; }
  .legal-hero p, .legal-hero a { color: #444; }
  .legal-wrap { display: block; padding: 0; }
  .legal { max-width: none; font-size: 11pt; }
  .legal h2 { break-after: avoid; margin-top: 24px; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
@media print { .no-print { display: none !important; } }
