/* ============================================================================
   litin.io — Dmitri Litin
   Dependency-free. No external fonts, no trackers, no network calls.
   ========================================================================== */

:root {
  --ink:        #11253c;   /* near-navy, headings */
  --navy:       #16324f;   /* primary brand */
  --navy-700:   #1f4068;
  --accent:     #2f6db0;   /* links / interactive */
  --accent-600: #285f9b;
  --gold:       #b88a3e;   /* hairline accents */
  --paper:      #fbfaf7;   /* page background */
  --paper-2:    #f3f0ea;   /* alt sections */
  --card:       #ffffff;
  --slate:      #51616f;   /* body text */
  --slate-2:    #6b7884;   /* muted */
  --line:       #e4ddd2;   /* borders */
  --white:      #ffffff;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Apple Color Emoji", sans-serif;

  --content-w: 75%;        /* content spans 75% of the viewport width */
  --entry-w: 820px;        /* max width of a centered experience/education entry */
  --radius: 14px;
  --shadow: 0 1px 2px rgba(17,37,60,.05), 0 12px 32px -16px rgba(17,37,60,.18);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 76px; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--slate);
  background: var(--paper);
  line-height: 1.65;
  font-size: 1.0625rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-600); }
img { max-width: 100%; display: block; }

/* Inline links inside role/education/about content */
.role-co a, .edu-list a, .exp-earlier a { color: var(--navy-700); text-decoration: none; border-bottom: 1px solid var(--line); }
.role-co a:hover, .edu-list a:hover, .exp-earlier a:hover { color: var(--accent-600); border-bottom-color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 100;
  background: var(--navy); color: #fff; padding: .6rem 1rem; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

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

/* Shared centered content column (75% of viewport) */
.nav, .hero, .stats, .section, .contact-inner, .footer-inner, .footer-fine {
  width: var(--content-w);
  margin-inline: auto;
}

/* ---- Header / nav ---------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,250,247,.88);
  backdrop-filter: saturate(150%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav {
  padding: .85rem 0;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand-mark {
  font-family: var(--serif); font-weight: 700; font-size: .95rem; letter-spacing: .03em;
  background: var(--navy); color: #fff; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center;
}
.brand-name { font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }

.nav-links { list-style: none; display: flex; align-items: center; gap: 1.4rem; margin: 0; padding: 0; }
.nav-links a { color: var(--slate); font-size: .95rem; font-weight: 500; }
.nav-links a:hover { color: var(--ink); }
.nav-cta {
  background: var(--navy); color: #fff !important; padding: .5rem .95rem; border-radius: 999px;
  font-weight: 600 !important;
}
.nav-cta:hover { background: var(--navy-700); }
.nav-cta-ghost {
  background: transparent; color: var(--navy) !important;
  border: 1.5px solid var(--line);
}
.nav-cta-ghost:hover { background: transparent; border-color: var(--navy); }

.nav-toggle, .nav-burger { display: none; }
.nav-burger { width: 40px; height: 36px; cursor: pointer; flex-direction: column; justify-content: center; gap: 5px; }
.nav-burger span { display: block; height: 2px; background: var(--ink); border-radius: 2px; transition: .25s; }

/* ---- Buttons --------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.4rem; border-radius: 999px; font-weight: 600; font-size: 1rem;
  border: 1.5px solid transparent; cursor: pointer; transition: transform .15s ease, background .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-700); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--navy); color: var(--ink); }
.btn-light { background: #fff; color: var(--navy); }
.btn-light:hover { background: #f1eee8; color: var(--navy); }

/* ---- Hero ------------------------------------------------------------------ */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(1.5rem, 4vw, 3rem); }
.hero-inner { display: grid; grid-template-columns: 1.25fr .9fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.eyebrow { text-transform: uppercase; letter-spacing: .18em; font-size: .78rem; font-weight: 700; color: var(--gold); margin: 0 0 .9rem; }
.hero h1 { font-size: clamp(2.7rem, 7vw, 4.4rem); margin-bottom: .5rem; }
.hero-role { font-family: var(--serif); font-size: clamp(1.05rem, 2.4vw, 1.4rem); color: var(--navy-700); margin: 0 0 1.3rem; font-weight: 500; }
.hero-summary { font-size: 1.15rem; max-width: 34ch; margin: 0 0 1.9rem; color: var(--slate); }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; }

