/* ========================================
 * Home Page — Editorial / Agentic Theme
 * Based on Claude Design handoff: "Buckley Robinson.dc.html"
 * ======================================== */

:root {
  --hm-bg:        #F1ECE3;
  --hm-bg-alt:    #EAE3D6;
  --hm-ink:       #17150F;
  --hm-ink-soft:  #413D34;
  --hm-ink-mute:  #5F5A4E;
  --hm-ink-faint: #8C8474;
  --hm-line:      rgba(23,21,15,0.14);
  --hm-line-hi:   rgba(23,21,15,0.18);
  --hm-accent:    #E24417;
  --hm-accent-2:  #E27A5E;
  --hm-dark:      #17150F;
  --hm-cream:     #F1ECE3;
  --hm-green:     #8FB98A;
  --hm-f-display: "Newsreader", serif;
  --hm-f-body:    "Hanken Grotesk", system-ui, sans-serif;
  --hm-f-mono:    "JetBrains Mono", ui-monospace, Menlo, monospace;
}

html:has(body.home-body) { scroll-behavior: smooth; }

body.home-body {
  margin: 0;
  background: var(--hm-bg);
  color: var(--hm-ink);
  font-family: var(--hm-f-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body.home-body ::selection { background: var(--hm-accent); color: #fff; }
body.home-body a { text-decoration: none; }
body.home-body button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

@keyframes hmDotPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(226,68,23,0.55); }
  50% { box-shadow: 0 0 0 6px rgba(226,68,23,0); }
}
@keyframes hmShimmer {
  0% { background-position: -160% 0; }
  100% { background-position: 260% 0; }
}
@keyframes hmBlink { 0%, 49% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes hmFloatUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }
@keyframes hmGridDrift { from { background-position: 0 0; } to { background-position: 0 -40px; } }

.hm-container { max-width: 1320px; margin: 0 auto; padding-left: 6vw; padding-right: 6vw; }

/* ===== NAV ===== */
.hm-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(241,236,227,0.82);
  border-bottom: 1px solid var(--hm-line-hi);
}
.hm-nav-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 14px 6vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.hm-brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--hm-ink); }
.hm-brand-mark {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--hm-ink); color: var(--hm-cream);
  font-family: var(--hm-f-mono); font-size: 12px; font-weight: 600; letter-spacing: 0.02em;
  flex: none;
}
.hm-brand-name { font-family: var(--hm-f-mono); font-size: 13px; letter-spacing: 0.02em; font-weight: 500; }

.hm-nav-links { display: flex; align-items: center; gap: 30px; font-family: var(--hm-f-mono); font-size: 12.5px; letter-spacing: 0.04em; }
.hm-nav-links a { color: var(--hm-ink-mute); text-decoration: none; transition: color .15s; }
.hm-nav-links a:hover, .hm-nav-links a.on { color: var(--hm-ink); }

.hm-nav-cta {
  font-family: var(--hm-f-mono); font-size: 12.5px; font-weight: 500; letter-spacing: 0.02em;
  background: var(--hm-ink); color: var(--hm-cream); text-decoration: none;
  padding: 11px 18px; border-radius: 2px; white-space: nowrap; transition: background .15s;
}
.hm-nav-cta:hover { background: var(--hm-accent); }

.hm-burger {
  display: none;
  align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 6px;
  border: 1px solid var(--hm-line-hi); color: var(--hm-ink);
}
.hm-burger svg { width: 18px; height: 18px; }

.hm-drawer {
  position: fixed; top: 0; right: 0; width: 280px; max-width: 85vw; height: 100vh;
  background: var(--hm-bg); border-left: 1px solid var(--hm-line-hi); z-index: 60;
  transform: translateX(100%); transition: transform .25s ease;
  display: flex; flex-direction: column; box-shadow: -10px 0 40px rgba(0,0,0,.25);
}
.hm-drawer.pf-side--open { transform: translateX(0); }
.hm-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--hm-line); }
.hm-drawer-close { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 6px; color: var(--hm-ink-mute); }
.hm-drawer-close svg { width: 18px; height: 18px; }
.hm-drawer-nav { display: flex; flex-direction: column; padding: 12px; gap: 2px; font-family: var(--hm-f-mono); }
.hm-drawer-nav a { display: block; padding: 13px 12px; border-radius: 6px; font-size: 14px; color: var(--hm-ink-mute); text-decoration: none; }
.hm-drawer-nav a:hover, .hm-drawer-nav a.on { color: var(--hm-ink); background: rgba(23,21,15,0.06); }
.hm-overlay {
  position: fixed; inset: 0; background: rgba(23,21,15,0.4); z-index: 55;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.hm-overlay.pf-overlay--visible { opacity: 1; pointer-events: auto; }

/* ===== HERO ===== */
.hm-hero { position: relative; max-width: 1320px; margin: 0 auto; padding: clamp(48px,7vw,104px) 6vw clamp(56px,7vw,96px); }
.hm-hero-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px,1fr)); gap: clamp(40px,5vw,72px); align-items: center; }

