:root {
  /* brand palette: darkest -> lightest */
  --cobalt-900: #3d52a0;
  --cobalt-800: #3d52a0; /* same tone as 900: the only swatch dark enough for text-on-white contrast */
  --cobalt-700: #7091e6; /* decorative fills/borders — not text-safe on white, see note below */
  --cobalt-500: #8697c4; /* hover-only accent, one step lighter than 700 */
  --cobalt-100: #ede8f5;

  --ink: #172033;
  --text: #344054;
  --muted: #667085;
  --line: #adbbda;
  --background: #ede8f5;
  --white: #ffffff;
}

:root[data-theme="dark"] {
  --ink: #eef2f7;
  --text: #c7d0dd;
  --muted: #94a3b8;
  --line: #2a3548;
  --background: #0f1520;
  --white: #161d2b;
  --cobalt-100: #1c2a44;

  /* #3d52a0 only reaches ~2.6:1 against this near-black background;
     the lighter brand tone keeps labels/headings legible here. */
  --cobalt-800: var(--cobalt-700);
}

* {
  box-sizing: border-box;
}

/* new interactive elements default to a sane display before/without CSS-in-shadow paints */
skill-tag {
  display: inline-flex;
}

cv-nav {
  display: block;
}

reveal-on-scroll {
  display: block;
}

/*
 * The hidden starting state only applies once JS has confirmed it can
 * run the reveal animation (see the early `classList.add('js')` in
 * index.html). Without it, content stays visible instead of stuck
 * at opacity: 0 forever.
 */
html.js reveal-on-scroll {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

html.js reveal-on-scroll.is-visible {
  opacity: 1;
  transform: none;
}

html {
  font-size: 15px;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    Inter,
    ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  line-height: 1.55;
  transition: background-color 0.25s ease, color 0.25s ease;
}

.cv {
  width: 1200px;
  max-width: calc(100% - 40px);
  margin: 40px auto;
  background: var(--white);
  transition: background-color 0.25s ease;
}


/* =========================================================
   HEADER
   ========================================================= */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 50px;

  padding: 56px 64px 46px;

  background: var(--cobalt-900);
  color: white;
}

.hero h1 {
  margin: 0 0 8px;

  color: white;
  font-size: 42px;
  line-height: 1.05;
  letter-spacing: -1.5px;
  font-weight: 750;
}

.hero-title {
  margin-bottom: 24px;

  color: var(--cobalt-100);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1.4px;
}

.hero-summary {
  max-width: 760px;
  margin: 0;

  color: var(--cobalt-100);
  font-size: 15px;
  line-height: 1.7;
}

.contact {
  align-self: center;

  border-left: 2px solid var(--cobalt-700);
  padding-left: 20px;

  font-size: 13px;
  line-height: 1.9;
}

.contact a {
  color: white;
  text-decoration: none;
}

.hero strong {
  color: inherit;
}


/* =========================================================
   MAIN LAYOUT
   ========================================================= */

.cv-body {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 52px;

  padding: 48px 64px 60px;

  align-items: start;
}

