/* Яшаяев Технологии — site styles.
   World: a server rack and an electrical cabinet. RAL 9005 rack black, RAL 7035 cabinet grey,
   RAL 1003 signal yellow for actions only. Russo One for display, PT Sans Narrow for device labels,
   Golos Text for reading, Martian Mono only for figures in specs. */

:root {
  --rack: #0d0e11;
  --rack-2: #121418;
  --graphite: #1b1d20;
  --graphite-2: #2c3139;
  --steel: #8d9299;
  --steel-2: #a6afbb;
  --label: #d3dae3;
  --white: #f2f3ef;

  --cab: #d3d6d2;          /* RAL 7035 */
  --cab-2: #e2e4e0;
  --cab-3: #c5c9c4;
  --ink: #0f1012;
  --ink-2: #3f444a;
  --ink-3: #4f555c;

  --signal: #f7b31a;       /* RAL 1003 signal yellow, as sampled from the approved comp */
  --signal-hi: #ffc23d;
  --signal-lo: #e09a00;
  --led: #49e07c;
  --pass: #2f9e5b;          /* pass green: checks and live indicators on paper */
  --led-paper: #2fc06a;     /* an LED lit on a light ground */
  --led-off: #9aa19c;       /* an unlit LED */
  --fault: #ff8a65;         /* an invalid field's border */
  --fault-text: #ffab91;    /* error text on graphite */

  /* Group strips: signal yellow plate, black hatching, black engraving */
  --strip-hi: #f2b524;
  --strip-lo: #dca117;
  --strip-hatch: #14110a;
  --strip-ink: #15120b;

  /* Paper samples: paper, pen and highlighter marks, pass and flag pills, the blue stamp */
  --paper: #f7f8f5;
  --note-ink: #4a3604;
  --add-ink: #1d5a35;
  --pass-tint: #d6f1df;
  --pass-ink: #17592f;
  --amber-tint: #fdeccb;
  --amber-ink: #6e4a00;
  --flag-tint: #ffe2c2;
  --flag-ink: #8a3b00;
  --neutral-tint: #e3e6ea;
  --stamp-blue: #1d4fa8;
  --plate-label: #474c52;   /* engraved field names on the rating plate */

  --line-d: rgba(242, 243, 239, .09);
  --line-d2: rgba(242, 243, 239, .16);
  --line-l: rgba(15, 16, 18, .14);
  --line-l2: rgba(15, 16, 18, .28);

  --f-display: "Russo One", "Golos Text", "Segoe UI", system-ui, sans-serif;
  --f-label: "PT Sans Narrow", "Arial Narrow", "Golos Text", sans-serif;
  --f-body: "Golos Text", "Segoe UI", system-ui, -apple-system, sans-serif;
  --f-mono: "Martian Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --gutter: clamp(16px, 4.3vw, 72px);
  --nav-h: 61px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);
  --sec-pad: clamp(88px, 10vw, 168px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 16px); }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  background: var(--rack);
  color: var(--white);
  font: 400 17px/1.55 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-kerning: normal;
  overflow-x: clip;
}
img, picture, video, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .22em; }
button { font: inherit; color: inherit; }
h1, h2, h3, h4 { margin: 0; font-family: var(--f-display); font-weight: 400; font-synthesis: none; text-wrap: balance; letter-spacing: 0; }
p { margin: 0; text-wrap: pretty; }
ul, ol { margin: 0; padding: 0; }
::selection { background: var(--signal); color: var(--ink); }
:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; border-radius: 2px; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--signal); color: var(--ink); padding: 10px 14px; font-weight: 600; text-decoration: none; transition: top .2s var(--ease-out); }
.skip:focus { top: 12px; }
html { scrollbar-color: var(--graphite-2) var(--rack); scrollbar-width: thin; }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--rack); }
::-webkit-scrollbar-thumb { background: var(--graphite-2); border: 2px solid var(--rack); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: #3a414b; }

/* ——— Buttons: a switch you press ——— */
.btn {
  --bg: transparent; --fg: var(--white); --bd: transparent;
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: .55em;
  min-height: 44px; padding: 0 22px;
  background: var(--bg); color: var(--fg);
  border: 1.5px solid var(--bd); border-radius: 4px;
  font: 500 16px/1 var(--f-body); letter-spacing: .005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background-color .18s var(--ease-out), border-color .18s var(--ease-out), color .18s var(--ease-out), transform .12s var(--ease-out), box-shadow .18s var(--ease-out);
  -webkit-tap-highlight-color: transparent;
  isolation: isolate; overflow: hidden;
}
.i { display: inline-block; width: 1em; height: 1em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: square; vertical-align: -.12em; transition: transform .25s var(--ease-out); }
.btn .i { width: 16px; height: 16px; }
a:hover > .i--r { transform: translateX(4px); }
a:hover > .i--x { transform: translate(2px, -2px); }
.btn:hover .i:not(.i--r):not(.i--x) { transform: translateY(2px); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn--signal { --bg: var(--signal); --fg: var(--ink); --bd: transparent; border-width: 0; font-weight: 600; box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 6px 14px -8px rgba(0,0,0,.55); }
.btn--signal:hover { --bg: var(--signal-hi); --bd: var(--signal-hi); }
.btn--signal:active { --bg: var(--signal-lo); --bd: var(--signal-lo); box-shadow: 0 2px 6px -2px rgba(0,0,0,.5) inset; }
.btn--ghost { --bd: rgba(242,243,239,.85); --fg: var(--white); }
.btn--ghost:hover { --bg: rgba(242,243,239,.08); --bd: var(--white); }
.btn--dark { --bg: var(--ink); --fg: var(--white); --bd: var(--ink); }
.btn--dark:hover { --bg: #23262b; --bd: #23262b; }
.btn--line { --bd: var(--line-l2); --fg: var(--ink); }
.btn--line:hover { --bd: var(--ink); --bg: rgba(15,16,18,.04); }
.btn--lg { min-height: 66px; padding: 0 30px; font-size: 18px; }
/* press pulse: a short current sweep across the button */
.btn::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(100deg, transparent 30%, rgba(255,255,255,.45) 50%, transparent 70%);
  transform: translateX(-120%);
}
.btn.is-pulse::after { animation: sweep .55s var(--ease-out); }
@keyframes sweep { to { transform: translateX(120%); } }

/* ——— Navigation ——— */
.nav {
  position: fixed; inset: 0 0 auto; z-index: 50;
  height: var(--nav-h);
  transition: transform .45s var(--ease-out), background-color .3s var(--ease-out);
}
.nav::after { content: ""; position: absolute; left: 0; bottom: 0; width: 100%; height: 1px; background: var(--line-d); transform: scaleX(.46); transform-origin: left; transition: transform .5s var(--ease-out); }
.nav.is-solid { background: rgba(13, 14, 17, .94); }
.nav.is-solid::after { transform: scaleX(1); }
.nav.is-hidden { transform: translateY(-100%); }
.nav__in { height: 100%; display: flex; align-items: center; gap: 24px; padding-inline: var(--gutter); }
.nav__logo { display: block; flex: none; }
.nav__logo img { height: 35px; width: auto; }
.nav__links { display: flex; gap: clamp(22px, 2.9vw, 48px); margin-left: auto; margin-right: auto; padding-right: 6vw; }
.nav__links a { font-size: 15px; color: var(--steel); text-decoration: none; position: relative; padding-block: 6px; transition: color .2s; }
.nav__links a::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--signal); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease-out); }
.nav__links a:hover, .nav__links a[aria-current="true"] { color: var(--white); }
.nav__links a:hover::after, .nav__links a[aria-current="true"]::after { transform: scaleX(1); }
.btn--nav { min-height: 52px; padding: 0 24px; font-size: 15.5px; margin-top: 2px; }
.nav__burger { display: none; width: 44px; height: 44px; margin-left: auto; background: none; border: 0; cursor: pointer; position: relative; }
.nav__burger span:not(.sr) { position: absolute; left: 11px; right: 11px; height: 2px; background: var(--white); transition: transform .3s var(--ease-out); }
.nav__burger span:nth-child(1) { top: 17px; } .nav__burger span:nth-child(2) { top: 25px; }
.nav__burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(4px) rotate(45deg); }
.nav__burger[aria-expanded="true"] span:nth-child(2) { transform: translateY(-4px) rotate(-45deg); }
.mnav { position: fixed; inset: var(--nav-h) 0 0; background: var(--rack); padding: 24px var(--gutter) 40px; display: flex; flex-direction: column; gap: 4px; }
.mnav[hidden] { display: none; }
.mnav a:not(.btn) { font: 400 28px/1.2 var(--f-display); text-decoration: none; padding: 14px 0; border-bottom: 1px solid var(--line-d); }
.mnav .btn { margin-top: 24px; min-height: 56px; }

