/* --------------------------------------------------
   Root variables
-------------------------------------------------- */
:root {
  --bg:        #faf9f7;   /* warm cream app background */
  --panel:     #ffffff;   /* panels / main surfaces */
  --card:      #ffffff;   /* cards */
  --border:    #e8e5e2;
  --line:      #ece8e5;

  --fg:        #1a1a1a;   /* main text */
  --muted:     #6b6b6b;   /* secondary text */

  --brand:     #0b6efb;
  --brand-2:    #0b6efb;
  --accent:    #1a88ff;
  --accent-soft:#e5f0ff;

  --success:   #16a34a;
  --warning:   #f59e0b;
  --danger:    #ef4444;

  --radius:    12px;
  --maxw:      980px;
  --sidebar:   260px;
  --subribbon: 230px;
  --shadow:    0 4px 18px rgba(0, 0, 0, 0.06);
}



/* --------------------------------------------------
   Base
-------------------------------------------------- */
* { box-sizing:border-box; }
html, body { height:100%; }
body {
  margin:0;
  background:var(--bg);
  color:var(--fg);
  font:16px/1.72 Inter, ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
}
img { max-width:100%; height:auto; }
/* a { color:var(--brand); text-decoration:none; } */
a { color:var(--brand); text-decoration:none; }
a:hover { text-decoration:underline; }

h1 {
  font-weight:800;
  font-size:clamp(20px,4vw,44px);
  letter-spacing:.2px;
  margin:.5rem 0 1rem;
  color:var(--brand);
}
h2 {
  font-weight:800;
  font-size:clamp(18px,2.2vw,22px);
  letter-spacing:.12em;
  color:var(--brand);
  text-transform:uppercase;
  margin:2rem 0 .75rem;
}
h3 { font-weight:700; font-size:18px; margin:0 0 .25rem; }
p { margin:0 0 1rem; }
small, .meta { color:var(--muted); font-size:12px; }

/* --------------------------------------------------
   Layouts
-------------------------------------------------- */
.layout {
  display:grid;
  grid-template-columns:var(--sidebar) 1fr;
  min-height:100vh;
}

.layout-writing {
  display:grid;
  grid-template-columns:var(--sidebar) var(--subribbon) 1fr;
  min-height:100vh;
}

/* --------------------------------------------------
   Sidebar
-------------------------------------------------- */
.sidebar {
  position:sticky;
  top:0;
  height:100vh;
  background:var(--panel);
  border-right:1px solid var(--line);
  padding:18px 16px;
  display:flex;
  flex-direction:column;
  gap:12px;
}

.sidebar .brand {
  font-weight:800;
  letter-spacing:.12em;
  text-transform:uppercase;
  color:var(--brand);
}

.sidebar .tagline {
  color:var(--muted);
  font-size:12px;
  margin-top:-4px;
}

/* Unified, conflict-free nav rule */
.sidebar .nav {
  display:grid;
  gap:4px;
  margin-top:4px;
}

.sidebar .nav a {
  display:flex;
  align-items:center;
  gap:12px;
  padding:8px 10px;
  border-radius:10px;
  color:var(--fg);
  font-weight:500;
  text-transform:uppercase;
  letter-spacing:.06em;
  border:1px solid transparent;
}

.sidebar .nav a:hover {
  background:#fff;
}

.sidebar .nav a.active,
.sidebar .nav a[aria-current="page"] {
  background:#fff;
  border-color:var(--line);
  box-shadow:var(--shadow);
}

/* Icon column */
.sidebar .nav a .lefticon {
  width:28px;
  height:28px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 28px;
}

.sidebar .nav a .lefticon svg {
  display:block;
  width:20px;
  height:20px;
  stroke-width:2;
  font-weight:inherit !important;
}

/* Sidebar section headings */
.sidebar .section-caption {
  color:var(--brand);
  font-weight:400;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  margin:10px 0 2px;
}

