:root {
  --bg: #fffdf8;
  --card: rgba(255, 253, 248, 0.86);
  --card-solid: #fffdf8;
  --text: #2b2118;
  --muted: #5a4835;
  --accent: #d2691e;
  --accent-ink: #a8431a;
  --border: rgba(168, 67, 26, 0.16);
  --shadow: 0 2px 14px rgba(120, 60, 20, 0.07);
  /* decorative gradient — bars, dots, rings */
  --grad: linear-gradient(120deg, #f2a03d, #c0492b);
  /* text & button gradient — darkened for contrast */
  --grad-ink: linear-gradient(120deg, #c25a16, #9e2f14);
  /* dark camel brown header */
  --nav-bg: linear-gradient(100deg, #3d2b1c 0%, #5a412c 55%, #6d5138 100%);
  --nav-text: #efdcc0;
  --nav-text-hover: #ffd9a0;
  --nav-line: rgba(247, 217, 168, 0.28);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  color: var(--text);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  background: var(--bg);
}
/* Warm SoCal-stucco wash. A fixed pseudo-element rather than
   background-attachment: fixed, which iOS Safari renders unreliably. */
body::before {
  content: "";
  position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(
    170deg,
    #fffdf8 0%,
    #fff4de 22%,
    #fde3ae 48%,
    #f8c87b 72%,
    #f2a85a 100%
  );
}
.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* Nav — dark camel brown bar, opaque, so no backdrop blur is needed.
   Scoped to the direct child of body: the archive pane on article pages is
   also a <nav>, and a bare `nav` selector paints it brown too. */
body > nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--nav-bg);
  border-bottom: 1px solid rgba(35, 22, 12, 0.5);
  box-shadow: 0 2px 16px rgba(61, 43, 28, 0.3);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 64px;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none;
}
.logo-thumb {
  width: 34px; height: 34px; border-radius: 50%;
  object-fit: cover; display: block;
  border: 2px solid rgba(247, 217, 168, 0.6);
  box-shadow: 0 1px 6px rgba(20, 12, 6, 0.35);
}
.logo-mark {
  font-weight: 800; font-size: 1.1rem; letter-spacing: 0.5px;
  /* the ink gradient disappears on brown — go light instead */
  background: linear-gradient(120deg, #ffe6bd, #e9a95c);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-links { display: flex; align-items: center; gap: 26px; }
.nav-links a {
  color: var(--nav-text); text-decoration: none; font-size: 0.92rem;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--nav-text-hover); }
.nav-links a:focus-visible { outline: 2px solid var(--nav-text-hover); outline-offset: 4px; border-radius: 4px; }
/* Articles — a button rather than another text link */
.nav-links a.nav-cta {
  padding: 7px 18px; border-radius: 999px; font-weight: 600;
  color: #fbe8c8; background: rgba(247, 217, 168, 0.12);
  border: 1px solid var(--nav-line);
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.nav-links a.nav-cta:hover {
  background: var(--grad); color: #34220f; border-color: transparent;
  transform: translateY(-1px);
}
.nav-links a.nav-cta[aria-current="page"] {
  background: rgba(247, 217, 168, 0.92); color: #4a3320; border-color: transparent;
}

/* Hero */
.hero {
  min-height: 88vh;
  display: flex; align-items: center;
  position: relative; overflow: hidden;
  padding: 48px 0;
}
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(620px 420px at 82% 18%, rgba(242, 160, 61, 0.28), transparent),
    radial-gradient(520px 360px at 12% 82%, rgba(192, 73, 43, 0.14), transparent);
  pointer-events: none;
}
.hero-content { position: relative; }
.hero-grid {
  display: grid; grid-template-columns: 1.4fr 1fr; gap: 48px; align-items: center;
}
.photo-ring {
  width: min(300px, 60vw); aspect-ratio: 1;
  padding: 5px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 10px 50px rgba(192, 73, 43, 0.28);
  justify-self: center;
}
.photo-ring img {
  width: 100%; height: 100%; display: block;
  border-radius: 50%; object-fit: cover;
}
.eyebrow {
  color: var(--accent-ink); font-size: 0.95rem; font-weight: 700;
  letter-spacing: 2px; text-transform: uppercase; margin-bottom: 16px;
}
h1 {
  font-size: clamp(2.2rem, 5.5vw, 3.6rem);
  line-height: 1.1; font-weight: 800; margin-bottom: 20px;
}
h1 .grad, .grad-text {
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.tagline {
  font-size: 1.15rem; color: var(--muted); max-width: 680px; margin-bottom: 36px;
}
.intro { max-width: 660px; margin-bottom: 36px; }
.intro p { color: var(--muted); font-size: 1.02rem; margin-bottom: 16px; }
.intro p:last-child { margin-bottom: 0; color: #453623; }
.intro strong { font-weight: 700; }
.btn {
  display: inline-block; padding: 13px 28px; border-radius: 8px;
  text-decoration: none; font-weight: 600; font-size: 0.95rem;
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn-primary {
  background: var(--grad-ink); color: #fff;
  box-shadow: 0 4px 18px rgba(158, 47, 20, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 24px rgba(158, 47, 20, 0.45); }
/* Floating "Get in touch" — pinned bottom-right, above all content */
.btn-float {
  position: fixed; right: 28px; bottom: 28px; z-index: 200;
  border-radius: 999px; padding: 14px 26px;
  box-shadow: 0 6px 22px rgba(158, 47, 20, 0.4);
}
.btn-float:hover { box-shadow: 0 10px 30px rgba(158, 47, 20, 0.5); }
.btn-float:focus-visible { outline: 3px solid #7a2a10; outline-offset: 3px; }

/* Sections */
section { padding: 90px 0; scroll-margin-top: 64px; }
section:nth-of-type(even) { background: rgba(255, 253, 248, 0.55); }
.section-title { font-size: 2rem; font-weight: 700; margin-bottom: 12px; }
.section-sub { color: var(--muted); margin-bottom: 48px; max-width: 640px; }
.accent-bar {
  width: 56px; height: 4px; background: var(--grad);
  border-radius: 2px; margin-bottom: 24px;
}

/* About */
.about-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start;
}
.about-text p { margin-bottom: 18px; color: #453623; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.stat {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; text-align: center;
  box-shadow: var(--shadow);
}
.stat .num {
  font-size: 1.9rem; font-weight: 800;
  background: var(--grad-ink);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat .label { color: var(--muted); font-size: 0.88rem; margin-top: 4px; }

/* Skills — two fixed rows */
.skills-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px;
}
.skills-row:last-child { margin-bottom: 0; }
.skill-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 12px; padding: 28px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.skill-card:hover {
  transform: translateY(-4px); border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(120, 60, 20, 0.14);
}
.skill-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.skill-card p { color: var(--muted); font-size: 0.92rem; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.tag {
  font-size: 0.78rem; padding: 4px 12px; border-radius: 999px;
  background: rgba(210, 105, 30, 0.12); color: var(--accent-ink);
  border: 1px solid rgba(168, 67, 26, 0.22);
}

/* Experience / Credentials pane — same card treatment for both sections */
.timeline-pane, .cred-block {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 30px 32px; box-shadow: var(--shadow);
}

/* Timeline (shared by Experience and Credentials) */
.timeline { position: relative; padding-left: 32px; }
.timeline::before {
  content: ""; position: absolute; left: 8px; top: 6px; bottom: 6px;
  width: 2px; background: rgba(168, 67, 26, 0.22);
}
.t-item { position: relative; margin-bottom: 40px; }
.t-item:last-child { margin-bottom: 0; }
.t-item::before {
  content: ""; position: absolute; left: -30px; top: 6px;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--grad);
  box-shadow: 0 0 0 4px rgba(242, 160, 61, 0.22);
}
.t-item .period { color: var(--accent-ink); font-size: 0.85rem; font-weight: 700; letter-spacing: 1px; }
.t-item h3 { font-size: 1.15rem; margin: 6px 0 2px; }
.t-item .org { color: var(--muted); font-size: 0.95rem; margin-bottom: 10px; }
.t-item p, .t-item li { color: #453623; font-size: 0.95rem; max-width: 720px; }
.t-item ul { margin: 8px 0 0 18px; }
.t-item li { margin-bottom: 6px; }

/* Credentials */
.cred-block { margin-bottom: 24px; }
.cred-block:last-of-type { margin-bottom: 0; }
.cred-heading {
  display: flex; align-items: center; gap: 10px;
  font-size: 1.15rem; font-weight: 700; margin-bottom: 24px;
  padding-bottom: 14px; border-bottom: 1px solid var(--border);
}
.cred-heading-icon { font-size: 1.3rem; }
.cred-timeline .t-item { margin-bottom: 28px; }
.cred-timeline .t-item .org { margin-bottom: 0; }
.learning { margin-top: 36px; }
.learning h3 { font-size: 1.05rem; margin-bottom: 14px; color: var(--text); }

/* Contact */
.contact-box {
  background: var(--card-solid); border: 1px solid var(--border);
  border-radius: 16px; padding: 48px; text-align: center;
  box-shadow: 0 6px 28px rgba(120, 60, 20, 0.12);
}
.contact-box h2 { font-size: 1.8rem; margin-bottom: 12px; }
.contact-box p { color: var(--muted); margin-bottom: 28px; }
.social-row { display: flex; justify-content: center; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
/* Logo buttons. Each sets --brand; the icon inherits currentColor, so the
   hover state only has to swap background and text colour. */
.social-btn {
  --brand: var(--accent-ink);
  display: inline-flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: 50%;
  border: 1px solid var(--border); background: rgba(255, 253, 248, 0.7);
  color: var(--accent-ink); text-decoration: none;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.15s;
}
.social-btn svg { width: 22px; height: 22px; display: block; fill: currentColor; }
.social-btn:hover, .social-btn:focus-visible {
  background: var(--brand); border-color: var(--brand); color: #fff;
  transform: translateY(-2px);
}
.social-btn:focus-visible { outline: 3px solid var(--accent-ink); outline-offset: 3px; }
.social-linkedin  { --brand: #0a66c2; }
.social-instagram { --brand: #e4405f; }
.social-facebook  { --brand: #1877f2; }
.social-x         { --brand: #14171a; }

/* Subpage header */
.page-head { padding: 80px 0 40px; }
.page-head h1 { font-size: clamp(2rem, 5vw, 3rem); }
.page-head .sub { color: var(--muted); max-width: 640px; }

/* ── Articles ──────────────────────────────────────────────────────────
   Two-column shell shared by the listing and every article page: the
   archive pane on the left, content on the right. Both panes' contents are
   rendered from articles.data.js by articles.nav.js. */
.articles-layout {
  display: grid; grid-template-columns: 250px minmax(0, 1fr);
  gap: 40px; align-items: start; padding-bottom: 90px;
}
.articles-layout-post { padding-top: 48px; }

/* Left pane — sticks below the 64px nav while the article scrolls */
.article-side {
  position: sticky; top: 88px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 20px 18px; box-shadow: var(--shadow);
  max-height: calc(100vh - 120px); overflow-y: auto;
}
.side-title {
  font-size: 0.78rem; font-weight: 800; letter-spacing: 1.6px;
  text-transform: uppercase; color: var(--accent-ink);
  padding-bottom: 12px; margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.side-empty { color: var(--muted); font-size: 0.9rem; }
.article-side ul { list-style: none; margin: 0; padding: 0; }
.article-side summary {
  cursor: pointer; list-style: none;
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; user-select: none;
}
.article-side summary::-webkit-details-marker { display: none; }
/* chevron, rotated when the group is open */
.article-side summary::before {
  content: ""; flex: none;
  width: 6px; height: 6px; margin-left: 2px;
  border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent);
  transform: rotate(-45deg); transition: transform 0.18s;
}
.article-side details[open] > summary::before { transform: rotate(45deg); }
.side-count {
  margin-left: auto; font-size: 0.72rem; line-height: 1;
  padding: 3px 8px; border-radius: 999px;
  background: rgba(210, 105, 30, 0.12); color: var(--accent-ink);
  border: 1px solid rgba(168, 67, 26, 0.22);
}
.side-year-label { font-weight: 800; font-size: 0.98rem; color: var(--text); }
.side-months { margin-left: 14px; }
.side-month-label { font-weight: 600; font-size: 0.88rem; color: var(--muted); }
.side-posts { margin: 2px 0 8px 22px; border-left: 1px solid var(--border); }
.side-posts a {
  display: block; padding: 5px 0 5px 12px; margin-left: -1px;
  border-left: 2px solid transparent;
  color: #453623; font-size: 0.86rem; line-height: 1.35;
  text-decoration: none; transition: color 0.15s, border-color 0.15s;
}
.side-posts a:hover { color: var(--accent-ink); border-left-color: var(--accent); }
.side-posts a.is-current {
  color: var(--accent-ink); font-weight: 700; border-left-color: var(--accent);
}

/* Listing cards */
.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 14px; padding: 26px 28px; margin-bottom: 22px;
  box-shadow: var(--shadow);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.article-card:last-child { margin-bottom: 0; }
.article-card:hover {
  transform: translateY(-3px); border-color: var(--accent);
  box-shadow: 0 8px 24px rgba(120, 60, 20, 0.14);
}
.article-card h2 { font-size: 1.3rem; margin: 6px 0 10px; }
.article-card h2 a { color: var(--text); text-decoration: none; }
.article-card h2 a:hover { color: var(--accent-ink); }
.article-card p { color: var(--muted); font-size: 0.96rem; }
.article-meta {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  color: var(--accent-ink); font-size: 0.8rem; font-weight: 700;
  letter-spacing: 1px; text-transform: uppercase;
}
.article-meta .dot { opacity: 0.6; }
.article-more {
  display: inline-block; margin-top: 16px;
  color: var(--accent-ink); font-weight: 600; font-size: 0.9rem;
  text-decoration: none;
}
.article-more:hover { text-decoration: underline; }

/* Article body */
.article-body {
  background: var(--card); border: 1px solid var(--border);
  border-radius: 16px; padding: 36px 40px; box-shadow: var(--shadow);
}
.crumb { margin-bottom: 18px; }
.crumb a { color: var(--accent-ink); text-decoration: none; font-size: 0.88rem; font-weight: 600; }
.crumb a:hover { text-decoration: underline; }
.article-body h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); margin: 10px 0 14px; }
.article-body h2 {
  font-size: 1.3rem; font-weight: 700; margin: 34px 0 12px;
  padding-top: 4px;
}
.article-body h3 { font-size: 1.08rem; margin: 24px 0 8px; }
.article-body p { color: #453623; margin-bottom: 16px; }
.article-body .lede { font-size: 1.12rem; color: var(--muted); margin: 18px 0 8px; }
.article-body ul, .article-body ol { margin: 0 0 18px 20px; }
.article-body li { color: #453623; margin-bottom: 8px; }
.article-body blockquote {
  margin: 26px 0; padding: 4px 0 4px 20px;
  border-left: 3px solid var(--accent);
  color: var(--accent-ink); font-size: 1.05rem; font-style: italic;
}
.article-body .tags { margin-bottom: 8px; }
.article-body a { color: var(--accent-ink); }
.article-end {
  margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.9rem;
}
.article-end p { color: var(--muted); margin: 0; font-size: 0.9rem; }

/* Cover image */
.article-hero { margin: 22px 0 8px; }
.article-hero img {
  width: 100%; height: auto; display: block;
  border-radius: 12px; border: 1px solid var(--border);
  box-shadow: 0 6px 22px rgba(120, 60, 20, 0.16);
}

/* "Also published on LinkedIn" footer note */
.crosspost {
  display: flex; align-items: center; gap: 14px;
  margin-top: 34px; padding: 16px 20px;
  background: rgba(10, 102, 194, 0.07);
  border: 1px solid rgba(10, 102, 194, 0.24);
  border-radius: 12px;
}
.crosspost svg { width: 26px; height: 26px; flex: none; fill: #0a66c2; }
.crosspost p { margin: 0; font-size: 0.92rem; color: var(--muted); }
.crosspost a { color: #0a66c2; font-weight: 600; }

/* ── Fallback landing (not-found.html) ─────────────────────────────────── */
.landing {
  min-height: calc(100vh - 150px);
  display: flex; align-items: center;
  padding: 56px 0;
}
.landing-box {
  max-width: 640px; margin: 0 auto; text-align: center;
  background: var(--card-solid); border: 1px solid var(--border);
  border-radius: 16px; padding: 52px 48px;
  box-shadow: 0 6px 28px rgba(120, 60, 20, 0.12);
}
.landing-mark {
  width: 62px; height: 62px; margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--grad);
  color: #fffdf8; font-weight: 800; font-size: 1.25rem; letter-spacing: 1px;
  box-shadow: 0 6px 20px rgba(192, 73, 43, 0.3);
}
.landing-box .eyebrow { font-size: 0.8rem; margin-bottom: 10px; }
.landing-box h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); margin-bottom: 16px; }
.landing-lede { color: var(--muted); font-size: 1.02rem; margin-bottom: 32px; }
.landing-actions {
  display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}
.btn-ghost {
  background: rgba(210, 105, 30, 0.08); color: var(--accent-ink);
  border: 1px solid rgba(168, 67, 26, 0.35);
}
.btn-ghost:hover {
  transform: translateY(-2px);
  background: rgba(210, 105, 30, 0.16); border-color: var(--accent);
}
.landing-foot {
  margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 0.88rem;
}
.landing-foot a { color: var(--accent-ink); }

footer {
  border-top: 1px solid rgba(168, 67, 26, 0.22);
  padding: 28px 0; text-align: center; color: #4a3826; font-size: 0.85rem;
}

/* Below the two-column threshold the archive pane moves above the content
   and stops sticking — a sticky pane on a phone just eats the viewport. */
@media (max-width: 900px) {
  .articles-layout { grid-template-columns: 1fr; gap: 24px; }
  .article-side { position: static; max-height: none; }
  .article-body { padding: 28px 24px; }
}

@media (max-width: 760px) {
  /* Five links plus the avatar cannot share one line on a phone —
     wrap them under the logo instead of overflowing the viewport. */
  /* vertical padding only — .container owns the horizontal padding */
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 12px; row-gap: 8px; }
  /* six items no longer fit one phone-width row — let them wrap rather than
     overflow, which would widen the whole page horizontally */
  .nav-links {
    width: 100%; flex-wrap: wrap; justify-content: center;
    row-gap: 8px; column-gap: 14px;
  }
  .nav-links a { font-size: 0.78rem; }
  .nav-links a.nav-cta { padding: 5px 12px; }
  .logo-thumb { width: 30px; height: 30px; }
  section { scroll-margin-top: 108px; }
  .about-grid { grid-template-columns: 1fr; }
  .hero-grid { grid-template-columns: 1fr; gap: 32px; }
  .photo-ring { order: -1; width: min(220px, 60vw); }
  .skills-row { grid-template-columns: 1fr; }
  .timeline-pane, .cred-block { padding: 24px 20px; }
  section { padding: 64px 0; }
  .btn-float { right: 16px; bottom: 16px; padding: 12px 22px; font-size: 0.88rem; }
  /* keep the floating button clear of the copyright line */
  footer { padding-bottom: 72px; }
}

@media (max-width: 430px) {
  .container { padding: 0 18px; }
  .contact-box { padding: 32px 22px; }
  .landing-box { padding: 36px 22px; }
  .landing-actions .btn { width: 100%; }
}