.hero-portrait {
  position: relative; border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid var(--line);
  aspect-ratio: 1 / 1; max-width: 360px; justify-self: end; width: 100%;
}
.hero-portrait::after {
  content: ""; position: absolute; inset: 0;
  box-shadow: inset 0 0 0 6px rgba(255,255,255,.55); border-radius: var(--radius); pointer-events: none;
}
.hero-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: center 22%; }

/* ---- Stats ----------------------------------------------------------------- */
.stats-grid {
  list-style: none; margin: 1rem 0 0; padding: 1.8rem 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stats-grid li { display: flex; flex-direction: column; gap: .25rem; }
.stat-num { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--navy); font-weight: 600; line-height: 1; }
.stat-label { font-size: .9rem; color: var(--slate-2); }

/* ---- Sections -------------------------------------------------------------- */
.section { padding: clamp(3.5rem, 8vw, 6rem) 0; }
.section-alt {
  background: var(--paper-2);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem);
}
.section-alt > * { width: 100%; margin-inline: auto; }
.section-head { margin-bottom: 2.4rem; }
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: .76rem; font-weight: 700; color: var(--gold); margin: 0 0 .6rem; }
.kicker::before { content: ""; display: inline-block; width: 26px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: .6rem; }
.section-head h2 { font-size: clamp(1.7rem, 4vw, 2.4rem); max-width: 22ch; }

.about-body { display: grid; gap: 1.2rem; font-size: 1.12rem; }

/* ---- Experience & Education entries span the full content width (85%) ------- */

/* ---- Experience groups ------------------------------------------------------ */
.exp-group + .exp-group { margin-top: 2.6rem; }
.group-label {
  font-family: var(--sans); font-size: .8rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .14em; color: var(--navy-700);
  margin: 0 0 1.1rem; padding-bottom: .55rem; border-bottom: 1px solid var(--line);
}

/* ---- Timeline / roles ------------------------------------------------------ */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.1rem; justify-items: center; }
.role {
  width: 100%;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.9rem); box-shadow: var(--shadow);
  border-left: 4px solid var(--navy);
}
.role-head { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem 1rem; margin-bottom: .9rem; }
.role-head h3 { font-size: 1.3rem; flex: 1 1 100%; }
.role-co { margin: .15rem 0 0; color: var(--navy-700); font-weight: 600; font-size: 1rem; }
.role-dates { margin: .15rem 0 0; color: var(--slate-2); font-size: .9rem; margin-left: auto; white-space: nowrap; }
.dot { color: var(--gold); margin: 0 .15rem; }
.role-arrow { color: var(--gold); font-weight: 400; }
.role-points { margin: 0; padding-left: 1.15rem; display: grid; gap: .5rem; }
.role-points li { padding-left: .15rem; }
.role-points strong { color: var(--ink); }
.exp-earlier { margin: 1.6rem auto 0; font-size: 1rem; color: var(--slate-2); }
.exp-earlier strong { color: var(--ink); }

/* ---- Expertise ------------------------------------------------------------- */
.pills { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 3rem; }
.pill {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: .55rem 1.05rem; font-size: .95rem; color: var(--ink); font-weight: 500;
}
.systems { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem 2.5rem; }
.sys-group h3 { font-size: 1.02rem; color: var(--navy); margin-bottom: .35rem; font-family: var(--sans); font-weight: 700; letter-spacing: .01em; }
.sys-group p { margin: 0; color: var(--slate); font-size: 1rem; }

