/* Eric Hollander Consulting homepage (plain HTML/CSS/JS). EHC brand
   language: docs/brand.md. Dark technical/editorial; BPMN-line-art
   atmosphere; JetBrains Mono. */

/* Palette and type stack come from /tokens.css (single source of truth). */
:root {
  --maxw: 1180px;
  --gut: clamp(20px, 5vw, 80px);
}

* { box-sizing: border-box; }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

a { color: var(--teal); text-decoration: none; }
.teal { color: var(--teal); }

/* keyboard focus */
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
}

/* screen-reader-only text */
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* skip link: visually hidden until focused */
.skip-link {
  position: fixed;
  top: 12px; left: 16px;
  z-index: 50;
  background: var(--bg);
  color: var(--teal);
  border: 1px solid var(--teal);
  border-radius: 7px;
  padding: 10px 16px;
  font-size: 13px;
  transform: translateY(-300%);
}
.skip-link:focus { transform: none; }

/* ---- cursor haze (desktop pointer-follow glow) -------------------------- */
.cursor-haze {
  position: fixed;
  top: 0; left: 0;
  width: 520px; height: 520px;
  margin: -260px 0 0 -260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 212, 200, 0.12), rgba(0, 212, 200, 0.04) 38%, transparent 66%);
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transform: translate3d(-9999px, -9999px, 0);
  transition: opacity 0.4s ease;
  will-change: transform;
}
@media (hover: none) { .cursor-haze { display: none; } }

/* ---- background atmosphere (fixed, behind everything) ------------------- */
.bg-field {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.bg-grid {
  position: absolute;
  inset: -2px;
  background-image:
    linear-gradient(var(--hair) 1px, transparent 1px),
    linear-gradient(90deg, var(--hair) 1px, transparent 1px);
  background-size: 54px 54px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 36%, #000 30%, transparent 78%);
  opacity: 0.5;
}
.bg-glow {
  position: absolute;
  top: 8%;
  left: 50%;
  width: 60vw;
  height: 46vw;
  transform: translateX(-50%);
  /* softness baked into the gradient stops; no filter on a huge fixed layer */
  background: radial-gradient(ellipse at center, rgba(0, 212, 200, 0.10), rgba(0, 212, 200, 0.045) 38%, rgba(0, 212, 200, 0.015) 55%, transparent 72%);
}
.bg-trace { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.42; }

/* ---- shell -------------------------------------------------------------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gut);
}

/* ---- header / nav ------------------------------------------------------- */
header.site {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 30;
  background: linear-gradient(to bottom, rgba(10, 14, 26, 0.92), rgba(10, 14, 26, 0));
  backdrop-filter: blur(4px);
  transition: background 0.25s ease;
}
header.site.scrolled { background: rgba(10, 14, 26, 0.9); border-bottom: 1px solid var(--hair); }
.scroll-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 1px;
  background: var(--teal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}
.nav {
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gut);
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; }
.brand svg { display: block; }
.brand b { font-size: 15.5px; font-weight: 700; letter-spacing: 0.03em; }
.brand span { color: var(--muted); font-weight: 400; }
.nav-links { display: flex; gap: 22px; margin-left: auto; }
.nav-links a {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: color 0.15s ease;
}
.nav-links a:hover { color: var(--ink); }

/* tools dropdown (disclosure: click/tap toggles, hover opens on desktop) */
.nav-dd { position: relative; display: flex; align-items: center; }
.nav-dd-toggle {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--mono);
  color: var(--muted);
  font-size: 13px; letter-spacing: 0.04em;
  display: inline-flex; align-items: center; gap: 5px;
  transition: color 0.15s ease;
}
.nav-dd-toggle:hover, .nav-dd.open .nav-dd-toggle { color: var(--ink); }
.nav-dd-toggle:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.dd-caret { font-size: 9px; transition: transform 0.2s ease; }
.nav-dd.open .dd-caret { transform: rotate(180deg); }
.nav-dd-menu {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  min-width: 280px;
  max-width: 84vw;
  background: rgba(16, 20, 32, 0.98);
  backdrop-filter: blur(8px);
  border: 1px solid var(--hair);
  border-radius: 10px;
  padding: 8px;
  display: flex; flex-direction: column; gap: 2px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  z-index: 40;
  max-height: calc(100vh - 90px);
  overflow-y: auto;
}
/* invisible bridge across the 12px gap so moving from the button to a menu
   item never leaves the hover zone (the classic disappearing-menu bug) */
