:root {
  --bg: #12100e;        /* deep espresso */
  --card: #1c1917;      /* coffee brown */
  --text: #f5f5f4;      /* ivory */
  --muted: #a8a29e;     /* taupe grey */
  --brand: #f59e0b;     /* amber/gold accent */
  --brand-2: #fbbf24;   /* lighter amber */
  --chip: #292524;      /* dark mocha chip */
  --border: #3f3f3f;    /* warm border */
}




:root[data-theme='light'] {
--bg: #f8fbff;
--card: #ffffff;
--text: #1d2939;
--muted: #667085;
--brand: #0f4c81;
--brand-2: #127fbf;
--chip: #f2f4f7;
--border: #e5e7eb;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: linear-gradient(180deg, var(--bg), color-mix(in oklab, var(--bg), var(--card) 20%));
}

.container { max-width: 1100px; margin: 0 auto; padding: 1.25rem; }

.skip-link { position: absolute; left: -999px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.skip-link:focus { position: static; width: auto; height: auto; background: var(--brand); color: #fff; padding: .5rem 1rem; border-radius: .5rem; }

.site-header { border-bottom: 1px solid var(--border); backdrop-filter: saturate(120%) blur(6px); position: sticky; top: 0; z-index: 10; background: color-mix(in oklab, var(--card), transparent 20%); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.id-block { display: flex; align-items: center; gap: 1rem; }
.avatar { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; border: 2px solid var(--brand); }

h1 { font-size: clamp(1.5rem, 4vw, 2rem); margin: .25rem 0; }
.muted { color: var(--muted); }

.contact { display: flex; gap: .5rem; flex-wrap: wrap; }
.chip { border: 1px solid var(--border); background: var(--chip); color: var(--text); padding: .5rem .75rem; border-radius: 999px; text-decoration: none; font-weight: 600; }
.chip:hover { border-color: var(--brand-2); }

.card { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 1.25rem; margin: 1rem 0; box-shadow: 0 8px 24px rgba(0,0,0,.1); }

.tags { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.tag { background: color-mix(in oklab, var(--brand), white 85%); color: #0f2740; border: 1px solid var(--border); padding: .35rem .6rem; border-radius: 999px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 1rem; }
.xp-card { border: 1px solid var(--border); border-radius: 14px; padding: 1rem; background: linear-gradient(180deg, var(--card), color-mix(in srgb, var(--card), #000 5%)); }
.xp-head h3 { margin: 0 0 .25rem; font-size: 1.05rem; }
.dates { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

.bullet { padding-left: 1rem; }
.bullet li { margin: .35rem 0; }

.timeline { list-style: none; padding: 0; }
.timeline li { padding: .5rem 0; border-bottom: 1px dashed var(--border); }
.timeline li:last-child { border-bottom: 0; }

.mt-24 { margin-top: 1.25rem; }
.flex-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }

.site-footer { color: var(--muted); text-align: center; margin: 2rem 0; }

/* ------- Credentials (grouped) ------- */
.sub-card { margin-top: 1rem; padding-top: .5rem; border-top: 1px dashed var(--border); }
.sub-card h3 { margin: 0 0 .5rem; font-size: 1.05rem; }

.credentials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  align-items: stretch;  /* ensure all grid items in the row are equal height */
}

.credential-card .caption {
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
  min-height: 1.7em;     /* optional: keeps two-line titles from shifting heights */
}


.credential-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--card);
  padding: .75rem;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08);
  display: flex;
  flex-direction: column;
  /* was: justify-content: center; */
  justify-content: flex-start;   /* top-align */
  align-items: stretch;          /* let image span full card width */

}

.credential-card img {
  max-width: 100%;
  height: auto;
  max-height: var(--thumb-h);        /* key: keeps cards in a row similar height */
  object-fit: contain;               /* preserve aspect ratio without cropping */
  align-self: stretch;
  border-radius: 8px;
  cursor: zoom-in;
  transition: transform .2s ease;
}
.credential-card img:hover { transform: scale(1.02); }

.caption {
  margin-top: .5rem;
  font-size: .85rem;
  color: var(--muted);
  text-align: center;
}

/* Lightbox Overlay */
.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  inset: 0;
  padding-top: 5%;
  background-color: rgba(0,0,0,0.9);
}
.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 85vh;
}
.lightbox-close {
  position: absolute;
  top: 20px;
  right: 28px;
  background: transparent;
  border: 0;
  color: #fff;
  font-size: 40px;
  cursor: pointer;
}
/* Smooth scroll behavior */
html { scroll-behavior: smooth; }

/* Sub-navigation (jump links) */
.subnav {
  position: sticky;
  top: 64px;              /* sits below your sticky header */
  z-index: 5;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
  padding: .5rem 0 0.75rem;
  margin-bottom: .75rem;
  background: color-mix(in oklab, var(--card), transparent 10%);
  backdrop-filter: blur(6px);
  border-bottom: 1px dashed var(--border);
}

.subnav a {
  display: inline-block;
  padding: .4rem .7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--text);
  background: var(--chip);
  font-weight: 600;
  font-size: .9rem;
}

.subnav a:hover { border-color: var(--brand-2); }
.subnav a.active {
  background: color-mix(in oklab, var(--brand), white 80%);
  color: #0f2740;
  border-color: var(--brand);
}

/* Make anchor targets land nicely below sticky header */
.sub-card { scroll-margin-top: 96px; }

/* Print: for clean PDF export */
@media print {
  :root { --bg: #fff; --card: #fff; --text: #000; --muted: #444; --border: #ddd; }
  body { background: #fff; }
  .site-header, #themeToggle, #printBtn { display: none !important; }
  .card { box-shadow: none; border-color: #bbb; }
  a { color: #000; text-decoration: none; }
  .xp-card { break-inside: avoid; }
}
