/* Arseny Afonin — site styles.
   Ported from the Claude Design canvas «Arseny Afonin — сайт» (Version 120).
   Logical properties (inline/block, start/end) are used throughout so the
   Hebrew version can mirror the layout with dir="rtl" alone. */

:root {
  --ink: #111111;
  --paper: #ffffff;
  --blue: #2f3fd8;
  --orange: #ff5a36;
  --green: #7dff8a;
  --line: var(--ink);
  --line-soft: rgba(17, 17, 17, .35);

  --gutter: 24px;
  --text: 17px;
  --text-l: clamp(15px, 1.4vw, 19px);   /* asides, case links, contact paragraph */
  --h-section: clamp(44px, 8.4vw, 128px);
  --h-item: clamp(28px, 3.6vw, 52px);   /* service titles, «11 years» */
  --h-small: clamp(26px, 2.9vw, 42px);  /* reasons, FAQ questions */
  --aside-width: 34ch;

  --arrow: url("arrow.svg");
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-padding-top: 72px; }

body {
  margin: 0;
  font-family: "Arimo", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--text);
  line-height: 1.4;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
a:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

h1, h2, h3, p, ul { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

/* small labels (menu, status, field names, footer): body size, sentence case,
   one step heavier than the text (Medium 500). The class name is historical. */
.caps {
  font-weight: 500;
  font-size: var(--text);
  line-height: 1.3;
}

/* ---------- header ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--paper);
  padding: 10px var(--gutter);
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}
.who { line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; gap: 6px 24px; }
.nav a { display: block; padding: 6px 0; text-decoration: none; }
.nav a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- sections ---------- */

.sec { padding: 28px var(--gutter) 56px; }
.sec--blue { background: var(--blue); color: var(--paper); --line: rgba(255, 255, 255, .75); }
.sec--orange { background: var(--orange); color: var(--ink); }

.head {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-block-end: 28px;
}
.h {
  font-size: var(--h-section);
  line-height: .88;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: -.06em;
}
.aside {
  margin-inline-start: auto;
  padding-block-start: 8px;
  max-width: var(--aside-width);
  font-size: var(--text-l);
  line-height: 1.35;
}

/* ---------- intro ---------- */

.intro {
  display: flex;
  flex-direction: column;
  min-height: min(calc(100vh - 88px), 920px);
  min-height: min(calc(100svh - 88px), 920px);
}
.intro .head { padding-block-end: 28px; border-block-end: 1px solid var(--line); }
.stage { flex: 1 0 auto; display: flex; flex-direction: column; }
.lede {
  flex: 1 0 auto;
  font-size: clamp(30px, 4.2vw, 60px);
  line-height: 1.08;
  letter-spacing: -.045em;
  max-width: 66.666%;
  margin-block-end: 48px;
  text-wrap: balance;
}
.lede em { font-style: normal; opacity: .7; }
.status {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  margin-inline-start: auto;
  padding-block-start: 8px;
  text-align: end;
}
.status .caps { line-height: 1.2; }
.status a { text-decoration: none; }
.status a:hover { text-decoration: underline; }
.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  margin-inline-end: 8px;
  vertical-align: 1px;
}
.bottom {
  padding-block-start: 20px;
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  align-items: flex-end;
  justify-content: space-between;
}
.bio { font-size: 19px; line-height: 1.45; max-width: 60ch; }
.bio p + p { margin-block-start: .6em; }
.where { padding-block-start: 0; gap: 0; }
/* location and email: same size and line height as the bio beside them */
.where .caps { font-size: 19px; line-height: 1.45; }

/* ---------- services ---------- */

.svc { border-block-start: 1px solid var(--line); }
.svc > li {
  display: grid;
  grid-template-columns: 44px minmax(0, 2fr) minmax(0, 1fr);
  gap: 20px 24px;
  padding: 26px 0 30px;
  border-block-end: 1px solid var(--line);
}
.num {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  font-size: 14px;
  margin-block-start: 10px;
}
.svc h3 {
  grid-column: 2;
  font-size: var(--h-item);
  line-height: 1.04;
  font-weight: 400;
  letter-spacing: -.035em;
  text-wrap: balance;
}
.svc .body {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}
.svc .body p { max-width: 52ch; }
.k { margin-block-end: 3px; }
.proof {
  grid-column: 3;
  grid-row: 2;
  width: 100%;
  max-width: var(--aside-width);
  margin-inline-start: auto;
  font-size: var(--text-l);
  line-height: 1.35;
}
.proof--lead { grid-row: 1 / 3; }
.figure {
  font-size: var(--h-item);
  line-height: 1.04;
  letter-spacing: -.035em;
  margin-block-end: 20px;
}
.figure small { display: block; font-size: var(--text-l); line-height: 1.35; letter-spacing: 0; margin-block-start: 6px; }
.cases li { padding: 3px 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cases li::before {
  content: "";
  display: inline-block;
  width: .7em;
  height: .7em;
  margin-inline-end: .45em;
  vertical-align: -.02em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
}

/* ---------- how I work ---------- */

.ways { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-block-start: 1px solid var(--line); }
.way { padding: 20px 20px 24px 0; padding-inline: 0 20px; border-block-end: 1px solid var(--line); }
.way + .way { padding-inline: 20px 0; border-inline-start: 1px solid var(--line); }
.way h3 { font-size: clamp(30px, 3.4vw, 48px); line-height: 1; font-weight: 400; margin: 6px 0 14px; letter-spacing: -.03em; }
.way p { margin-block-end: 10px; max-width: 46ch; }
.way ul { margin-block-start: 10px; }
.way li { padding: 7px 0; border-block-start: 1px solid var(--line-soft); font-size: 15px; }

/* ---------- what I bring ---------- */

.why { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-block-start: 1px solid var(--line); }
.reason { padding: 20px 0 8px; padding-inline: 0 24px; }
.reason + .reason { padding-inline-start: 24px; border-inline-start: 1px solid var(--line); }
.fact { margin-block-end: 14px; }
.reason h3 { margin-block-end: 16px; font-size: var(--h-small); line-height: 1.08; font-weight: 400; letter-spacing: -.03em; text-wrap: balance; }
.reason p { max-width: 40ch; }

/* ---------- FAQ ---------- */

.faq { border-block-start: 1px solid var(--line); }
.q {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 0;
  align-items: start;
  padding: 22px 0 26px;
  border-block-end: 1px solid var(--line);
}
.q h3 { padding-inline-end: 20px; font-size: var(--h-small); line-height: 1.08; font-weight: 400; letter-spacing: -.03em; }
.q p { padding-block-start: 6px; padding-inline-start: 20px; max-width: calc(46ch + 20px); line-height: 1.45; }

/* ---------- contact ---------- */

.reach { border-block-start: 1px solid var(--line); }
.reach li {
  border-block-end: 1px solid var(--line);
  padding: 10px 0 14px;
  font-size: clamp(34px, min(6vw, 8vh), 88px);  /* shrinks on short laptop screens so Contact fits one screen */
  line-height: 1;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}
.reach a { display: flex; align-items: center; gap: .25em; text-decoration: none; }
.reach a::after {
  content: "";
  flex: none;
  width: .62em;
  height: .62em;
  background: currentColor;
  -webkit-mask: var(--arrow) center / contain no-repeat;
  mask: var(--arrow) center / contain no-repeat;
  transition: transform .15s;
}
.reach a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .08em; }
.reach a:hover::after { transform: translate(.06em, -.06em); }