/* ---- Education ------------------------------------------------------------- */
.edu-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; justify-items: center; }
.edu-list li {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.3rem clamp(1.2rem, 3vw, 1.8rem); box-shadow: var(--shadow);
}
.edu-list h3 { font-size: 1.15rem; }
.edu-list p { margin: .2rem 0 0; color: var(--slate); }
.edu-year { color: var(--gold); font-weight: 700; font-size: .9rem; white-space: nowrap; text-align: right; }

/* ---- Contact --------------------------------------------------------------- */
.contact { width: var(--content-w); margin-inline: auto; background: var(--navy); color: #fff; border-radius: var(--radius); }
.contact-inner { width: 100%; padding: clamp(3rem, 6vw, 4.5rem) clamp(1.5rem, 4vw, 3rem); text-align: center; }
.contact h2 { color: #fff; font-size: clamp(1.8rem, 4.5vw, 2.6rem); max-width: 20ch; margin: 0 auto 1rem; }
.kicker-light { color: #d8b878; }
.kicker-light::before { background: #d8b878; }
.contact-sub { color: #c5d2df; font-size: 1.1rem; margin: 0 0 2rem; }

/* ---- Footer ---------------------------------------------------------------- */
.site-footer { background: var(--ink); color: #c5d2df; padding: 2.5rem 0; }
.footer-inner {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.4rem;
}
.footer-brand { font-family: var(--serif); font-size: 1.15rem; color: #fff; font-weight: 600; }
.footer-meta { color: #8ba0b4; font-size: .92rem; }
.footer-social { margin-left: auto; display: inline-flex; gap: 1.3rem; }
.footer-inner a { color: #fff; font-weight: 600; }
.footer-inner a:hover { color: #d8b878; }
.footer-fine { margin-top: 1.3rem; font-size: .82rem; color: #7e93a8; border-top: 1px solid rgba(255,255,255,.08); padding-top: 1.2rem; }

/* ---- Hero availability cue --------------------------------------------------- */
.hero-availability {
  display: inline-flex; align-items: center; gap: .55rem;
  margin: 0 0 1.5rem; font-size: .95rem; font-weight: 600; color: var(--navy-700);
}
.hero-availability::before {
  content: ""; width: 9px; height: 9px; border-radius: 50%;
  background: #2e9e6b; box-shadow: 0 0 0 3px rgba(46,158,107,.18);
}

/* ---- About & Expertise: center-aligned (per request G) ---------------------- */
#about .section-head, #expertise .section-head { text-align: center; }
#about .section-head h2, #expertise .section-head h2 { margin-inline: auto; }
#about .about-body { margin-inline: auto; text-align: center; }
#expertise .pills { justify-content: center; }
#expertise .sys-group { text-align: center; }

/* ---- Services (How I help) -------------------------------------------------- */
#services .section-head { text-align: center; }
#services .section-head h2 { margin-inline: auto; }
.services-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.2rem;
}
.service {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: clamp(1.3rem, 3vw, 1.8rem); box-shadow: var(--shadow);
  border-top: 3px solid var(--gold); text-align: left;
}
.service h3 { font-size: 1.12rem; margin-bottom: .5rem; color: var(--navy); }
.service p { margin: 0; color: var(--slate); }

/* ---- Responsive ------------------------------------------------------------ */
@media (max-width: 820px) {
  :root { --content-w: 90%; }

  .nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    flex-direction: column; align-items: stretch; gap: 0;
    padding: .5rem 5% 1.2rem; display: none;
  }
  .nav-toggle:checked ~ .nav-links { display: flex; }
  .nav-links li { border-top: 1px solid var(--line); }
  .nav-links a { display: block; padding: .9rem .2rem; }
  .nav-cta, .nav-cta-ghost { text-align: center; margin-top: .8rem; }
  .nav-burger { display: flex; }

  .hero-inner { grid-template-columns: 1fr; }
  .hero-portrait { grid-row: 1; max-width: 220px; justify-self: start; }
  .hero-summary { max-width: 52ch; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 1.6rem 1rem; }
  .systems, .services-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .role-dates { margin-left: 0; }
}