.nav-dd-menu::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: -14px;
  height: 14px;
}
.dd-group {
  margin: 10px 4px 4px;
  padding-top: 8px;
  border-top: 1px solid var(--hair);
  color: var(--muted);
  font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase;
}
.dd-group:first-child { margin-top: 2px; padding-top: 0; border-top: 0; }
.dd-item { display: block; padding: 10px 12px; border-radius: 7px; transition: background 0.15s ease; }
.dd-item:hover { background: rgba(0, 212, 200, 0.08); }
.dd-item b { display: block; color: var(--teal); font-size: 13.5px; font-weight: 600; }
.dd-item span { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; line-height: 1.4; }
.dd-item:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
.nav-cta {
  border: 1px solid var(--teal);
  color: var(--teal);
  padding: 7px 14px;
  border-radius: 7px;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  transition: background 0.15s ease, color 0.15s ease;
}
.nav-cta:hover { background: var(--teal); color: var(--bg); }

/* ---- generic section ---------------------------------------------------- */
section { position: relative; padding: clamp(80px, 12vh, 150px) 0; scroll-margin-top: 80px; }
.eyebrow {
  display: flex; align-items: center; gap: 12px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin: 0 0 26px;
}
.eyebrow::before { content: ''; width: 26px; height: 1px; background: var(--teal); opacity: 0.7; }
.section-head {
  font-size: clamp(30px, 4.4vw, 54px);
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
  max-width: 16ch;
}
.section-head.dim { color: rgba(238, 241, 248, 0.45); }

/* ---- hero --------------------------------------------------------------- */
.hero { min-height: 100vh; min-height: 100svh; display: flex; align-items: center; padding-top: 90px; }
.hero-eyebrow {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 11.5px; letter-spacing: 0.18em; margin: 0 0 22px;
}
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.6);
}
@media (prefers-reduced-motion: no-preference) {
  .dot { animation: pulse 2.4s ease-out infinite; }
  @keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0.55); }
    70% { box-shadow: 0 0 0 9px rgba(255, 181, 71, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 181, 71, 0); }
  }
}
.hero h1 {
  font-size: clamp(40px, 8.5vw, 104px);
  line-height: 1.0;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 26px;
}
.hero h1 .teal { color: var(--teal); }
/* the cycling word gets its own line with reserved height, so changing the
   word never changes the headline's line count (no page reflow / nudging) */
.cycle-line { display: block; min-height: 1em; }
.cursor {
  display: inline-block;
  width: 0.6ch; height: 0.92em;
  background: var(--teal);
  margin-left: 4px;
  transform: translateY(0.08em);
}
@media (prefers-reduced-motion: no-preference) {
  .cursor { animation: blink 1.05s steps(1) infinite; }
  @keyframes blink { 50% { opacity: 0; } }
}
.hero-sub {
  max-width: 46ch;
  color: var(--muted);
  font-size: clamp(14px, 1.4vw, 16px);
  margin: 0 0 34px;
}
.hero-sub strong { color: var(--ink); font-weight: 600; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
/* sub-caption sits tight under the CTAs; carries the gap down to the stats */
.cta-sub { margin: 0 0 52px; color: var(--muted); font-size: 12.5px; letter-spacing: 0.02em; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 20px; border-radius: 8px;
  font-size: 13px; letter-spacing: 0.03em;
  border: 1px solid var(--line);
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--teal); color: var(--bg); border-color: var(--teal); font-weight: 600; }
.btn.primary:hover { background: var(--teal-2); }
.stats { display: flex; flex-wrap: wrap; gap: 22px clamp(28px, 5vw, 72px); }
.stat .n { font-size: 22px; font-weight: 700; color: var(--ink); }
.stat .l { color: var(--muted); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; margin-top: 4px; }

