/* ===================================================================
   about-me.life — Viktor Konstantinov
   Personal site · light only · Bricolage Grotesque + Manrope
   =================================================================== */

:root {
  --ink:     #16202e;
  --text:    #37414f;
  --muted:   #66707e;
  --accent:  #2f5fd0;
  --accent-dark: #234aa8;
  --accent2: #e2704f;   /* warm coral, small doses */
  --accent3: #159a72;   /* teal green, small doses */
  --tint:    #f5f8fc;
  --tint-deep: #eaf0f8;
  --border:  #e2e8f1;
  --card:    #ffffff;

  --serif: "Bricolage Grotesque", "Segoe UI", Helvetica, Arial, sans-serif;
  --sans:  "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
           Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; overflow-x: clip; }

body {
  margin: 0;
  overflow-x: clip;   /* reveal transforms must never cause sideways scroll */
  background: #ffffff;
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-dark); text-decoration: underline; text-underline-offset: 3px; }
img { display: block; max-width: 100%; }
::selection { background: #d8e4f9; color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

p { margin: 0 0 14px; }
p:last-child { margin-bottom: 0; }
strong { color: var(--ink); font-weight: 600; }

.wrap { width: min(920px, 100% - 48px); margin-inline: auto; }

/* ===================================================================
   Hero
   =================================================================== */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(640px 420px at 8% -12%, rgba(226, 112, 79, .11), transparent 62%),
    radial-gradient(780px 520px at 94% 4%, rgba(47, 95, 208, .13), transparent 62%),
    radial-gradient(520px 380px at 70% 118%, rgba(21, 154, 114, .09), transparent 60%),
    linear-gradient(180deg, var(--tint) 0%, #ffffff 100%);
  border-top: 4px solid var(--accent);
  border-bottom: 1px solid var(--border);
}
/* slowly drifting dot grid */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 1px 1px, #d9e4f2 1.2px, transparent 0) 0 0 / 22px 22px;
  animation: dots-drift 80s linear infinite;
  pointer-events: none;
}
@keyframes dots-drift {
  to { background-position: 220px 110px; }
}

/* language switcher — compact dropdown showing only the current language */
.lang {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, 100% - 48px);
  display: flex;
  justify-content: flex-end;
  z-index: 5;
  pointer-events: none;          /* full-width rail; only the button is clickable */
}
.lang > * { pointer-events: auto; }

.lang__btn {
  list-style: none;              /* hide the details marker */
  cursor: pointer;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--text);
  background: rgba(255, 255, 255, .85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: 0 4px 14px -10px rgba(22, 32, 46, .3);
  transition: border-color .2s ease, color .2s ease, box-shadow .2s ease;
}
.lang__btn::-webkit-details-marker { display: none; }
.lang__btn:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}
.lang__globe {
  width: 14px;
  height: 14px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 1.6;
  stroke-linecap: round;
}
.lang__chev {
  width: 12px;
  height: 12px;
  flex: none;
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .2s ease;
}
.lang[open] .lang__chev { transform: rotate(180deg); }
.lang[open] .lang__btn {
  border-color: var(--accent);
  box-shadow: 0 6px 18px -10px rgba(47, 95, 208, .35);
}

.lang__menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 74px;
  display: grid;
  gap: 2px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 14px 30px -14px rgba(22, 32, 46, .3);
  animation: lang-pop .16s ease both;
}
@keyframes lang-pop {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
}
.lang__menu a {
  display: block;
  text-align: center;
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--muted);
  transition: background .15s ease, color .15s ease;
}
.lang__menu a:hover {
  background: var(--tint);
  color: var(--accent-dark);
  text-decoration: none;
}

.hero__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 48px;
  padding: 68px 0 62px;
}

.hero__photo {
  width: 196px;
  height: 196px;
  object-fit: cover;
  border-radius: 26px;
  flex: none;
  box-shadow:
    0 0 0 1px var(--border),
    0 22px 44px -18px rgba(22, 32, 46, .32);
  animation: photo-breathe 9s ease-in-out infinite;
}
/* the photo slowly "breathes" between organic shapes */
@keyframes photo-breathe {
  0%, 100% { border-radius: 26px; }
  50%      { border-radius: 42px 28px 46px 30px / 32px 44px 28px 42px; }
}