/* Icon list */
.icon-list { display:grid; gap:4px; }
.icon-link {
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 10px;
  border-radius:10px;
  color:var(--fg);
  border:1px solid transparent;
}
.icon-link:hover { background:#fff; text-decoration:none; }

/* --------------------------------------------------
   Writing sub-ribbon
-------------------------------------------------- */
.subribbon {
  position:sticky;
  top:0;
  height:100vh;
  overflow:auto;
  background:var(--panel);
  border-right:1px solid var(--line);
  padding:18px 14px;
}

.subribbon h4 {
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:.1em;
  font-size:12px;
  margin:.25rem 0 .5rem;
}

.subnav { display:grid;  margin-bottom:10px; }

.subnav a {
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 10px;
  border-radius:8px;
  color:var(--fg);
  border:1px solid transparent;
  text-transform:uppercase;
  font-weight:700;
  font-size:12px;
  letter-spacing:.06em;
}

.subnav a:hover { background:var(--panel); }

.subnav a.active,
.subnav a[aria-current="page"] {
  background:#eefcf2;
  border-color:#c7e8d4;
}

.sublist {
  margin:4px 0 12px 8px;
  padding-left:6px;
  border-left:2px solid var(--line);
  display:grid;
  gap:6px;
}

.sublist a {
  font-size:13px;
  text-transform:none;
  font-weight:600;
  color:#0f172a;
}
.sublist a:hover { text-decoration:underline; }

/* --------------------------------------------------
   Content
-------------------------------------------------- */
.content {
  display:flex;
  justify-content:center;
  padding:28px;
}

.reading {
  max-width:var(--maxw);
  width:100%;
}

/* --------------------------------------------------
   Home list
-------------------------------------------------- */
.article-row {
  display: flex;
  justify-content: space-between; /* direct property */
  align-items: baseline;
  gap: 12px;
  padding: 6px 0; /* your preferred tight spacing */
  /* border-bottom: 1px solid var(--line); */
  border-bottom-style: none !important;
}
.article-row:last-child { 
  border-bottom: none; 
}
.article-row a { 
  font-weight: 700; 
  margin-bottom: 0 !important; /* kill bottom margin */
}
.right-meta {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
  line-height: 1.25 !important; /* tighter date line */
  margin-top: 0 !important;
}

/* --------------------------------------------------
   Writing archive
-------------------------------------------------- */
.w-archive .year {
  color:var(--brand);
  text-transform:uppercase;
  letter-spacing:.12em;
  font-weight:800;
  margin:1.75rem 0 .25rem;
}

.w-archive .month {
  color:#6b7280;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.12em;
  margin:1.25rem 0 .25rem;
}

.w-archive .post {
  display:grid;
  grid-template-columns:1fr auto;
  gap:10px;
  align-items:baseline;
  padding:.45rem 0;
  /* border-bottom:1px solid var(--line); */
}
.w-archive .post:last-child { border-bottom:none; }

.w-archive .post .title {
  font-weight:800;
  color:var(--fg);
}
.w-archive .post .title:hover { text-decoration:underline; }

.w-archive .post .sub {
  color:var(--muted);
  font-style:italic;
  margin-top:2px;
}

.w-archive .post .meta {
  color:var(--muted);
  text-align:right;
  white-space:nowrap;
}

/* --------------------------------------------------
   Newsletter form
-------------------------------------------------- */
.form-wrap {
  margin:12px 0 18px;
  border:1px solid var(--line);
  border-radius:10px;
  padding:10px;
  background:#f8fafc;
  box-shadow:var(--shadow);
}

.form-inline {
  display:flex;
  gap:8px;
  align-items:center;
}

.form-inline input[type="email"] {
  flex:1;
  border:1px solid var(--line);
  border-radius:999px;
  padding:12px 14px;
  font-size:14px;
}

.form-inline button {
  border:0;
  background:var(--brand-2);
  color:#fff;
  padding:12px 18px;
  border-radius:999px;
  font-weight:700;
}
.form-inline button:hover {
  filter:brightness(.95);
  cursor:pointer;
}


/* --------------------------------------------------
   Mobile
-------------------------------------------------- */
@media (max-width:1100px) {
  .layout-writing { grid-template-columns:var(--sidebar) 1fr; }
  .subribbon { display:none; }
}

@media (max-width:900px) {
/* Stack layout instead of two columns */
  .layout { display: block; }

  /* Sidebar becomes a slim sticky top bar */
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 50;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    border-right: none;
    height: auto;
    padding: 10px 12px;
  }

  /* Brand small; hide tagline to save space */
  .sidebar .brand { font-size: 14px; font-weight: 800; letter-spacing: .12em; }
  .sidebar .tagline { display: none; }

  /* Primary nav → horizontal pill scroller */
  .sidebar .nav {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    white-space: nowrap;
    padding: 6px 0;
    margin-top: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar .nav a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    text-transform: none;           /* better legibility on mobile */
    letter-spacing: 0;
    background: #fff;               /* pills look intentional */
  }

  .sidebar .nav a.active,
  .sidebar .nav a[aria-current="page"] {
    background: #eefcf2;
    border-color: #c7e8d4;
    box-shadow: none;
  }

  /* Icon box inside each pill */
  .sidebar .nav a .lefticon {
    width: 20px; height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 20px;
  }
  .sidebar .nav a .lefticon svg {
    display: block;
    width: 18px; height: 18px; stroke-width: 2;
  }

  /* Hide secondary blocks (hire me / elsewhere) on mobile */
  .sidebar .section-caption,
  .sidebar .icon-list { display: none; }

  /* Content spacing below the sticky bar */
  .content { padding: 18px 18px 24px; }
}

@media (min-width: 901px){
  .about-header { grid-template-columns: 180px 1fr; }
  .about-avatar { width: 180px; height: 180px; }
}
@media (max-width: 900px){
  .about-avatar { width: 80px; height: 80px; }
}
/* --------------------------------------------------
   Utility
-------------------------------------------------- */
a.link.black {
  color:black;
  font-style:italic;
  font-weight:bold;
  text-decoration:none;
}
a.link.black:hover {
  text-decoration:underline;
}

/* Only hide NordPass inside forms */
form nordpass-icon,
form nordpass-icon * {
  display: none !important;
}

