/* ivanoff.app — home */

/* hero — avatar, name, one sentence */
.hero { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s5); }
.avatar {
  width: 64px; height: 64px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 1px solid var(--line-2);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line);
  filter: grayscale(.15) contrast(1.05);
}
h1 {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--fg);
}
.bio {
  position: relative;
  margin: var(--s3) 0 0;
  font-size: 20px;
  line-height: 1.45;
  font-weight: 500;
  letter-spacing: -.018em;
  color: var(--dim);
  max-width: 520px;
}
/* typing: the untyped tail stays in the layout (transparent), so lines never jump */
.bio .u { color: transparent; }
.cur {
  display: inline-block;
  width: 2px; height: 1.08em;
  margin: 0 -4px 0 2px;           /* zero advance: the caret never pushes text or wraps */
  vertical-align: -.17em;
  border-radius: 1px;
  background: var(--fg-2);
  transition: opacity .5s var(--ease);
}
.cur.blink { animation: blink 1.05s steps(2, jump-none) infinite; }
.cur.gone { opacity: 0; animation: none; }
@keyframes blink { 50% { opacity: 0; } }


/* chain: one chronological line */
.chain { position: relative; --gut: 76px; padding-left: var(--gut); }
.chain::before {
  content: "";
  position: absolute;
  left: calc(var(--gut) - 9px);
  top: 20px; bottom: 20px;
  width: 1px;
  background: var(--line-2);
  transform: scaleY(var(--growth, 1));
  transform-origin: top;
  transition: transform var(--chaindur, 1s) var(--ease);
}
.item {
  position: relative;
  display: block;
  padding: var(--s4) 0 var(--s4) var(--s5);
  text-decoration: none;
  color: inherit;
}
.item::before {
  content: "";
  position: absolute;
  inset: 2px -14px 2px calc(-1 * var(--gut) - 10px);
  border-radius: var(--r-lg);
  background: transparent;
  transition: background .25s;
  z-index: -1;
}
a.item:hover::before { background: rgba(255,255,255,.028); }

.dot {
  position: absolute;
  left: -12px; top: 27px;          /* centred on the chain line */
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--muted);
  transition: border-color .25s;
}
a.item:hover .dot { border-color: var(--dim); }


.iyear {
  position: absolute;
  left: calc(-1 * var(--gut));
  top: 21px;
  width: calc(var(--gut) - 26px);
  text-align: right;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: 0;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.ihead { display: flex; align-items: center; gap: var(--s3); }
.ititle { display: inline-flex; align-items: center; gap: 10px; min-width: 0; }
.mark {
  height: 22px; min-width: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 4px;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--bg-2);
  font-family: var(--mono); font-size: 11px; font-weight: 500; line-height: 1;
  color: var(--dim);
  transition: border-color .25s, color .25s, background .25s;
}
.mark img { height: 13px; width: auto; max-width: 14px; display: block; opacity: .8; filter: grayscale(1) brightness(1.5); transition: opacity .25s, filter .25s; }
.mark.wide { padding: 0 7px; }
.mark.wide img { height: 10px; max-width: 64px; }
a.item:hover .mark { border-color: var(--dim); color: var(--fg); background: var(--bg-3); }
a.item:hover .mark img { opacity: 1; filter: none; }
.iname { font-size: 16px; font-weight: 550; letter-spacing: -.012em; color: var(--fg); }
.ihead .pill { margin-left: auto; }
a.item:hover .pill { color: var(--fg); border-color: var(--dim); background: var(--bg-2); }
a.item:hover .pill .ar { transform: translateX(3px); }
a.item:hover .pill.ext .ar { transform: translate(2px, -2px); }
.idesc { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: var(--dim); max-width: 60ch; }

