/* Hallmark · custom theme · vibe: "Tashkent plaster by day, lit windows at night"
 * paper #eceeeb cool grey-white · ink #121417 · accent amber #e8892b (lamp) · Tektur + Onest + Martian Mono
 * structure: statement → break-the-kernel block → about → project deck (tabs, one playable toy) → contact
 */
:root {
  --paper: #eceeeb;
  --paper-2: #e1e4e0;
  --card: #f7f8f6;
  --ink: #121417;
  --ink-2: #565a62;
  --line: #cdd1cc;
  --night: #0b0d12;
  --amber: #e8892b;
  --amber-ink: #8a4a0c;
  --on-night: #eef0ec;
  --shade: rgba(18, 20, 23, 0.14);

  --font-display: "Tektur", "Arial Narrow", sans-serif;
  --font-body: "Onest", "Segoe UI", sans-serif;
  --font-mono: "Martian Mono", ui-monospace, monospace;

  --pad: clamp(16px, 3.2vw, 48px);
  --radius: 26px;
  --radius-s: 16px;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { background: var(--paper); -webkit-text-size-adjust: 100%; }
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-body);
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
code { font-family: var(--font-mono); font-size: 0.82em; }
:focus-visible { outline: 2px solid var(--amber); outline-offset: 3px; border-radius: 6px; }

/* ---------- Pills: the one button shape on the site ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 0.5em; white-space: nowrap;
  min-height: 40px; padding: 0 18px; border-radius: 999px;
  background: var(--paper-2); color: var(--ink);
  font: 500 0.88rem/1 var(--font-body); text-decoration: none;
  transition: background-color 0.25s var(--ease-out), transform 0.25s var(--ease-out);
}
button.pill { border: 0; cursor: pointer; }
.pill:hover { background: var(--line); }
.pill:active { transform: translateY(1px); }
.pill--ink { background: var(--ink); color: var(--paper); }
.pill--ink:hover { background: var(--ink-2); }
.pill--big { min-height: 64px; padding: 0 30px; font-size: clamp(1.05rem, 1.6vw, 1.5rem); }

/* ---------- Bar ---------- */
.bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; gap: clamp(12px, 2vw, 28px);
  padding: 14px var(--pad) 22px;
  background: linear-gradient(to bottom, var(--paper) 62%, rgba(236, 238, 235, 0));
}
.bar__id { font: 700 1.02rem/1 var(--font-display); font-stretch: 85%; text-decoration: none; margin-right: auto; white-space: nowrap; }
.bar__nav { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2); }
.bar__nav a { padding: 9px 14px; border-radius: 999px; font-size: 0.86rem; text-decoration: none; transition: background-color 0.25s var(--ease-out); }
.bar__nav a:hover { background: var(--card); }
.bar__clock { font: 400 0.72rem/1 var(--font-mono); color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.bar__id, .bar__clock { transition: color 0.3s var(--ease-out); }

/* ---------- Intro statement ---------- */
.intro {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 22rem); align-items: end; gap: clamp(20px, 4vw, 64px);
  padding: clamp(96px, 16vh, 150px) var(--pad) clamp(28px, 5vh, 48px);
}
.intro__title {
  font: 800 clamp(40px, 6.4vw, 112px)/0.94 var(--font-display); font-stretch: 80%;
  letter-spacing: -0.02em; overflow-wrap: anywhere; min-width: 0;
}
.intro__side { color: var(--ink-2); font-size: 1.02rem; padding-bottom: 0.6em; }

/* ---------- Facts: the office photo and two short notes ---------- */
.facts {
  display: grid; grid-template-columns: 168px minmax(0, 1fr) minmax(0, 1fr); gap: clamp(24px, 3.5vw, 56px);
  align-items: start; padding: clamp(48px, 9vh, 110px) var(--pad);
}
.fact__photo { margin: 0; display: grid; gap: 10px; }
.fact__photo img { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: var(--radius-s); display: block; }
.fact__photo figcaption { font: 400 0.68rem/1.5 var(--font-mono); color: var(--ink-2); }
.fact { display: grid; gap: 14px; align-content: start; }
.fact + .fact { padding-left: clamp(24px, 3.5vw, 56px); border-left: 1px solid var(--line); }
.fact h2 { font: 700 clamp(28px, 2.8vw, 44px)/1 var(--font-display); font-stretch: 85%; letter-spacing: -0.01em; }
.fact p { color: var(--ink-2); max-width: 34rem; }
.fact p a { color: var(--ink); text-decoration-color: var(--amber); text-underline-offset: 3px; }
.fact .pill { justify-self: start; }