/* PROFILE CARD: smaller padding + avatar, less space above badges */
/* #profile-card{
  padding: 14px 16px !important;
} */
#profile-card .avatar{ gap: 12px; }
#profile-card .avatar img{
  width: 108px; height: 108px; /* was 120 */
}
#profile-card .badges.nowrap{ gap: 6px; margin-top: 6px; }
#profile-card .hero-certs{ margin-top: 8px !important; }

/* --- PROFILE CARD TIGHTENING --- */
#profile-card {
	line-height: 1.5;
  height: 150px;
	max-width: 760px;

}
.badges .tag { background: #bcd4ff; border: 1px solid var(--line); padding: 6px 12px; border-radius: 999px; font-size: 15px; }

/* #profile-card { min-height: 220px; } */

#profile-card p {
	margin: 4px 0
}

#profile-card .profile-link {
	margin: 4px 0 2px
}

#profile-card .hero-certs {
  margin-top: 6px !important;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  gap: 8px;                /* consistent spacing */
  align-items: center;     /* vertical alignment */
  justify-items: center;   /* horizontal centering */
}

#profile-card .hero-certs a {
  padding: 4px;            /* prevents overlap */
  display: inline-block;
}

#profile-card .hero-certs img {
  height: 95px;            /* consistent badge size */
  width: 95px;
  object-fit: contain;     /* keeps proportions */
}

.profile-contact p {
  margin: 6px 0;
}

/* responsive */
@media (max-width:920px) {
	.hero {
		grid-template-columns: 1fr
	}

	#profile-card {
		max-width: 100%
	}
}

.badges {
	display: flex;
	flex-wrap: wrap;
	gap: 10px
}

.badges.nowrap {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
}

.badges.nowrap .tag {
	white-space: nowrap;
	font-size: 12px;
	padding: 3px 10px
}

.tag {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 999px;
	background: #102040;
	border: 1px solid var(--line);
	color: #bcd4ff;
	font-size: 12px
}

.meta {
	color: #9fb7d8;
	font-size: 16px
}

.kicker {
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--brand);
	font-weight: 600
}

.about-header {
  display: flex;
  gap: 24px;
  align-items: center;
  margin-bottom: 32px;
}

.about-avatar {
  width: 300px;
  height: 300px;
  border-radius: 100%;
  object-fit: cover;
  /* border: 3px solid var(--line); */
}

.section-divider {
  margin: 40px 0;
  border: none;
  border-top: 1px solid var(--line);
}

.timeline-title {
  text-transform: uppercase;
  letter-spacing: .12em;
  color: var(--brand);
  font-weight: 800;
  margin-bottom: 24px;
}

.timeline {
  display: grid;
  gap: 32px;
  position: relative;
}

.timeline-item {
  display: flex;
  gap: 16px;
}

.timeline-icon {
  position: relative;
}

.timeline-line {
  position: absolute;
  top: 0;
  left: 50%;
  height: 100%;
  width: 1px;
  background: var(--brand);
  z-index: -1;
}

.timeline-icon img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: white;
  border: 1px solid var(--line);
  padding: 4px;
}

.timeline-content {
  width: 90%;
}

.timeline-dates {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}
.timeline-role {
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
}
.timeline-company {
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 8px;
}
.timeline-description {
  margin: 0;
}
/* =========================
   Mobile Header – Unified
   ========================= */
:root {
  --header-height: 56px;
  --header-bg: #f8fbff;   /* var(--bg); */
  --header-fg: #1e293b;  /* bolder text */
  --header-border: #f0f4ff; /* 1px solid var(--line); */
  --header-shadow: var(--shadow);
  --brand-weight: 800;
  --brand-letter: .12em;
  --home-measure: 720px;   /* width of the main text column */
  --date-col: 160px;       /* width reserved for the date */
  --header-bg: #eff6ff;  /* light blue for headers/nav */
  --ribbon-bg: #eff6ff;  /* slightly deeper for ribbons/tabs */
  --header-fg: #1e3a8a;  /* darker blue text/icons */
}

/* Default: no mobile chrome on desktop */
/* .mobile-bar, .mobile-menu { display: none; } */
/* Desktop: never show mobile writing tabs or mobile chrome
.mobile-subnav { display: none !important; }
.mobile-bar, .mobile-menu { display: none !important; } */

/* === Fix: desktop social icons missing (set sizes for icon-list) === */
.icon-list .lefticon{
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  flex: 0 0 28px;
}
.icon-list .lefticon svg{ width: 20px; height: 20px; stroke-width: 2; }



/* Only the real sidebar uses section-caption baseline */
.sidebar .section-caption { font-weight: 400; }


