/* The public website's "dark technical" look: a dark page over a faint grid, IBM Plex Sans with JetBrains Mono
   accents, and code-flavoured decoration (`// comments`, `## headings`, a terminal window). */
:root {
  --bg: #0B0F14;
  --panel: #111821;
  --panel-deep: #0A0E13;
  --line: #1F2A37;
  --line-strong: #2E3D4E;
  --text: #E6EDF3;
  --text-soft: #C3CDD6;
  --muted: #8B98A6;
  --green: #3DDC97;
  --green-ink: #04130C;
  --cyan: #5CC8FF;
  --amber: #FFC857;
  --red: #FF7B72;
  --font-body: 'IBM Plex Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SFMono-Regular', Menlo, monospace;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  /* A green glow top right, over a 48px grid. */
  background-image:
    radial-gradient(circle at 80% -10%, rgba(61, 220, 151, 0.12), transparent 45%),
    linear-gradient(rgba(31, 42, 55, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 42, 55, 0.18) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-position: 0 0, -1px -1px, -1px -1px;
  background-attachment: fixed;
}

a { color: var(--cyan); }
a:hover { color: var(--green); }
img { max-width: 100%; }
::selection { background: rgba(61, 220, 151, 0.35); }
:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }

.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
@media (min-width: 800px) { .wrap { padding-left: 32px; padding-right: 32px; } }

/* --- Terminal accents --- */

.ok { color: var(--green); }
.dim { color: var(--muted); }
.hi { color: var(--amber); }
.prompt { color: var(--green); }
.cursor { color: var(--green); animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .cursor { animation: none; } }

.comment { margin-bottom: 14px; font: 13px var(--font-mono); color: var(--green); }
.hash { margin-right: 4px; font-family: var(--font-mono); font-weight: 400; color: var(--green); }

/* --- Header and footer --- */

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding-top: 22px;
  padding-bottom: 22px;
}

/* The white wordmark from the Rails site (500×108), shown at a fixed height. */
.site-logo { display: block; line-height: 0; }
.site-logo img { width: auto; height: 32px; }
@media (min-width: 800px) { .site-logo img { height: 36px; } }

.site-nav, .footer-links { display: flex; flex-wrap: wrap; gap: 6px 24px; font: 14px var(--font-mono); text-transform: lowercase; }
.site-nav a, .footer-links a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .footer-links a:hover { color: var(--green); }
.site-nav a.active, .footer-links a.active { color: var(--text); }
.site-nav a.active::before { content: '> '; color: var(--green); }

.site-main { flex: 1; }

.site-footer { display: flex; flex-direction: column; gap: 18px; padding-top: 32px; padding-bottom: 32px; }
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font: 12px var(--font-mono);
  color: var(--muted);
}
.footer-legal a { color: var(--muted); text-transform: lowercase; }
.footer-legal a:hover { color: var(--green); }

/* --- Buttons and links --- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--green);
  border-radius: 8px;
  background: var(--green);
  color: var(--green-ink);
  font: 600 15px var(--font-body);
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow 0.2s;
}
.btn:hover { color: var(--green-ink); box-shadow: 0 0 0 4px rgba(61, 220, 151, 0.2); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-ghost:hover { color: var(--text); border-color: var(--green); box-shadow: none; }
.btn-ghost .prompt { font-family: var(--font-mono); }

.arrow-link { color: var(--cyan); font-weight: 500; text-decoration: none; }
.arrow-link:hover { color: var(--cyan); text-decoration: underline; text-underline-offset: 4px; }
.arrow-link span { display: inline-block; transition: transform 0.15s; }
.arrow-link:hover span { transform: translateX(3px); }

/* --- Home hero --- */