.hm-eyebrow { display: flex; align-items: center; gap: 10px; font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hm-accent); margin-bottom: 28px; }
.hm-eyebrow-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--hm-accent); animation: hmDotPulse 2.4s ease-out infinite; }

.hm-h1 { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(42px,6.6vw,92px); line-height: 0.98; letter-spacing: -0.02em; margin: 0 0 26px; }
.hm-h1-brace { font-style: italic; }
.hm-h1-brace-glyph { font-family: var(--hm-f-mono); font-style: normal; color: var(--hm-accent); font-size: 0.62em; font-weight: 500; vertical-align: 0.12em; }

.hm-lead { font-size: clamp(16px,1.35vw,19px); line-height: 1.55; color: var(--hm-ink-soft); max-width: 33em; margin: 0 0 38px; }

.hm-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; }
.hm-btn-primary {
  font-family: var(--hm-f-mono); font-size: 13.5px; font-weight: 500; letter-spacing: 0.02em;
  background: var(--hm-accent); color: #fff; text-decoration: none;
  padding: 16px 26px; border-radius: 2px; display: inline-flex; align-items: center; gap: 10px;
  transition: background .15s;
}
.hm-btn-primary:hover { background: var(--hm-ink); }
.hm-btn-link {
  font-family: var(--hm-f-mono); font-size: 13.5px; letter-spacing: 0.02em; color: var(--hm-ink);
  text-decoration: none; border-bottom: 1px solid rgba(23,21,15,0.3); padding-bottom: 3px; transition: color .15s, border-color .15s;
}
.hm-btn-link:hover { border-color: var(--hm-accent); color: var(--hm-accent); }

/* Live agent console */
.hm-console-wrap { position: relative; }
.hm-console-label { position: absolute; inset: -14px -14px auto auto; font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--hm-ink-faint); text-transform: uppercase; text-align: right; }
.hm-console {
  border-radius: 8px; overflow: hidden; background: #141210;
  box-shadow: 0 40px 80px -40px rgba(23,21,15,0.55), 0 2px 0 rgba(255,255,255,0.03) inset;
  border: 1px solid rgba(255,255,255,0.06);
}
.hm-console-bar { display: flex; align-items: center; gap: 8px; padding: 13px 16px; border-bottom: 1px solid rgba(255,255,255,0.07); }
.hm-console-dot { width: 10px; height: 10px; border-radius: 50%; background: #3a352b; }
.hm-console-dot--accent { background: var(--hm-accent); }
.hm-console-title { margin-left: 8px; font-family: var(--hm-f-mono); font-size: 11.5px; color: #7c7566; letter-spacing: 0.04em; }
.hm-console-status { margin-left: auto; display: flex; align-items: center; gap: 6px; font-family: var(--hm-f-mono); font-size: 11px; color: var(--hm-green); }
.hm-console-status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--hm-green); }

