/* ============================================================
   consulting.benjamin.ie — design tokens & base
   ============================================================ */

:root {
  --bg: #0a0d12;
  --bg-elev: #0f1218;
  --bg-elev-2: #141923;
  --line: #1c2230;
  --line-strong: #2a3346;
  --text: #e6edf3;
  --text-dim: #9aa6b2;
  --text-faint: #5a6573;
  --accent: #7ee787;
  --accent-warm: #f2cc60;
  --accent-cold: #79c0ff;
  --danger: #ff7b72;

  --mono: ui-monospace, "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Inter, sans-serif;

  --radius: 6px;
  --radius-lg: 12px;

  --shadow-1: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-2: 0 24px 60px rgba(0, 0, 0, 0.5);
  --max: 1180px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body {
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(1200px 600px at 80% -10%, rgba(126, 231, 135, 0.06), transparent 60%),
    radial-gradient(800px 500px at 10% 110%, rgba(121, 192, 255, 0.06), transparent 60%);
}

a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  transition: color 120ms ease, border-color 120ms ease;
}
a:hover { color: #b6f0bb; border-bottom-color: currentColor; }

::selection { background: rgba(126, 231, 135, 0.25); color: var(--text); }

img, svg { display: block; max-width: 100%; }

/* ============================================================
   layout
   ============================================================ */
.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 24px;
}

main { padding: 48px 0 96px; }

/* ============================================================
   header / nav
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(10, 13, 18, 0.7);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  font-family: var(--mono);
  font-size: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  border-bottom: none;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 22px;
  height: 22px;
  border: 1px solid var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  font-weight: 700;
  border-radius: 4px;
  font-size: 13px;
  box-shadow: 0 0 0 3px rgba(126, 231, 135, 0.08);
}

.brand-text { letter-spacing: 0.02em; }
.brand-text .dim { color: var(--text-faint); }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  color: var(--text-dim);
  padding: 6px 10px;
  border-radius: 4px;
  border-bottom: none;
}
.nav-links a:hover { color: var(--text); background: var(--bg-elev); }
.nav-links a.active { color: var(--accent); background: rgba(126, 231, 135, 0.06); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--line-strong);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--mono);
}

@media (max-width: 720px) {
  .nav-links {
    position: absolute;
    top: 100%; left: 0; right: 0;
    background: var(--bg-elev);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 8px;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: inline-flex; }
}

/* ============================================================
   typography
   ============================================================ */
h1, h2, h3, h4 {
  font-family: var(--sans);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0 0 16px;
}
h1 { font-size: clamp(2rem, 4.6vw, 3.4rem); font-weight: 700; }
h2 { font-size: clamp(1.5rem, 2.8vw, 2.1rem); font-weight: 600; }
h3 { font-size: 1.2rem; font-weight: 600; }

p { color: var(--text-dim); margin: 0 0 16px; }
p.lead { font-size: 1.1rem; color: var(--text); max-width: 60ch; }

.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.kicker::before {
  content: "";
  width: 18px; height: 1px; background: var(--accent);
}

code, .mono { font-family: var(--mono); font-size: 0.92em; }
code {
  background: var(--bg-elev);
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--accent-cold);
}

/* ============================================================
   hero
   ============================================================ */
.hero {
  position: relative;
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.hero-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 30%, #000 40%, transparent 80%);
  pointer-events: none;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.7;
}

.hero-inner {
  position: relative;
  display: grid;
  gap: 32px;
  grid-template-columns: 1.2fr 1fr;
  align-items: center;
}

@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
}

.hero h1 .accent { color: var(--accent); }
.hero h1 .underline {
  background-image: linear-gradient(transparent 70%, rgba(126,231,135,0.25) 0);
}