/* ---- services grid ------------------------------------------------------ */
.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin-top: 56px; border: 1px solid var(--hair); }
.card {
  position: relative;
  padding: 34px 32px 40px;
  border: 1px solid var(--hair);
  margin: -0.5px;
  transition: background 0.2s ease;
}
.card:hover { background: rgba(23, 28, 42, 0.5); }
.card .num { position: absolute; top: 20px; left: 32px; color: var(--muted); font-size: 11px; letter-spacing: 0.12em; }
.card .arrow { position: absolute; top: 20px; right: 28px; color: var(--muted); transition: color 0.2s ease, transform 0.2s ease; }
.card:hover .arrow { color: var(--teal); transform: translate(2px, -2px); }
.card .ico { color: var(--teal); margin: 18px 0 18px; }
.card h3 { font-size: 17px; font-weight: 600; margin: 0 0 12px; letter-spacing: 0.01em; }
.card p { color: var(--muted); font-size: 13.5px; margin: 0; max-width: 40ch; }

/* ---- live demos strip ---------------------------------------------------- */
.demos {
  margin-top: 34px;
  border: 1px solid var(--hair);
  border-radius: 8px;
  background: rgba(23, 28, 42, 0.35);
  padding: 18px 24px 20px;
}
.demos-label {
  color: var(--muted);
  font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase;
  margin: 0 0 6px;
}
.demo {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px;
  padding: 9px 0;
  border-top: 1px solid var(--hair);
  font-size: 13px;
}
.demo:first-of-type { border-top: 0; }
.demo b { color: var(--teal); font-weight: 600; white-space: nowrap; }
.demo .d { color: var(--muted); flex: 1 1 30ch; min-width: 0; }
.demo .arrow { color: var(--muted); margin-left: auto; transition: color 0.2s ease, transform 0.2s ease; }
.demo:hover .arrow { color: var(--teal); transform: translate(2px, -2px); }
.demos-more {
  display: flex; align-items: center; gap: 6px;
  margin-top: 4px; padding-top: 12px;
  border-top: 1px solid var(--hair);
  color: var(--teal); font-size: 12px; letter-spacing: 0.04em;
}
.demos-more .arrow { transition: transform 0.2s ease; }
.demos-more:hover .arrow { transform: translate(2px, -2px); }

/* ---- approach ----------------------------------------------------------- */
.approach-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; }
.principles { display: flex; flex-direction: column; gap: 0; border-top: 1px solid var(--hair); }
.principle { padding: 22px 4px; border-bottom: 1px solid var(--hair); display: flex; gap: 18px; }
.principle .k { color: var(--gold); font-size: 12px; letter-spacing: 0.1em; flex: 0 0 30px; padding-top: 2px; }
.principle .t { color: var(--ink); font-size: 14px; }
.principle .t b { color: var(--ink); }
.principle .t span { color: var(--muted); }

