/* ---------- tokens ---------- */
:root {
  --bg: #f6f2ec;          /* warm paper */
  --bg-alt: #efe9e0;      /* deeper paper */
  --surface: #fffcf7;
  --ink: #17150f;
  --text: #2e2a22;
  --muted: #6d665a;
  --line: #ddd4c6;
  --line-strong: #c6bbaa;
  --accent: #c0442a;      /* terracotta */
  --accent-soft: #f2e0d8;
  --radius: 4px;
  --wrap: 1080px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }

h1, h2 { font-family: var(--serif); color: var(--ink); line-height: 1.12; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(2.3rem, 5.4vw, 3.9rem); }
h2 { font-size: clamp(1.7rem, 3.4vw, 2.4rem); }
p { margin: 0 0 1em; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 28px; }
.accent { color: var(--accent); font-style: italic; white-space: nowrap; }
.nb { white-space: nowrap; }
.eyebrow {
  font-family: var(--mono); font-size: .76rem; text-transform: uppercase;
  letter-spacing: .18em; color: var(--muted); margin-bottom: 1.4em;
}
.eyebrow::before {
  content: ""; display: inline-block; width: 26px; height: 1px;
  background: var(--accent); vertical-align: middle; margin-right: 12px;
}
.section { padding: 92px 0; }
.section--alt { background: var(--bg-alt); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ---------- buttons ---------- */
.btn {
  display: inline-block; padding: 14px 26px; border-radius: var(--radius);
  background: var(--ink); color: #f6f2ec; font-weight: 550; font-size: .95rem;
  border: 1px solid var(--ink); transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--accent); border-color: var(--accent); }