/* ---------- Projects ---------- */
.projects { padding: clamp(80px, 14vh, 160px) var(--pad) clamp(60px, 10vh, 120px); }
.projects__head { display: grid; grid-template-columns: minmax(0, 1fr) minmax(220px, 22rem); align-items: end; gap: 24px; margin-bottom: clamp(32px, 5vw, 72px); }
.projects__head h2 { font: 800 clamp(48px, 7vw, 120px)/0.86 var(--font-display); font-stretch: 78%; letter-spacing: -0.03em; min-width: 0; overflow-wrap: anywhere; }
.projects__head p { color: var(--ink-2); }

/* Project deck: tabs on top, one project and its toy on screen */
.deck { display: grid; gap: clamp(20px, 2.4vw, 32px); }
.deck__tabs {
  display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--paper-2);
  justify-self: start; max-width: 100%; overflow-x: auto; scrollbar-width: none; scroll-snap-type: x proximity;
}
.deck__tabs::-webkit-scrollbar { display: none; }
.deck__tab {
  flex: none; scroll-snap-align: start; border: 0; cursor: pointer; white-space: nowrap;
  min-height: 40px; padding: 0 18px; border-radius: 999px; background: transparent; color: var(--ink);
  font: 500 0.9rem/1 var(--font-body); transition: background-color 0.25s var(--ease-out), color 0.25s var(--ease-out);
}
.deck__tab:hover { background: var(--card); }
.deck__tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.deck__tab:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }

.deck__panel { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(24px, 3.5vw, 56px); align-items: start; outline: none; }
.deck__info { display: grid; gap: 12px; align-content: start; }
.deck__title { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; }
.deck__title h3 { font: 800 clamp(36px, 3.6vw, 60px)/0.92 var(--font-display); font-stretch: 78%; letter-spacing: -0.02em; margin: 0; }
.ptag { font: 400 0.68rem/1.3 var(--font-mono); text-transform: uppercase; color: var(--ink-2); }
.deck__line { font-weight: 600; font-size: 1.05rem; }
.deck__text { color: var(--ink-2); font-size: 0.95rem; }
.deck__shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 8px; }

.toyhost {
  position: relative; height: 460px; border-radius: var(--radius); background: var(--card);
  box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; isolation: isolate;
}
.toyhost.is-loading::after, .toyhost.is-broken::after {
  position: absolute; inset: 0; display: grid; place-items: center;
  font: 400 0.72rem/1 var(--font-mono); color: var(--ink-2);
}
.toyhost.is-loading::after { content: "загружаю…"; }
.toyhost.is-broken::after { content: "демо не загрузилось — скрины слева"; }

/* Shots: one visual language for every screenshot on the site */
.shot { margin: 0; display: grid; gap: 6px; align-content: start; }
.shot__img { position: relative; border-radius: 10px; overflow: hidden; background: var(--card); aspect-ratio: 16 / 10; box-shadow: 0 0 0 1px var(--line); }
.shot__img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.shot figcaption { font: 400 0.64rem/1.4 var(--font-mono); text-transform: uppercase; color: var(--ink-2); }

.pstack { font: 400 0.68rem/1.6 var(--font-mono); text-transform: uppercase; color: var(--ink-2); }
.plinks { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.plinks a { min-height: 36px; padding: 0 14px; font-size: 0.82rem; }

/* ---------- Contact and footer ---------- */
.contact { padding: clamp(60px, 12vh, 140px) var(--pad) clamp(40px, 8vh, 90px); display: grid; gap: clamp(28px, 4vw, 48px); }
.contact h2 { font: 800 clamp(44px, 6vw, 104px)/0.9 var(--font-display); font-stretch: 78%; letter-spacing: -0.03em; max-width: 11ch; }
.contact__note { color: var(--ink-2); max-width: 34rem; margin-top: calc(-1 * clamp(8px, 1.5vw, 20px)); }
.links { display: flex; flex-wrap: wrap; gap: 10px; }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding: 20px var(--pad) 28px; border-top: 1px solid var(--line); color: var(--ink-2); font-size: 0.85rem; }

/* ---------- Small screens ---------- */
@media (max-width: 860px) {
  .bar__nav, .bar__clock { display: none; }
  .intro, .projects__head { grid-template-columns: 1fr; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .fact__photo { grid-template-columns: 96px 1fr; align-items: end; }
  .fact + .fact { padding-left: 0; border-left: 0; padding-top: 24px; border-top: 1px solid var(--line); }
  .deck__tabs { justify-self: stretch; border-radius: 22px; }
  .deck__panel { grid-template-columns: minmax(0, 1fr); }
  .toyhost { order: -1; height: min(560px, 74svh); }
}

@media (pointer: coarse) {
  .deck__tab { min-height: 44px; }
  .plinks a, .fact .pill { min-height: 44px; }
  .fact p a { padding: 10px 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; animation: none !important; }
}