.hm-console-rows { padding: 14px 16px 10px; }
.hm-row { display: flex; align-items: center; gap: 12px; padding: 9px 0; }
.hm-row-dot { width: 8px; height: 8px; border-radius: 50%; background: #3a352b; flex: none; transition: all .3s; }
.hm-row-name { font-family: var(--hm-f-mono); font-size: 13px; color: #6b6456; width: 104px; flex: none; transition: color .3s; }
.hm-row-track { flex: 1; height: 3px; border-radius: 3px; background: #26231c; overflow: hidden; position: relative; }
.hm-row-state { font-family: var(--hm-f-mono); font-size: 11px; color: #5b5447; width: 58px; text-align: right; flex: none; transition: color .3s; }

.hm-console-log-wrap { border-top: 1px solid rgba(255,255,255,0.07); padding: 12px 16px 15px; background: #100e0b; }
.hm-console-log { font-family: var(--hm-f-mono); font-size: 11.5px; line-height: 1.85; color: #a7a091; height: 104px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; }
.hm-console-prompt { font-family: var(--hm-f-mono); font-size: 11.5px; color: var(--hm-green); margin-top: 2px; }
.hm-console-cursor { display: inline-block; width: 7px; height: 14px; background: var(--hm-green); vertical-align: -2px; animation: hmBlink 1.1s step-end infinite; }

/* ===== PROOF BAND ===== */
.hm-proof { background: var(--hm-dark); color: var(--hm-cream); }
.hm-proof-inner { max-width: 1320px; margin: 0 auto; padding: clamp(56px,7vw,96px) 6vw; }
.hm-proof-label { font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hm-accent-2); margin-bottom: 44px; }
.hm-proof-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: clamp(32px,4vw,56px); }
.hm-proof-num { font-family: var(--hm-f-display); font-size: clamp(52px,6vw,86px); line-height: 0.9; letter-spacing: -0.02em; color: var(--hm-cream); }
.hm-proof-num-sym { color: var(--hm-accent); }
.hm-proof-text { font-size: 15px; line-height: 1.5; color: #B4AC9C; margin: 18px 0 0; max-width: 22em; }
.hm-proof-text strong { color: var(--hm-cream); font-weight: 500; }

/* ===== SECTION HEADER ===== */
.hm-section { max-width: 1320px; margin: 0 auto; padding: clamp(72px,9vw,140px) 6vw; }
.hm-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: clamp(40px,5vw,72px); }
.hm-section-title { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(34px,4.6vw,62px); letter-spacing: -0.02em; line-height: 1; margin: 0; max-width: 14em; }
.hm-section-tag { font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hm-accent); }

/* ===== SERVICES ===== */
.hm-services { border-top: 1px solid var(--hm-line); }
.hm-svc-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px,1fr)); gap: clamp(24px,3vw,56px); padding: clamp(36px,4vw,56px) 0; border-bottom: 1px solid var(--hm-line); }
.hm-svc-head { display: flex; gap: 22px; align-items: flex-start; }
.hm-svc-num { font-family: var(--hm-f-mono); font-size: 13px; color: var(--hm-accent); padding-top: 14px; }
.hm-svc-title { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(28px,3vw,40px); line-height: 1.05; letter-spacing: -0.01em; margin: 0; }
.hm-svc-title em { font-style: italic; }
.hm-svc-desc { font-size: 16px; line-height: 1.6; color: var(--hm-ink-soft); margin: 0 0 22px; max-width: 38em; }
.hm-tags { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--hm-f-mono); font-size: 11.5px; color: var(--hm-ink-mute); }
.hm-tag { border: 1px solid var(--hm-line-hi); border-radius: 2px; padding: 5px 10px; }

/* ===== WORK ===== */
.hm-work { background: var(--hm-bg-alt); }
.hm-work-list { border-top: 1px solid var(--hm-line-hi); }
.hm-work-row {
  display: grid; grid-template-columns: minmax(0,180px) 1fr auto; gap: clamp(16px,3vw,48px); align-items: baseline;
  padding: clamp(28px,3.4vw,44px) 0; border-bottom: 1px solid var(--hm-line-hi);
  text-decoration: none; color: var(--hm-ink); transition: background .15s;
}
.hm-work-row:hover { background: rgba(226,68,23,0.05); }
.hm-work-meta { font-family: var(--hm-f-mono); font-size: 12px; color: var(--hm-ink-mute); }
.hm-work-title { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(24px,2.6vw,34px); line-height: 1.1; margin: 0 0 10px; }
.hm-work-desc { font-size: 15px; line-height: 1.55; color: #4A463C; margin: 0 0 14px; max-width: 44em; }
.hm-work-pillars { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--hm-f-mono); font-size: 11px; color: var(--hm-ink-mute); }
.hm-work-arrow { font-family: var(--hm-f-mono); font-size: 20px; color: var(--hm-accent); align-self: center; }
.hm-work-more { margin-top: 36px; }

/* ===== PROCESS ===== */
.hm-steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px,1fr)); gap: clamp(24px,2.5vw,40px); }
.hm-step { border-top: 2px solid var(--hm-line-hi); padding-top: 22px; }
.hm-step--lead { border-top-color: var(--hm-accent); }
.hm-step-num { font-family: var(--hm-f-mono); font-size: 12px; color: var(--hm-ink-faint); margin-bottom: 18px; }
.hm-step--lead .hm-step-num { color: var(--hm-accent); }
.hm-step-title { font-family: var(--hm-f-display); font-weight: 400; font-size: 26px; margin: 0 0 12px; }
.hm-step-desc { font-size: 15px; line-height: 1.6; color: var(--hm-ink-soft); margin: 0; }

