/* ————————————————————————————————————————————————
   портфолио -- русская версия
   598px column · Times 14/18 · SF Mono 12 · Departure Mono
   scaled +15% from the reference frame, font sizes snapped to even px
   ———————————————————————————————————————————————— */

@font-face {
  font-family: "Departure Mono";
  src: url("assets/fonts/DepartureMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}


:root {
  --ink: #3b3d41;
  --black: #000;
  --gray: #a0a5ac;
  --hair: rgba(225, 228, 232, 0.8);
  --canvas: #f8f8f8;
  --canvas-dark: #161616;

  --sq-black: #000;
  --sq-red: #e0311c;
  --sq-blue: #2f80eb;
  --sq-gray: #e3e3e3;
  --sq-green: #3d7a44;

  --times: "Times New Roman", TimesNewRomanPSMT, Times, "Liberation Serif", serif;
  --sfmono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, "Cascadia Mono", monospace;
  --departure: "Departure Mono", "SF Mono", ui-monospace, monospace;

  --col: 598px;
  --colw: 856px; /* 184 rail + 74 gap + 598 content */
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--times);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  padding: 0 24px;
}

.col  { width: 100%; max-width: var(--col);  margin-left: auto; margin-right: auto; }
.colw { width: 100%; max-width: var(--colw); margin-left: auto; margin-right: auto; }

/* ————— type atoms ————— */

.mono {
  font-family: var(--sfmono);
  font-size: 12px;
  letter-spacing: -0.01em;
  line-height: 18px;
}
.idx { font-family: var(--sfmono); font-size: 12px; letter-spacing: -0.01em; color: var(--ink); }
.dep {
  font-family: var(--departure);
  font-size: 14px;
  line-height: 18px;
  letter-spacing: -0.01em;
  color: var(--ink);
}

a { color: inherit; text-decoration: none; }
p a { border-bottom: 0.5px solid var(--hair); }
p a:hover { border-color: var(--ink); }

sup { font-size: 10px; line-height: 0; vertical-align: super; }

/* ————— top nav (one quiet line) ————— */

.nav {
  padding-top: 28px;
  display: flex;
  justify-content: flex-end;
  gap: 18px;
  font-family: var(--sfmono);
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--gray);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }

/* ————— head block ————— */

.head { padding-top: 64px; }
.head .row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 18px;
}
.head h1 {
  font-family: var(--times);
  font-size: 20px;
  font-weight: 400;
  line-height: 26px;
  letter-spacing: -0.03em;
  color: var(--ink);
}
.head .sub { padding-bottom: 18px; }
.head .sub a { border-bottom: 0.5px solid transparent; }
.head .sub a:hover { border-color: var(--gray); }

.intro { color: var(--black); padding-bottom: 18px; }
.intro p { margin-bottom: 17px; }
.intro p:last-child { margin-bottom: 0; }

.currently { padding-bottom: 37px; border-bottom: 0.5px solid var(--hair); }

/* ————— contact / teams ————— */

.cols {
  display: grid;
  grid-template-columns: 1fr 1px 1fr;
  gap: 0 46px;
  padding: 37px 0;
  align-items: start;
}
.cols .rule { background: var(--hair); height: 68px; align-self: center; }

.label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 7px;
}
/* a section label set in the pixel mono, at ink weight */
.label-dep { font-family: var(--departure); font-size: 14px; letter-spacing: -0.01em; }