.hero__name {
  margin: 0 0 6px;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.2rem, 5vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.hero__role {
  margin: 0 0 22px;
  font-size: 1.18rem;
  color: var(--accent);
  font-weight: 500;
}

.contacts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 26px;
  font-size: 0.94rem;
}
.contacts a, .contacts span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.contacts a:hover { color: var(--accent-dark); }
.contacts svg {
  width: 17px;
  height: 17px;
  flex: none;
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ===================================================================
   Bands & section titles
   =================================================================== */
.band { padding: 58px 0; }
.band--tint {
  background:
    radial-gradient(700px 420px at 100% 0%, rgba(226, 112, 79, .05), transparent 60%),
    linear-gradient(135deg, #f3f7fc 0%, #f8f5f0 100%);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.band:last-child { padding-bottom: 84px; }

.sec {
  margin: 0 0 26px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.55rem, 3vw, 1.9rem);
  letter-spacing: -0.01em;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 16px;
}
/* short accent dash before the title */
.sec::before {
  content: "";
  width: 34px;
  height: 4px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--accent) 55%, var(--accent2));
  flex: none;
}

.prose { max-width: 72ch; }
.lead {
  font-size: 1.13rem;
  line-height: 1.78;
}

/* ===================================================================
   Key Skills
   =================================================================== */
.skills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.skill {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 20px 22px;
  transition: border-color .2s ease, box-shadow .2s ease;
}
.skill:hover {
  border-color: #c7d6ee;
  box-shadow: 0 6px 18px -12px rgba(22,32,46,.18);
}
.skill--wide { grid-column: 1 / -1; }
.skill__name {
  margin: 0 0 6px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 9px;
}
.skill__name::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 3px;
  background: var(--accent);
  flex: none;
}
/* rotate marker colours across the grid */
.skill:nth-child(3n+2) .skill__name::before { background: var(--accent2); }
.skill:nth-child(3n)   .skill__name::before { background: var(--accent3); }
.skill p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ===================================================================
   Experience
   =================================================================== */
.job {
  border-left: 3px solid var(--tint-deep);
  padding-left: 28px;
  position: relative;
}
.job::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 8px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--border);
  animation: dot-ping 3.2s ease-out infinite;
}
/* soft sonar ring emanating from the timeline dot */
@keyframes dot-ping {
  0%, 25% { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--border), 0 0 0 5px rgba(47, 95, 208, .30); }
  70%     { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--border), 0 0 0 18px rgba(47, 95, 208, 0); }
  100%    { box-shadow: 0 0 0 4px #fff, 0 0 0 5px var(--border), 0 0 0 18px rgba(47, 95, 208, 0); }
}

.job__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 14px;
  margin-bottom: 10px;
}
.job__role {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.45rem;
  color: var(--ink);
}
.job__where { margin: 0; color: var(--muted); font-size: 1.02rem; }
.job__where em { color: var(--muted); }

.job__intro { margin-bottom: 26px; }

.track { margin-top: 24px; }
.track__name {
  margin: 0 0 12px;
  font-family: var(--sans);
  font-size: 1.04rem;
  font-weight: 600;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 16px 6px 13px;
  background: var(--tint);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.track__name::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex: none;
}

/* ===================================================================
   Bullet lists
   =================================================================== */
.dots {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 9px;
  max-width: 78ch;
}
.dots li {
  position: relative;
  padding-left: 22px;
  line-height: 1.62;
}
.dots li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 0.65em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  opacity: .55;
}
.dots--sm li { font-size: 0.94rem; }

/* ===================================================================
   Key Projects
   =================================================================== */
.projects-note {
  margin: -6px 0 26px;
  color: var(--muted);
  max-width: 78ch;
}

.projects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 26px 28px;
  box-shadow: 0 1px 2px rgba(22,32,46,.03);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #c7d6ee;
  box-shadow: 0 14px 30px -16px rgba(22,32,46,.24);
}

.card__name {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.28rem;
  color: var(--ink);
  line-height: 1.25;
}
.card__kind {
  margin: 3px 0 10px;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 500;
}
.card__desc { margin-bottom: 14px; color: var(--text); }

/* ===================================================================
   Education
   =================================================================== */