.btn--ghost { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--ghost:hover { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn--sm { padding: 9px 17px; font-size: .85rem; }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 242, 236, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav__inner { display: flex; align-items: center; gap: 22px; height: 68px; }
.nav__logo { font-family: var(--serif); font-weight: 600; font-size: 1.25rem; color: var(--ink); }
.nav__logo .dot { color: var(--accent); }
.lang {
  display: flex; align-items: center; gap: 8px; margin-left: auto;
  font-family: var(--mono); font-size: .76rem; letter-spacing: .06em;
}
.lang__on { color: var(--accent); }
.lang a { color: var(--muted); }
.lang a:hover { color: var(--ink); }

/* ---------- hero ---------- */
.hero {
  padding: 132px 0 104px;
  background: linear-gradient(180deg, #fffdf9 0%, var(--bg) 65%);
  border-bottom: 1px solid var(--line);
}
.hero h1 { max-width: 31ch; }
html[lang="ru"] .hero h1 { max-width: 34ch; font-size: clamp(2.1rem, 4.6vw, 3.3rem); }
.lead {
  color: var(--text); font-size: 1.18rem; max-width: 52ch; margin-top: 1.3em;
  padding-left: 22px; border-left: 2px solid var(--accent);
}
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin: 2.6em 0 0; }

/* ---------- intro paragraph ---------- */
.intro p {
  font-family: var(--serif); font-size: clamp(1.25rem, 2.3vw, 1.6rem);
  line-height: 1.5; color: var(--ink); max-width: 36ch; margin: 0;
}

/* ---------- work tiles ---------- */
.tiles {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
  margin-top: 2.4em;
}
.tile {
  aspect-ratio: 1 / 1;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}
.tile:hover { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); }
.tile__slot {
  font-family: var(--mono); font-size: .78rem; letter-spacing: .1em;
  color: var(--line-strong);
}

/* slots waiting for an app: dashed, unclickable, slightly self-deprecating */
.tile--soon {
  background: transparent;
  border-style: dashed; border-color: var(--line-strong);
  padding: 18px; cursor: default;
}
.tile--soon::before {
  content: "◆"; position: absolute; top: 12px; left: 14px;
  font-size: .6rem; color: var(--line-strong);
}
.tile--soon { position: relative; }
.tile__soon {
  font-family: var(--mono); font-size: .76rem; line-height: 1.5;
  letter-spacing: .04em; color: var(--muted); text-align: center;
}
.tile--filled { border-color: var(--line-strong); overflow: hidden; position: relative; padding: 0; }
.tile--filled img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.tile--filled:hover { background: var(--surface); }
.tile--filled:hover img { transform: scale(1.03); }
.tile__caption { position: absolute; left: 0; right: 0; bottom: 0; display: block; }
.tile__name {
  display: block; padding: 26px 14px 12px;
  font-family: var(--mono); font-size: .74rem; letter-spacing: .12em;
  text-transform: uppercase; color: #fffcf7; text-align: center;
  background: linear-gradient(to top, rgba(23, 21, 15, .78), rgba(23, 21, 15, 0));
}
.tile__desc { display: block; }

/* No artwork yet: keep the paper look and dark text until the image lands */
.tile--pending .tile__caption { position: static; padding: 16px; text-align: left; }
.tile--pending .tile__name { padding: 0 0 8px; text-align: left; color: var(--ink); background: none; }
.tile--pending .tile__desc { color: var(--muted); font-size: .84rem; line-height: 1.45; }
.tile--pending { align-items: flex-start; justify-content: flex-start; }

/* Pointer devices: description slides up on hover / keyboard focus */
@media (hover: hover) {
  .tile__desc {
    padding: 0 16px; text-align: center;
    font-size: .82rem; line-height: 1.45; color: #f1ebe2;
    background: rgba(23, 21, 15, .88);
    max-height: 0; opacity: 0; overflow: hidden;
    transition: max-height .3s ease, opacity .25s ease, padding .3s ease;
  }
  .tile--filled:hover .tile__desc,
  .tile--filled:focus-visible .tile__desc {
    max-height: 10em; opacity: 1; padding: 4px 16px 18px;
  }
  .tile--filled:hover .tile__name,
  .tile--filled:focus-visible .tile__name {
    background: rgba(23, 21, 15, .88); padding-top: 18px;
  }
  /* pending tiles have no image to hide behind — keep everything visible */
  .tile--pending .tile__desc,
  .tile--pending:hover .tile__desc {
    max-height: none; opacity: 1; padding: 0; background: none;
    color: var(--muted); text-align: left;
  }
  .tile--pending:hover .tile__name { background: none; padding: 0 0 8px; }
  .tile--pending:hover { background: var(--surface); }
}

/* Touch devices: no hover, so the description always sits under the image */
@media (hover: none) {
  /* rows hug their content, otherwise a long description gets clipped
     because the stretched row is sized from the shorter neighbour */
  .tiles { grid-auto-rows: min-content; }
  .tile--filled { aspect-ratio: auto; display: block; align-self: start; height: auto; background: var(--surface); }
  .tile--filled img { position: static; aspect-ratio: 1 / 1; height: auto; }
  .tile__caption { position: static; padding: 12px 14px 16px; }
  .tile__name {
    padding: 0 0 6px; text-align: left; color: var(--ink); background: none;
  }
  .tile__desc { font-size: .84rem; line-height: 1.45; color: var(--muted); }
}
.tile:hover .tile__slot { color: var(--accent); }

/* ---------- contact ---------- */
.contact { padding-bottom: 110px; }
.contact__links {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0;
  margin-top: 2.2em;
  border-top: 1px solid var(--line-strong); border-bottom: 1px solid var(--line-strong);
}
.contact__link {
  padding: 26px 24px; display: flex; flex-direction: column; gap: 5px;
  border-left: 1px solid var(--line); transition: background .2s ease;
}
.contact__link:first-child { border-left: none; padding-left: 0; }
.contact__link:hover { background: var(--surface); }
.contact__label { font-family: var(--mono); font-size: .7rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); }
.contact__value { font-family: var(--serif); font-size: 1.08rem; color: var(--ink); word-break: break-word; }
.contact__link:hover .contact__value { color: var(--accent); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--line); padding: 28px 0; color: var(--muted); font-size: .86rem; background: var(--bg-alt); }
.footer__inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }

/* ---------- reveal ---------- */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}

/* ---------- responsive ---------- */
@media (max-width: 780px) {
  .contact__links { grid-template-columns: 1fr; }
  .contact__link { border-left: none; border-top: 1px solid var(--line); padding-left: 0; }
  .contact__link:first-child { border-top: none; }
}
@media (max-width: 620px) {
  body { font-size: 16px; }
  .section { padding: 68px 0; }
  .hero { padding: 76px 0 62px; }
  h1 { font-size: 2.15rem; }
  html[lang="ru"] h1 { font-size: 1.95rem; }
  h2 { font-size: 1.6rem; }
  .lead { font-size: 1.02rem; padding-left: 16px; }
  .eyebrow { letter-spacing: .12em; font-size: .7rem; }
  .eyebrow::before { width: 16px; margin-right: 8px; }
  .tiles { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .hero__cta .btn { flex: 1 1 100%; text-align: center; }
}
