/* Resume — light theme, modern typography */
@import url("https://fonts.googleapis.com/css2?family=Libre+Baskerville:ital,wght@0,400;0,700;1,400&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
  --color-bg: #fafafa;
  --color-bg-elevated: #fff;
  --color-bg-subtle: #f0f0f0;
  /* Full-page mobile (light): cool gray — matches browser chrome / screenshots */
  --color-bg-mobile: #f0f2f5;
  --color-text: #1a1a1a;
  --color-text-muted: #5a5a5a;
  --color-accent: #0366d6;
  --color-accent-hover: #0256c2;
  --color-border: #e0e0e0;
  --color-catalog-line: rgba(0, 0, 0, 0.2);
  --color-catalog-row: rgba(0, 0, 0, 0.05);
  --font-serif: "Libre Baskerville", Georgia, "Times New Roman", serif;
  --font-sans: "Source Sans 3", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, "SF Mono", "Cascadia Code", Consolas, monospace;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --max-width: 52rem;
  --line-height: 1.65;
  --radius: 6px;
  /* Typographic scale — fewer sizes for consistency */
  --text-body: 0.95rem;
  --text-label: 0.9rem;
  --text-heading-sm: 1.05rem;
  --text-heading-md: 1.1rem;
  --text-heading-lg: 1.85rem;
  --text-mini: 0.75rem;
  --font-weight-normal: 400;
  --font-weight-medium: 600;
  --font-weight-bold: 700;
  /* Skills / Education grid — must match ::before vertical rule */
  --catalog-label-col: 9rem;
}

* {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  padding: var(--space-xl) var(--space-lg);
  background-color: #3d4d5e;
  color: var(--color-text);
  font-family: var(--font-sans);
  line-height: var(--line-height);
  font-weight: 400;
}

.page-bg,
.page-bg-chrome {
  display: none;
}

@media (min-width: 769px) {
  html {
    background-color: #3d4d5e;
  }

  .page-bg {
    display: block;
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background-color: #3d4d5e;
    background-image:
      url("../images/bg-texture-right.svg"),
      url("../images/bg-texture-left.svg"),
      linear-gradient(165deg, #3d4d5e 0%, #3a4a5a 50%, #324050 100%);
    background-position: right top, left top, 0 0;
    background-size: 360px 360px, 360px 360px, 100% 100%;
    background-attachment: fixed;
  }

  .page-bg-chrome {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: min(30vh, 13rem);
    z-index: -1;
    pointer-events: none;
    background: linear-gradient(
      to bottom,
      #3d4d5e 0%,
      #3d4d5e 18%,
      rgba(61, 77, 94, 0.72) 48%,
      rgba(61, 77, 94, 0.28) 78%,
      rgba(61, 77, 94, 0) 100%
    );
  }

  body {
    background-color: transparent;
    background-image: none;
  }
}

#Resume {
  max-width: var(--max-width);
  margin: 0 auto var(--space-2xl);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 8px;
  padding: var(--space-lg) var(--space-xl) var(--space-sm);
  box-shadow:
    0 8px 32px rgba(0, 0, 0, 0.25),
    0 2px 8px rgba(0, 0, 0, 0.15);
  border: none;
}

/* Header — avatar | name + contact | certs (aligned row) */
#Header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-xl);
  align-items: start;
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-md);
}

#Header img[alt=""] {
  width: 116px;
  height: 116px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  object-fit: cover;
}

#Header .header-text {
  min-width: 0;
}

#Header h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: var(--text-heading-lg);
  font-weight: var(--font-weight-bold);
  color: var(--color-text);
  letter-spacing: 0.01em;
}

#Header p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-text-muted);
}

#Header p a {
  color: var(--color-accent);
}

#Header .header-links {
  margin-top: var(--space-xs);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

#Header .header-links a {
  display: inline-flex;
  color: var(--color-text-muted);
  transition: color 0.2s, opacity 0.2s;
}

#Header .header-links a:hover {
  color: var(--color-accent);
}

#Header .icon-link {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* Muted link — e.g. Generic dot Business, blends with heading text */
a.muted-link {
  color: inherit;
}

a.muted-link:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Cert logos — horizontal row, vertically aligned */
#Header .certs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  align-self: start;
  margin-top: 6px;
  gap: var(--space-md);
}

#Header .certs a {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
}