/* ========== Mobile header + full-screen overlay (single source of truth) ========== */
@media (max-width: 900px) {

  /* Hide desktop chrome; keep content pushed below fixed bar */
  .layout { display: block; }
  .sidebar { display: none; }
  .content { padding-top: 72px; } /* 56px bar + spacing */

  /* Top brand bar (always visible) */
  .mobile-bar {
    position: fixed; top: 0; left: 0; right: 0;
    height: 56px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
  }
  .mobile-brand {
    font-weight: 800;                /* only the name is bold */
    letter-spacing: .12em;
    color: var(--brand);
    text-transform: uppercase;
  }
  .hamburger {
    width: 36px; height: 36px;
    border: 1px;
    /* background: #fff; */
    background: var(--header-bg);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .hamburger svg { width: 22px; height: 22px; }

  /* Full-screen overlay */
  .mobile-menu {
    position: fixed; inset: 0;
    z-index: 200;
    background: var(--panel);
    transform: translateX(100%);
    transition: transform .22s ease;
    display: flex; flex-direction: column;
  }
  .mobile-menu.open { transform: translateX(0); }

  .mobile-menu .mm-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    background: var(--panel);
  }
  .mobile-menu .mm-close {
    width: 36px; height: 36px;
    border: 1px solid var(--line);
    border-radius: 8px; background: var(--header-bg);
    display: inline-flex; align-items: center; justify-content: center;
  }
  .mobile-menu .mm-scroll { overflow: auto; padding: 12px 16px 28px; }

  /* Section headings (e.g., Elsewhere) */
  .mobile-menu .section-caption {
    color: var(--brand);
    font-size: 12px;
    font-weight: 500;                 /* not bold */
    text-transform: uppercase;
    letter-spacing: .12em;
    margin: 16px 0 8px;
    display: block;
  }

  /* Primary nav: vertical list, consistent type, no “button” chrome */
  .mobile-menu .nav {
    display: block;
    margin: 6px 0 16px;
  }
  .mobile-menu .nav a {
    display: flex; align-items: center;
    gap: 12px;
    width: 100%;
    padding: 10px 0;                  /* comfortable tap target */
    background: transparent;
    border: 0;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: .04em;
    font-size: 18px;
    font-weight: 500;                 /* not bold */
    line-height: 1.2;
  }
  /* Active: brand color + underline (no pill/border) */
  .mobile-menu .nav a.active,
  .mobile-menu .nav a[aria-current="page"] {
    color: var(--brand);
    text-decoration: underline;
  }

  /* Elsewhere links: same sizing/weight as primary nav */
  .mobile-menu .icon-list { display: grid; gap: 10px; margin-bottom: 10px; }
  .mobile-menu .icon-list .icon-link {
    display: flex; align-items: center;
    gap: 12px;
    padding: 10px 0;
    color: var(--fg);
    font-size: 18px;
    font-weight: 500;                 /* not bold */
    background: transparent; border: 0;
  }

  /* Icon sizing (compact and aligned) */
  .mobile-menu .lefticon,
  .mobile-menu .nav a .lefticon {
    width: 20px; height: 20px; flex: 0 0 20px;
    display: inline-flex; align-items: center; justify-content: center;
  }
  .mobile-menu .lefticon svg,
  .mobile-menu .nav a .lefticon svg {
    width: 18px; height: 18px; stroke-width: 2;
  }
}
/* --- Mobile overlay: typography + spacing normalization --- */
@media (max-width: 900px){
  /* Make overlay inherit the site’s font + normal letter spacing */
  .mobile-menu { font-family: inherit; letter-spacing: normal; }

  /* Primary nav: keep as-is (uppercase), not bold */
  .mobile-menu .nav a{
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .04em;
    text-transform: uppercase;
    line-height: 1.2;
    padding: 10px 0;
  }

  /* Section captions unchanged (just ensuring consistency) */
  .mobile-menu .section-caption{
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin: 16px 0 8px;
  }

  /* Social list: tighter spacing + title case (no transform) */
  .mobile-menu .icon-list{ gap: 4px; margin-bottom: 8px; }
  .mobile-menu .icon-list .icon-link{
    padding: 6px 0;           /* was 10px 0 */
    line-height: 1.2;         /* reduce perceived vertical space */
    font-size: 18px;
    font-weight: 500;
    text-transform: none;     /* Twitter / LinkedIn / Are.na look natural */
  }

  /* Compact icons in overlay */
  .mobile-menu .lefticon,
  .mobile-menu .nav a .lefticon{
    width: 20px; height: 20px; flex: 0 0 20px;
  }
  .mobile-menu .lefticon svg,
  .mobile-menu .nav a .lefticon svg{
    width: 18px; height: 18px; stroke-width: 2;
  }
}

/* ===== FINAL MOBILE OVERRIDES (place at very end of styles.css) ===== */

/* Never show hamburger/overlay on desktop */
@media (min-width: 901px) {
  .mobile-bar, .mobile-menu { display: none !important; }
}