.hero-cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ============================================================
   buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0 20px;
  min-height: 44px;
  line-height: 1.2;
  border-radius: var(--radius);
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: transform 80ms ease, background 120ms ease, border-color 120ms ease, color 120ms ease;
  border: 1px solid transparent;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--accent);
  color: #0a0d12;
}
.btn-primary:hover { background: #a4f0ab; color: #0a0d12; }

.btn-ghost {
  background: transparent;
  border-color: var(--line-strong);
  color: var(--text);
}
.btn-ghost:hover { background: var(--bg-elev); border-color: var(--accent); color: var(--text); }

.btn .arrow { transition: transform 120ms ease; }
.btn:hover .arrow { transform: translateX(3px); }

/* ============================================================
   terminal card
   ============================================================ */
.terminal {
  background: linear-gradient(180deg, var(--bg-elev) 0%, var(--bg-elev-2) 100%);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  font-family: var(--mono);
  font-size: 13px;
}

.terminal-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(0,0,0,0.3);
  border-bottom: 1px solid var(--line);
  color: var(--text-faint);
  font-size: 12px;
}
.terminal-bar .dots { display: inline-flex; gap: 6px; margin-right: 6px; }
.terminal-bar .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.terminal-bar .dot:nth-child(1) { background: #ff5f56; }
.terminal-bar .dot:nth-child(2) { background: #ffbd2e; }
.terminal-bar .dot:nth-child(3) { background: #27c93f; }
.terminal-bar .title { margin-left: auto; }

.terminal-body {
  padding: 18px 20px;
  color: var(--text-dim);
  line-height: 1.7;
  min-height: 220px;
}
.terminal-body .prompt { color: var(--accent); }
.terminal-body .cmd { color: var(--text); }
.terminal-body .output { color: var(--text-dim); }
.terminal-body .ok { color: var(--accent); }
.terminal-body .warn { color: var(--accent-warm); }
.terminal-body .key { color: var(--accent-cold); }
.terminal-body .caret {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: var(--accent);
  vertical-align: middle;
  margin-left: 2px;
  animation: blink 1s steps(1) infinite;
}
@keyframes blink {
  50% { opacity: 0; }
}

/* ============================================================
   section header
   ============================================================ */
.section {
  padding: 72px 0;
  border-bottom: 1px solid var(--line);
}
.section:last-of-type { border-bottom: 0; }

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 32px;
  gap: 24px;
  flex-wrap: wrap;
}
.section-head p { max-width: 60ch; margin: 8px 0 0; }

/* ============================================================
   cards / grid
   ============================================================ */
.grid {
  display: grid;
  gap: 16px;
}
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }

@media (max-width: 900px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

.card {
  position: relative;
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px;
  transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background:
    radial-gradient(400px circle at var(--mx, 50%) var(--my, 50%),
      rgba(126,231,135,0.08), transparent 40%);
  opacity: 0;
  transition: opacity 200ms ease;
}
.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
}
.card:hover::before { opacity: 1; }

.card .icon {
  width: 36px; height: 36px;
  display: inline-flex;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(126,231,135,0.06);
  color: var(--accent);
  margin-bottom: 14px;
}
.card h3 { margin: 0 0 6px; }
.card p { margin: 0; font-size: 0.94rem; }
.card .card-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--text-faint);
}
.card .card-list li::before {
  content: "▸ ";
  color: var(--accent);
}

/* ============================================================
   trail / list
   ============================================================ */
.trail {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 14px;
}
.trail li {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: start;
  gap: 12px;
  font-family: var(--mono);
  font-size: 14px;
  color: var(--text-dim);
}
.trail li .bullet {
  color: var(--accent);
  font-weight: 700;
}

/* ============================================================
   stats
   ============================================================ */
.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin: 32px 0 0;
}
@media (max-width: 720px) { .stats { grid-template-columns: repeat(2, 1fr); } }

.stat {
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 18px;
  background: rgba(255,255,255,0.01);
}
.stat .num {
  font-family: var(--mono);
  font-size: 1.6rem;
  color: var(--accent);
  margin: 0 0 4px;
}
.stat .label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ============================================================
   forms
   ============================================================ */
.form {
  display: grid;
  gap: 18px;
  max-width: 640px;
}
.field {
  display: grid;
  gap: 6px;
}
.field label {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--text-dim);
  text-transform: uppercase;
}
.field label .req { color: var(--accent); }

