/* ==========================================================================
   BLOCKS — one commented section per block, like WordPress block patterns.
   A page is a stack of <section class="block block--NAME">. To add a block,
   copy one of the HTML sections and (if it's new) add its styles here.
   ========================================================================== */

.block { padding-block: var(--space-8); }
.block--alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.block__head { max-width: 620px; margin-bottom: var(--space-6); }
.block__head p { color: var(--text-muted); margin: 0; }

/* ==========================================================================
   TEMPLATE PART: Site header (rendered by assets/js/layout.js)
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner { height: 100%; display: flex; align-items: center; gap: var(--space-5); }

.logo {
  display: inline-flex; align-items: center; gap: .6rem;
  font-weight: 700; font-size: 1.08rem; color: var(--text); text-decoration: none;
  letter-spacing: -0.01em;
}
.logo:hover { color: var(--text); }
.logo__mark { width: 30px; height: 30px; color: var(--primary); }
.logo__sub { font-weight: 400; color: var(--text-muted); }

.site-nav { margin-left: auto; }
.site-nav ul { list-style: none; display: flex; gap: .25rem; margin: 0; padding: 0; }
.site-nav a {
  display: block; padding: .55rem .85rem; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); font-weight: 500; color: var(--text-muted); text-decoration: none;
}
.site-nav a:hover { color: var(--text); background: var(--bg-alt); }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--primary-soft); }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer;
  background: transparent; color: var(--text-muted);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); }
.icon-btn svg { width: 20px; height: 20px; }
.nav-toggle { display: none; }

@media (max-width: 760px) {
  .nav-toggle { display: grid; }
  [data-theme-toggle] { margin-left: auto; }
  .logo__sub { display: none; }
  .site-nav {
    position: fixed; inset: var(--header-h) 0 auto 0; margin: 0;
    background: var(--bg); border-bottom: 1px solid var(--border);
    padding: var(--space-3) 1.25rem var(--space-5);
    transform: translateY(-130%); transition: transform .25s ease;
  }
  .site-nav[data-open="true"] { transform: translateY(0); }
  .site-nav ul { flex-direction: column; }
  .site-nav a { padding: .85rem .75rem; font-size: 1rem; }
}

/* ==========================================================================
   BLOCK: Hero (landing intro + illustration)
   ========================================================================== */
.block--hero { padding-block: clamp(3rem, 7vw, 6rem); }
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: var(--space-7); align-items: center; }
.hero__lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 40ch; margin-bottom: var(--space-6); }
.hero__art { aspect-ratio: 1 / 0.86; width: 100%; max-width: 520px; justify-self: end; }
.hero__art svg { width: 100%; height: 100%; }
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; gap: var(--space-6); }
  .hero__art { justify-self: center; max-width: 400px; order: -1; }
}

/* Gentle "scan" pulse on the illustration's outer ring */
.pulse { transform-origin: 260px 224px; animation: pulse 4s ease-out infinite; }
@keyframes pulse { 0% { transform: scale(.92); opacity: .55; } 100% { transform: scale(1.12); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .pulse { animation: none; opacity: 0; } }

/* ==========================================================================
   BLOCK: About (what this site is + who it's for)
   ========================================================================== */
.about { display: grid; grid-template-columns: 1fr 1.1fr; gap: var(--space-7); align-items: start; }
.about__text p { color: var(--text-muted); }
.about__list { display: grid; gap: var(--space-4); }
.about__item { color: inherit; text-decoration: none; transition: border-color .15s ease; }
.about__item:hover { color: inherit; border-color: var(--primary); }
.about__item { display: flex; gap: var(--space-4); align-items: flex-start; }
.about__item h3 { font-size: 1.05rem; margin-bottom: .2rem; }
.about__item p { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; }
@media (max-width: 860px) { .about { grid-template-columns: 1fr; gap: var(--space-6); } }

/* ==========================================================================
   BLOCK: Page head (title strip at the top of inner pages)
   ========================================================================== */
.page-head { padding-block: clamp(2.5rem, 6vw, 4.5rem) var(--space-6); }
.page-head__lead { font-size: var(--fs-lg); color: var(--text-muted); max-width: 52ch; margin: 0; }

/* ==========================================================================
   BLOCK: Post grid (posts.html) — 3 columns on desktop, 2 on tablet, 1 on phone.
   Add a card by copying one <article class="card post-card"> block.
   ========================================================================== */
.post-grid { display: grid; gap: var(--space-5); grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .post-grid { grid-template-columns: minmax(0, 1fr); } }

.post-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; position: relative; transition: border-color .15s ease; }
.post-card:hover, .post-card:focus-within { border-color: var(--primary); }
.post-card__thumb {
  aspect-ratio: 16 / 9; display: grid; place-items: center; overflow: hidden;
  background: linear-gradient(135deg, var(--primary-soft), var(--ill-bg)); color: var(--primary);
  border-bottom: 1px solid var(--border);
}
.post-card__thumb svg { width: 44px; height: 44px; opacity: .85; }
.post-card__thumb img { width: 100%; height: 100%; object-fit: cover; }   /* use an <img> instead of the icon for real covers */
.post-card__body { padding: var(--space-5); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.post-card h3 { font-size: 1.12rem; margin: 0; }
.post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h3 a::after { content: ""; position: absolute; inset: 0; }   /* makes the whole card clickable */
.post-card h3 a:hover { color: var(--primary); }
.post-card p { font-size: var(--fs-sm); color: var(--text-muted); margin: 0; flex: 1; }
.post-card__more { display: inline-flex; align-items: center; gap: .35rem; font-size: var(--fs-sm); font-weight: 600; color: var(--primary); }
.post-card__more svg { width: 16px; height: 16px; }
.sample-note { margin-top: var(--space-5); font-size: .85rem; color: var(--text-faint); }

/* ==========================================================================
   BLOCK: Empty state (placeholder pages)
   ========================================================================== */
.empty { text-align: center; padding: var(--space-7) var(--space-5); border: 1px dashed var(--border); border-radius: var(--radius); color: var(--text-muted); }
.empty .icon-chip { margin: 0 auto var(--space-4); }
.empty p { margin: 0; }

/* ==========================================================================
   BLOCK: Profile (contact.html) — headshot left, info right, badges beneath
   ========================================================================== */
.profile { display: grid; grid-template-columns: minmax(200px, 300px) 1fr; gap: var(--space-7); align-items: center; }
.profile__photo {
  position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--border); background: linear-gradient(135deg, var(--primary-soft), var(--ill-bg));
  display: grid; place-items: center; box-shadow: var(--shadow);
  font-size: 3.2rem; font-weight: 600; color: var(--primary);
}
.profile__photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.profile__title { font-size: var(--fs-lg); color: var(--secure); font-weight: 600; margin-bottom: var(--space-4); }
.profile__bio { max-width: 65ch; }
.profile__bio p { color: var(--text-muted); }
@media (max-width: 760px) {
  .profile { grid-template-columns: 1fr; gap: var(--space-5); }
  .profile__photo { max-width: 240px; }
}