.sidebar,
.content {
  min-width: 0;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.sidebar section {
  margin-bottom: 36px;
}

.content section {
  margin-bottom: 40px;
}

.section-title {
  margin: 0 0 18px;

  color: var(--cobalt-800);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sidebar .section-title {
  padding-bottom: 8px;
  border-bottom: 2px solid var(--cobalt-100);
}


/* =========================================================
   CORE EXPERTISE
   ========================================================= */

.expertise-group {
  margin-bottom: 18px;
}

.expertise-group strong {
  display: block;
  margin-bottom: 4px;

  color: var(--ink);
  font-size: 13px;
}

.expertise-group p {
  margin: 0;

  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-hint {
  margin: -8px 0 14px;

  color: var(--muted);
  font-size: 11px;
  font-style: italic;
}


/* =========================================================
   LANGUAGES
   ========================================================= */

.language {
  display: flex;
  justify-content: space-between;

  padding: 7px 0;

  border-bottom: 1px solid var(--line);

  font-size: 13px;
}

.language:last-child {
  border-bottom: 0;
}

.language span:first-child {
  color: var(--ink);
  font-weight: 650;
}

.language span:last-child {
  color: var(--muted);
}

.additional-tech {
  margin: 0;

  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.7;
}


/* =========================================================
   EXPERIENCE
   ========================================================= */

.experience-item {
  display: grid;
  grid-template-columns: 135px minmax(0, 1fr);
  gap: 28px;

  margin-bottom: 34px;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-meta {
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.experience-meta strong {
  display: block;
  margin-bottom: 4px;

  color: var(--cobalt-800);
  font-size: 12px;
}

.experience-meta span {
  display: block;
}

.experience-item h3 {
  margin: 0 0 3px;

  color: var(--ink);
  font-size: 20px;
  line-height: 1.25;
}

.company {
  margin-bottom: 13px;

  color: var(--cobalt-800);
  font-size: 13px;
  font-weight: 650;
}

.experience-item p {
  margin: 0 0 11px;
  font-size: 13px;
}

.experience-item ul {
  margin: 0;
  padding-left: 18px;
}

.experience-item li {
  margin-bottom: 6px;
  font-size: 13px;
}

strong {
  color: var(--ink);
}

/* =========================================================
   SKILL FILTER
   ========================================================= */

[data-skills] {
  transition: opacity 0.2s ease, outline-color 0.2s ease;
}

.skill-dim {
  opacity: 0.35;
}

.skill-match {
  outline: 2px solid var(--cobalt-700);
  outline-offset: 4px;
  border-radius: 6px;
}


/* =========================================================
   SELECTED SYSTEMS
   ========================================================= */

.systems {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 18px;
}

.system {
  padding: 14px 16px;

  border-left: 3px solid var(--cobalt-700);

  background: var(--cobalt-100);
}

.system h3 {
  margin: 0 0 5px;

  color: var(--cobalt-800);
  font-size: 13.5px;
}

.system p {
  margin: 0;

  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}


/* =========================================================
   TECHNICAL PROFILE
   ========================================================= */

.profile-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px 34px;
}

.profile-block h3 {
  margin: 0 0 5px;

  color: var(--ink);
  font-size: 13.5px;
}

.profile-block p {
  margin: 0;

  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.6;
}


/* =========================================================
   EDUCATION
   ========================================================= */

.education-item {
  margin-bottom: 14px;
}

.education-item:last-child {
  margin-bottom: 0;
}

.education-item strong {
  display: block;
  font-size: 13px;
}

.education-item span {
  display: block;

  color: var(--muted);
  font-size: 12px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media screen and (max-width: 850px) {

  .cv {
    max-width: calc(100% - 24px);
    margin: 12px auto;
  }

  .hero {
    grid-template-columns: 1fr;
    gap: 24px;

    padding: 38px 30px;
  }

  .hero h1 {
    font-size: 34px;
  }

  .cv-body {
    grid-template-columns: 1fr;
    gap: 40px;

    padding: 38px 30px;
  }

  .experience-item {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .systems,
  .profile-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   PRINT
   A4 PAPER + DESKTOP TWO-COLUMN LAYOUT
   ========================================================= */

@media print {

  @page {
    size: A4 portrait;
    margin: 10mm;
  }

  /*
   * Always print the light palette, regardless of the on-screen
   * dark mode toggle. The attribute selector is repeated here to
   * match (and, by source order, beat) the specificity of the
   * :root[data-theme="dark"] rule above — a bare :root alone loses
   * that specificity fight and would silently print dark mode.
   */
  :root,
  :root[data-theme="dark"] {
    --ink: #172033;
    --text: #344054;
    --muted: #667085;
    --line: #adbbda;
    --background: #ede8f5;
    --white: #ffffff;
    --cobalt-100: #ede8f5;
  }

  html,
  body {
    margin: 0;
    padding: 0;

    background: white;
  }

  /* Interactive-only chrome has no place in the PDF */
  cv-nav,
  .tag-hint {
    display: none !important;
  }

  /* Skill filtering is a screen-only affordance */
  .skill-dim {
    opacity: 1 !important;
  }

  .skill-match {
    outline: none !important;
  }

  reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }

  .cv {
    width: 100%;
    max-width: none;
    margin: 0;
  }

  /*
   * IMPORTANT:
   * Keep the desktop layout when printing.
   */

  .hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px;
    gap: 30px;

    padding: 30px 34px;
  }

  .hero h1 {
    font-size: 31px;
  }

  .hero-title {
    margin-bottom: 15px;
    font-size: 11px;
  }

  .hero-summary {
    font-size: 10.5px;
    line-height: 1.55;
  }

  .contact {
    font-size: 10px;
  }


  /*
   * THIS is what keeps Core Expertise/Languages
   * in the left column and Experience in the right.
   */

  .cv-body {
    display: grid;
    grid-template-columns: 205px minmax(0, 1fr);
    gap: 30px;

    padding: 30px 34px;

    align-items: start;
  }

  .sidebar {
    display: block;
  }

  .content {
    display: block;
  }


  /* Smaller print typography */

  .section-title {
    margin-bottom: 12px;
    font-size: 9.5px;
  }

  .expertise-group strong {
    font-size: 10px;
  }

  .expertise-group p,
  .additional-tech,
  .language {
    font-size: 9.5px;
  }


  /* Keep experience internally two-column */

  .experience-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 15px;

    margin-bottom: 25px;
  }

  .experience-meta {
    font-size: 8.5px;
  }

  .experience-meta strong {
    font-size: 9px;
  }

  .experience-item h3 {
    font-size: 15px;
  }

  .company {
    margin-bottom: 9px;
    font-size: 9.5px;
  }

  .experience-item p,
  .experience-item li {
    font-size: 9.5px;
  }

  .experience-item li {
    margin-bottom: 4px;
  }


  /* Keep these two-column as well */

  .systems,
  .profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .system {
    padding: 9px 11px;
  }

  .system h3 {
    font-size: 10px;
  }

  .system p,
  .profile-block p {
    font-size: 8.8px;
  }

  .profile-block h3 {
    font-size: 10px;
  }


  .education-item strong {
    font-size: 9.5px;
  }

  .education-item span {
    font-size: 8.8px;
  }


  /* Avoid ugly splits */

  .sidebar section,
  .experience-item,
  .system,
  .profile-block,
  .education-item {
    break-inside: avoid;
  }

  a {
    color: inherit;
    text-decoration: none;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  reveal-on-scroll {
    opacity: 1;
    transform: none;
    transition: none;
  }

  body,
  .cv,
  [data-skills] {
    transition: none;
  }
}