#Header img.cert {
  height: 44px;
  width: auto;
  max-width: 70px;
  object-fit: contain;
  object-position: center;
  vertical-align: middle;
  opacity: 0.95;
  transition: opacity 0.2s;
}

#Header .certs a:hover img.cert {
  opacity: 1;
}

/* Links */
a {
  color: var(--color-accent);
  text-decoration: none;
}

a:hover {
  color: var(--color-accent-hover);
  text-decoration: underline;
}

/* Typography — uses scale from :root */
h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

h2 {
  font-family: var(--font-serif);
  font-size: var(--text-heading-sm);
  font-weight: var(--font-weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--color-text-muted);
  margin-top: var(--space-2xl);
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid var(--color-border);
}

h2:first-of-type {
  margin-top: 0;
}

h2[id],
h3[id],
h6[id] {
  scroll-margin-top: var(--space-xl);
}

h3 {
  font-family: var(--font-serif);
  font-size: var(--text-heading-md);
  font-weight: var(--font-weight-bold);
  margin-top: var(--space-lg);
  margin-bottom: 0;
}

h3:first-child {
  margin-top: 0;
}

h3.subsection {
  font-size: var(--text-heading-sm);
  font-weight: var(--font-weight-medium);
  margin-top: var(--space-lg);
  margin-bottom: var(--space-sm);
  color: var(--color-text);
}

h3.subsection:first-of-type {
  margin-top: 0;
}

/* Employer title + optional site link (deep link matches other section headings) */
h3.company-heading.section-heading.company-heading--with-site {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35em 0.75em;
}

h3.company-heading.section-heading.company-heading--with-site .section-anchor {
  flex: 1 1 auto;
  min-width: 0;
  align-items: baseline;
}

h3.company-heading.section-heading.company-heading--with-site .company-heading__site {
  flex: 0 0 auto;
  font-size: var(--text-label);
  font-weight: var(--font-weight-normal);
  color: var(--color-text-muted);
  text-decoration: none;
}

h3.company-heading.section-heading.company-heading--with-site .company-heading__site:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* Section heading deep links — inherit heading typography; paperclip on hover */
.section-heading .section-anchor {
  display: flex;
  align-items: center;
  gap: 0.4em;
  box-sizing: border-box;
  color: inherit;
  text-decoration: none;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

/* Full-width row only where the heading spans the section (not experience h3/h6) */
h2.section-heading .section-anchor,
h3.subsection.section-heading .section-anchor {
  width: 100%;
  align-items: center;
}

/* Experience: inline row so floats, line height, and vertical rhythm match pre-anchor layout */
ul.Section.experience h3.company-heading .section-anchor,
ul.Section.experience h6.job-role-heading .section-anchor {
  display: inline-flex;
  width: auto;
  max-width: 100%;
  align-items: baseline;
  vertical-align: baseline;
}

ul.Section.experience h3.company-heading .section-anchor__icon,
ul.Section.experience h6.job-role-heading .section-anchor__icon {
  flex-shrink: 0;
  position: relative;
  top: 0.1em;
}

ul.Section.experience h3.company-heading .section-anchor__label,
ul.Section.experience h6.job-role-heading .section-anchor__label {
  flex: 0 1 auto;
  min-width: 0;
}

.section-heading .section-anchor:hover,
.section-heading .section-anchor:focus-visible {
  color: inherit;
  text-decoration: none;
}

.section-heading .section-anchor__label {
  flex: 1;
  min-width: 0;
}

.section-heading .section-anchor__icon {
  flex-shrink: 0;
  width: 0.95em;
  height: 0.95em;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.section-heading:hover .section-anchor__icon,
.section-heading .section-anchor:focus-visible .section-anchor__icon {
  opacity: 0.42;
}

.section-heading .section-anchor:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 2px;
}

h6 {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text-muted);
  margin: 0.0625rem 0;
}

/* Job titles — body size, medium weight for hierarchy */
ul.Section li > h6:not(.location) {
  font-size: var(--text-body);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
}

h6.location {
  float: right;
  margin-top: 0;
}

/* Section lists */
ul.Section {
  list-style: none;
  padding: 0;
  margin: 0 0 var(--space-lg);
}

ul.Section > li {
  margin-bottom: var(--space-xl);
}

ul.Section > li:last-child {
  margin-bottom: 0;
}

