/* ==========================================================================
   Vadim Gurinov — personal site
   Light theme. Editorial serif headings, neutral grotesque body.
   ========================================================================== */

:root {
  --bg:            #FBFAF8;
  --bg-raised:     #FFFFFF;
  --bg-sunken:     #F3F1ED;
  --ink:           #16181C;
  --ink-soft:      #4A4F58;
  --ink-faint:     #868C96;
  --rule:          #E4E0D9;
  --rule-strong:   #CFC9BF;
  --accent:        #1F3A5F;
  --accent-soft:   #E8EDF3;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --shell:  1120px;
  --measure: 68ch;

  --step-0: 1rem;
  --step-1: 1.125rem;
  --step-2: clamp(1.35rem, 1.1rem + 0.8vw, 1.7rem);
  --step-3: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  --step-4: clamp(2.4rem, 1.6rem + 3.2vw, 4.25rem);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

img { max-width: 100%; height: auto; display: block; }

::selection { background: var(--accent); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

/* --- Layout primitives ---------------------------------------------------- */

.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 5vw, 2.5rem);
}

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem); }
.section--tight { padding-block: clamp(2.5rem, 5vw, 4rem); }
.section--sunken { background: var(--bg-sunken); }
.section + .section { border-top: 1px solid var(--rule); }
.section--sunken + .section,
.section--sunken { border-top: 1px solid var(--rule); }

.measure { max-width: var(--measure); }

/* Eyebrow label above section headings */
.eyebrow {
  font-size: 0.72rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 500;
  margin: 0 0 1rem;
}

.section-title {
  font-size: var(--step-3);
  margin-bottom: 1.5rem;
}

.lede {
  font-size: var(--step-1);
  line-height: 1.6;
  color: var(--ink-soft);
}

/* --- Header --------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 250, 248, 0.88);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--rule);
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 68px;
}

.wordmark {
  font-family: var(--serif);
  font-size: 1.05rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav { display: flex; align-items: center; gap: clamp(1rem, 2.5vw, 2rem); }

.nav a {
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  padding-block: 0.35rem;
  border-bottom: 1px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.nav a:hover { color: var(--ink); border-bottom-color: var(--rule-strong); }
.nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--rule-strong);
  border-radius: 3px;
  padding: 0.4rem 0.5rem;
  color: var(--ink);
  cursor: pointer;
  line-height: 0;
}
.nav-toggle svg { display: block; }

@media (max-width: 720px) {
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav {
    position: absolute;
    inset: 100% 0 auto;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg-raised);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem clamp(1.25rem, 5vw, 2.5rem) 1.25rem;
  }
  .nav[hidden] { display: none; }
  .nav a { padding-block: 0.7rem; border-bottom: 1px solid var(--rule); }
  .nav a:last-child { border-bottom: none; }
}

/* --- Hero ----------------------------------------------------------------- */

.hero { padding-block: clamp(3rem, 8vw, 6rem) clamp(3rem, 7vw, 5rem); }

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__name {
  font-size: var(--step-4);
  line-height: 1.02;
  margin-bottom: 1.25rem;
}

.hero__role {
  font-size: var(--step-1);
  color: var(--ink-soft);
  max-width: 40ch;
  margin-bottom: 2rem;
}

.hero__portrait {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: 0 1px 2px rgba(22, 24, 28, 0.06), 0 18px 40px -22px rgba(22, 24, 28, 0.35);
}
.hero__portrait img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: center 22%;
}

@media (max-width: 820px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__portrait { max-width: 340px; order: -1; }
}

/* --- Facts strip ---------------------------------------------------------- */

.facts {
  display: grid;
  /* Never 3-across: a fourth item would orphan onto its own row and the empty
     cell would expose the grid's rule colour. Two-by-two, or four in a line. */
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  background: var(--rule);
  border-block: 1px solid var(--rule);
}

@media (min-width: 1000px) {
  .facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.fact {
  background: var(--bg);
  padding: 1.5rem clamp(1rem, 2vw, 1.5rem);
}
.fact__label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.5rem;
}
.fact__value {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--ink);
  margin: 0;
}

/* --- Prose ---------------------------------------------------------------- */

.prose { max-width: var(--measure); font-size: var(--step-1); line-height: 1.72; color: var(--ink-soft); }

/* Justified, with hyphenation on. Without hyphens, justification opens rivers
   of white space; the two go together. Left ragged on narrow screens, where
   lines are too short for justification to do anything but damage. */
@media (min-width: 640px) {
  .prose p {
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
  }
}
.prose h2 { font-size: var(--step-2); color: var(--ink); margin: 2.5rem 0 1rem; }
.prose h2:first-child { margin-top: 0; }
.prose strong { color: var(--ink); font-weight: 600; }

/* --- Two-column split (label / content) ----------------------------------- */