/* preview strip: stacked at rest, spreads on hover */
.prev {
  display: flex;
  margin-top: var(--s4);
  --w: 132px; --h: 84px; --ov: 40px;
  height: var(--h);
}
.prev.portrait { --w: 64px; --h: 128px; --ov: 34px; }
.prev img {
  width: var(--w); height: var(--h);
  flex: none;
  object-fit: cover; object-position: top;
  border-radius: var(--r);
  border: 1px solid var(--line-2);
  background: #111;
  box-shadow: 0 14px 34px -14px rgba(0,0,0,.95);
  filter: brightness(.82) saturate(.9);
  transition: transform .55s var(--ease), margin-left .55s var(--ease), filter .35s, border-color .35s;
}
.prev img + img { margin-left: calc(-1 * (var(--w) - var(--ov))); }
.prev img:nth-child(1) { transform: rotate(-2deg) translateY(2px); z-index: 1; }
.prev img:nth-child(2) { transform: rotate(1.2deg); z-index: 2; }
.prev img:nth-child(3) { transform: rotate(-1deg) translateY(1px); z-index: 3; }
.prev img:nth-child(2) { transition-delay: 30ms; }
.prev img:nth-child(3) { transition-delay: 60ms; }
a.item:hover .prev img { transform: none; filter: none; border-color: #353535; }
a.item:hover .prev img + img { margin-left: 10px; }

/* contacts */
.contacts { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); }
.contacts .pill { padding: 6px 12px; font-size: 12.5px; color: var(--fg-2); }
.contacts .pill .h { color: var(--muted); }
.contacts a.pill:hover .h { color: var(--fg-2); }

/* awards — org mark in a tile, year, name, one line */
.awards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s3); }
.award {
  display: flex; flex-direction: column;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--bg-2);
  color: inherit; text-decoration: none;
  transition: border-color .25s, background .25s, transform .3s var(--ease);
}
a.award:hover { border-color: var(--line-2); background: var(--bg-3); transform: translateY(-2px); }
.ahead { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); margin-bottom: 14px; }
.alogo {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line-2);
  background: var(--bg);
}
.alogo img { width: 18px; height: 18px; object-fit: contain; display: block; opacity: .82; transition: opacity .25s; }
a.award:hover .alogo img { opacity: 1; }
.ayear { font-family: var(--mono); font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.aname { font-size: 15px; font-weight: 550; letter-spacing: -.01em; color: var(--fg); }
.aname .ar { color: var(--faint); font-weight: 400; display: inline-block; margin-left: 4px; transition: transform .25s var(--ease), color .25s; }
a.award:hover .aname .ar { color: var(--fg); transform: translate(2px, -2px); }
.adesc { margin-top: 6px; font-size: 13.5px; line-height: 1.55; color: var(--dim); }
@media (max-width: 600px) { .awards { grid-template-columns: 1fr; } }

/* intro: hidden until revealed by script */
.pre { opacity: 0; transform: translateY(8px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.pre.in { opacity: 1; transform: none; }
.avatar.pre { transform: scale(.94); }
.no-js .pre, .no-js .reveal { opacity: 1; transform: none; }

@media (max-width: 600px) {
  .hero { gap: var(--s4); }
  .avatar { width: 56px; height: 56px; }
  h1 { font-size: 24px; }
  .bio { font-size: 18px; }
  .chain { --gut: 14px; }
  .chain::before { left: 4px; }
  .item { padding: var(--s3) 0 var(--s3) var(--s4); }
  .item::before { inset: 0 -8px 0 -8px; }
  .dot { left: -13px; top: 21px; }
  .iyear { position: static; display: block; width: auto; text-align: left; font-size: 11px; margin-bottom: 4px; }
  .ihead { flex-wrap: wrap; row-gap: 6px; }
  .ihead .pill { display: none; }
  .idesc { font-size: 12.5px; }
  .prev { --w: 104px; --h: 66px; --ov: 30px; }
  .prev.portrait { --w: 54px; --h: 108px; --ov: 26px; }
}
@media (hover: none) {
  .prev img { filter: none; }
}