.list { list-style: none; }
.list li { display: flex; align-items: center; gap: 6px; line-height: 18px; }
.list .grow { flex: 1 1 auto; min-width: 0; }
.list .yr {
  font-family: var(--sfmono);
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.list .arr { font-family: var(--sfmono); font-size: 14px; color: var(--ink); }
.list a { display: flex; align-items: center; width: 100%; gap: 6px; }
.list a:hover .grow { color: var(--black); }
.list a:hover .arr { transform: translate(1px, -1px); }
.list .arr { transition: transform 0.12s; }

.sq { width: 6px; height: 6px; flex: none; background: var(--sq-gray); }
.sq--black { background: var(--sq-black); }
.sq--red   { background: var(--sq-red); }
.sq--blue  { background: var(--sq-blue); }
.sq--green { background: var(--sq-green); }

/* ————— feed (projects on index) ————— */

.gap-40  { height: 46px; }
.gap-64  { height: 74px; }
.gap-96  { height: 110px; }

.service { padding: 14px 0; }

.entry .label {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 0;
}
/* project titles are set in the pixel mono, underlined */
.entry .label .t {
  font-family: var(--departure);
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: var(--hair);
}
.entry .label a { display: inline-flex; align-items: center; gap: 6px; }
.entry .label a:hover .t { color: var(--black); text-decoration-color: var(--ink); }
.entry .label .yr {
  margin-left: auto;
  font-family: var(--sfmono);
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.entry .desc { max-width: 598px; padding-bottom: 14px; }
.entry .tick { width: 18px; height: 1px; background: var(--hair); margin-bottom: 14px; }
.entry .with { padding-bottom: 28px; }

/* ————— canvases ————— */

.canvas {
  background: var(--canvas);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.canvas--dark { background: var(--canvas-dark); }
/* canvas that hugs its image instead of a fixed height */
.canvas--fit { height: auto; padding: 44px 20px; }
.canvas img { display: block; max-width: 100%; height: auto; }
.canvas--fit img { width: 100%; }
.canvas .note {
  font-family: var(--sfmono);
  font-size: 12px;
  line-height: 20px;
  letter-spacing: -0.01em;
  color: var(--gray);
  text-align: center;
  padding: 28px;
  max-width: 44ch;
}
.canvas .note code { display: block; color: #c4c8cd; font-family: inherit; font-size: 12px; }
.canvas--dark .note { color: #6b6f75; }
.canvas--dark .note code { color: #55585e; }

.h-700 { height: min(805px, 88vh); }
.h-520 { height: min(598px, 70vh); }
.h-420 { height: min(483px, 60vh); }
.h-340 { height: 391px; }


.cap {
  padding-top: 8px;
  color: var(--ink);
  display: flex;
  justify-content: space-between;
  gap: 18px;
}
.cap .mono { color: var(--ink); }

/* ————— rail: headings left, all content right ————— */

.rail {
  display: grid;
  grid-template-columns: 184px minmax(0, 1fr);
  gap: 0 74px;
  align-items: start;
}
.rail__side h2 {
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  color: var(--black);
}
.rail__side .idx { display: block; padding-top: 3px; }
/* the rail is Times throughout — no secondary face for notes */
.rail__side .side-note { padding-top: 16px; }
.rail__side .side-note:first-child { padding-top: 0; }
.rail__main p { margin-bottom: 17px; max-width: 598px; }
.rail__main p:last-child { margin-bottom: 0; }
.rail__main .cap { max-width: none; }

.klabel {
  font-family: var(--departure);
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: block;
  padding-bottom: 3px;
}

.meta { border-top: 0.5px solid var(--hair); }
.meta > div {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 18px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--hair);
  align-items: baseline;
}
.meta span { font-family: var(--departure); font-size: 14px; letter-spacing: -0.01em; color: var(--ink); }

.steps { list-style: none; border-top: 0.5px solid var(--hair); }
.steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 0.5px solid var(--hair);
  align-items: baseline;
}
.steps .n { font-family: var(--sfmono); font-size: 12px; color: var(--ink); font-variant-numeric: tabular-nums; }
.steps h4 { font-size: 14px; font-weight: 400; display: inline; color: var(--black); }
.steps p { display: inline; color: var(--ink); }
.steps p::before { content: " -- "; }

.plain { list-style: none; border-top: 0.5px solid var(--hair); }
.plain li { padding: 8px 0; border-bottom: 0.5px solid var(--hair); }

/* ————— stacked figures ————— */

.figs > * + * { margin-top: 37px; }

.measure { max-width: 598px; }

/* ————— about ————— */

.portrait {
  float: right;
  width: 152px;
  margin: 2px 0 14px 23px;
  filter: grayscale(1);
}

.xp { list-style: none; border-top: 0.5px solid var(--hair); }
.xp > li { padding: 12px 0; border-bottom: 0.5px solid var(--hair); }
.xp .hrow { display: flex; align-items: baseline; gap: 9px; }
.xp .hrow b { font-weight: 400; color: var(--black); }
.xp .hrow .role { color: var(--ink); }
.xp .hrow .yr {
  margin-left: auto;
  font-family: var(--sfmono);
  font-size: 12px;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.xp .d { padding-top: 3px; color: var(--ink); }

.skills { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 28px; }
.skills h3 {
  font-family: var(--sfmono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding-bottom: 7px;
}
.skills ul { list-style: none; }
.skills li { line-height: 18px; padding: 2px 0; }

/* ————— footer ————— */

.foot { padding: 110px 0 74px; }

/* подпись в подвале: фото и облачко висят всегда, ховер называет действие */
.sign {
  position: relative;
  display: block;
  width: 72px;
  margin: 0 auto 0 calc(50% + 46px);
}
/* фото задаёт коробку -- целиком, без кропа */
.sign__photo {
  display: block;
  width: 100%;
  height: auto;
  filter: grayscale(1);
}
.sign__bubble {
  position: absolute;
  left: calc(100% + 18px);
  top: 7px;
  white-space: nowrap;
  padding: 5px 9px;
  background: #fff;
  border: 0.5px solid var(--hair);
  color: var(--ink);
  pointer-events: none;
}
/* хвостик облачка мысли: два кружка в сторону лица */
.sign__bubble::before,
.sign__bubble::after {
  content: "";
  position: absolute;
  background: #fff;
  border: 0.5px solid var(--hair);
  border-radius: 50%;
}
.sign__bubble::before { width: 8px; height: 8px; left: -13px; top: 21px; }
.sign__bubble::after  { width: 5px; height: 5px; left: -18px; top: 30px; }
/* footer sits in Times, same size as the body */
.foot .line {
  padding-top: 46px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--ink);
}
.foot .line a:hover { text-decoration: underline; text-underline-offset: 2.5px; }

/* ————— responsive ————— */

@media (max-width: 640px) {
  body { padding: 0 20px; }
  .cols { grid-template-columns: 1fr; gap: 32px; }
  .cols .rule { display: none; }
  .rail { grid-template-columns: 1fr; gap: 14px; }
  .measure { max-width: none; }
  .h-700 { height: min(644px, 80vh); }
  .skills { grid-template-columns: 1fr; gap: 23px; }
  .meta > div { grid-template-columns: 97px 1fr; gap: 12px; }
  .portrait { width: 124px; margin: 2px 0 12px 18px; }
  /* keep the sign-off bubble inside the page on narrow screens — tail flips too */
  .sign__bubble { left: auto; right: calc(100% + 18px); }
  .sign__bubble::before { left: auto; right: -13px; }
  .sign__bubble::after  { left: auto; right: -18px; }
  .gap-96 { height: 74px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

/* ————— гейт с паролем ————— */

.gate { padding-top: 64px; }
.gate form {
  display: flex;
  align-items: stretch;
  max-width: 260px;
  margin-top: 18px;
  border: 0.5px solid var(--ink);
}
.gate input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: none;
  font: inherit;
  color: inherit;
  padding: 7px 9px;
}
.gate input:focus { outline: none; }
.gate button {
  border: 0;
  border-left: 0.5px solid var(--ink);
  background: none;
  font-family: var(--sfmono);
  font-size: 12px;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 7px 11px;
  cursor: pointer;
}
.gate button:hover { background: var(--ink); color: #fff; }
.gate .msg { padding-top: 10px; visibility: hidden; }
.gate .msg.on { visibility: visible; }