.edu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.edu li {
  background: var(--tint);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 12px;
  padding: 16px 20px;
  font-size: 0.97rem;
  line-height: 1.55;
  transition: background .2s ease, box-shadow .2s ease;
}
.edu li:nth-child(2) { border-left-color: var(--accent2); }
.edu li:nth-child(3) { border-left-color: var(--accent3); }
.edu li:nth-child(4) { border-left-color: #b98b2e; }
.edu li:hover {
  background: #fff;
  box-shadow: 0 6px 18px -12px rgba(22,32,46,.16);
}

/* ===================================================================
   Scroll-reveal & motion
   =================================================================== */
/* translate/fade reveals (no hover-transform conflicts) */
.rv-t {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity .65s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms),
    transform .65s cubic-bezier(.22, 1, .36, 1) var(--d, 0ms);
}
.rv-t.rv--zoom  { transform: scale(.86) translateY(12px); }
.rv-t.rv--left  { transform: translateX(-30px) rotate(-.5deg); }
.rv-t.rv--right { transform: translateX(30px) rotate(.5deg); }
.rv-t.in { opacity: 1; transform: none; }

/* blur-in reveals for hoverable cards (keeps hover transforms snappy) */
.rv-b {
  opacity: 0;
  filter: blur(9px);
  transition:
    opacity .6s ease var(--d, 0ms),
    filter .6s ease var(--d, 0ms),
    transform .2s ease,
    box-shadow .2s ease,
    border-color .2s ease,
    background .2s ease;
}
.rv-b.in { opacity: 1; filter: none; }

/* section title dash draws itself in */
.sec.rv-t::before { width: 0; transition: width .55s cubic-bezier(.22, 1, .36, 1) calc(var(--d, 0ms) + 180ms); }
.sec.rv-t.in::before { width: 34px; }

/* skill marker square spins on card hover */
.skill__name::before { transition: transform .35s cubic-bezier(.34, 1.56, .64, 1); }
.skill:hover .skill__name::before { transform: rotate(135deg); }

/* underline draws in on contact links */
.contacts a {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-size: 0% 1.5px;
  background-position: 0 100%;
  transition: background-size .3s ease, color .2s ease;
}
.contacts a:hover { text-decoration: none; background-size: 100% 1.5px; }

@media (prefers-reduced-motion: reduce) {
  .rv-t, .rv-b { opacity: 1 !important; transform: none !important; filter: none !important; transition: none !important; }
  .sec.rv-t::before { width: 34px; transition: none; }
  .hero::before, .hero__photo, .job::before { animation: none; }
  html { scroll-behavior: auto; }
}

/* ===================================================================
   Responsive
   =================================================================== */
@media (max-width: 780px) {
  .hero__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 26px;
    padding: 44px 0 40px;
  }
  .hero__photo { width: 152px; height: 152px; border-radius: 20px; }
  .contacts { flex-direction: column; gap: 10px; }
  .skills, .projects, .edu { grid-template-columns: 1fr; }
  .band { padding: 44px 0; }
  .job { padding-left: 20px; }
}

/* phones: centred hero, tappable contact pills */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap { width: min(920px, 100% - 36px); }

  .lang { top: 14px; }

  .hero__inner {
    align-items: center;
    text-align: center;
    gap: 22px;
    padding: 78px 0 38px;   /* clear air between the switcher and the photo */
  }
  .hero__photo { width: 168px; height: 168px; border-radius: 24px; }
  .hero__name { font-size: 2.1rem; }
  .hero__role { margin-bottom: 18px; }

  .contacts { width: 100%; max-width: 360px; margin-inline: auto; gap: 9px; }
  .contacts li { width: 100%; }
  .contacts a, .contacts span {
    width: 100%;
    min-width: 0;
    justify-content: center;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 11px 14px;
    font-size: 0.9rem;
    overflow-wrap: anywhere;
    box-shadow: 0 1px 2px rgba(22, 32, 46, .04);
  }
  .contacts a:active { background: var(--tint); }

  .band { padding: 38px 0; }
  .band:last-child { padding-bottom: 64px; }
  .sec { margin-bottom: 20px; }
  .sec::before { width: 26px; }
  .sec.rv-t.in::before { width: 26px; }

  .skill, .card { padding: 20px; border-radius: 14px; }
  .job { padding-left: 18px; }
  .job__role { font-size: 1.3rem; }
  .track__name { white-space: normal; line-height: 1.4; }
  .dots li { padding-left: 19px; }
}

/* ===================================================================
   Print
   =================================================================== */
@media print {
  .hero { border-top: none; background: #fff; }
  .band--tint { background: #fff; border: none; }
  .card, .skill, .edu li { break-inside: avoid; }
  a { color: var(--text); }
}