/* Badge slots: each slot is a fixed square with a caption beneath; images are scaled to fit
   (never cropped or stretched). */
.badges-block { margin-top: var(--space-7); padding-top: var(--space-6); border-top: 1px solid var(--border); }
.badges-block h2 { font-size: 1.1rem; margin-bottom: var(--space-4); }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-5) var(--space-4); }
.badge-item { width: 140px; display: flex; flex-direction: column; align-items: center; gap: var(--space-2); text-align: center; }
.badge {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: var(--radius);
  background: var(--surface); border: 1px dashed var(--border);
  display: grid; place-items: center; color: var(--text-faint);
}
.badge svg { width: 28px; height: 28px; }
.badge img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 12px; }
/* Once a badge image loads, the dashed placeholder becomes a soft tile behind the badge.
   Light mode: a pale blue tile with a thin blue border. */
.badge:has(img) {
  background: color-mix(in srgb, var(--primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 20%, transparent);
}
.badge:has(img) svg { display: none; }
/* Dark mode: a faint light tile keeps dark badges from blending into the navy background */
[data-theme="dark"] .badge:has(img) { background: color-mix(in srgb, #fff 8%, transparent); border-color: color-mix(in srgb, #fff 12%, transparent); }
.badge__label { font-size: .85rem; font-weight: 600; line-height: 1.3; color: var(--text-muted); text-wrap: balance; }
@media (max-width: 600px) { .badge-item { width: calc((100% - 2 * var(--space-4)) / 3); } }

/* LinkedIn badge (contact.html) */
.li-badge {
  display: inline-flex; align-items: center; gap: var(--space-4); text-align: left;
  padding: var(--space-4) var(--space-5) var(--space-4) var(--space-4);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); color: var(--text); text-decoration: none;
  transition: border-color .15s ease;
}
.li-badge:hover { border-color: #0a66c2; color: var(--text); }
.li-badge__logo { width: 48px; height: 48px; border-radius: 10px; background: #0a66c2; color: #fff; display: grid; place-items: center; flex: none; }
.li-badge__logo svg { width: 26px; height: 26px; }
.li-badge strong { display: block; line-height: 1.25; }
.li-badge small { color: var(--text-muted); font-size: var(--fs-sm); }
.connect { text-align: center; }
.connect p { color: var(--text-muted); max-width: 46ch; margin: 0 auto var(--space-5); }

/* ==========================================================================
   TEMPLATE PART: Site footer (rendered by assets/js/layout.js)
   ========================================================================== */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding-block: var(--space-6); }
.site-footer__inner { display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6); align-items: center; justify-content: space-between; }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; }
.site-footer a { color: var(--text-muted); font-size: var(--fs-sm); text-decoration: none; }
.site-footer a:hover { color: var(--primary); }
.site-footer small { color: var(--text-faint); font-size: .85rem; }