/* Mobile: unify header and show mobile writing tabs */
@media (max-width: 900px) {
  :root { --header-h: 56px; }

  /* Hide desktop chrome */
  .sidebar       { display: none !important; }
  .subribbon     { display: none !important; }
  .lead strong {
      display: none !important;
    }
  /* Fixed brand bar identical on every page */
  .mobile-bar {
    box-shadow: none !important;
    position: fixed; top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--bg);
    /* border-bottom:  none !important; */
    box-shadow: var(--shadow);
    z-index: 100;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 16px;
    
  }
  .mobile-brand {
    font-weight: 800;               /* only the name is bold */
    letter-spacing: .12em;
    color: var(--brand);
    text-transform: uppercase;
    line-height: var(--header-h);
  }

  /* Default content offset for pages w/o writing tabs */
  .content { padding-top: calc(var(--header-h) + 16px) !important; }

  /* When writing mobile tabs exist, add extra offset */
  /* body.has-mobile-subnav .content {
    padding-top: calc(var(--header-h) + 56px) !important;
  } */

  /* Mobile writing sub-nav (tabs) */
  .mobile-subnav {
    display: none; /* default hidden; shown via JS */
    position: sticky; top: var(--header-h);
    z-index: 90;
    gap: 1px;
    padding: 10px 16px 8px;
    background: var(--header-bg);
    /* border-bottom: 1px solid var(--line); */
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-subnav .msn-link {
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 600;
    color: var(--fg);
    text-transform: uppercase;
    letter-spacing: .06em;
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  /* .mobile-subnav .msn-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
  } */

  /* Overlay menu typography (no random bold/giant icons) */
  .mobile-menu .nav a,
  .mobile-menu .icon-list .icon-link {
    font-weight: 500; font-size: 18px; letter-spacing: .04em;
  }
  .mobile-menu .section-caption {
    font-size: 12px; font-weight: 500;
    text-transform: uppercase; letter-spacing: .12em; color: var(--brand);
    margin: 16px 0 8px;
  }

  /* Social icon sizing (same as desktop) */
  .mobile-menu .icon-list .lefticon { width: 28px; height: 28px; flex: 0 0 28px; display: inline-flex; align-items: center; justify-content: center; }
  .mobile-menu .icon-list .lefticon svg { width: 20px; height: 20px; stroke-width: 2; }
}
/* Default: never show mobile tabs on desktop */
.mobile-subnav { display: none; }

/* Header height token (used by content offset) */
:root { --header-h: 56px; }

@media (max-width: 900px) {
  /* Sticky mobile tabs under your fixed brand header */
  .mobile-subnav {
    display: flex !important;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    gap: 16px;
    padding: 10px 16px 8px;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-subnav .msn-link {
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  /* .mobile-subnav .msn-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
  } */

  /* Push page body below fixed header (+ tabs when present) */
  .content { padding-top: calc(var(--header-h) + 16px) !important; }
  /* body.has-mobile-subnav .content {
    padding-top: calc(var(--header-h) + 56px) !important;
  } */
}

/* --- MOBILE WRITING LAYOUT HARD OVERRIDES --- */
@media (max-width: 900px) {
  /* If the page uses the 3-column writing grid, force it to 1 column */
  .layout-writing { display:block; grid-template-columns:1fr !important; }

  /* Never show the left sub-ribbon on phones */
  .subribbon { display: none !important; }

  /* Make sure main content occupies the full width */
  .content { grid-column: 1 / -1 !important; }

  /* Defensive: if any base layout is still two columns, collapse it */
  .layout { grid-template-columns: 1fr !important; }
}

/* Hidden on desktop by default */
.mobile-subnav { display: none; }

/* Mobile: show tabs, sit under fixed brand header */
@media (max-width: 900px) {
  :root { --header-h: 56px; 
          --header-pad: 16px; /* consistent horizontal padding */} /* keep consistent with your fixed header */
  

  .mobile-subnav {
    display: flex !important;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    gap: 16px;
    padding: 10px 16px 8px;
    background: var(--header-bg);
    /* border-bottom: 1px solid var(--line); */
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-subnav .msn-link {
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  /* .mobile-subnav .msn-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
  } */

  /* Push content below fixed header (+tabs if present) */
  /* .content { padding-top: calc(var(--header-h) + 56px) !important; } */
}

/* --- KILL GHOST SUB-RIBBON ON MOBILE --- */
@media (max-width: 900px) {
  /* collapse any writing layout to a single column */
  .layout-writing { display:block; grid-template-columns:1fr !important; }

  /* absolutely ensure subribbon never paints or reserves space */
  .subribbon,
  .layout-writing > .subribbon,
  [class*="subribbon"] {
    display: none !important;
    width: 0 !important;
    max-width: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
  }

  /* make the main content span the whole grid */
  .content { grid-column: 1 / -1 !important; }
}

/* --- MOBILE TABS + HEADER SPACING --- */
@media (max-width: 900px) {
  :root { --header-h: 56px; }

  /* fixed brand bar already in your CSS; we just align content offset */
  /* .content { 
    padding-top: calc(var(--header-h) + 56px) !important; 
  } */

  .mobile-subnav {
    display: flex !important;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    gap: 16px;
    padding: 10px 16px 8px;
    background: var(--header-bg);
    /* border-bottom: 1px solid var(--line); */
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
  .mobile-subnav .msn-link {
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  /* .mobile-subnav .msn-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
  } */
}

/* ==== FINAL MOBILE WRITING LAYOUT OVERRIDE (keep at bottom) ==== */
@media (max-width: 900px) {
  :root {
    --header-h: 56px;
  }

  /* Collapse all grids to a single column */
  .layout,
  .layout-writing {
    display: block;
    grid-template-columns: 1fr !important;
  }

  /* Hide desktop chrome on phones */
  .sidebar,
  .subribbon {
    display: none !important;
  }

  /* Main content takes full width and clears space for fixed header */
  .content {
    padding: 65px 16px 24px !important; /* 56 header + ~16 gap */
    max-width: 100%;
  }

  /* Mobile “Writing” tabs under the fixed header */
  .mobile-subnav {
    display: flex !important;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    gap: 16px;
    padding: 10px 16px 8px;
    background: var(--header-bg);
    /* border-bottom: 1px solid var(--line); */
    box-shadow: none !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .mobile-subnav .msn-link {
    display: inline-block;
    padding: 6px 2px;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--brand);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }
  /* .mobile-subnav .msn-link.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
  } */
}

/* keep nav item weight normal on desktop too */
.sidebar .nav a { font-weight: 500; }

/* tag contrast fix (uses defined token) */
.tag { background:#fff; border:1px solid var(--line); color:#0f172a; }

/* ==== MOBILE: reuse subribbon as Writing tabs ==== */
@media (max-width: 900px) {
  :root { --header-h: 56px; }

  /* Collapse layout to a single column */
  .layout-writing { display: block; grid-template-columns: 1fr !important; }
  .sidebar { display: none !important; }

  /* Subribbon becomes a horizontal tab bar under the header */
  .subribbon {
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    display: flex;
    align-items: center;
    gap: 24px;
    padding: 12px 16px 8px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .subribbon h4 {
    margin: 0;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--muted);
    flex: 0 0 auto;
  }

  .subribbon .subnav {
    display: flex;
    gap: 20px;
    flex: 1 1 auto;
  }

  .subribbon .subnav a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 0;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--fg);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
  }

  .subribbon .subnav a .lefticon {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .subribbon .subnav a.active,
  .subribbon .subnav a[aria-current="page"] {
    color: var(--brand);
    border-bottom-color: var(--brand);
  }

  /* Push content below header + tabs */
  .content {
    /* padding-top: calc(var(--header-h) + 56px) !important; */
    padding-inline: 16px;
  }
}

:root {
  --header-h: 56px; /* shared height */
  --header-pad: 16px; /* consistent horizontal padding */
}

@media (max-width: 900px) {
  /* FIXED TOP BAR: brand + hamburger */
  .mobile-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--header-h);
    background: var(--panel); /* match overlay */
    border-bottom: 1px solid var(--line);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 var(--header-pad);
    box-shadow: var(--shadow);
  }

  .mobile-brand {
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand);
    font-size: 16px;
    line-height: var(--header-h);
  }

  /* OVERLAY HEADER: exact visual match */
  .mobile-menu .mm-head {
    position: sticky;
    top: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-h);
    padding: 0 var(--header-pad);
    background: var(--panel); /* identical to bar */
    border-bottom: 1px solid var(--line);
    border-top: none; /* no double line */
  }

  .mobile-menu .mm-head .mobile-brand {
    font-weight: 800;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--brand);
    font-size: 16px;
  }

  .mm-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: inherit;
  }

  .mm-close svg {
    width: 20px;
    height: 20px;
  }

  /* Overlay scroll area starts right below header */
  .mobile-menu .mm-scroll {
    padding: 0 var(--header-pad);
  }

  /* Seamless overlay entrance */
  .mobile-menu.open {
    animation: slideIn 0.2s ease-out;
  }

  @keyframes slideIn {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
  }
}
/* --------------------------------------------------
   Writing sub-navigation (left ribbon)
-------------------------------------------------- */
.hero-text {
  font-size: clamp(1.125rem, 4vw, 1.5rem); /* scales smoothly */
  line-height: 1.6;
  max-width: 65ch; /* readable width */
  margin-bottom: 2rem;
}

.hero-text .link.black {
  font-size: inherit; /* match parent size */
  font-weight: 600;
}

/* Responsive: larger on desktop */
@media (min-width: 900px) {
  .hero-text {
    font-size: 18px; /* 22px */
    max-width: 70ch;
  }
}
.black {
    color: #000;
}
/* Feather icon sizing + alignment */
.feather {
  display: inline-block;
  vertical-align: middle; /* v-mid equivalent */
  margin-left: 0.25rem;
}

.feather.h1 {
  width: 1.5rem;  /* 24px */
  height: 1.5rem;
}

.feather-arrow-right {
  stroke-width: 2.5; /* thicker stroke for better visibility */
}

/* Ensure link text + icon align */
.black a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.see-all-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

/* Article links/titles black */
.article-row a,
.w-archive .post .title a,
.post a {
  color: #0f172a !important; /* pure black */
}

.article-row a:hover,
.w-archive .post .title a:hover {
  color: var(--brand) !important; /* brand color on hover */
  text-decoration: underline;
}


/* Kill ALL Tachyons borders on articles */
#home-latest .bb,
#home-latest [class*="bb"],
.article-row {
  border-bottom: none !important;
  border-bottom-style: none !important;
  border-bottom-width: 0 !important;
  
}

/* make the intro block and the list share the same measure */
.home-intro,
#home-latest{
  max-width: var(--home-measure);
}

