/* Mirrors frontend/src/humetric.css (tokens + header/footer/button/card/form
   rules) so the server-rendered blog looks identical to the React site
   instead of like a separate app. Kept as its own file (not the SPA's hashed
   build output) so the backend never depends on a frontend build artifact. */

:root {
  --ink: #15130f;
  --paper: #f4efe6;
  --paper2: #ece5d6;
  --line: #2a2620;
  --rust: #b5421f;
  --moss: #4a5d3a;
  --gold: #c08a2d;
  --sky: #3a5a78;
  --mute: #6b6355;
  --card: #fbf8f1;
  --border: rgba(42, 38, 32, 0.13);
  --border2: rgba(42, 38, 32, 0.22);
  --shadow: 0 2px 12px rgba(21, 19, 15, 0.07);
  --shadow-md: 0 6px 24px rgba(21, 19, 15, 0.11);
  --f-serif: "Fraunces", Georgia, serif;
  --f-sans: "Spline Sans", sans-serif;
  --f-mono: "Spline Sans Mono", monospace;
  --ease: cubic-bezier(0.22, 0.68, 0, 1.2);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.hm-grid-bg {
  background-image:
    linear-gradient(rgba(42, 38, 32, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(42, 38, 32, 0.035) 1px, transparent 1px);
  background-size: 44px 44px;
}
.hm-grid-fade {
  -webkit-mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
  mask-image: linear-gradient(to bottom, transparent, black 8%, black 92%, transparent);
}

.hm-serif { font-family: var(--f-serif); }
.hm-mono { font-family: var(--f-mono); }
.hm-em { color: var(--rust); font-style: italic; }

/* ── header (matches Header.tsx) ── */
.hm-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 241, 0.85);
  backdrop-filter: blur(8px);
  border-bottom: 1.5px solid var(--line);
}
.hm-header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 28px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.hm-brand {
  display: flex;
  align-items: baseline;
  gap: 9px;
  text-decoration: none;
  color: var(--ink);
}
.hm-brand-mark {
  font-family: var(--f-serif);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1;
}
.hm-brand-mark em { color: var(--rust); font-style: italic; }
.hm-brand-tag {
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--mute);
}
.hm-nav { display: flex; align-items: center; gap: 4px; }
.hm-nav a {
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mute);
  text-decoration: none;
  padding: 8px 12px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.hm-nav a:hover { color: var(--ink); }
.hm-nav a.active { color: var(--rust); border-bottom-color: var(--rust); }
.hm-header-right { display: flex; align-items: center; gap: 10px; }

/* ── buttons ── */
.hm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: var(--f-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  text-decoration: none;
  border: 1.5px solid transparent;
  transition: background 0.15s, transform 0.15s var(--ease), box-shadow 0.15s;
}
.hm-btn-primary { background: var(--rust); color: #fff; }
.hm-btn-primary:hover { background: #9e3a1a; transform: translateY(-1px); box-shadow: 0 5px 16px rgba(181, 66, 31, 0.3); }
.hm-btn-ghost { background: var(--paper2); border-color: var(--line); color: var(--ink); }
.hm-btn-ghost:hover { background: var(--paper); }
.hm-btn-sm { padding: 6px 12px; font-size: 11px; }

/* ── card ── */
.hm-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.hm-card-pad { padding: 24px; }

/* ── forms ── */
.hm-label {
  font-family: var(--f-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mute);
  display: block;
  margin-bottom: 6px;
}
.hm-input {
  width: 100%;
  font-family: var(--f-sans);
  font-size: 14px;
  background: var(--paper);
  border: 1.5px solid var(--border2);
  border-radius: 7px;
  padding: 10px 12px;
  color: var(--ink);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hm-input:focus { border-color: rgba(181, 66, 31, 0.45); box-shadow: 0 0 0 3px rgba(181, 66, 31, 0.08); }

/* ── footer (matches Footer.tsx) ── */
.hm-footer {
  border-top: 1.5px solid var(--line);
  background: var(--card);
  margin-top: auto;
}
.hm-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  text-align: center;
}

/* ── blog article ── */
.hm-blog-main { flex: 1; }
.hm-blog-inner { max-width: 760px; margin: 0 auto; padding: 48px 28px 80px; }
.hm-blog-meta { font-family: var(--f-mono); font-size: 11px; letter-spacing: 0.04em; color: var(--mute); margin-bottom: 8px; }
.hm-blog-index-title { font-family: var(--f-serif); font-size: 40px; font-weight: 900; letter-spacing: -0.03em; margin: 0 0 32px; }
.hm-blog-list-item { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.hm-blog-list-item:last-child { border-bottom: none; }
.hm-blog-list-item h2 { margin: 0 0 4px; }
.hm-blog-list-item h2 a { color: var(--ink); text-decoration: none; }
.hm-blog-list-item h2 a:hover { color: var(--rust); }
.hm-blog-list-item p { color: var(--mute); margin: 4px 0 0; }

.hm-blog-article h1 {
  font-family: var(--f-serif);
  font-size: 40px;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 0 0 6px;
}
.hm-blog-article h2 {
  font-family: var(--f-serif);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 40px 0 14px;
}
.hm-blog-article h3 { font-size: 18px; font-weight: 700; margin: 28px 0 10px; }
.hm-blog-article p { margin: 0 0 16px; }
.hm-blog-article a { color: var(--rust); }
.hm-blog-article ul, .hm-blog-article ol { margin: 0 0 16px; padding-left: 22px; }
.hm-blog-article li { margin-bottom: 6px; }
.hm-blog-article code {
  font-family: var(--f-mono);
  font-size: 0.9em;
  background: var(--paper2);
  border-radius: 4px;
  padding: 2px 5px;
}
.hm-blog-article pre {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  overflow-x: auto;
}
.hm-blog-article pre code { background: none; padding: 0; }
.hm-blog-article blockquote {
  margin: 0 0 16px;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--rust);
  color: var(--mute);
}

/* ── article images & video embeds ── */
.hm-blog-figure {
  margin: 28px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--card);
}
.hm-blog-figure img { display: block; width: 100%; height: auto; cursor: zoom-in; }

/* ── image lightbox (click a figure to enlarge) ── */
.hm-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  padding: 40px;
  background: rgba(21, 19, 15, 0.88);
  cursor: zoom-out;
  align-items: center;
  justify-content: center;
}
.hm-lightbox.hm-lightbox-open { display: flex; }
.hm-lightbox img {
  display: block;
  max-width: 92vw;
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.5);
}
.hm-lightbox-close {
  position: fixed;
  top: 18px;
  right: 24px;
  font-family: var(--f-mono);
  font-size: 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 6px;
  padding: 7px 12px;
  cursor: pointer;
}
.hm-blog-video {
  position: relative;
  margin: 28px 0;
  padding-top: 56.25%;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: var(--ink);
}
.hm-blog-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── embedded mini tool ── */
.hm-blog-tool { margin: 28px 0; }
.hm-blog-tool h3 { margin-top: 0 !important; }
.hm-blog-tool-result { margin-top: 16px; font-weight: 600; }