.hero { display: grid; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 72px; }
@media (min-width: 960px) { .hero { grid-template-columns: 1.15fr 1fr; padding-top: 88px; padding-bottom: 88px; } }
.hero h1 {
  margin: 0 0 22px;
  font-size: clamp(44px, 7.5vw, 80px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.hero h1 .cursor { margin-left: 4px; font-weight: 400; }
.hero .lead { margin-bottom: 32px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.kicker { margin: 0 0 20px; font: 13px var(--font-mono); color: var(--muted); text-transform: lowercase; }

.lead { margin: 0; max-width: 560px; font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; color: var(--muted); }
.lead.wide { max-width: 820px; color: var(--text-soft); }

/* A terminal window: the home hero's process, and the contact form's frame. */
.term {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-deep);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.45);
}
.term-bar { display: flex; align-items: center; gap: 7px; padding: 12px 14px; border-bottom: 1px solid var(--line); background: var(--panel); }
.term-bar span { width: 11px; height: 11px; border-radius: 50%; background: #2A3442; }
.term-bar span:nth-child(1) { background: #FF5F57; }
.term-bar span:nth-child(2) { background: #FEBC2E; }
.term-bar span:nth-child(3) { background: #28C840; }
.term-bar em { margin-left: 10px; font: normal 12px var(--font-mono); color: var(--muted); }
.term-body { margin: 0; padding: 20px; font: 13px/1.9 var(--font-mono); color: var(--text); white-space: pre-wrap; overflow-x: auto; }

/* --- Pages and sections --- */

.page { width: 100%; max-width: 1160px; margin: 0 auto; padding: 40px 16px; }
@media (min-width: 800px) { .page { padding: 56px 32px; } }
.page.narrow { max-width: 824px; }

.page-header { margin-bottom: 40px; }
.page-header h1, .page h1 {
  margin: 0 0 20px;
  font-size: clamp(36px, 6vw, 60px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.page-header h1:last-child { margin-bottom: 0; }

.section-title {
  margin: 0 0 28px;
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.panel-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }
.panel {
  margin: 0;
  padding: 28px 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 24, 33, 0.85);
  transition: border-color 0.2s;
}
.panel:hover { border-color: var(--line-strong); }
.panel h2, .panel h3 { margin: 0 0 12px; font-size: 22px; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; }
.panel p { margin: 0 0 16px; font-size: 15px; line-height: 1.65; color: var(--muted); }
.panel p:last-child { margin-bottom: 0; }

/* A heading beside its content on wide screens, stacked on narrow ones. */
.split { display: grid; gap: 8px 64px; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); padding-top: 72px; padding-bottom: 72px; } }
.split-body p { margin: 0 0 18px; font-size: 17px; line-height: 1.75; color: var(--text-soft); }
.split-intro { margin: 0 0 16px; font-size: 16px; line-height: 1.7; color: var(--muted); }

.numbered-list { list-style: none; margin: 0; padding: 0; counter-reset: step; }
.numbered-list li {
  counter-increment: step;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  padding: 24px 0;
  border-top: 1px solid var(--line);
}
.numbered-list li:last-child { border-bottom: 1px solid var(--line); }
.numbered-list li::before {
  content: '[' counter(step) ']';
  grid-row: span 2;
  padding-top: 7px;
  font: 14px var(--font-mono);
  color: var(--green);
}
.numbered-list h2, .numbered-list h3 { margin: 0 0 8px; font-size: 24px; font-weight: 600; letter-spacing: -0.01em; }
.numbered-list p { margin: 0; max-width: 720px; font-size: 16px; line-height: 1.7; color: var(--muted); }
.numbered-list.compact h3 { font-size: 20px; }
.numbered-list.compact li { grid-template-columns: 48px minmax(0, 1fr); }

.cta {
  padding: 40px 24px;
  border: 1px solid rgba(61, 220, 151, 0.35);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(61, 220, 151, 0.12), rgba(92, 200, 255, 0.06));
}
@media (min-width: 800px) { .cta { padding: 64px; } }
.cta h2 { margin: 0 0 18px; font-size: clamp(32px, 6vw, 60px); font-weight: 700; line-height: 1.02; letter-spacing: -0.03em; }
.cta p { margin: 0 0 16px; max-width: 680px; font-size: 16.5px; line-height: 1.7; color: var(--text-soft); }
.cta .btn { margin-top: 12px; }

/* --- Clients and testimonials --- */

/* The logos are grey on white JPEGs: inverted and screened, the white drops out against the dark page. */
.logo-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 24px;
  margin-bottom: 40px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.logo-strip img {
  width: 100%;
  max-width: 150px;
  height: auto;
  margin: 0 auto;
  filter: grayscale(1) invert(1) brightness(1.4);
  mix-blend-mode: screen;
  opacity: 0.8;
}

.testimonial { display: flex; flex-direction: column; justify-content: space-between; gap: 20px; }
.testimonial blockquote { margin: 0; padding-left: 14px; border-left: 2px solid var(--green); }
.testimonial .testimonial-quote { margin-bottom: 12px; font-size: 18px; font-weight: 600; line-height: 1.35; color: var(--text); }
.testimonial .testimonial-quote::before { content: '“'; }
.testimonial .testimonial-quote::after { content: '”'; }
.testimonial figcaption { display: flex; align-items: center; gap: 12px; font-size: 13px; line-height: 1.45; color: var(--muted); }
.testimonial figcaption strong { display: block; color: var(--text); }
.testimonial figcaption img { flex: none; width: 40px; height: 40px; border-radius: 8px; object-fit: cover; }

/* --- Services --- */

.tool-list { display: flex; flex-wrap: wrap; gap: 10px; margin: 0; padding: 0; list-style: none; align-self: start; }
.tool-list li {
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--panel);
  font: 14px var(--font-mono);
  color: var(--text-soft);
}

.faq details { border-top: 1px solid var(--line); }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 0;
  font-size: 16.5px;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}
.faq summary:hover { color: var(--green); }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; flex: none; font-family: var(--font-mono); color: var(--green); }
.faq details[open] summary::after { content: '−'; }
.faq details p { margin: 0 0 20px; font-size: 15.5px; line-height: 1.7; color: var(--muted); }

/* --- About --- */