/* ---------- footer ---------- */

.foot {
  padding: 18px var(--gutter);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

/* ---------- narrow screens ---------- */

@media (max-width: 860px) {
  :root { --gutter: 16px; }
  html { scroll-padding-top: 52px; }

  /* the sticky header stays one line: the nav scrolls sideways instead of wrapping */
  /* the caption is dropped on phones (the name and lede say the same right below) */
  .bar { padding-block: 6px; }
  .who { display: none; }
  /* all five links fit one line on a 375px phone; on narrower ones the row scrolls sideways */
  .nav { flex: 1; flex-wrap: nowrap; justify-content: space-between; gap: 8px; overflow-x: auto; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; font-size: 15px; }

  .aside { margin-inline-start: 0; max-width: none; }
  .lede { max-width: none; }
  .status { align-items: flex-start; text-align: start; margin-inline-start: 0; }

  .svc > li { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .num { margin-block-start: 0; }
  .svc h3, .svc .body, .proof { grid-column: 1; grid-row: auto; }
  .svc .body { grid-template-columns: 1fr; }
  .proof { margin-inline-start: 0; max-width: none; }

  .ways { grid-template-columns: 1fr; }
  .way + .way { padding-inline-start: 0; border-inline-start: 0; }

  .why { grid-template-columns: 1fr; }
  .reason + .reason { padding-inline-start: 0; border-inline-start: 0; border-block-start: 1px solid var(--line); }

  .q { grid-template-columns: 1fr; }
  .q h3 { padding-inline-end: 0; }
  .q p { padding-inline-start: 0; }
}

/* ---------- section transitions (assets/fx.js) ---------- */

.sec { background: var(--paper); }
.sec--blue { background: var(--blue); }
.sec--orange { background: var(--orange); }
.foot { position: relative; z-index: 1; background: var(--paper); }
.fx-anchor { height: 0; }

/* every section sticks; the next one, later in the page, slides over it */
[data-fx] main > section {
  position: sticky;
  /* each section is at least a screen tall, so short ones read as a full slide */
  min-height: calc(100vh - var(--fx-top, 0px));
  min-height: calc(100lvh - var(--fx-top, 0px)); /* largest viewport: phone toolbars hide while scrolling down */
  /* air under the last line: the page scrolls a little into it before the next slide arrives */
  padding-block-end: max(56px, 28vh);
}
[data-fx] main > section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: #000;
  /* dims slowly at first, so the last lines stay readable while the next slide comes in */
  opacity: calc(var(--p, 0) * var(--p, 0) * .35);
  pointer-events: none;
}
[data-fx] main > .fx-anchor + section ~ section { box-shadow: 0 -18px 40px rgba(0, 0, 0, .18); }
[data-fx] .intro { padding-block-end: 56px; }
/* the last section and the footer share exactly one screen: no air, nothing slides over it */
[data-fx] main > section:last-child {
  position: relative;
  top: auto !important;
  padding-block-end: 56px;
  min-height: calc(100vh - var(--fx-top, 0px) - var(--fx-foot, 0px));
  min-height: calc(100lvh - var(--fx-top, 0px) - var(--fx-foot, 0px)); /* so the page can scroll Contact all the way up with the toolbar hidden */
  display: flex;
  flex-direction: column;
}
[data-fx] main > section:last-child::after { content: none; }

/* long sections (Services, FAQ): the heading row, down to its rule, stays put
   and the content scrolls up under it until the section ends */
/* off only on very short screens (e.g. a phone held sideways) */
@media (min-height: 500px) {
  .sec--pinhead .head {
    position: sticky;
    top: var(--fx-top, 50px);
    z-index: 1;
    background: inherit;
    margin: -28px 0 0;
    padding-block: 28px;
    border-block-end: 1px solid var(--line);
  }
  .sec--pinhead .svc,
  .sec--pinhead .faq { border-block-start: 0; }
}
[data-fx] main > section::after { z-index: 2; }

@media (prefers-reduced-motion: reduce) {
  .reach a::after { transition: none; }
}