/* ===== APPROACH ===== */
.hm-approach { background: var(--hm-dark); color: var(--hm-cream); }
.hm-approach-label { font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--hm-accent-2); margin-bottom: 36px; }
.hm-approach-quote { font-family: var(--hm-f-display); font-weight: 300; font-size: clamp(28px,4vw,52px); line-height: 1.14; letter-spacing: -0.015em; margin: 0 0 clamp(48px,6vw,88px); max-width: 20em; }
.hm-approach-quote em { font-style: italic; color: var(--hm-accent-2); }
.hm-approach-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px,1fr)); gap: clamp(28px,3vw,48px); }
.hm-approach-item { border-top: 1px solid rgba(241,236,227,0.18); padding-top: 22px; }
.hm-approach-item-title { font-family: var(--hm-f-display); font-weight: 400; font-size: 23px; margin: 0 0 10px; }
.hm-approach-item-desc { font-size: 14.5px; line-height: 1.6; color: #B4AC9C; margin: 0; }

/* ===== EXPERIENCE + TOOLKIT ===== */
.hm-split { max-width: 1320px; margin: 0 auto; padding: clamp(72px,9vw,140px) 6vw; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px,1fr)); gap: clamp(48px,6vw,96px); }
.hm-split-title { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(30px,3.6vw,46px); letter-spacing: -0.02em; margin: 0 0 clamp(28px,3vw,44px); }

.hm-exp-list { border-top: 1px solid var(--hm-line); }
.hm-exp-row { display: flex; justify-content: space-between; gap: 20px; padding: 20px 0; border-bottom: 1px solid var(--hm-line); }
.hm-exp-role { font-size: 16.5px; font-weight: 600; }
.hm-exp-company { font-size: 14px; color: var(--hm-ink-mute); margin-top: 3px; }
.hm-exp-when { font-family: var(--hm-f-mono); font-size: 11.5px; color: var(--hm-ink-faint); white-space: nowrap; text-align: right; padding-top: 3px; }
.hm-exp-more { margin-top: 28px; }

.hm-toolkit-groups { display: flex; flex-direction: column; gap: 26px; }
.hm-tool-label { font-family: var(--hm-f-mono); font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hm-accent); margin-bottom: 12px; }
.hm-tool-tags { display: flex; flex-wrap: wrap; gap: 8px; font-family: var(--hm-f-mono); font-size: 12.5px; color: var(--hm-ink-soft); }
.hm-tool-tags span { border: 1px solid var(--hm-line-hi); border-radius: 2px; padding: 5px 10px; }

/* ===== CONTACT ===== */
.hm-contact { position: relative; background: var(--hm-accent); color: #fff; overflow: hidden; }
.hm-contact-grid-bg {
  position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,0.06) 1px,transparent 1px), linear-gradient(90deg,rgba(255,255,255,0.06) 1px,transparent 1px);
  background-size: 40px 40px; animation: hmGridDrift 6s linear infinite;
}
.hm-contact-inner { position: relative; max-width: 1320px; margin: 0 auto; padding: clamp(80px,10vw,150px) 6vw; }
.hm-contact-label { font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.16em; text-transform: uppercase; color: rgba(255,255,255,0.7); margin-bottom: 32px; }
.hm-contact-title { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(36px,6vw,84px); line-height: 1.02; letter-spacing: -0.02em; margin: 0 0 40px; max-width: 16em; }
.hm-contact-cta {
  font-family: var(--hm-f-mono); font-size: 14.5px; font-weight: 500; letter-spacing: 0.02em;
  background: var(--hm-dark); color: var(--hm-cream); text-decoration: none;
  padding: 18px 30px; border-radius: 2px; display: inline-flex; align-items: center; gap: 12px;
  transition: background .15s, color .15s;
}
.hm-contact-cta:hover { background: #fff; color: var(--hm-dark); }
.hm-contact-links { display: flex; flex-wrap: wrap; gap: 28px; margin-top: 56px; font-family: var(--hm-f-mono); font-size: 13px; }
.hm-contact-links a { color: #fff; text-decoration: none; border-bottom: 1px solid rgba(255,255,255,0.4); padding-bottom: 2px; transition: opacity .15s; }
.hm-contact-links a:hover { opacity: 0.8; }

/* ===== FOOTER ===== */
.hm-footer { background: var(--hm-dark); color: var(--hm-ink-faint); }
.hm-footer-inner { max-width: 1320px; margin: 0 auto; padding: 32px 6vw; display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; font-family: var(--hm-f-mono); font-size: 12px; }

/* ===== LONG-FORM CONTENT PAGE (e.g. Buck Workflow) ===== */
.hm-page { max-width: 880px; margin: 0 auto; padding: clamp(40px,6vw,72px) 6vw clamp(96px,10vw,140px); }

.hm-back { margin-bottom: 24px; font-family: var(--hm-f-mono); font-size: 12.5px; }
.hm-back a { color: var(--hm-ink-mute); text-decoration: none; transition: color .15s; }
.hm-back a:hover { color: var(--hm-accent); }

.hm-h1row { display: flex; align-items: baseline; justify-content: space-between; gap: 24px; flex-wrap: wrap; margin-bottom: 10px; }
.hm-h1row h1 { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(34px,4.6vw,52px); letter-spacing: -0.02em; line-height: 1.05; margin: 0; }
.hm-h1row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; flex-shrink: 0; }
.hm-page-meta { font-family: var(--hm-f-mono); font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--hm-ink-faint); }
.hm-page-meta .hm-acc { color: var(--hm-accent); }