.team { display: flex; flex-wrap: wrap; gap: 16px; }
.team-member { width: 220px; text-align: center; font-size: 14px; line-height: 1.5; color: var(--muted); }
.team-member img { display: block; width: 140px; height: 140px; margin: 0 auto 16px; border-radius: 12px; object-fit: cover; }
.team-member strong { display: block; font-size: 18px; font-weight: 600; color: var(--text); }

/* --- Contact --- */

.term-form { box-shadow: none; }
.contact-form { display: flex; flex-direction: column; padding: 24px 20px; }
@media (min-width: 600px) { .contact-form { padding: 28px; } }
.contact-form label { margin-bottom: 6px; font: 13px var(--font-mono); color: var(--muted); text-transform: lowercase; }
.contact-form label::before { content: '> '; color: var(--green); }
.contact-form input, .contact-form textarea {
  width: 100%;
  margin-bottom: 20px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font-body);
}
.contact-form input:focus, .contact-form textarea:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px rgba(61, 220, 151, 0.2); }
.contact-form textarea { resize: vertical; }
.contact-form .btn { align-self: flex-start; }
/* Honeypot: off-screen for people, still filled in by naive bots. */
.contact-form .hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-error {
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: rgba(255, 123, 114, 0.08);
  color: var(--red);
  font-size: 14px;
}

/* --- Misc --- */

.empty { color: var(--muted); }

.back-link { padding-top: 0; font-family: var(--font-mono); font-size: 14px; }

.preview-banner {
  margin-bottom: 24px;
  padding: 10px 14px;
  border: 1px solid var(--amber);
  border-radius: 8px;
  background: rgba(255, 200, 87, 0.08);
  color: var(--amber);
  font: 13px var(--font-mono);
}

/* --- Tags --- */

.tags, .tag-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tags { margin-bottom: 12px; }
.tag-filter { margin-bottom: 28px; }
.tag-filter-label { margin-right: 4px; font: 13px var(--font-mono); color: var(--muted); }

.tag {
  padding: 2px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font: 12px var(--font-mono);
  color: var(--muted);
  text-decoration: none;
  text-transform: lowercase;
}
.tag::before { content: '#'; color: var(--green); }
.tag:hover { border-color: var(--green); color: var(--text); }
.tag.selected { background: var(--green); border-color: var(--green); color: var(--green-ink); }
.tag.selected::before { color: var(--green-ink); }

.clear-filter { margin-left: 4px; font: 13px var(--font-mono); }

/* --- Blog cards --- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 16px;
}

.card {
  display: flex;
  flex-direction: column;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(17, 24, 33, 0.85);
  transition: border-color 0.2s;
}
.card:hover { border-color: var(--line-strong); }

.card h2 { margin: 0 0 10px; font-size: 20px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover { color: var(--green); }

.excerpt { flex: 1; margin: 0 0 16px; font-size: 14.5px; line-height: 1.6; color: var(--muted); }

.byline { font: 12.5px var(--font-mono); color: var(--muted); }
.byline .author { color: var(--text); }

.badge {
  margin-left: 8px;
  padding: 1px 8px;
  border: 1px solid var(--amber);
  border-radius: 6px;
  font: 11px var(--font-mono);
  color: var(--amber);
  text-transform: lowercase;
}

.pager {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-top: 32px;
  font: 13px var(--font-mono);
  color: var(--muted);
}

/* --- A single post --- */

.post h1 { font-size: clamp(32px, 5.5vw, 48px); }
.post .byline { margin-bottom: 32px; }

.video { position: relative; aspect-ratio: 16 / 9; margin-bottom: 28px; border-radius: 12px; overflow: hidden; }
.video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

.related { padding-top: 0; }

/* --- News --- */

.news-item { padding: 32px 0; border-top: 1px solid var(--line); }
.news-item h2 { margin: 0 0 6px; font-size: 26px; font-weight: 600; letter-spacing: -0.01em; }
.news-item h2 a { color: var(--text); text-decoration: none; }
.news-item h2 a:hover { color: var(--green); }
.news-item .byline { margin-bottom: 16px; }

/* --- Markdown bodies --- */

.prose { font-size: 17px; line-height: 1.75; color: var(--text-soft); overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { color: var(--text); line-height: 1.25; letter-spacing: -0.01em; margin: 1.6em 0 0.5em; }
.prose strong { color: var(--text); }
.prose blockquote { margin: 1.2em 0; padding-left: 16px; border-left: 2px solid var(--green); color: var(--muted); }
.prose code { padding: 1px 5px; border-radius: 4px; background: var(--panel); font-family: var(--font-mono); font-size: 0.86em; color: var(--text); }
.prose pre { padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-deep); overflow-x: auto; }
.prose pre code { padding: 0; background: none; font-size: 0.82em; line-height: 1.7; }
.prose table { border-collapse: collapse; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: var(--panel); color: var(--text); }
.prose img, .prose iframe { max-width: 100%; }
.prose img { height: auto; border-radius: 8px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2em 0; }