/* Horizontal rules between employers */
ul.Section.experience > li {
  padding-top: var(--space-xl);
  border-top: 1px solid var(--color-border);
}

ul.Section.experience > li:first-child {
  padding-top: 0;
  border-top: none;
}

/* Contain floated location so margins and borders don’t collapse oddly */
ul.Section.experience > li::after {
  content: "";
  display: table;
  clear: both;
}

/* Space above the hr: add margin below last bullet list in each employer */
ul.Section.experience > li > ul:last-of-type {
  margin-bottom: var(--space-lg);
}

ul.Section ul {
  list-style: disc;
  padding-left: 1.35rem;
  margin: var(--space-sm) 0 0;
  color: var(--color-text);
}

ul.Section ul ul {
  list-style: circle;
  margin-top: var(--space-sm);
  color: var(--color-text);
  font-size: var(--text-body);
  line-height: var(--line-height);
}

ul.Section ul ul li {
  color: inherit;
}

ul.Section li {
  margin-bottom: var(--space-sm);
}

ul.Section li:last-child {
  margin-bottom: 0;
}

#Resume p {
  margin: 0 0 var(--space-sm);
  font-size: var(--text-body);
  color: var(--color-text);
}

p.overview {
  margin-bottom: var(--space-lg);
  max-width: 52rem;
}

ul.career-highlights {
  list-style: disc;
  padding-left: 1.35rem;
  margin: 0 0 var(--space-lg);
  max-width: 52rem;
  color: var(--color-text);
}

ul.career-highlights li {
  margin-bottom: var(--space-xs);
}

ul.career-highlights li:last-child {
  margin-bottom: 0;
}

ul.career-highlights p {
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.35;
}

/* Expertise — bullets + catalog */
#Skills {
  margin-top: var(--space-md);
}

#Skills .expertise-highlights {
  list-style: disc;
  padding-left: 1.35rem;
  margin: 0 0 var(--space-lg);
  color: var(--color-text);
}

#Skills .expertise-highlights li {
  margin-bottom: var(--space-xs);
}

#Skills .expertise-highlights li:last-child {
  margin-bottom: 0;
}

#Skills .expertise-highlights p {
  margin: 0;
  font-size: var(--text-body);
  color: var(--color-text);
  line-height: 1.35;
}

#Skills .expertise-catalog {
  margin-top: var(--space-lg);
}

#Skills .skills-compact {
  position: relative;
  display: grid;
  grid-template-columns: var(--catalog-label-col) 1fr;
  gap: 0 var(--space-md);
  align-items: baseline;
  margin: 0;
  font-size: var(--text-body);
  line-height: 1.5;
}

#Skills .skills-compact::before {
  content: "";
  position: absolute;
  left: var(--catalog-label-col);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-catalog-line);
  pointer-events: none;
}

#Skills .skills-compact dt {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm) var(--space-xs) 0;
  border-bottom: 1px solid var(--color-catalog-row);
}

#Skills .skills-compact dt:last-of-type {
  border-bottom: none;
}

#Skills .skills-compact dd {
  margin: 0;
  min-width: 0;
  padding: var(--space-xs) 0;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-catalog-row);
  overflow-wrap: anywhere;
}

#Skills .skills-compact dd:last-of-type {
  border-bottom: none;
}

/* Education & Training — same scale as Skills */
.education-compact {
  position: relative;
  display: grid;
  grid-template-columns: var(--catalog-label-col) 1fr;
  gap: 0 var(--space-md);
  align-items: baseline;
  margin: var(--space-md) 0 0;
  font-size: var(--text-body);
  line-height: 1.5;
}

.education-compact::before {
  content: "";
  position: absolute;
  left: var(--catalog-label-col);
  top: 0;
  bottom: 0;
  width: 1px;
  background: var(--color-catalog-line);
  pointer-events: none;
}

.education-compact dt {
  font-size: var(--text-label);
  font-weight: var(--font-weight-medium);
  color: var(--color-text);
  padding: var(--space-xs) var(--space-sm) var(--space-xs) 0;
  border-bottom: 1px solid var(--color-catalog-row);
}

.education-compact dt:last-of-type {
  border-bottom: none;
}

.education-compact dt a {
  color: inherit;
  text-decoration: none;
}

.education-compact dt a:hover {
  text-decoration: underline;
}