.hm-gh-badge {
  display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex-shrink: 0;
  border-radius: 50%; background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi); color: var(--hm-ink-mute);
  transition: color .15s, border-color .15s, background .15s;
}
.hm-gh-badge svg { width: 14px; height: 14px; }
.hm-gh-badge:hover { color: #fff; background: var(--hm-ink); border-color: var(--hm-ink); }

.hm-cta-primary {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--hm-f-mono); font-size: 13px; font-weight: 500;
  letter-spacing: 0.02em; color: #fff; background: var(--hm-accent); padding: 11px 20px; border-radius: 2px;
  text-decoration: none; transition: background .15s;
}
.hm-cta-primary span { transition: transform .15s; }
.hm-cta-primary:hover { background: var(--hm-ink); }
.hm-cta-primary:hover span { transform: translate(2px, 2px); }

.hm-page-lede { font-size: 17px; line-height: 1.6; color: var(--hm-ink-soft); max-width: 64ch; margin: 0 0 28px; }
.hm-page-lede a { color: var(--hm-accent); text-decoration: underline; text-underline-offset: 2px; }

.hm-callout {
  background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi); border-left: 3px solid var(--hm-accent);
  border-radius: 4px; padding: 18px 22px; margin: 0 0 40px;
}
.hm-callout p { font-size: 14.5px; color: var(--hm-ink); line-height: 1.6; margin: 0; }
.hm-callout code {
  font-family: var(--hm-f-mono); font-size: 13px; color: var(--hm-accent);
  background: rgba(226,68,23,0.08); padding: 1px 5px; border-radius: 4px;
}

/* Section label — smaller than home's big hm-section-title, used inline throughout a page */
.hm-seclabel { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; font-family: var(--hm-f-display); font-weight: 400; font-size: 26px; color: var(--hm-ink); margin: 56px 0 20px; }
.hm-seclabel-mark { display: inline-flex; align-items: center; color: var(--hm-ink-faint); font-size: 15px; }
.hm-seclabel-mark::before { content: ""; display: inline-block; width: 32px; height: 1px; background: var(--hm-line-hi); margin-right: 4px; vertical-align: middle; }
.hm-seclabel-sub { margin-left: auto; font-family: var(--hm-f-mono); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hm-ink-faint); }

.hm-page code { font-family: var(--hm-f-mono); }

.hm-code-block {
  background: #141210; border: 1px solid rgba(255,255,255,0.08); border-radius: 6px; padding: 18px 20px; margin: 0 0 16px;
  overflow-x: auto; font-family: var(--hm-f-mono); font-size: 13px; line-height: 1.7; color: #d8d2c4;
}

.hm-copy-button {
  display: inline-flex; align-items: center; gap: 8px; font-family: var(--hm-f-mono); font-size: 12.5px; font-weight: 500;
  color: #fff; background: var(--hm-accent); border: 0; border-radius: 2px; padding: 9px 16px; cursor: pointer; transition: background .15s;
}
.hm-copy-button:hover { background: var(--hm-ink); }