/* ——— Hero ——— */
.hero {
  position: relative;
  height: clamp(640px, 100svh, 1060px);
  overflow: hidden;
  background: var(--rack);
  isolation: isolate;
}
.hero__copy {
  position: relative; z-index: 3;
  width: 37vw; max-width: 760px;
  padding-left: var(--gutter);
  padding-top: calc(var(--nav-h) + clamp(40px, 11svh, 132px));
  box-sizing: content-box;
}
.hero__title {
  font-size: clamp(34px, 3.53vw, 72px);
  line-height: 1.087;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--white);
  text-wrap: initial;
}
.hero__title .ln { display: block; overflow: hidden; padding-bottom: .04em; margin-bottom: -.04em; }
.hero__title .ln > span { display: inline-block; }
.hero__sub { margin-top: clamp(12px, 1.25vw, 24px); max-width: 21.4em; font-size: clamp(16px, 1.56vw, 28px); line-height: 1.42; color: var(--steel); }
.hero__actions { display: flex; flex-wrap: wrap; gap: clamp(12px, 1vw, 20px); margin-top: clamp(24px, 2.85vw, 52px); width: max-content; max-width: 46vw; }
.hero__actions .btn--lg { min-height: clamp(52px, 4.6vw, 80px); font-size: clamp(16px, 1.34vw, 23px); padding-inline: clamp(20px, 1.8vw, 32px); border-radius: 7px; }
.hero__actions .btn--ghost { border-width: 2px; }
.hero__actions .btn--signal { min-width: 15vw; }
.hero__actions .btn--ghost { min-width: 20.8vw; }