.education-compact dd {
  margin: 0;
  min-width: 0;
  padding: var(--space-xs) 0;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-catalog-row);
  overflow-wrap: anywhere;
}

.education-compact dd:last-of-type {
  border-bottom: none;
}

/* References */
.references {
  list-style: none;
  padding: 0;
}

.references li,
.references p {
  color: var(--color-text);
}

/* Binary footer — flex-wrap so bytes stay on octet boundaries but lines
   wrap reliably (inline + nowrap spans can overflow in WebKit/Safari). */
#BinaryFooter {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  gap: 0;
  margin-top: var(--space-lg);
  padding: var(--space-xs) var(--space-sm) 0;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--color-text);
  letter-spacing: 0.08em;
  opacity: 0.5;
  line-height: 1.4;
}

#BinaryFooter .binary-byte {
  flex: 0 0 auto;
  white-space: nowrap;
}

/* Force two balanced rows (32 bits each) on narrow screens */
#BinaryFooter .binary-row-break {
  display: none;
}

/* Responsive — mobile */
@media (max-width: 768px) {
  :root {
    --catalog-label-col: 7rem;
  }

  html {
    background: var(--color-bg-mobile);
  }

  body {
    padding: 0;
    padding-top: max(0px, env(safe-area-inset-top));
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
    padding-bottom: max(0px, env(safe-area-inset-bottom));
    font-size: 16px;
    background: var(--color-bg-mobile);
    background-image: none;
  }

  /* Full-bleed: page color only — no inner “card” fill */
  #Resume {
    max-width: none;
    width: 100%;
    margin: 0 0 var(--space-lg);
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: transparent;
    padding: var(--space-md) var(--space-md) var(--space-sm);
  }

  #BinaryFooter .binary-row-break {
    display: block;
    flex-basis: 100%;
    width: 100%;
    height: 0;
    overflow: hidden;
    padding: 0;
    margin: 0;
    border: 0;
  }

  #Header {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: var(--space-md);
    text-align: center;
  }

  #Header img[alt=""] {
    margin: 0 auto;
  }

  #Header .header-text {
    order: 1;
  }

  #Header .header-links {
    justify-content: center;
  }

  #Header .certs {
    flex-wrap: wrap;
    justify-content: center;
    order: 2;
    padding-top: var(--space-md);
    border-top: 1px solid var(--color-border);
  }

  #Header img.cert {
    height: 38px;
  }

  h6.location {
    float: none;
    text-align: inherit;
  }

  #Skills .skills-compact,
  .education-compact {
    grid-template-columns: var(--catalog-label-col) 1fr;
  }
}

/* Mobile dark only — desktop layout/colors unchanged */
@media (max-width: 768px) and (prefers-color-scheme: dark) {
  :root {
    --color-bg-mobile: #0d1117;
    --color-text: #e8eaed;
    --color-text-muted: #9aa0a6;
    --color-accent: #58a6ff;
    --color-accent-hover: #79b8ff;
    --color-border: #3d444d;
    --color-catalog-line: rgba(255, 255, 255, 0.16);
    --color-catalog-row: rgba(255, 255, 255, 0.07);
    /* Light backing for raster badges — keep subtle, not a full-width “card” */
    --color-cert-strip-bg: rgba(232, 236, 243, 0.92);
    --color-cert-strip-border: rgba(140, 150, 165, 0.35);
  }

  html {
    color-scheme: dark;
  }

  /* Shrink-wrapped strip: logos stay legible without a dominant framed bar */
  #Header .certs {
    display: inline-flex;
    flex-wrap: wrap;
    justify-content: center;
    align-self: center;
    width: auto;
    max-width: 100%;
    gap: var(--space-sm);
    margin-left: auto;
    margin-right: auto;
    margin-top: var(--space-xs);
    padding: var(--space-xs) var(--space-sm);
    background: var(--color-cert-strip-bg);
    border-radius: 4px;
    border: 1px solid var(--color-cert-strip-border);
    box-shadow: none;
  }

  #BinaryFooter {
    opacity: 0.55;
  }
}

@media (max-width: 480px) {
  :root {
    --catalog-label-col: 6rem;
  }

  #Skills .skills-compact,
  .education-compact {
    grid-template-columns: var(--catalog-label-col) 1fr;
  }

  #Header img.cert {
    height: 34px;
  }
}
