/* ---------- Design tokens ---------- */
:root {
  --bg:        #0b1220;
  --bg-2:      #101a2e;
  --surface:   #f7f5f0;
  --surface-2: #ffffff;
  --ink:       #16202e;
  --ink-soft:  #4b586b;
  --muted:     #7c8797;
  --line:      #e3ded4;
  --accent:    #c8742a;
  --accent-2:  #e2a15c;
  --teal:      #1f7a8c;
  --radius:    18px;
  --shadow:    0 24px 60px -30px rgba(11, 18, 32, .45);
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body:    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(200,116,42,.22), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(31,122,140,.25), transparent 60%),
    var(--bg);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }
a { color: var(--teal); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }

.skip-link {
  position: absolute; left: -999px; top: 0;
  padding: .5rem .75rem; background: var(--accent); color: #fff; z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Layout shell ---------- */
.site-shell {
  width: min(1100px, 100% - 2rem);
  margin: 0 auto;
  padding-block: 1.25rem 3rem;
}

/* ---------- Header / hero (dark) ---------- */
.site-header { color: #f3efe7; }

.site-header__top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: .5rem 0 1.5rem;
}

.brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -.01em;
  color: #fff;
  text-decoration: none;
}
.brand::before {
  content: "";
  display: inline-block; width: .6em; height: .6em; margin-right: .5em;
  border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 4px rgba(226,161,92,.25);
  vertical-align: baseline;
}

.site-nav { display: flex; gap: .25rem; flex-wrap: wrap; }
.site-nav a {
  color: #d8dde6; text-decoration: none; font-weight: 500; font-size: .95rem;
  padding: .5rem .9rem; border-radius: 999px;
  transition: background .15s, color .15s;
}
.site-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.site-nav a[aria-current="page"] { background: rgba(255,255,255,.14); color: #fff; }

.hero {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2.5rem;
  align-items: center;
  padding: 1rem 0 3rem;
}
.eyebrow {
  margin: 0 0 .75rem;
  font-size: .78rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--accent-2);
}
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 6vw, 4.4rem);
  line-height: 1.02;
  letter-spacing: -.03em;
  margin: 0 0 1rem;
  color: #fff;
}
.lede { font-size: 1.15rem; color: #c9d0db; max-width: 36rem; margin: 0 0 1.75rem; }

.hero__actions { display: flex; gap: .75rem; flex-wrap: wrap; }

.btn {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .75rem 1.25rem; border-radius: 999px;
  font-weight: 600; text-decoration: none; font-size: .95rem;
  transition: transform .15s, background .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: #b3651f; color: #fff; }
.btn--ghost { color: #fff; border: 1px solid rgba(255,255,255,.3); }
.btn--ghost:hover { border-color: #fff; color: #fff; }

.hero__photo {
  width: 100%; max-width: 300px; height: auto; aspect-ratio: 2 / 3; object-fit: cover;
  justify-self: end;
  border-radius: var(--radius);
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,255,255,.08);
  transform: rotate(2deg);
}

/* ---------- Main content (light card) ---------- */
.site-main {
  background: var(--surface);
  border-radius: calc(var(--radius) + 6px);
  padding: clamp(1.5rem, 4vw, 3rem);
  box-shadow: var(--shadow);
}

.site-main h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  letter-spacing: -.02em;
  margin: 0 0 .5rem;
}
.site-main h2:not(:first-child) { margin-top: 2.75rem; }
.site-main h3 {
  font-size: 1.05rem; font-weight: 600; letter-spacing: .01em;
  margin: 2rem 0 .5rem; color: var(--ink-soft);
}
.section-intro { color: var(--ink-soft); margin: 0 0 1.5rem; max-width: 60ch; }
.muted { color: var(--muted); }

/* Cards (home page) */
.card-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  margin-top: 1.5rem;
}
.card {
  display: flex; flex-direction: column; gap: .5rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-decoration: none; color: inherit;
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 16px 40px -24px rgba(11,18,32,.5); border-color: var(--accent-2); color: inherit; }
.card__kicker { font-size: .75rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.card h3 { margin: 0; font-size: 1.15rem; color: var(--ink); }
.card p { margin: 0; color: var(--ink-soft); font-size: .95rem; flex: 1; }
.card__cta { font-weight: 600; color: var(--teal); }
.card:hover .card__cta { color: var(--accent); }

/* Link lists (presentations, downloads) */
.link-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .5rem; }
.link-list li a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  padding: .9rem 1.1rem;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px;
  text-decoration: none; color: var(--ink); font-weight: 500;
}
.link-list li a:hover { border-color: var(--accent-2); color: var(--ink); }
.link-list .tag {
  font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase;
  color: var(--muted); background: var(--surface); padding: .25rem .55rem; border-radius: 6px;
}

/* Tables */
.table-wrap { overflow-x: auto; margin: 1rem 0 0; }
table {
  width: 100%; border-collapse: collapse;
  background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 12px; overflow: hidden;
  font-size: .97rem;
}
th, td { padding: .8rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  font-size: .75rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); background: #f1ede5;
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fbfaf7; }
td:empty::before { content: "\2014"; color: var(--line); }

/* Preformatted key blocks */
pre {
  margin: .75rem 0 0;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-size: .85rem; line-height: 1.55;
  background: var(--bg-2); color: #dfe6f0;
  border-radius: 12px;
}

/* ---------- Footer ---------- */
.site-footer { color: #d8dde6; padding-top: 3rem; }
.site-footer h2 {
  font-family: var(--font-display); font-weight: 600; font-size: 1.6rem;
  margin: 0 0 .25rem; color: #fff;
}
.site-footer .muted { margin: 0 0 1.25rem; color: #9aa4b3; }

.badges {
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--surface);
  color: var(--ink);
  border-radius: calc(var(--radius) + 6px);
  box-shadow: var(--shadow);
}
.badges h2 { color: var(--ink); }
.badges .muted { color: var(--ink-soft); }

.badge-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(4, 150px);
  justify-content: start;
  justify-items: start;
}
.badge {
  width: 150px; min-height: 270px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 12px;
}
/* Credly's embed.js replaces each .badge div with an iframe and drops its
   classes, so target grid children positionally instead. The 8th badge is the
   first LPIC credential and must start a new row. */
@media (min-width: 761px) {
  .badge-grid > :nth-child(8) { grid-column: 1; }
}

.site-footer__bar {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem;
  margin-top: 2.5rem; padding-top: 1.25rem;
  border-top: 1px solid rgba(255,255,255,.1);
  font-size: .9rem; color: #9aa4b3;
}
.site-footer__bar a { color: #d8dde6; text-decoration: none; }
.site-footer__bar a:hover { color: #fff; }

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .badge-grid { grid-template-columns: repeat(2, 150px); }
  .hero { grid-template-columns: 1fr; gap: 1.5rem; padding-bottom: 2rem; }
  .hero__photo { justify-self: start; max-width: 220px; transform: none; order: -1; }
  .site-header__top { flex-direction: column; align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