.field input,
.field textarea,
.field select {
  width: 100%;
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  padding: 12px 14px;
  border-radius: var(--radius);
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(126, 231, 135, 0.12);
  background: var(--bg-elev-2);
}
.field textarea { min-height: 140px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

.form-status {
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px 12px;
  border-radius: var(--radius);
  display: none;
}
.form-status.ok { display: block; color: var(--accent); background: rgba(126,231,135,0.08); border: 1px solid rgba(126,231,135,0.25); }
.form-status.err { display: block; color: var(--danger); background: rgba(255,123,114,0.06); border: 1px solid rgba(255,123,114,0.25); }

/* ============================================================
   footer
   ============================================================ */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 64px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--text-faint);
}
.site-footer .row {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}
.site-footer a { color: var(--text-dim); border-bottom: none; }
.site-footer a:hover { color: var(--accent); }
.site-footer .links { display: flex; gap: 16px; flex-wrap: wrap; }

/* easter-egg footer link — looks like the copyright text, but a touch
   warmer on hover so curious cursors get a hint. */
.site-footer a.footer-egg {
  color: var(--text-faint);
  border-bottom: 1px dashed transparent;
  transition: color 160ms ease, border-color 160ms ease;
}
.site-footer a.footer-egg:hover {
  color: var(--accent-warm);
  border-bottom-color: rgba(242, 204, 96, 0.4);
}

/* ============================================================
   utility
   ============================================================ */
.muted { color: var(--text-dim); }
.faint { color: var(--text-faint); }
.center { text-align: center; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }

.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong), transparent);
  margin: 32px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-dim);
  background: var(--bg-elev);
}
.badge .dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  50% { opacity: 0.5; }
}

/* reveal animation */
.reveal { opacity: 0; transform: translateY(12px); transition: opacity 600ms ease, transform 600ms ease; }
.reveal.in { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ============================================================
   404 easter egg — "helipug"
   ============================================================ */
.eg-hint {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding: 6px 10px;
  background: transparent;
  border: 1px dashed var(--line-strong);
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text-faint);
  cursor: pointer;
  transition: color 120ms ease, border-color 120ms ease, background 120ms ease;
}
.eg-hint:hover {
  color: var(--text-dim);
  border-color: var(--accent);
  background: rgba(126, 231, 135, 0.04);
}
.eg-hint kbd {
  font-family: inherit;
  font-size: 11px;
  padding: 1px 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--bg-elev);
  color: var(--text-dim);
  margin: 0 2px;
}
.eg-hint-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-warm);
  box-shadow: 0 0 6px var(--accent-warm);
  animation: pulse 2.4s ease-in-out infinite;
}

/* morph: fade page content out when game is active */
.hero .hero-inner,
.hero-grid,
.hero-canvas {
  transition: opacity 280ms ease, transform 280ms ease, filter 280ms ease;
}
body.eg-playing .hero .hero-inner {
  opacity: 0;
  transform: translateY(-12px);
  filter: blur(2px);
  pointer-events: none;
}
body.eg-playing .hero-grid,
body.eg-playing .hero-canvas {
  opacity: 0.25;
}

/* game stage overlay inside .hero */
.eg-stage {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 280ms ease, transform 280ms ease;
  z-index: 5;
}
.eg-stage.eg-show {
  opacity: 1;
  transform: scale(1);
}
.eg-stage-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  max-width: 1000px;
  width: 100%;
}
.eg-canvas {
  display: block;
  width: 100%;
  max-width: 960px;
  aspect-ratio: 320 / 180;
  height: auto;
  image-rendering: pixelated;
  image-rendering: -moz-crisp-edges;
  image-rendering: crisp-edges;
  background: #0a0d12;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2), 0 0 0 1px rgba(126, 231, 135, 0.12);
  outline: none;
  touch-action: manipulation;
}
.eg-tag {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-faint);
}
.eg-tag .eg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 6px var(--accent);
}
.eg-tag .eg-sep { color: var(--line-strong); }
.eg-tag kbd {
  font-family: inherit;
  font-size: 10px;
  padding: 1px 5px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 2px;
  border-radius: 3px;
  background: var(--bg-elev);
  color: var(--text-dim);
}