/* Skill phases / cards / detail panels */
.hm-skill-phase { margin-bottom: 36px; }
.hm-skill-phase:last-child { margin-bottom: 24px; }
.hm-skill-phase-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--hm-line-hi); }
.hm-skill-phase-num { font-family: var(--hm-f-mono); font-weight: 600; font-size: 12px; color: var(--hm-accent); letter-spacing: 0.05em; flex-shrink: 0; }
.hm-skill-phase-title { font-family: var(--hm-f-display); font-weight: 400; font-size: 20px; color: var(--hm-ink); margin: 0 0 3px; }
.hm-skill-phase-desc { font-size: 13.5px; color: var(--hm-ink-mute); margin: 0; }

.hm-skill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-bottom: 24px; }
.hm-skill-phase .hm-skill-grid { margin-bottom: 0; }
.hm-skill-card { background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi); border-radius: 6px; padding: 18px 20px 20px; transition: border-color .15s, transform .15s; }
.hm-skill-card:hover { border-color: var(--hm-accent); transform: translateY(-2px); }
.hm-skill-card-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.hm-skill-card-head code { font-family: var(--hm-f-mono); font-weight: 600; font-size: 14px; color: var(--hm-accent); }
.hm-skill-card p { font-size: 13px; color: var(--hm-ink-mute); line-height: 1.55; margin: 0; }
.hm-skill-card p + p { margin-top: 6px; color: var(--hm-ink-faint); font-size: 12.5px; }

.hm-skill-detail { position: relative; padding: 22px 24px; margin-bottom: 18px; background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi); border-radius: 6px; scroll-margin-top: 96px; }
.hm-skill-detail:hover { border-color: var(--hm-line-hi); }
.hm-skill-detail-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px dashed var(--hm-line-hi); }
.hm-skill-detail-head code { font-family: var(--hm-f-mono); font-size: 15px; color: var(--hm-accent); letter-spacing: 0.01em; }
.hm-skill-detail-tag { font-family: var(--hm-f-mono); font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--hm-ink-mute); border: 1px solid var(--hm-line-hi); border-radius: 999px; padding: 2px 10px; }
.hm-skill-detail-body p { font-size: 14.5px; color: var(--hm-ink-soft); line-height: 1.6; margin: 0 0 12px; max-width: 72ch; }
.hm-skill-detail-body p:last-child { margin-bottom: 0; }
.hm-skill-detail-body strong { color: var(--hm-ink); font-weight: 600; }
.hm-skill-detail-body code { font-family: var(--hm-f-mono); font-size: 13px; background: rgba(226,68,23,0.08); border: 1px solid var(--hm-line-hi); border-radius: 4px; padding: 1px 5px; color: var(--hm-accent); }
.hm-skill-detail-when { padding-top: 4px; }

.hm-tags--anchors a { text-decoration: none; }
.hm-tags--anchors a:hover .hm-tag { color: var(--hm-accent); border-color: var(--hm-accent); }

/* Closing note */
.hm-brace { color: var(--hm-accent); }

.hm-note { margin-top: 56px; border-left: 2px solid var(--hm-accent); padding: 4px 0 4px 20px; font-weight: 300; font-size: 17px; line-height: 1.5; color: var(--hm-ink); max-width: 70ch; }
.hm-note-cta {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 18px; font-family: var(--hm-f-mono); font-weight: 500; font-size: 13px;
  color: #fff; background: var(--hm-accent); padding: 10px 18px; border-radius: 999px; text-decoration: none; transition: background .15s;
}
.hm-note-cta:hover { background: var(--hm-ink); }
.hm-note-cta svg { width: 15px; height: 15px; flex-shrink: 0; }

/* Scroll reveal */
[data-reveal] { opacity: 0; transform: translateY(22px); transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); }
[data-reveal].hm-revealed { opacity: 1; transform: translateY(0); }

/* ===== PORTFOLIO INDEX (master-detail) ===== */
.hm-portfolio-page { max-width: 1240px; margin: 0 auto; padding: clamp(40px,6vw,56px) 6vw clamp(96px,10vw,140px); }

.hm-md { display: grid; grid-template-columns: 1fr 300px; gap: 20px; align-items: start; }

/* Rail */
.hm-rail {
  position: sticky; top: 86px; max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--hm-line-hi); border-radius: 8px; overflow: hidden;
}
.hm-rail-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px; border-bottom: 1px solid var(--hm-line-hi); background: var(--hm-bg-alt); }
.hm-rail-label { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--hm-ink-mute); text-transform: uppercase; }
.hm-rail-count { font-family: var(--hm-f-mono); font-size: 11px; font-weight: 600; color: var(--hm-accent); background: rgba(226,68,23,0.1); padding: 2px 8px; border-radius: 999px; }
.hm-rail-list { overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--hm-line-hi) transparent; padding: 8px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.hm-rail-list::-webkit-scrollbar { width: 5px; }
.hm-rail-list::-webkit-scrollbar-track { background: transparent; }
.hm-rail-list::-webkit-scrollbar-thumb { background: var(--hm-line-hi); border-radius: 999px; }