/* ---- bio ---------------------------------------------------------------- */
.bio-grid { display: grid; grid-template-columns: 0.7fr 1.3fr; gap: 48px; align-items: start; margin-top: 6px; }
.portrait-slot {
  aspect-ratio: 4 / 5;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(23, 28, 42, 0.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  color: var(--muted);
}
.portrait-slot .slot-note { font-size: 10px; letter-spacing: 0.2em; text-transform: uppercase; opacity: 0.7; }
.bio-copy p { color: var(--muted); font-size: 15px; margin: 0 0 18px; max-width: 60ch; }
.bio-copy p:last-child { margin-bottom: 0; }
.bio-copy p:nth-child(2) { color: var(--ink); border-left: 2px solid var(--gold); padding-left: 20px; margin-left: 2px; }

/* ---- work --------------------------------------------------------------- */
.work-list { border-top: 1px solid var(--hair); margin-top: 48px; }
.work-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1.6fr) auto;
  gap: 24px;
  align-items: baseline;
  padding: 26px 6px;
  border-bottom: 1px solid var(--hair);
  transition: background 0.18s ease, padding-left 0.18s ease;
}
.work-row:hover { background: rgba(23, 28, 42, 0.45); padding-left: 16px; }
.work-row h3 { margin: 0; font-size: 16px; font-weight: 600; }
.work-row p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
/* work rows that link to a live app (whole row is the anchor) */
.work-link { color: inherit; }
.work-link .go {
  color: var(--teal);
  font-size: 10.5px; font-weight: 400;
  letter-spacing: 0.1em; text-transform: uppercase;
  white-space: nowrap; margin-left: 12px;
}
.work-link .go .arrow { display: inline-block; transition: transform 0.2s ease; }
.work-link:hover .go .arrow { transform: translate(2px, -2px); }
.work-row .tag {
  justify-self: end; align-self: center;
  font-size: 10px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--hair); border-radius: 5px; padding: 4px 9px; white-space: nowrap;
}
.tag.consulting { color: var(--teal); border-color: rgba(0, 212, 200, 0.35); }
.tag.product { color: var(--gold); border-color: rgba(255, 181, 71, 0.35); }

/* ---- selected work teaser (four featured case studies) ------------------ */
.work-teaser { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--hair); margin-top: 44px; }
.wt-card { position: relative; display: block; padding: 26px 28px 30px; border: 1px solid var(--hair); margin: -0.5px; color: inherit; transition: background 0.2s ease; }
.wt-card:hover { background: rgba(23, 28, 42, 0.5); }
.wt-status { font-size: 10px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--muted); }
.wt-status.ok { color: var(--ok); }
.wt-status.dev { color: var(--teal); }
.wt-status.beta { color: var(--gold); }
.wt-card h3 { font-size: 16px; font-weight: 600; margin: 12px 0 8px; color: var(--ink); letter-spacing: 0.01em; }
.wt-card p { color: var(--muted); font-size: 13px; margin: 0; max-width: 46ch; }
.wt-arrow { position: absolute; top: 24px; right: 26px; color: var(--muted); transition: color 0.2s ease, transform 0.2s ease; }
.wt-card:hover .wt-arrow { color: var(--teal); transform: translate(2px, -2px); }
.see-all { margin-top: 28px; }

/* ---- stack -------------------------------------------------------------- */
.stack-groups { display: grid; grid-template-columns: repeat(2, 1fr); gap: 38px 56px; margin-top: 52px; }
.stack-group .gl { color: var(--muted); font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; margin: 0 0 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 11.5px; letter-spacing: 0.02em; color: var(--ink);
  border: 1px solid var(--hair); border-radius: 5px; padding: 6px 11px;
  background: rgba(23, 28, 42, 0.4);
  transition: border-color 0.15s ease, color 0.15s ease;
}
.chip:hover { border-color: rgba(0, 212, 200, 0.3); }

