/* ---------------------------------------------------------------
   Technical Editorial — dark canvas, signal amber, confident sans
   --------------------------------------------------------------- */

@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wdth,wght@12..96,75..125,200..800&family=IBM+Plex+Sans:ital,wght@0,300;0,400;0,500;0,600;0,700;1,400;1,500&family=JetBrains+Mono:wght@400;500;700&display=swap');

:root {
  /* Palette */
  --bg:           #0F0F10;
  --bg-elevated:  #17171B;
  --bg-deep:      #08080A;
  --text:         #EAE5DB;
  --text-soft:    #A8A39C;
  --muted:        #6E6964;
  --rule:         #26262A;
  --rule-strong:  #383840;
  --accent:       #F09340;
  --accent-hot:   #FF7F33;
  --accent-soft:  #C97A35;

  /* Type */
  --display: 'Bricolage Grotesque', -apple-system, system-ui, sans-serif;
  --body:    'IBM Plex Sans', -apple-system, system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', Consolas, monospace;

  /* Layout */
  --max-width: 1180px;
  --gutter:    clamp(1.25rem, 4vw, 3rem);

  /* Type scale */
  --fs-mega:   clamp(3.75rem, 10vw, 8rem);
  --fs-h1:     clamp(2.25rem, 5vw, 3.75rem);
  --fs-h2:     clamp(1.5rem, 2.5vw, 2rem);
  --fs-body:   1.0625rem;
  --fs-small:  0.9375rem;
  --fs-xs:     0.75rem;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Atmospheric glow */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 12% 0%, rgba(240,147,64,0.06) 0%, transparent 40%),
    radial-gradient(circle at 88% 100%, rgba(240,147,64,0.04) 0%, transparent 45%);
  z-index: 0;
}

img { max-width: 100%; height: auto; display: block; }

a {
  color: var(--text);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-strong);
  transition: border-color 0.2s ease, color 0.2s ease;
}
a:hover { color: var(--accent); border-bottom-color: var(--accent); }

::selection { background: var(--accent); color: var(--bg); }

/* Layout primitives */
.wrap {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

.rule {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 4rem 0;
}

/* Masthead — sticky, translucent */
.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: rgba(15, 15, 16, 0.82);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.masthead .wrap {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.masthead a {
  border-bottom: none;
  color: var(--text-soft);
}
.masthead a:hover { color: var(--accent); }
.masthead-nav { display: flex; gap: 1.75rem; }

/* Hero */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(2.5rem, 5vw, 4rem);
  position: relative;
}

.eyebrow {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-weight: 500;
}
.eyebrow::before {
  content: '';
  width: 0.5rem;
  height: 0.5rem;
  background: var(--accent);
  border-radius: 50%;
  box-shadow: 0 0 10px var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 10px var(--accent); }
  50%      { opacity: 0.55; box-shadow: 0 0 4px var(--accent); }
}
.eyebrow::after {
  content: '';
  flex: 1;
  max-width: 4rem;
  height: 1px;
  background: var(--rule);
}

.display {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-mega);
  line-height: 0.92;
  letter-spacing: -0.04em;
  margin: 0 0 1.75rem;
  color: var(--text);
  font-variation-settings: "opsz" 96, "wdth" 100;
}
.display em {
  font-style: normal;
  color: var(--accent);
}

.lede {
  font-family: var(--body);
  font-weight: 400;
  font-size: clamp(1.125rem, 1.6vw, 1.375rem);
  line-height: 1.5;
  color: var(--text-soft);
  max-width: 42rem;
  margin: 0 0 2.5rem;
}

.hero-meta {
  display: flex;
  gap: 2.25rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.hero-meta span strong {
  display: block;
  color: var(--text);
  font-weight: 500;
  margin-top: 0.4rem;
  letter-spacing: -0.005em;
  text-transform: none;
  font-family: var(--body);
  font-size: var(--fs-small);
}
.hero-meta a { border-bottom: none; color: var(--text); }
.hero-meta a:hover { color: var(--accent); }

/* Section heads */
.section {
  padding: clamp(2.5rem, 5vw, 4rem) 0;
  scroll-margin-top: 5rem;
}

.section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2rem;
  align-items: baseline;
  margin-bottom: 3rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--rule);
}
.section-num {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--accent);
}
.section-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: var(--fs-h1);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0;
  color: var(--text);
  font-variation-settings: "opsz" 72, "wdth" 100;
}
.section-title em { font-style: normal; color: var(--accent); }