.hm-rail-item {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 6px;
  border: 1px solid transparent; background: transparent; cursor: pointer; text-align: left; width: 100%;
  transition: border-color .15s, background .15s; position: relative; font: inherit;
}
.hm-rail-item:hover { background: var(--hm-bg-alt); border-color: var(--hm-line-hi); }
.hm-rail-item.on { background: rgba(226,68,23,0.06); border-color: var(--hm-accent); }
.hm-rail-item.on .hm-rail-name { color: var(--hm-accent); }

.hm-rail-thumb {
  flex-shrink: 0; width: 40px; height: 40px; border-radius: 6px;
  background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi);
  display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative;
}
.hm-rail-icon { width: 20px; height: 20px; color: var(--hm-accent); opacity: .85; }
.hm-rail-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.4; }
.hm-rail-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.hm-rail-text { flex: 1; min-width: 0; }
.hm-rail-name { font-family: var(--hm-f-display); font-weight: 600; font-size: 14px; color: var(--hm-ink); line-height: 1.2; margin: 0 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hm-rail-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hm-rail-company { font-family: var(--hm-f-mono); font-size: 9px; letter-spacing: 0.06em; color: var(--hm-ink-faint); text-transform: uppercase; }
.hm-rail-time { font-family: var(--hm-f-mono); font-size: 9px; letter-spacing: 0.06em; color: var(--hm-ink-faint); }
.hm-rail-time::before { content: "·"; margin-right: 6px; opacity: .6; }
.hm-rail-star { flex-shrink: 0; display: inline-flex; align-items: center; color: var(--hm-accent); opacity: .8; }
.hm-rail-star svg { width: 10px; height: 10px; }
.hm-rail-item--featured .hm-rail-name::after { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--hm-accent); margin-left: 6px; vertical-align: 2px; }

/* Hero / selected detail card */
.hm-proj-hero { background: #fff; border: 1px solid var(--hm-line-hi); border-radius: 10px; padding: 28px; position: relative; overflow: hidden; }
.hm-proj-hero-head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.hm-proj-hero-head h2 { font-family: var(--hm-f-display); font-weight: 400; font-size: clamp(26px, 2.8vw, 36px); color: var(--hm-ink); letter-spacing: -0.01em; line-height: 1.1; margin: 0; }
.hm-proj-hero-sub { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.hm-proj-role { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--hm-accent); text-transform: uppercase; }
.hm-proj-timeframe { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.08em; color: var(--hm-ink-faint); text-transform: uppercase; }
.hm-proj-mn { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.1em; color: var(--hm-ink-faint); text-transform: uppercase; }

.hm-proj-hero-body { display: grid; grid-template-columns: 1fr 1.3fr; gap: 32px; align-items: start; margin-bottom: 28px; }
.hm-proj-hero-details h3 { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--hm-ink-mute); text-transform: uppercase; margin: 0 0 10px; }
.hm-proj-subhead { font-family: var(--hm-f-mono); font-size: 10.5px; letter-spacing: 0.14em; color: var(--hm-ink-mute); text-transform: uppercase; margin: 16px 0 8px; }
.hm-proj-lead { font-size: 15px; color: var(--hm-ink-soft); line-height: 1.6; margin: 0 0 16px; }
.hm-proj-ctas { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.hm-tag--accent { color: var(--hm-accent); border-color: rgba(226,68,23,0.3); }

.hm-proj-hero-media {
  aspect-ratio: 16/10; border-radius: 8px; border: 1px solid var(--hm-line-hi);
  background: var(--hm-bg-alt); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.hm-proj-media-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(to right, rgba(23,21,15,0.06) 1px, transparent 1px), linear-gradient(to bottom, rgba(23,21,15,0.06) 1px, transparent 1px);
  background-size: 28px 28px; mask-image: radial-gradient(ellipse at center, black 55%, transparent 100%);
}
.hm-proj-media-label { position: absolute; top: 14px; left: 16px; font-family: var(--hm-f-mono); font-size: 10px; letter-spacing: 0.14em; color: var(--hm-ink-mute); text-transform: uppercase; }
.hm-proj-media-label::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--hm-accent); margin-right: 7px; vertical-align: 1px; }
.hm-proj-media-center { display: flex; flex-direction: column; align-items: center; gap: 10px; position: relative; z-index: 1; }
.hm-proj-media-placeholder { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--hm-ink-faint); text-transform: uppercase; }
.hm-proj-media-icon { width: 64px; height: 64px; color: var(--hm-accent); opacity: .9; }
.hm-proj-media-icon svg { width: 100%; height: 100%; stroke: currentColor; fill: none; stroke-width: 1.2; }
.hm-proj-media-img { width: 100%; height: 100%; object-fit: cover; border-radius: 6px; }