.split {
  display: grid;
  grid-template-columns: minmax(0, 260px) minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 4rem);
  align-items: start;
}
@media (max-width: 780px) {
  /* Stacked, the aside heading's own bottom margin lands on top of the grid
     gap, which reads as a hole under short titles like "Trade". */
  .split { grid-template-columns: 1fr; gap: 1rem; }
  .split__aside .section-title { margin-bottom: 0; }
}

.split__aside { position: sticky; top: 92px; }
@media (max-width: 780px) { .split__aside { position: static; } }

/* --- Cards ---------------------------------------------------------------- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
  gap: clamp(1rem, 2vw, 1.5rem);
}

.card {
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: clamp(1.5rem, 3vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  border-color: var(--rule-strong);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -22px rgba(22, 24, 28, 0.5);
}

.card__meta {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0;
}
.card__title { font-size: 1.4rem; margin: 0; }
.card__body { font-size: 0.95rem; color: var(--ink-soft); margin: 0; line-height: 1.6; }
.card__link {
  margin-top: auto;
  font-size: 0.88rem;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-bottom: 1px solid var(--accent-soft);
  align-self: flex-start;
  padding-bottom: 2px;
}
.card__link:hover { border-bottom-color: var(--accent); }

/* --- Timeline ------------------------------------------------------------- */

.timeline { list-style: none; margin: 0; padding: 0; }

.timeline__item {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: clamp(1rem, 3vw, 2.5rem);
  padding-block: 1.75rem;
  border-top: 1px solid var(--rule);
}
.timeline__item:last-child { border-bottom: 1px solid var(--rule); }

.timeline__year {
  font-family: var(--serif);
  font-size: 1.15rem;
  color: var(--accent);
  padding-top: 0.1rem;
  white-space: nowrap;
}
.timeline__title { font-size: 1.25rem; margin: 0 0 0.4rem; }
.timeline__body { font-size: 0.97rem; color: var(--ink-soft); margin: 0; max-width: 62ch; }

@media (max-width: 620px) {
  .timeline__item { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* --- Definition list (education, holdings) -------------------------------- */

.deflist {
  margin: 0;
  /* Capped so the two columns stay near enough to read as pairs. Left to the
     full container width the eye cannot tell which value belongs to which. */
  max-width: 40rem;
}
.deflist__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.25rem 2rem;
  padding-block: 1.1rem;
  border-top: 1px solid var(--rule);
  align-items: baseline;
}
.deflist__row:last-child { border-bottom: 1px solid var(--rule); }
.deflist dt {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--ink);
  margin: 0;
}
.deflist dd { margin: 0; font-size: 0.95rem; color: var(--ink-soft); }

@media (max-width: 620px) {
  .deflist__row { grid-template-columns: 1fr; gap: 0.25rem; }
}

/* --- Buttons -------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.5rem;
  border-radius: 3px;
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn--primary { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.btn--primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn--ghost { border: 1px solid var(--rule-strong); color: var(--ink); background: transparent; }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }

.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  border-top: 1px solid var(--rule);
  background: var(--bg-sunken);
  padding-block: clamp(2.5rem, 5vw, 3.5rem);
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 3rem;
  justify-content: space-between;
  align-items: flex-start;
}
.site-footer a { color: var(--ink-soft); text-decoration: none; border-bottom: 1px solid var(--rule-strong); }
.site-footer a:hover { color: var(--ink); border-bottom-color: var(--ink); }
.site-footer__links { display: flex; flex-direction: column; gap: 0.5rem; }
.site-footer__legal { font-size: 0.8rem; color: var(--ink-faint); }

/* --- Utilities ------------------------------------------------------------ */

.stack > * + * { margin-top: 1rem; }
.stack-lg > * + * { margin-top: 2rem; }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.75rem 1.25rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* Two-up card grid — used where there are exactly four cards */
@media (min-width: 900px) {
  .cards--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* --- Secondary portrait (introduction aside) ------------------------------ */

/* Portrait headshot, 223x245 at source. Displayed at 200px so it stays inside
   its native resolution. Do not scale it up: replace the file first. */
.aside-portrait {
  width: 200px;
  max-width: 100%;
  margin: 1.75rem 0 0;
  border-radius: 20px;
  overflow: hidden;
  background: var(--bg-sunken);
  box-shadow: 0 1px 2px rgba(22, 24, 28, 0.06), 0 10px 24px -16px rgba(22, 24, 28, 0.4);
}
.aside-portrait img {
  width: 100%;
  height: auto;
  display: block;
}


/* --- Venture blocks -------------------------------------------------------
   Facts and links sit under the prose rather than in a tall stacked sidebar,
   which kept the right-hand column empty and the block several screens deep. */

.venture-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  gap: 1.15rem 2rem;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}
.venture-meta__label {
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.35rem;
}
.venture-meta__value {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.5;
  color: var(--ink);
}

.venture-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.5rem;
  margin-top: 1.5rem;
  font-size: 0.9rem;
}
.venture-links a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: 2px;
}
.venture-links a:hover { border-bottom-color: var(--accent); color: var(--ink); }