/* About */
.about {
  display: grid;
  grid-template-columns: 1fr;
  gap: 2.5rem;
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 48rem;
  color: var(--text-soft);
}
.about p { margin: 0 0 1.25rem; }
.about a { color: var(--text); border-bottom-color: var(--accent); }

/* Experience */
.role {
  display: grid;
  grid-template-columns: 10rem 1fr;
  gap: 2.5rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--rule);
}
.role:last-child { border-bottom: 1px solid var(--rule); }

.role-date {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 0.5rem;
  line-height: 1.55;
}
.role-date strong {
  display: block;
  color: var(--text-soft);
  font-weight: 500;
  margin-top: 0.5rem;
  font-size: var(--fs-xs);
  letter-spacing: 0.05em;
}

.role-body h3 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.625rem;
  line-height: 1.15;
  margin: 0 0 0.4rem;
  letter-spacing: -0.025em;
  color: var(--text);
  font-variation-settings: "opsz" 48;
}
.role-body .employer {
  font-family: var(--mono);
  font-style: normal;
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.25rem;
  font-weight: 500;
}
.role-body p {
  margin: 0 0 1rem;
  color: var(--text-soft);
  line-height: 1.65;
}
.role-body p:last-child { margin-bottom: 0; }

.role-body code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}

/* Skills */
.skills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 2rem 3rem;
}
.skill-group h4 {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.skill-group ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.skill-group li {
  padding: 0.4rem 0;
  font-size: 0.9375rem;
  color: var(--text-soft);
}

/* Credentials */
.creds {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
@media (max-width: 720px) { .creds { grid-template-columns: 1fr; gap: 2rem; } }
.creds h4 {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--rule);
}
.creds ul { list-style: none; padding: 0; margin: 0; }
.creds li {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--rule);
}
.creds li strong {
  display: block;
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.creds li span {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* Writing teasers */
.writing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr));
  gap: 2.5rem;
}
.writing-card {
  border-top: 2px solid var(--accent);
  padding-top: 1.5rem;
  transition: border-color 0.25s ease, transform 0.25s ease;
}
.writing-card:hover {
  border-top-color: var(--accent-hot);
  transform: translateY(-2px);
}
.writing-card .kicker {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 0.75rem;
  font-weight: 500;
}
.writing-card h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 0 0 0.75rem;
  color: var(--text);
}
.writing-card h3 a { border-bottom: none; color: var(--text); }
.writing-card h3 a:hover { color: var(--accent); }
.writing-card p {
  margin: 0 0 1rem;
  color: var(--text-soft);
  font-size: 0.9375rem;
  line-height: 1.6;
}
.writing-card p code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}
.writing-card .more {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  border-bottom: none;
  font-weight: 500;
}
.writing-card .more::after { content: ' →'; }

/* Footer */
footer {
  border-top: 1px solid var(--rule);
  margin-top: 4rem;
  padding: 2.5rem 0 3rem;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
footer a { color: var(--text-soft); border-bottom: none; }
footer a:hover { color: var(--accent); }

/* Blog index */
.post-list { display: flex; flex-direction: column; }
.post-list-item {
  display: grid;
  grid-template-columns: 9rem 1fr auto;
  gap: 2rem;
  align-items: baseline;
  padding: 2.25rem 1rem 2.25rem 0;
  border-top: 1px solid var(--rule);
  transition: background 0.25s ease, padding-left 0.25s ease;
  margin: 0 -1rem;
  padding-left: 1rem;
}
.post-list-item:last-child { border-bottom: 1px solid var(--rule); }
.post-list-item:hover {
  background: linear-gradient(90deg, rgba(240,147,64,0.05), transparent 70%);
  padding-left: 1.5rem;
}
.post-list-item .date {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.post-list-item h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--text);
  font-variation-settings: "opsz" 60;
}
.post-list-item h2 a { border-bottom: none; color: var(--text); }
.post-list-item h2 a:hover { color: var(--accent); }
.post-list-item p {
  margin: 0;
  color: var(--text-soft);
  font-size: 0.9375rem;
  max-width: 36rem;
  line-height: 1.6;
}
.post-list-item p code {
  font-family: var(--mono);
  font-size: 0.85em;
  color: var(--accent);
}
.post-list-item .tag {
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
  font-weight: 500;
}
@media (max-width: 720px) {
  .post-list-item { grid-template-columns: 1fr; gap: 0.5rem; }
}