/* each row: title | date (fixed width) */
#home-latest .article-row{
  display: grid;
  grid-template-columns: 1fr var(--date-col);
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}
#home-latest .article-row:last-child{ border-bottom: none; }

/* title + date styling */
#home-latest .title{
  font-weight: 700;
  color: var(--fg);
  text-decoration: none;
}
#home-latest .title:hover{ color: var(--brand); text-decoration: underline; }

#home-latest .right-meta{
  color: var(--muted);
  font-size: 12px;
  text-align: right;
  white-space: nowrap;
}

/* optional: stack nicely on narrow screens */
@media (max-width: 640px){
  #home-latest .article-row{ grid-template-columns: 1fr; }
  #home-latest .right-meta{ text-align: left; margin-top: 2px; }
}


/* Put the "See all" in the same right column as the dates */
.see-all-wrapper{
  display: grid;
  grid-template-columns: 1fr var(--date-col);
  align-items: baseline;
  gap: 12px;
  margin-top: 8px;
}


/* Hero image in the header */
.reading header figure img {
  width: 25%;
  max-width: 25%;
  height: auto;
  display: block;
  margin: 10px 0;           /* tweak as you like */
}

/* Inline images inside the article body */
.reading .article-body img {
  width: 25%;
  max-width: 25%;
  height: auto;
  display: block;            /* or inline-block if you prefer */
  margin: 12px 0;            /* spacing around inline images */
}