.hm-proj-features { background: var(--hm-bg-alt); border: 1px solid var(--hm-line-hi); border-radius: 8px; padding: 22px 24px 24px; }
.hm-proj-features h3 { font-family: var(--hm-f-mono); font-size: 11px; letter-spacing: 0.14em; color: var(--hm-ink-mute); text-transform: uppercase; margin: 0 0 18px; display: flex; align-items: center; gap: 12px; }
.hm-proj-features h3::after { content: ""; flex: 1; height: 1px; background: var(--hm-line-hi); }
.hm-proj-features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.hm-proj-feat { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: #fff; border: 1px solid var(--hm-line-hi); border-radius: 6px; transition: border-color .15s, transform .15s; }
.hm-proj-feat:hover { border-color: var(--hm-accent); transform: translateY(-1px); }
.hm-proj-feat-icon { width: 28px; height: 28px; border-radius: 6px; background: rgba(226,68,23,0.08); border: 1px solid rgba(226,68,23,0.2); color: var(--hm-accent); display: flex; align-items: center; justify-content: center; }
.hm-proj-feat-icon svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; }
.hm-proj-feat h4 { font-family: var(--hm-f-display); font-weight: 600; font-size: 13.5px; color: var(--hm-ink); letter-spacing: -0.005em; margin: 2px 0 0; line-height: 1.25; }
.hm-proj-feat p { font-size: 12.5px; color: var(--hm-ink-mute); line-height: 1.5; margin: 0; }

/* Hero transition (fade/swap on rail selection) */
.hm-proj-hero[data-transition="1"] .hm-proj-hero-head,
.hm-proj-hero[data-transition="1"] .hm-proj-hero-body,
.hm-proj-hero[data-transition="1"] .hm-proj-features {
  opacity: 0; transform: translateY(6px);
}
.hm-proj-hero-head, .hm-proj-hero-body, .hm-proj-features { transition: opacity .28s ease, transform .28s ease; }

/* ===== RESPONSIVE ===== */
@media (max-width: 760px) {
  .hm-nav-links { display: none; }
  .hm-nav-cta { display: none; }
  .hm-burger { display: flex; }
  .hm-skill-grid { grid-template-columns: 1fr; }
  .hm-h1row { flex-direction: column; align-items: flex-start; }
  .hm-h1row-side { align-items: flex-start; }

  .hm-work-row { grid-template-columns: 1fr; gap: 0; }
  .hm-work-meta {
    font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--hm-accent);
    margin-bottom: 8px;
  }
  .hm-work-arrow { display: none; }
}

@media (max-width: 980px) {
  .hm-md { display: flex; flex-direction: column; }
  .hm-rail {
    position: sticky; top: 70px; z-index: 25; max-height: none; order: -1; margin-bottom: 16px;
    border-radius: 0; border-left: none; border-right: none; min-width: 0; width: 100%;
  }
  .hm-rail-head { padding: 10px 16px 8px; }
  .hm-rail-list { flex-direction: row; overflow-x: auto; overflow-y: hidden; padding: 6px 12px 10px; gap: 8px; }
  .hm-rail-item { flex: 0 0 auto; flex-direction: row; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 999px; white-space: nowrap; width: auto; }
  .hm-rail-text { width: auto; }
  .hm-rail-name { white-space: nowrap; font-size: 12px; margin: 0; }
  .hm-rail-meta { display: none; }
  .hm-rail-thumb { width: 24px; height: 24px; border-radius: 50%; }
  .hm-rail-icon { width: 14px; height: 14px; }
  .hm-rail-item--featured .hm-rail-name::after { display: none; }
  .hm-proj-hero-body { grid-template-columns: 1fr; }
  .hm-proj-features-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .hm-proj-features-grid { grid-template-columns: 1fr; }
}