/* The rack stage is the plate's own square; every overlay is placed in stage fractions. */
.rack { position: absolute; z-index: 1; left: 43.2vw; top: var(--nav-h); width: max(56.8vw, calc((clamp(640px, 100svh, 1060px) - var(--nav-h)) * .95 / .865)); }
.rack__stage { position: relative; width: 100%; aspect-ratio: 1 / .865; container-type: inline-size; }
.rack__plate, .rack__plate img { position: absolute; inset: 0; width: 100%; height: 100%; }
.rack__plate { -webkit-mask-image: linear-gradient(#000 96.5%, transparent); mask-image: linear-gradient(#000 96.5%, transparent); }
.rack__plate img { object-fit: fill; }
.rack__layer { position: absolute; inset: 0; }
.rack__stage > *, .rack__layer { will-change: auto; }

.strip {
  position: absolute; left: 12.4%; top: calc(var(--y) * 100%);
  height: 4.5%;
  display: flex; align-items: center;
  padding: 0 9cqw 0 1.6cqw;
  background:
    repeating-linear-gradient(-56deg, transparent 0 .5cqw, var(--strip-hatch) .5cqw 1.05cqw, transparent 1.05cqw 1.5cqw) right 1.6cqw center / 6.2cqw 100% no-repeat,
    linear-gradient(180deg, #d79f1b, #c18c12);
  color: var(--strip-ink);
  font: 400 2.2cqw/1 var(--f-display);
  text-transform: uppercase; letter-spacing: .02em;
  clip-path: polygon(0 0, 100% 0, calc(100% - 1.4cqw) 100%, 0 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,.25) inset;
  pointer-events: none;
}

.unit {
  position: absolute; left: 11.2%; width: 72.8%;
  top: calc(var(--y) * 100% - 4.4%); height: 8.8%;
  background: none; border: 0; padding: 0; margin: 0;
  cursor: pointer; text-align: left;
  border-radius: .5cqw;
  -webkit-tap-highlight-color: transparent;
}
.unit::before { /* hover wash on the device front */
  content: ""; position: absolute; inset: 6% 1.2%; border-radius: .4cqw;
  background: linear-gradient(90deg, rgba(247,179,26,0), rgba(247,179,26,.07) 30%, rgba(247,179,26,0) 70%);
  opacity: 0; transition: opacity .3s var(--ease-out);
}
.unit:hover::before, .unit:focus-visible::before { opacity: 1; }
/* the press area reaches into the gap between devices: about 40px tall on a phone instead of 30px */
.unit::after { content: ""; position: absolute; inset: -10% 0; }
.unit:focus-visible { outline-offset: -2px; }
.unit__label {
  position: absolute; left: 9.4%; top: 50%; transform: translateY(calc(-46% + var(--ly, 0cqw)));
  font: 400 2.75cqw/1 var(--f-label);
  letter-spacing: 0;
  color: var(--label);
  white-space: nowrap;
  transition: color .25s var(--ease-out), opacity .3s var(--ease-out), transform .3s var(--ease-out);
}
.unit__label .sm, .drawer__label .sm { display: none; }
.num { font: inherit; }
.nw { white-space: nowrap; }
.unit:hover .unit__label, .unit:focus-visible .unit__label { color: #fff; transform: translateY(calc(-46% + var(--ly, 0cqw))) translateX(.4cqw); }
.unit__led {
  position: absolute; left: 75%; top: 52%; width: 1.05cqw; height: 1.05cqw; margin: -.52cqw 0 0 -.52cqw;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #c9ffd9, var(--led) 45%, #1e8c46 80%);
  box-shadow: 0 0 .6cqw .1cqw rgba(73,224,124,.55);
  opacity: .0; transition: opacity .2s, box-shadow .3s, background .3s;
}
.unit:hover .unit__led, .unit:focus-visible .unit__led { opacity: 1; box-shadow: 0 0 1.4cqw .35cqw rgba(73,224,124,.7); animation: blink 1.1s steps(2, jump-none) infinite; }
.unit[aria-pressed="true"] .unit__label { opacity: 0; }
@keyframes blink { 50% { opacity: .55; } }

/* Empty slot left behind by the pulled device */
.slot {
  position: absolute; left: 11.6%; width: 72%;
  top: calc(var(--slot-y, .361) * 100% - 4.3%); height: 8.6%;
  background: linear-gradient(#030304, #08090b 40%, #050506);
  box-shadow: 0 0 0 1px rgba(255,255,255,.03), inset 0 1.4cqw 1.6cqw rgba(0,0,0,.9);
  border-radius: .3cqw;
  opacity: 1;
  transition: opacity .35s var(--ease-out);
}
.rack.is-empty .slot { opacity: 0; }

/* The pulled device: one element, re-seated at whichever slot is active */
.drawer {
  position: absolute; z-index: 2;
  left: -.2%; width: 82%;
  top: calc(var(--open-top, .244) * 100%);
  clip-path: inset(14% 0 0 0 round 4px);
  aspect-ratio: 3840 / 1648;
  transform-origin: 51.2% 62%;
  pointer-events: none;
  filter: drop-shadow(0 3.2cqw 2.4cqw rgba(0,0,0,.65));
}
.drawer img { width: 100%; height: 100%; }
.drawer__label {
  position: absolute; left: 10.2%; top: 56.6%;
  transform: translateY(-50%) rotate(2.4deg);
  transform-origin: left center;
  font: 400 2.85cqw/1 var(--f-label); letter-spacing: .015em;
  color: var(--label);
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0,0,0,.6);
}

.card {
  position: absolute; z-index: 3;
  left: 39.6%; top: calc(var(--card-top, .343) * 100%);
  width: 37%;
  padding: 1.5cqw 2cqw 1.6cqw;
  background: linear-gradient(170deg, #e6e9ec, #c9ced4);
  color: var(--ink);
  border-radius: .35cqw;
  transform: perspective(70cqw) rotateX(31deg) rotateZ(4.2deg) skewX(-6deg);
  transform-origin: 50% 100%;
  box-shadow: 0 .8cqw 1.4cqw rgba(0,0,0,.45);
}
.card__pain { font: 500 1.9cqw/1.22 var(--f-body); font-style: italic; letter-spacing: -.005em; }
.card__btn {
  display: inline-flex; align-items: center; gap: .5em;
  margin-top: 1.1cqw; padding: .55cqw 1.3cqw;
  background: var(--signal); color: var(--ink);
  font: 600 1.8cqw/1.1 var(--f-body); font-style: italic;
  text-decoration: none; border-radius: .25cqw;
  pointer-events: auto;
  transition: background-color .2s;
  position: relative;
}
/* the card's button looks small on a phone; its press area is at least 44px tall on screen
   (the card's perspective tilt shrinks the extension, hence the larger inset) */
.card__btn::after { content: ""; position: absolute; inset: -14px -10px; }
.card__btn:hover { background: var(--signal-hi); }

/* Motion states driven by script (content stays visible without it) */
.js .hero__title .ln > span { transform: translateY(0); }
.js.is-booting .hero__title .ln > span { transform: translateY(105%); }
.js.is-booting .hero__sub, .js.is-booting .hero__actions { opacity: 0; transform: translateY(14px); }
.js .hero__sub, .js .hero__actions { transition: opacity .7s var(--ease-out), transform .7s var(--ease-out); }
.js.is-booting .rack__plate { opacity: 0; transform: scale(1.035); }
.js .rack__plate { transition: opacity 1.1s var(--ease-out), transform 1.6s var(--ease-out); }
.js.is-booting .strip { opacity: 0; transform: translateX(-2cqw); }
.js .strip { transition: opacity .6s var(--ease-out) .5s, transform .6s var(--ease-out) .5s; }
.js.is-booting .unit__label { opacity: 0; }

/* ——— Responsive hero ——— */
@media (max-width: 1100px) {
  .nav__links { display: none; }
  .nav__in { justify-content: space-between; }
}
@media (max-width: 899px) {
  :root { --nav-h: 60px; }
  .nav::after { transform: scaleX(1); }
  .nav, .nav.is-solid { background: var(--rack); }
  .btn--nav { display: none; }
  .nav__burger { display: block; }
  .nav__logo img { height: 30px; }
  .nav__in { gap: 12px; }
  .hero { height: auto; padding-bottom: 8px; }
  .hero__copy { width: auto; padding-right: var(--gutter); padding-top: calc(var(--nav-h) + 36px); }
  .hero__title { font-size: clamp(30px, 8.4vw, 46px); }
  .hero__title .ln { display: inline; overflow: visible; }
  .hero__title .ln + .ln::before { content: " "; }
  .hero__sub { font-size: 17px; }
  .hero__actions { width: auto; max-width: none; }
  .hero__actions .btn--lg { flex: 1 1 100%; min-height: 56px; font-size: 17px; }
  .hero__actions .btn--signal, .hero__actions .btn--ghost { min-width: 0; }
  .rack { position: relative; left: auto; top: auto; width: 104vw; margin: 28px 0 0 -2vw; }
  .unit__label { font-size: 3.6cqw; font-weight: 700; }
  .unit__label .lg, .drawer__label .lg { display: none; }
  .unit__label .sm, .drawer__label .sm { display: inline; }
  .drawer__label { font-size: 3.8cqw; font-weight: 700; }
  .card { left: 46%; width: 48%; top: calc(var(--card-top, .343) * 100% - 9.5%); padding: 2cqw 2.6cqw; transform: perspective(90cqw) rotateX(18deg) rotateZ(3deg); }
  .card__pain { font-size: 3.1cqw; }
  .card__btn { font-size: 3cqw; padding: 1.2cqw 2.4cqw; margin-top: 1.8cqw; }
}


/* Phones: the card leaves the plate and lies under the rack at reading size. The plate and its devices keep
   their own square (86.5cqw tall), so the stage can grow by the card's height without moving them. */
@media (max-width: 599px) {
  .rack__plate, .rack__layer { bottom: auto; height: 86.5cqw; }
  .drawer { top: calc(var(--open-top, .244) * 86.5cqw); }
  .card { position: relative; left: auto; top: auto; width: auto; margin: calc(86.5cqw + 14px) calc(var(--gutter) + 2vw) 0; padding: 16px 18px 18px; border-radius: 6px; transform: none; box-shadow: 0 10px 24px -12px rgba(0,0,0,.6); }
  .card__pain { font-size: 17px; line-height: 1.35; }
  .card__btn { min-height: 44px; margin-top: 14px; padding: 0 16px; font-size: 16px; border-radius: 4px; }
  .card__btn::after { display: none; }
  .strip { height: 5.4%; font-size: 3.1cqw; padding-right: 10cqw; }
}

/* The narrowest phones (320px): the wordmark steps down so the logo and the burger share one line */
@media (max-width: 359px) {
  .nav__logo img { height: 26px; }
  .strip { height: 6%; font-size: 3.6cqw; }
}