/* Optional: center hero and inline images */
.reading header figure img,
.reading .article-body img {
  /* margin-left: auto; */
  margin-right: auto;
}

/* Mobile: use full width for readability */
@media (max-width: 900px) {
  .reading header figure img,
  .reading .article-body img {
    width: 100%;
    max-width: 100%;
  }
}

.btn {
	display: inline-block;
	padding: 10px 14px;
	border-radius: 12px;
	background: var(--accent);
	color: #071423;
	font-weight: 600
}

/* HERO: closer columns, tighter heading & CTA */
.hero{
  grid-template-columns: 1.05fr 0.95fr;
  gap: 16px;
  padding: 10px 10px;        /* was ~40px */
}
.hero h2{
  margin: 8px 0 10px;        /* reduce whitespace above/below */
  line-height: 1.15;
  font-size: clamp(24px, 4vw, 44px);
}
.hero .lead{ margin-top: 8px; }
.hero .btn{ margin-top: 10px; }

/* CTA button */
.btn-green {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: var(--brand-2); /* your lighter green */
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  box-shadow: var(--shadow);
}
.btn-green:hover {
  filter: brightness(.95);
  text-decoration: none;
}

/* === Article hero: image left, description right === */
.hero-split {
  display: grid;
  grid-template-columns: minmax(120px, 28%) 1fr; /* image | copy */
  gap: 16px;
  align-items: start;
  margin: 18px 0;
}
.hero-split .hero-img {
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  display: block;
}
.hero-split .hero-copy .lede {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
  margin: 0 0 10px;
}


/* Ensure footer spans under the grid layout */
.footer {
  grid-column: 1 / -1;
  margin-top: 20px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: #9fb7d8;
  font-size: 14px;
  background: var(--bg);
}

/* Mobile: stack hero */
@media (max-width: 900px) {
  .hero-split {
    grid-template-columns: 1fr;
  }
}

/* Sidebar footer (desktop only) */
.sidebar { display: flex; flex-direction: column; }
.sidebar-foot{
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

/* Show sidebar footer only on desktop; keep bottom footer only on mobile */
@media (min-width: 901px){
  .footer{ display: none !important; }     /* hide bottom footer on desktop */
}
@media (max-width: 900px){
  .sidebar-foot{ display: none !important; } /* hide sidebar footer on mobile */
  .footer{ display: block !important; }      /* show bottom footer on mobile */
}

.post-nav { display:flex; justify-content:space-between; gap:12px; }
.post-nav a { white-space:nowrap; }

/* Mobile brand: single line, no wrap, truncate if needed */
@media (max-width: 900px) {
  .mobile-bar { display: flex; align-items: center; }
  .mobile-bar .mobile-brand {
    flex: 1;              /* take remaining space */
    min-width: 0;         /* allow flex item to shrink */
    white-space: nowrap;  /* prevent wrapping */
    overflow: hidden;     
    text-overflow: ellipsis;
    letter-spacing: .08em;               /* slightly tighter on mobile */
    font-size: clamp(14px, 4.3vw, 18px); /* scale down on small screens */
  }
  .mobile-bar .hamburger { margin-left: 12px; }

  /* Match the overlay header so it never wraps there either */
  .mobile-menu .mm-head .mobile-brand {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    letter-spacing: .08em;
    font-size: clamp(14px, 4.3vw, 18px);
  }
}

/* Desktop baseline (see next section for exact sizing) */

/* Desktop: never show the sampled sublists in the Writing sidebar */
@media (min-width: 901px) {
  .subribbon .sublist { display: none !important; }
}

/* --- Mobile: Home-like rows for Writing (Latest & Start Here) --- */
@media (max-width: 900px) {
  /* Generic article row (Home + Start Here) */
  .article-row {
    display: block;
    /* padding: 18px 0; */
    /* border-bottom: 1px solid var(--line); */
  }
  .article-row .title,
  .article-row > a { /* support both .title link and direct <a> */
    display: block;
    /* font-weight: 800; */
    font-size: 16px; /* 22px; */
    line-height: 1.25;
    margin: 0;
    color: #0f172a;
    text-decoration: none;
  }
  .article-row .title:hover,
  .article-row > a:hover { text-decoration: underline; }

  /* Hide the right-side desktop date and print date below title instead */
  .article-row .right-meta { display: none; }
  .article-row[data-date]::after {
    content: attr(data-date);
    display: block;
    /* margin-top: 8px; */
    font-size: 16px;
    color: var(--muted);
  }

  /* Writing → Latest archive list (renderArchive output) */
  #archive .post {
    display: block;             /* stacks content then date below */
    /* padding: 18px 0; */
    /* border-bottom: 1px solid var(--line); */
  }
  #archive .post .title a {
    font-weight: 800;
    font-size: 18px;  /* 22px; */
    line-height: 1.25;
    text-decoration: none;
    color: #0f172a;
  }
  #archive .post .title a:hover { text-decoration: underline; }
  #archive .post .sub { margin-top: 6px; }
  #archive .post .meta {
    margin-top: 8px;
    text-align: left;
    color: var(--muted);
    font-size: 16px;
  }
}