/* Article */
.article-hero { padding: clamp(2.5rem, 6vw, 5rem) 0 2rem; }
.article-hero .eyebrow { margin-bottom: 2rem; }
.article-title {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.25rem, 5.5vw, 4.25rem);
  line-height: 1;
  letter-spacing: -0.04em;
  margin: 0 0 2rem;
  color: var(--text);
  max-width: 42rem;
  font-variation-settings: "opsz" 96;
}
.article-title em { font-style: normal; color: var(--accent); }
.article-meta {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 1.5rem;
  border-top: 1px solid var(--rule);
}

.article {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2rem 0 4rem;
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--text-soft);
}
.article p { margin: 0 0 1.5rem; }
.article h2 {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.75rem;
  line-height: 1.2;
  letter-spacing: -0.025em;
  margin: 3rem 0 1rem;
  color: var(--text);
  font-variation-settings: "opsz" 60;
}
.article h2::before {
  content: counter(h2-counter, decimal-leading-zero);
  counter-increment: h2-counter;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.article { counter-reset: h2-counter; }
.article h3 {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 2rem 0 0.75rem;
  letter-spacing: -0.015em;
  color: var(--text);
}
.article ul, .article ol { margin: 0 0 1.5rem; padding-left: 1.5rem; }
.article li { padding: 0.25rem 0; }
.article ul li::marker { color: var(--accent); }
.article ol li::marker { color: var(--accent); font-family: var(--mono); font-size: 0.9em; }
.article strong { color: var(--text); font-weight: 600; }
.article em { color: var(--text); font-style: italic; }

.article blockquote {
  margin: 2rem 0;
  padding: 0.5rem 0 0.5rem 1.5rem;
  border-left: 3px solid var(--accent);
  font-family: var(--display);
  font-style: normal;
  font-weight: 500;
  font-size: 1.25rem;
  color: var(--text);
  line-height: 1.4;
  letter-spacing: -0.015em;
}

.article code {
  font-family: var(--mono);
  font-size: 0.875em;
  background: var(--bg-elevated);
  color: var(--accent);
  padding: 0.1em 0.4em;
  border-radius: 3px;
  border: 1px solid var(--rule);
}
.article pre {
  font-family: var(--mono);
  background: var(--bg-deep);
  color: var(--text);
  padding: 1.25rem 1.5rem;
  border-radius: 4px;
  overflow-x: auto;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 1.5rem 0;
  border: 1px solid var(--rule);
  border-left: 3px solid var(--accent);
}
.article pre code {
  background: transparent;
  padding: 0;
  color: inherit;
  border: none;
}
.article hr {
  border: none;
  height: 1px;
  background: var(--rule);
  margin: 3rem auto;
  max-width: 50%;
}

.article-foot {
  max-width: 38rem;
  margin: 0 auto;
  padding: 2rem 0 0;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.article-foot a { color: var(--text-soft); border-bottom: none; }
.article-foot a:hover { color: var(--accent); }

/* Mobile */
@media (max-width: 720px) {
  .role { grid-template-columns: 1fr; gap: 1rem; }
  .role-date { padding-top: 0; }
  .hero-meta { gap: 1.25rem; }
  .masthead-nav { gap: 1.25rem; }
  .section-head { gap: 1rem; }
}

/* Reveal */
@keyframes rise {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.rise { animation: rise 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) backwards; }
.rise-1 { animation-delay: 0.05s; }
.rise-2 { animation-delay: 0.15s; }
.rise-3 { animation-delay: 0.25s; }
.rise-4 { animation-delay: 0.35s; }
.rise-5 { animation-delay: 0.45s; }

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

/* Print — produces a clean light PDF when user prints */
@media print {
  body { background: white; color: #111; font-size: 10pt; }
  body::before { display: none; }
  .masthead, footer, .writing-grid { display: none; }
  .section { padding: 1rem 0; }
  .display, .section-title, .article-title, .role-body h3, .creds li strong { color: #111; }
  .display em, .section-title em, .article-title em, .section-num,
  .role-body .employer, .skill-group h4, .creds h4, .eyebrow { color: #C97A35; }
  .eyebrow::before, .eyebrow::after { display: none; }
  .display { font-size: 28pt; }
  .lede { font-size: 11pt; color: #333; }
  .section-title { font-size: 16pt; }
  a { color: #111; border-bottom: none; }
  .role { padding: 0.5rem 0; page-break-inside: avoid; border-color: #ddd; }
  .role-body p, .skill-group li, .about, .about p { color: #333; }
  .role-body code { background: #f4f0e8; color: #C97A35; border-color: #ddd; }
  .hero { padding: 0 0 1rem; }
  .hero-meta { color: #555; border-color: #ddd; }
  .hero-meta span strong { color: #111; }
  .creds li span { color: #555; }
}
