/* =========================================================================
   Peter Olkhovets, resume
   Warm paper, ink, one editor's blue. A scroll, top to bottom.
   ========================================================================= */

:root {
  --paper:      #E9E2D1;   /* warm, slightly greyed, not AI cream */
  --paper-card: #F2ECDD;   /* lifted card stock */
  --ink:        #1B1710;   /* warm near-black */
  --ink-soft:   #5E5644;   /* muted secondary */
  --blue:       #1E33C0;   /* the accent / second voice */
  --blue-deep:  #15259a;
  --rule:       #CDC2A8;   /* hairline */

  --maxw: 50rem;

  --fr: "Fraunces", Georgia, serif;
  --ns: "Newsreader", Georgia, serif;
  --mn: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ns);
  font-size: clamp(1.0625rem, 0.97rem + 0.45vw, 1.2rem);
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }

/* faint paper grain */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
  background-image: radial-gradient(rgba(27,23,16,0.025) 1px, transparent 1.4px);
  background-size: 4px 4px;
}

.skip {
  position: absolute;
  left: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: 0.5rem 0.9rem;
  font-family: var(--mn); font-size: 0.8rem; z-index: 10;
}
.skip:focus { left: 0.75rem; top: 0.75rem; }

.page {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(2.5rem, 6vw, 5.5rem) 1.5rem 4rem;
}

/* -------------------------------------------------------------- masthead */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding-bottom: clamp(1.75rem, 4vw, 2.75rem);
  margin-bottom: clamp(2rem, 5vw, 3.25rem);
}
.name {
  font-family: var(--fr);
  font-weight: 400;
  font-size: clamp(2.7rem, 6vw + 1rem, 5.25rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
  margin: 0 0 1rem;
  text-wrap: balance;
}
.standfirst {
  font-size: clamp(1.2rem, 1rem + 0.8vw, 1.5rem);
  line-height: 1.4;
  max-width: 34ch;
  margin: 0 0 1.6rem;
}
.standfirst em { font-style: italic; }
.contact {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem 1.4rem;
  padding: 0;
  margin: 0;
}
.contact a {
  font-family: var(--mn);
  font-size: 0.84rem;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 2px;
  transition: color 0.16s, border-color 0.16s;
}
.contact a:hover { color: var(--blue-deep); border-color: var(--blue); }

/* --------------------------------------------------------------- section */
.section {
  padding: clamp(1.75rem, 4vw, 2.75rem) 0;
  border-bottom: 1px solid var(--rule);
}
.section:last-of-type { border-bottom: 0; }
.section__label {
  font-family: var(--mn);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--blue);
  margin: 0 0 1.75rem;
}

/* On wide screens the section name sits in the margin, like a printed page. */
@media (min-width: 50rem) {
  .section {
    display: grid;
    grid-template-columns: 8rem 1fr;
    gap: 2.5rem;
  }
  .section__label {
    grid-column: 1;
    margin: 0;
    position: sticky;
    top: 2rem;
    align-self: start;
    text-align: right;
  }
  .section__body { grid-column: 2; }
}

/* ----------------------------------------------------------------- entry */
.entry { margin: 0 0 2rem; }
.entry:last-child { margin-bottom: 0; }
.entry__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin-bottom: 0.5rem;
}
.entry__org {
  font-family: var(--fr);
  font-weight: 500;
  font-size: 1.3rem;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0;
}
.entry__role {
  font-family: var(--ns);
  font-style: italic;
  font-weight: 400;
  font-size: 1.05rem;
  color: var(--blue);
  letter-spacing: 0;
}
.entry__role::before { content: ", "; color: var(--ink-soft); font-style: normal; }
.entry__meta {
  font-family: var(--mn);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0;
  white-space: nowrap;
}
.entry__line {
  margin: 0;
  font-size: 1.08rem;
  line-height: 1.5;
}

/* expandable highlights */
.more { margin-top: 0.7rem; }
.more summary {
  font-family: var(--mn);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--blue);
  cursor: pointer;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.15rem 0;
  user-select: none;
}
.more summary::-webkit-details-marker { display: none; }
.more summary::before {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.05rem;
  height: 1.05rem;
  border: 1px solid var(--blue);
  font-size: 0.9rem;
  line-height: 1;
}
.more[open] summary::before { content: "\2013"; } /* en dash bar = minus */
.more summary:hover { color: var(--blue-deep); }
.more summary:focus-visible { outline: 2px solid var(--blue); outline-offset: 3px; }
.more .bullets { margin-top: 0.8rem; }

/* bullets with a hairline-blue marker */
.bullets {
  list-style: none;
  margin: 0;
  padding: 0;
}
.bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.4rem;
  line-height: 1.5;
}
.bullets li:last-child { margin-bottom: 0; }
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 0.6rem;
  height: 1px;
  background: var(--blue);
}

/* ---------------------------------------------------------------- skills */
.skills { margin: 0; }
.skills__row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.2rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--rule);
}
.skills__row:first-child { border-top: 0; padding-top: 0; }
.skills dt {
  font-family: var(--mn);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--blue);
}
.skills dd {
  margin: 0;
  font-size: 1.02rem;
  line-height: 1.5;
}
@media (min-width: 34rem) {
  .skills__row { grid-template-columns: 8rem 1fr; gap: 1.5rem; align-items: baseline; }
}

/* -------------------------------------------------------------- colophon */
.colophon {
  margin-top: clamp(2.5rem, 6vw, 3.5rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 1.5rem;
}
.colophon p {
  font-family: var(--mn);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  color: var(--ink-soft);
  margin: 0;
}

/* --------------------------------------------------- scroll reveal (light) */
.reveal { opacity: 0; transform: translateY(14px); }
.reveal.is-in {
  opacity: 1;
  transform: none;
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.no-js .reveal { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
}