/* ---- contact ------------------------------------------------------------ */
.contact-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-sub { color: var(--muted); font-size: 14px; max-width: 38ch; margin: 22px 0 30px; }
.contact-mail {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--teal); font-size: clamp(15px, 2vw, 20px);
  border-bottom: 1px solid rgba(0, 212, 200, 0.3); padding-bottom: 6px;
  transition: border-color 0.15s ease;
}
.contact-mail:hover { border-color: var(--teal); }
/* contact form */
.contact-form { margin: 24px 0 18px; display: flex; flex-direction: column; gap: 16px; max-width: 46ch; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { color: var(--muted); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; }
.contact-form input,
.contact-form textarea {
  font-family: var(--mono);
  font-size: 14px;
  color: var(--ink);
  background: rgba(23, 28, 42, 0.5);
  border: 1px solid var(--hair);
  border-radius: 8px;
  padding: 11px 13px;
  width: 100%;
  transition: border-color 0.15s ease;
}
.contact-form textarea { resize: vertical; min-height: 92px; }
.contact-form input:focus,
.contact-form textarea:focus { outline: none; border-color: var(--teal); }
.contact-form .btn.primary { align-self: flex-start; cursor: pointer; }
.contact-form .btn.primary:disabled { opacity: 0.55; cursor: default; }
/* honeypot: off-screen, never shown to humans, skipped by keyboard */
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.cf-status { margin: 2px 0 0; font-size: 13px; min-height: 1.2em; }
.cf-status.cf-ok { color: var(--teal); }
.cf-status.cf-err { color: var(--gold); }
.contact-alt { color: var(--muted); font-size: 13px; margin: 0; }
.contact-alt a { border-bottom: 1px solid rgba(0, 212, 200, 0.3); }

.meta { display: flex; flex-direction: column; border-top: 1px solid var(--hair); }
.meta-row { display: flex; justify-content: space-between; gap: 20px; padding: 13px 2px; border-bottom: 1px solid var(--hair); font-size: 12px; }
.meta-row .mk { color: var(--muted); letter-spacing: 0.12em; text-transform: uppercase; }
.meta-row .mv { color: var(--ink); }
.meta-row .mv .dot { display: inline-block; margin-right: 7px; transform: translateY(-1px); }

/* ---- footer ------------------------------------------------------------- */
footer.site { border-top: 1px solid var(--hair); padding: 26px 0; position: relative; z-index: 1; }
.foot { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gut); }
.foot .copy { color: var(--muted); font-size: 11.5px; letter-spacing: 0.03em; }
.foot .links { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-left: auto; }
.foot .links a { color: var(--muted); font-size: 11.5px; }
.foot .links a:hover { color: var(--teal); }

/* ---- scroll reveal ------------------------------------------------------ */
@media (prefers-reduced-motion: no-preference) {
  .reveal { opacity: 0; transform: translateY(22px); transition: opacity 0.7s ease, transform 0.7s cubic-bezier(.2,.6,.2,1); }
  .reveal.in { opacity: 1; transform: none; }
  .stagger > * { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s cubic-bezier(.2,.6,.2,1); }
  /* --i is set per child by home.js so every row staggers, not just 1-4 */
  .stagger.in > * { opacity: 1; transform: none; transition-delay: calc(var(--i, 0) * 80ms); }
}

/* ---- responsive --------------------------------------------------------- */
@media (max-width: 860px) {
  /* compact nav: drop the brand text, keep the logo mark and the link row */
  .nav { gap: 12px; padding-top: 10px; padding-bottom: 10px; }
  .brand b { display: none; }
  .nav-links { gap: 14px; }
  .nav-links a { font-size: 11px; }
  .nav-cta { padding: 6px 10px; font-size: 11px; white-space: nowrap; }
  .cards { grid-template-columns: 1fr; }
  .work-teaser { grid-template-columns: 1fr; }
  .approach-grid, .contact-grid { grid-template-columns: 1fr; gap: 36px; }
  .bio-grid { grid-template-columns: 1fr; gap: 30px; }
  .portrait-slot { max-width: 220px; }
  .stack-groups { grid-template-columns: 1fr; }
  .work-row { grid-template-columns: 1fr; gap: 8px; }
  .work-row .tag { justify-self: start; }
  .hero h1 { font-size: clamp(34px, 11vw, 60px); }
}
@media (max-width: 480px) {
  /* keep the section links; the mail CTA lives in the hero and footer too */
  .nav-cta { display: none; }
  .nav-links { margin-left: auto; gap: 12px; }
}
@media (max-width: 400px) {
  /* keep "and <longest cycle word>" plus the cursor on one line */
  .hero h1 { font-size: 9.5vw; }
}