/* Writing archive uses the same row layout as Home */
.w-archive .article-row {
  display: grid;
  grid-template-columns: 1fr auto; /* title/sub on left, date on right */
  gap: 10px;
  align-items: baseline;
  padding: .45rem 0;
  border: 0; /* keep Home look; remove if you want separators */
}
.w-archive .article-row .title a {
  color: var(--fg);
  text-decoration: none;
  font-weight: 700;
}
.w-archive .article-row .title a:hover {
  color: var(--brand);
  text-decoration: underline;
}
.w-archive .article-row .sub {
  color: var(--muted);
  font-style: italic;
  margin-top: 2px;
}
.w-archive .article-row .right-meta {
  font-size: 12px;
  color: var(--muted);
  text-align: right;
}

/* Mobile: same behavior as Home (date under title via data-attr) */
@media (max-width: 900px) {
  .w-archive .article-row {
    grid-template-columns: 1fr;
  }
  .w-archive .article-row .right-meta { display: none; }
  .w-archive .article-row .title::after {
    content: attr(data-date);
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
  }
}

/* Fixed top bar */
.mobile-bar {
  background: var(--header-bg) !important;
  border-bottom-color: var(--accent-soft);
}

/* Overlay header */
.mobile-menu .mm-head {
  background: var(--header-bg);
}

/* Writing list: mobile card rhythm */
@media (max-width: 900px) {
  .w-archive .post {
    display: block;
    padding: .55rem 0 .85rem;
    border-bottom: 1px solid var(--line);
  }
  .w-archive .post .title a {
    line-height: 1.25;
  }
  .w-archive .post .sub {
    margin-top: .35rem;
    color: var(--muted);
    font-style: italic;
  }
  .w-archive .post .meta {
    margin-top: .5rem;   /* slightly more above */
    font-size: 14px;
    color: var(--muted);
  }
  .mobile-subnav {
    position: sticky; top: 40px; z-index: 5;
    background: var(--header-bg);
    border-bottom: 1px solid var(--line);
  }
  .mobile-subnav .msn-link { padding: 14px 12px; }
  
}

/* Sticky year headings (desktop) */
@media (min-width: 901px) {
  .w-archive .year {
    position: sticky;
    top: 54px;              /* below your fixed header */
    background: var(--bg);
    padding: 6px 0;
    z-index: 1;
  }
}

@media (max-width: 900px) {
  .mobile-brand {
    font-weight: 800; /* Slightly lighter for mobile */
    letter-spacing: .08em;
  }
  .mobile-menu .nav a {
    font-weight: 600; /* Match brand weight */
  }
}

/* Bulletproof fixed top bar - NEVER moves */
.mobile-bar {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  height: var(--header-h) !important;
  z-index: 999 !important;  /* Above everything */
  background: var(--header-bg, var(--panel)) !important;
  border-bottom: 1px solid var(--line) !important;
  box-shadow: var(--shadow) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  padding: 0 var(--header-pad) !important;
  will-change: transform;  /* GPU acceleration */
}

/* Content ALWAYS offsets header */
.content {
  padding-top: var(--header-h) !important;
  padding-inline-start: var(--header-pad) !important;
}

/* Tabs sticky BELOW header only */
.mobile-subnav, .subribbon {
  position: sticky !important;
  /* top: var(--header-h) !important; */
  z-index: 100 !important;  /* Below bar, above content */
  background: var(--panel) !important;
}

/* Kill JS class dependency */
body.has-mobile-subnav .content {
  padding-top: calc(var(--header-h) + 0px) !important;  /* No extra */
}

.article-row{
  display: grid;
  grid-template-columns: 1fr var(--date-col);
  gap: 12px;
  align-items: baseline;
  padding: 4px 0;
  border-bottom: 1px solid var(--line);
}





.pdf-actions {
  margin: 12px 0 28px;
}

.pdf-btn {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
}

.pdf-btn:hover {
  opacity: 0.9;
}

.pdf-header {
  display: none;
}